-- Stub file was translated on January 3, 1984 0:09 am by Lupine of December 20, 1983 1:22 pm -- Source interface ThParty came from file ThParty.bcd, which was created on January 3, 1984 0:09 am with version stamp 137B#133B#34120436254B from source of December 28, 1983 11:09 pm. -- The RPC stub modules for ThParty are: -- ThPartyRpcControl.mesa; -- ThPartyRpcClientImpl.mesa; -- ThPartyRpcBinderImpl.mesa; -- ThPartyRpcServerImpl.mesa. -- The parameters for this translation are: -- Target language = Cedar -- Default parameter passing = VALUE -- Deallocate server heap arguments = TRUE -- Inline RpcServerImpl dispatcher stubs = FALSE -- Declare signals = TRUE -- Warn about short POINTER ("MDS") allocations = TRUE -- Maximum number of dynamic heap NEWs = 50, MDS NEWs = 50 -- Acceptable parameter protocols = VersionRange[1..1]. DIRECTORY Basics, Lark, Thrush, ThSmarts, ThParty, ThPartyRpcControl USING [InterMdsCallsOnly, LupineProtocolVersion, ProcedureIndex, SignalIndex], RPC USING [EncryptionKey, InterfaceName, Principal, standardZones, Zones], RPCLupine --USING SOME OF [Call, DataLength, Dispatcher, ExportHandle, -- ExportInterface, GetStubPkt, maxDataLength, maxPrincipalLength, -- maxShortStringLength, pktOverhead, ReceiveExtraPkt, SendPrelimPkt, -- StartCall, StartSignal, StubPkt, UnexportInterface]--, LupineRuntime --USING SOME OF [BindingError, CheckPktLength, CopyFromPkt, -- CopyFromMultiplePkts, CopyToPkt, CopyToMultiplePkts, defaultZones, -- DispatchingError, FinishThisPkt, ListHeader, MarshalingError, -- MarshalingExprError, NilHeader, ProtocolError, RopeHeader, RpcPktDoubleWord, -- RuntimeError, SequenceHeader, SHORT, StartNextPkt, StringHeader, -- StubPktDoubleWord, TranslationError, UnmarshalingError, UnmarshalingExprError, -- WordsForChars]--, Atom --USING SOME OF [GetPName, MakeAtom]--, Rope --USING SOME OF [InlineFlatten, Length, NewText, Text]--; ThPartyRpcServerImpl: MONITOR IMPORTS ThParty, RpcPrivate: RPCLupine, Lupine: LupineRuntime, Atom, Rope EXPORTS ThPartyRpcControl SHARES ThParty, ThPartyRpcControl, Rope = BEGIN OPEN ThParty, RpcControl: ThPartyRpcControl, RpcPublic: RPC; -- Standard remote binding routines. bound: BOOLEAN _ FALSE; myInterface: RpcPrivate.ExportHandle; paramZones: RpcPublic.Zones _ RpcPublic.standardZones; ExportInterface: PUBLIC ENTRY SAFE PROCEDURE [ interfaceName: RpcPublic.InterfaceName, user: RpcPublic.Principal, password: RpcPublic.EncryptionKey, parameterStorage: RpcPublic.Zones ] = TRUSTED BEGIN ENABLE UNWIND => NULL; IsNull: PROCEDURE [string: Rope.ROPE] RETURNS [BOOLEAN] = INLINE {RETURN[string.Length[] = 0]}; IF bound THEN Lupine.BindingError; myInterface _ RpcPrivate.ExportInterface [ interface: [ type: IF ~IsNull[interfaceName.type] THEN interfaceName.type ELSE "ThParty~137B#133B#34120436254B", instance: interfaceName.instance, version: interfaceName.version ], user: user, password: password, dispatcher: ServerDispatcher, localOnly: RpcControl.InterMdsCallsOnly, stubProtocol: RpcControl.LupineProtocolVersion ]; paramZones _ [ gc: IF parameterStorage.gc # NIL THEN parameterStorage.gc ELSE Lupine.defaultZones.gc, heap: IF parameterStorage.heap # NIL THEN parameterStorage.heap ELSE Lupine.defaultZones.heap, mds: IF parameterStorage.mds # NIL THEN parameterStorage.mds ELSE Lupine.defaultZones.mds ]; bound _ TRUE; END; UnexportInterface: PUBLIC ENTRY SAFE PROCEDURE = TRUSTED BEGIN ENABLE UNWIND => NULL; IF ~bound THEN Lupine.BindingError; myInterface _ RpcPrivate.UnexportInterface[myInterface]; paramZones _ RpcPublic.standardZones; bound _ FALSE; END; -- Public procedure dispatcher and public signal and error catcher. ServerDispatcher: --PROCEDURE [pkt: RPCPkt, callLength: DataLength, -- lastPkt: BOOLEAN, localConversation: Conversation] RETURNS [returnLength: -- DataLength]-- RpcPrivate.Dispatcher = BEGIN -- Catch public signals. ENABLE BEGIN END; -- Catch public signals. -- Call public procedures (still in dispatcher). SELECT LOOPHOLE[pkt.data[0], RpcControl.ProcedureIndex] FROM Alert => RETURN[ AlertStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; Advance => RETURN[ AdvanceStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; CreateConversation => RETURN[ CreateConversationStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; MergeConversations => RETURN[ MergeConversationsStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; SetSubject => RETURN[ SetSubjectStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; GetSubject => RETURN[ GetSubjectStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; OtherParty => RETURN[ OtherPartyStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; DescribeParty => RETURN[ DescribePartyStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; ConversationsForParty => RETURN[ ConversationsForPartyStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; SetInterval => RETURN[ SetIntervalStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; RegisterKey => RETURN[ RegisterKeyStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; CreateParty => RETURN[ CreatePartyStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; GetParty => RETURN[ GetPartyStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; GetJayParty => RETURN[ GetJayPartyStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; GetPartyFromNumber => RETURN[ GetPartyFromNumberStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; GetPartyFromFeepNum => RETURN[ GetPartyFromFeepNumStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; ReleaseTrunkParty => RETURN[ ReleaseTrunkPartyStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; GetRname => RETURN[ GetRnameStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; Register => RETURN[ RegisterStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; RegisterClone => RETURN[ RegisterCloneStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; Deregister => RETURN[ DeregisterStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; Enable => RETURN[ EnableStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; Disable => RETURN[ DisableStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; GetNumbersForRName => RETURN[ GetNumbersForRNameStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; ENDCASE => RETURN[Lupine.DispatchingError[]]; END; -- ServerDispatcher -- Public procedure dispatcher stubs. AlertStub: --PROCEDURE [shhh: SHHH, credentials: Credentials, state: -- StateInConv, reason: Reason, calledPartyID: PartyHandle, urgency: -- CallUrgency, alertKind: AlertKind, newConv: BOOL, comment: ROPE] -- RETURNS [nb: NB, convID: ConversationHandle]-- RpcPrivate.Dispatcher = BEGIN comment: ROPE; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, credentials (1): Credentials, state (8): StateInConv, reason (9): Reason, calledPartyID (10): PartyHandle, urgency (12): CallUrgency, alertKind (13): AlertKind, newConv (14): BOOL]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ nb (0): NB, convID (1): ConversationHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 15; BEGIN -- Unmarshal comment: ROPE from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN comment _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; comment _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal comment. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.nb, resPkt.convID] _ Alert[localConversation, argPkt.credentials, argPkt.state, argPkt.reason, argPkt.calledPartyID, argPkt.urgency, argPkt.alertKind, argPkt.newConv, comment]; pktLength _ 3; RETURN[returnLength: pktLength]; END; -- AlertStub. AdvanceStub: --PROCEDURE [shhh: SHHH, credentials: Credentials, state: -- StateInConv, reason: Reason, comment: ROPE] -- RETURNS [nb: NB]-- RpcPrivate.Dispatcher = BEGIN comment: ROPE; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, credentials (1): Credentials, state (8): StateInConv, reason (9): Reason]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ nb (0): NB]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 10; BEGIN -- Unmarshal comment: ROPE from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN comment _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; comment _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal comment. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.nb] _ Advance[localConversation, argPkt.credentials, argPkt.state, argPkt.reason, comment]; pktLength _ 1; RETURN[returnLength: pktLength]; END; -- AdvanceStub. CreateConversationStub: --PROCEDURE [shhh: SHHH, credentials: Credentials, -- urgency: CallUrgency, alertKind: AlertKind] -- RETURNS [nb: NB, convID: ConversationHandle]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, credentials (1): Credentials, urgency (8): CallUrgency, alertKind (9): AlertKind]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ nb (0): NB, convID (1): ConversationHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 10; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.nb, resPkt.convID] _ CreateConversation[localConversation, argPkt.credentials, argPkt.urgency, argPkt.alertKind]; pktLength _ 3; RETURN[returnLength: pktLength]; END; -- CreateConversationStub. MergeConversationsStub: --PROCEDURE [shhh: SHHH, credentials: Credentials, -- otherStateID: StateID, otherConvID: ConversationHandle] -- RETURNS [nb: NB]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, credentials (1): Credentials, otherStateID (8): StateID, otherConvID (9): ConversationHandle]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ nb (0): NB]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 11; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.nb] _ MergeConversations[localConversation, argPkt.credentials, argPkt.otherStateID, argPkt.otherConvID]; pktLength _ 1; RETURN[returnLength: pktLength]; END; -- MergeConversationsStub. SetSubjectStub: --PROCEDURE [shh: SHHH, convID: ConversationHandle, -- subject: ROPE]-- RpcPrivate.Dispatcher = BEGIN subject: ROPE; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, convID (1): ConversationHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; BEGIN -- Unmarshal subject: ROPE from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN subject _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; subject _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal subject. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; SetSubject[localConversation, argPkt.convID, subject]; pktLength _ 0; RETURN[returnLength: pktLength]; END; -- SetSubjectStub. GetSubjectStub: --PROCEDURE [shh: SHHH, convID: ConversationHandle] -- RETURNS [subject: ROPE]-- RpcPrivate.Dispatcher = BEGIN subject: ROPE; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, convID (1): ConversationHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [subject] _ GetSubject[localConversation, argPkt.convID]; pktLength _ 0; BEGIN -- Marshal subject: ROPE to pkt.data[pktLength]. pkt.data[pktLength] _ subject=NIL; pktLength _ pktLength+1; IF subject # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: subject]; IF textRope.length > RpcPrivate.maxShortStringLength THEN Lupine.MarshalingError; pkt.data[pktLength] _ textRope.length; pktLength _ pktLength+1; pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: TRUE]; END; -- IF subject # NIL. END; -- Marshal subject. RETURN[returnLength: pktLength]; END; -- GetSubjectStub. OtherPartyStub: --PROCEDURE [shhh: SHHH, credentials: Credentials] -- RETURNS [nb: NB, partyID: PartyHandle, description: Thrush.ROPE, -- conference: BOOL]-- RpcPrivate.Dispatcher = BEGIN description: Thrush.ROPE; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, credentials (1): Credentials]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ nb (0): NB, partyID (1): PartyHandle, conference (3): BOOL]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 8; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.nb, resPkt.partyID, description, resPkt.conference] _ OtherParty[localConversation, argPkt.credentials]; pktLength _ 4; BEGIN -- Marshal description: Thrush.ROPE to pkt.data[pktLength]. pkt.data[pktLength] _ description=NIL; pktLength _ pktLength+1; IF description # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: description]; IF textRope.length > RpcPrivate.maxShortStringLength THEN Lupine.MarshalingError; pkt.data[pktLength] _ textRope.length; pktLength _ pktLength+1; pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: TRUE]; END; -- IF description # NIL. END; -- Marshal description. RETURN[returnLength: pktLength]; END; -- OtherPartyStub. DescribePartyStub: --PROCEDURE [shh: SHHH, partyID: PartyHandle] -- RETURNS [description: Thrush.ROPE]-- RpcPrivate.Dispatcher = BEGIN description: Thrush.ROPE; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, partyID (1): PartyHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [description] _ DescribeParty[localConversation, argPkt.partyID]; pktLength _ 0; BEGIN -- Marshal description: Thrush.ROPE to pkt.data[pktLength]. pkt.data[pktLength] _ description=NIL; pktLength _ pktLength+1; IF description # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: description]; IF textRope.length > RpcPrivate.maxShortStringLength THEN Lupine.MarshalingError; pkt.data[pktLength] _ textRope.length; pktLength _ pktLength+1; pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: TRUE]; END; -- IF description # NIL. END; -- Marshal description. RETURN[returnLength: pktLength]; END; -- DescribePartyStub. ConversationsForPartyStub: --PROCEDURE [shh: SHHH, partyID: PartyHandle]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, partyID (1): PartyHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; ConversationsForParty[localConversation, argPkt.partyID]; pktLength _ 0; RETURN[returnLength: pktLength]; END; -- ConversationsForPartyStub. SetIntervalStub: --PROCEDURE [shhh: SHHH, credentials: Credentials, -- intervalSpec: Thrush.IntervalSpec] -- RETURNS [nb: NB]-- RpcPrivate.Dispatcher = BEGIN intervalSpec: Thrush.IntervalSpec; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, credentials (1): Credentials]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ nb (0): NB]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 8; BEGIN -- Unmarshal intervalSpec: Thrush.IntervalSpec from pkt.data[pktLength]. isNIL: Lupine.NilHeader; isNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF isNIL THEN intervalSpec _ NIL ELSE BEGIN intervalSpec _ (paramZones.gc.NEW[Thrush.IntervalSpecBody]); BEGIN -- Unmarshal intervalSpec^: Thrush.IntervalSpecBody -- from pkt.data[pktLength]. pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: LOOPHOLE[intervalSpec], dataLength: SIZE[Thrush.IntervalSpecBody], alwaysOnePkt: TRUE]; END; -- Unmarshal intervalSpec^. END; -- IF isNIL. END; -- Unmarshal intervalSpec. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.nb] _ SetInterval[localConversation, argPkt.credentials, intervalSpec]; pktLength _ 1; RETURN[returnLength: pktLength]; END; -- SetIntervalStub. RegisterKeyStub: --PROCEDURE [shh: SHHH, credentials: Credentials, -- key: Thrush.EncryptionKey] -- RETURNS [nb: NB, keyIndex: [0..15]]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, credentials (1): Credentials, key (8): Thrush.EncryptionKey]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ nb (0): NB, keyIndex (1): [0..15]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 12; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.nb, resPkt.keyIndex] _ RegisterKey[localConversation, argPkt.credentials, argPkt.key]; pktLength _ 2; RETURN[returnLength: pktLength]; END; -- RegisterKeyStub. CreatePartyStub: --PROCEDURE [shh: SHHH, rName: Rname, type: Thrush.PartyType] -- RETURNS [partyID: PartyHandle]-- RpcPrivate.Dispatcher = BEGIN rName: Rname; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, type (1): Thrush.PartyType]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ partyID (0): PartyHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 2; BEGIN -- Unmarshal rName: Rname from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN rName _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; rName _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal rName. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.partyID] _ CreateParty[localConversation, rName, argPkt.type]; pktLength _ 2; RETURN[returnLength: pktLength]; END; -- CreatePartyStub. GetPartyStub: --PROCEDURE [shh: SHHH, partyID: PartyHandle, rName: -- Rname] -- RETURNS [newPartyID: PartyHandle]-- RpcPrivate.Dispatcher = BEGIN rName: Rname; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, partyID (1): PartyHandle]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ newPartyID (0): PartyHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; BEGIN -- Unmarshal rName: Rname from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN rName _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; rName _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal rName. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.newPartyID] _ GetParty[localConversation, argPkt.partyID, rName]; pktLength _ 2; RETURN[returnLength: pktLength]; END; -- GetPartyStub. GetJayPartyStub: --PROCEDURE [shh: SHHH, partyID: PartyHandle] RETURNS -- [newPartyID: PartyHandle]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, partyID (1): PartyHandle]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ newPartyID (0): PartyHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.newPartyID] _ GetJayParty[localConversation, argPkt.partyID]; pktLength _ 2; RETURN[returnLength: pktLength]; END; -- GetJayPartyStub. GetPartyFromNumberStub: --PROCEDURE [shh: SHHH, partyID: PartyHandle, -- phoneNumber: Thrush.ROPE, description: ROPE, trunkOK: BOOL] -- RETURNS [newPartyID: PartyHandle]-- RpcPrivate.Dispatcher = BEGIN phoneNumber: Thrush.ROPE; description: ROPE; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, partyID (1): PartyHandle, trunkOK (3): BOOL]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ newPartyID (0): PartyHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 4; BEGIN -- Unmarshal phoneNumber: Thrush.ROPE from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN phoneNumber _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; phoneNumber _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal phoneNumber. BEGIN -- Unmarshal description: ROPE from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN description _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; description _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal description. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.newPartyID] _ GetPartyFromNumber[localConversation, argPkt.partyID, phoneNumber, description, argPkt.trunkOK]; pktLength _ 2; RETURN[returnLength: pktLength]; END; -- GetPartyFromNumberStub. GetPartyFromFeepNumStub: --PROCEDURE [shh: SHHH, partyID: PartyHandle, -- feepNum: Thrush.ROPE] -- RETURNS [newPartyID: PartyHandle]-- RpcPrivate.Dispatcher = BEGIN feepNum: Thrush.ROPE; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, partyID (1): PartyHandle]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ newPartyID (0): PartyHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; BEGIN -- Unmarshal feepNum: Thrush.ROPE from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN feepNum _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; feepNum _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal feepNum. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.newPartyID] _ GetPartyFromFeepNum[localConversation, argPkt.partyID, feepNum]; pktLength _ 2; RETURN[returnLength: pktLength]; END; -- GetPartyFromFeepNumStub. ReleaseTrunkPartyStub: --PROCEDURE [shh: SHHH, partyID: PartyHandle]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, partyID (1): PartyHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; ReleaseTrunkParty[localConversation, argPkt.partyID]; pktLength _ 0; RETURN[returnLength: pktLength]; END; -- ReleaseTrunkPartyStub. GetRnameStub: --PROCEDURE [shh: SHHH, partyID: PartyHandle] RETURNS -- [Rname: Thrush.Rname]-- RpcPrivate.Dispatcher = BEGIN Rname: Thrush.Rname; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, partyID (1): PartyHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [Rname] _ GetRname[localConversation, argPkt.partyID]; pktLength _ 0; BEGIN -- Marshal Rname: Thrush.Rname to pkt.data[pktLength]. pkt.data[pktLength] _ Rname=NIL; pktLength _ pktLength+1; IF Rname # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: Rname]; IF textRope.length > RpcPrivate.maxShortStringLength THEN Lupine.MarshalingError; pkt.data[pktLength] _ textRope.length; pktLength _ pktLength+1; pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: TRUE]; END; -- IF Rname # NIL. END; -- Marshal Rname. RETURN[returnLength: pktLength]; END; -- GetRnameStub. RegisterStub: --PROCEDURE [shh: SHHH, partyID: PartyHandle, interface: -- SmartsInterface, properties: ThSmarts.SmartsProperties, oldSmartsID: -- SmartsHandle] -- RETURNS [smartsID: SmartsHandle]-- RpcPrivate.Dispatcher = BEGIN interface: SmartsInterface; ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, partyID (1): PartyHandle, properties (3): ThSmarts.SmartsProperties, oldSmartsID (5): SmartsHandle]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ smartsID (0): SmartsHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 7; BEGIN -- Unmarshal interface: SmartsInterface from pkt.data[pktLength]. isNIL: Lupine.NilHeader; isNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF isNIL THEN interface _ NIL ELSE BEGIN interface _ (paramZones.gc.NEW[ThSmarts.SmartsInterfaceRecord]); BEGIN -- Unmarshal interface^: ThSmarts.SmartsInterfaceRecord -- from pkt.data[pktLength]. pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: LOOPHOLE[interface], dataLength: SIZE[ThSmarts.SmartsInterfaceRecord], alwaysOnePkt: TRUE]; -- Restore garbled REFs to NIL following copy. BEGIN OPEN record: interface^; LOOPHOLE[record.type, LONG POINTER] _ NIL; LOOPHOLE[record.instance, LONG POINTER] _ NIL; END; -- OPEN record: interface^. BEGIN OPEN record: interface^; BEGIN -- Unmarshal record.type: ShortROPE from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN record.type _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; record.type _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal record.type. BEGIN -- Unmarshal record.instance: ShortROPE from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN record.instance _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; record.instance _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal record.instance. END; -- OPEN record: interface^. END; -- Unmarshal interface^. END; -- IF isNIL. END; -- Unmarshal interface. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.smartsID] _ Register[localConversation, argPkt.partyID, interface, argPkt.properties, argPkt.oldSmartsID]; pktLength _ 2; RETURN[returnLength: pktLength]; END; -- RegisterStub. RegisterCloneStub: --PROCEDURE [shh: SHHH, partyID: PartyHandle, -- clonePartyID: PartyHandle, oldSmartsID: SmartsHandle] -- RETURNS [smartsID: SmartsHandle]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, partyID (1): PartyHandle, clonePartyID (3): PartyHandle, oldSmartsID (5): SmartsHandle]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ smartsID (0): SmartsHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 7; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.smartsID] _ RegisterClone[localConversation, argPkt.partyID, argPkt.clonePartyID, argPkt.oldSmartsID]; pktLength _ 2; RETURN[returnLength: pktLength]; END; -- RegisterCloneStub. DeregisterStub: --PROCEDURE [shh: SHHH, smartsID: SmartsHandle]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, smartsID (1): SmartsHandle]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; Deregister[localConversation, argPkt.smartsID]; pktLength _ 0; RETURN[returnLength: pktLength]; END; -- DeregisterStub. EnableStub: --PROCEDURE [shh: SHHH, smartsID: SmartsHandle] RETURNS -- [nb: Thrush.NB]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, smartsID (1): SmartsHandle]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ nb (0): Thrush.NB]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.nb] _ Enable[localConversation, argPkt.smartsID]; pktLength _ 1; RETURN[returnLength: pktLength]; END; -- EnableStub. DisableStub: --PROCEDURE [shh: SHHH, smartsID: SmartsHandle] RETURNS -- [nb: Thrush.NB]-- RpcPrivate.Dispatcher = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex, smartsID (1): SmartsHandle]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ nb (0): Thrush.NB]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [resPkt.nb] _ Disable[localConversation, argPkt.smartsID]; pktLength _ 1; RETURN[returnLength: pktLength]; END; -- DisableStub. GetNumbersForRNameStub: --PROCEDURE [shh: SHHH, rName: ROPE] RETURNS -- [fullRName: ROPE, number: ROPE, homeNumber: ROPE]-- RpcPrivate.Dispatcher = BEGIN rName: ROPE; fullRName: ROPE; number: ROPE; homeNumber: ROPE; pktLength: RpcPrivate.DataLength _ 1; BEGIN -- Unmarshal rName: ROPE from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; ropeIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeIsNIL THEN rName _ NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength _ pkt.data[pktLength]; pktLength _ pktLength+1; IF ropeLength > RpcPrivate.maxShortStringLength THEN Lupine.UnmarshalingError; rName _ textRope _ Rope.NewText[size: ropeLength]; pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: TRUE]; END; -- IF ropeIsNIL. END; -- Unmarshal rName. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; [fullRName, number, homeNumber] _ GetNumbersForRName[localConversation, rName]; pktLength _ 0; BEGIN -- Marshal fullRName: ROPE to pkt.data[pktLength]. pkt.data[pktLength] _ fullRName=NIL; pktLength _ pktLength+1; IF fullRName # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: fullRName]; IF textRope.length > RpcPrivate.maxShortStringLength THEN Lupine.MarshalingError; pkt.data[pktLength] _ textRope.length; pktLength _ pktLength+1; pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: TRUE]; END; -- IF fullRName # NIL. END; -- Marshal fullRName. BEGIN -- Marshal number: ROPE to pkt.data[pktLength]. pkt.data[pktLength] _ number=NIL; pktLength _ pktLength+1; IF number # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: number]; IF textRope.length > RpcPrivate.maxShortStringLength THEN Lupine.MarshalingError; pkt.data[pktLength] _ textRope.length; pktLength _ pktLength+1; pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: TRUE]; END; -- IF number # NIL. END; -- Marshal number. BEGIN -- Marshal homeNumber: ROPE to pkt.data[pktLength]. pkt.data[pktLength] _ homeNumber=NIL; pktLength _ pktLength+1; IF homeNumber # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: homeNumber]; IF textRope.length > RpcPrivate.maxShortStringLength THEN Lupine.MarshalingError; pkt.data[pktLength] _ textRope.length; pktLength _ pktLength+1; pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: TRUE]; END; -- IF homeNumber # NIL. END; -- Marshal homeNumber. RETURN[returnLength: pktLength]; END; -- GetNumbersForRNameStub. -- No module initialization. END. -- ThPartyRpcServerImpl.