-- Copyright (C) 1986 by Xerox Corporation. All rights reserved. -- Stub file was translated on August 8, 1986 7:17:53 pm PDT by Lupine of February 22, 1986 5:15:54 pm PST -- Source interface ThParty came from file ThParty.bcd, which was created on August 8, 1986 7:17:43 pm PDT with version stamp 254#77#30470563237 from source of August 8, 1986 7:17:33 pm PDT. -- 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 = TRUE -- 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 BasicTime, IV, RefID, RPC, Thrush, ThSmartsRpcControl, ThParty, ThPartyRpcControl USING [InterfaceRecord, InterMdsCallsOnly, LupineProtocolVersion, ProcedureIndex, SignalIndex], RPCLupine --USING SOME OF [Alloc, Call, DataLength, DeAlloc, Dispatcher, -- GetPkt, GetStubPkt, ImportHandle, ImportInterface, maxDataLength, -- maxPrincipalLength, maxShortStringLength, pktOverhead, ReceiveExtraPkt, -- SendPrelimPkt, StartCall, StartSignal, StubPkt, UnimportInterface]--, RPCLupineExtras --USING SOME OF [ImportInterfaceWithHost, noHost, -- RPCHost]--, LupineRuntime --USING SOME OF [BindingError, CheckPktLength, CopyFromPkt, -- CopyFromMultiplePkts, CopyToPkt, CopyToMultiplePkts, defaultZones, -- DispatchingError, FinishThisPkt, ListHeader, MarshalingError, -- MarshalingExprError, MarshalAtom, MarshalRope, NilHeader, ProtocolError, -- RopeHeader, RpcPktDoubleWord, RuntimeError, SequenceHeader, SHORT, -- StartNextPkt, StringHeader, StubPktDoubleWord, TranslationError, -- UnmarshalingError, UnmarshalingExprError, UnmarshalAtom, UnmarshalRope, -- WordsForChars]--, Atom --USING SOME OF [GetPName, MakeAtom]--, PrincOpsUtils --USING SOME OF [Enter, Exit]--, Rope --USING SOME OF [InlineFlatten, Length, NewText, Text]--, VM --USING SOME OF [AddressForPageNumber, PageCount, PageNumber, -- PageNumberForAddress, PagesForWords]--; ThPartyRpcClientImpl: MONITOR IMPORTS RpcPrivate: RPCLupine, RpcPrivateExtras: RPCLupineExtras, Lupine: LupineRuntime, Atom, PrincOpsUtils, Rope EXPORTS ThParty, ThPartyRpcControl SHARES ThParty, ThPartyRpcControl, Rope = BEGIN OPEN ThParty, RpcControl: ThPartyRpcControl, RpcPublic: RPC; -- Standard remote binding routines. bound: BOOLEAN _ FALSE; myInterface: RpcPrivate.ImportHandle; paramZones: RpcPublic.Zones _ RpcPublic.standardZones; ImportInterface: PUBLIC ENTRY SAFE PROCEDURE [ interfaceName: RpcPublic.InterfaceName, parameterStorage: RpcPublic.Zones, hostHint: RpcPrivateExtras.RPCHost_RpcPrivateExtras.noHost ] = TRUSTED BEGIN ENABLE UNWIND => NULL; IsNull: PROCEDURE [string: Rope.ROPE] RETURNS [BOOLEAN] = INLINE {RETURN[string.Length[] = 0]}; myInterface _ RpcPrivateExtras.ImportInterfaceWithHost [ interface: [ type: IF ~IsNull[interfaceName.type] THEN interfaceName.type ELSE "ThParty~254#77#30470563237", instance: interfaceName.instance, version: interfaceName.version ], localOnly: RpcControl.InterMdsCallsOnly, stubProtocol: RpcControl.LupineProtocolVersion, hostHint: hostHint ]; 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; UnimportInterface: PUBLIC ENTRY SAFE PROCEDURE = TRUSTED BEGIN ENABLE UNWIND => NULL; IF ~bound THEN Lupine.BindingError; myInterface _ RpcPrivate.UnimportInterface[myInterface]; paramZones _ RpcPublic.standardZones; bound _ FALSE; END; -- Remote public procedure stubs. CreateConversation: PUBLIC SAFE PROCEDURE [shhh: SHHH, credentials: Credentials, state: Thrush.StateInConv, urgency: Thrush.CallUrgency, alertKind: Thrush.AlertKind, reason: Thrush.Reason, comment: ROPE, subject: Thrush.ROPE] RETURNS [nb: NB, convEvent: Thrush.ConvEvent] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ CreateConversation, credentials (1): Credentials, state (9): Thrush.StateInConv]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 10; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shhh]; argPkt^ _ [credentials: credentials, state: state]; BEGIN -- Marshal urgency: Thrush.CallUrgency to pkt.data[pktLength]. pktLength _ Lupine.MarshalAtom[urgency, pkt, pktLength]; END; -- Marshal urgency. BEGIN -- Marshal alertKind: Thrush.AlertKind to pkt.data[pktLength]. pktLength _ Lupine.MarshalAtom[alertKind, pkt, pktLength]; END; -- Marshal alertKind. BEGIN -- Marshal reason: Thrush.Reason to pkt.data[pktLength]. pktLength _ Lupine.MarshalAtom[reason, pkt, pktLength]; END; -- Marshal reason. BEGIN -- Marshal comment: ROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[comment, pkt, pktLength, FALSE]; END; -- Marshal comment. BEGIN -- Marshal subject: Thrush.ROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[subject, pkt, pktLength, FALSE]; END; -- Marshal subject. [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. BEGIN -- Unmarshal convEvent: Thrush.ConvEvent from pkt.data[pktLength]. [convEvent, pktLength] _ UnmarshalThrushDotConvEvent[pkt, pktLength]; END; -- Unmarshal convEvent. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, convEvent]; END; -- UNWIND. END; -- CreateConversation. Alert: PUBLIC SAFE PROCEDURE [shhh: SHHH, credentials: Credentials, calledPartyID: PartyID, comment: ROPE] RETURNS [nb: NB] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ Alert, credentials (1): Credentials, calledPartyID (9): PartyID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 11; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shhh]; argPkt^ _ [credentials: credentials, calledPartyID: calledPartyID]; BEGIN -- Marshal comment: ROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[comment, pkt, pktLength, FALSE]; END; -- Marshal comment. [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb]; END; -- UNWIND. END; -- Alert. Advance: PUBLIC SAFE PROCEDURE [shhh: SHHH, credentials: Credentials, state: Thrush.StateInConv, reportToAll: BOOL, reason: Thrush.Reason, comment: ROPE] RETURNS [nb: NB, convEvent: Thrush.ConvEvent] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ Advance, credentials (1): Credentials, state (9): Thrush.StateInConv, reportToAll (10): BOOL]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 11; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shhh]; argPkt^ _ [credentials: credentials, state: state, reportToAll: reportToAll]; BEGIN -- Marshal reason: Thrush.Reason to pkt.data[pktLength]. pktLength _ Lupine.MarshalAtom[reason, pkt, pktLength]; END; -- Marshal reason. BEGIN -- Marshal comment: ROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[comment, pkt, pktLength, FALSE]; END; -- Marshal comment. [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. BEGIN -- Unmarshal convEvent: Thrush.ConvEvent from pkt.data[pktLength]. [convEvent, pktLength] _ UnmarshalThrushDotConvEvent[pkt, pktLength]; END; -- Unmarshal convEvent. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, convEvent]; END; -- UNWIND. END; -- Advance. ReportAction: PUBLIC SAFE PROCEDURE [shhh: SHHH, report: Thrush.ActionReport, reportToAll: BOOL, selfOnCompletion: BOOL] RETURNS [nb: NB, numReportsIssued: NAT] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ ReportAction, reportToAll (1): BOOL, selfOnCompletion (2): BOOL]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ numReportsIssued (0): NAT]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shhh]; argPkt^ _ [reportToAll: reportToAll, selfOnCompletion: selfOnCompletion]; BEGIN -- Marshal report: Thrush.ActionReport to pkt.data[pktLength]. pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: @report, dataLength: SIZE[Thrush.ActionReport], alwaysOnePkt: FALSE]; BEGIN OPEN record: report; BEGIN -- Marshal record.actionClass: ActionClass to pkt.data[pktLength]. pktLength _ Lupine.MarshalAtom[record.actionClass, pkt, pktLength]; END; -- Marshal record.actionClass. BEGIN -- Marshal record.actionType: ActionType to pkt.data[pktLength]. pktLength _ Lupine.MarshalAtom[record.actionType, pkt, pktLength]; END; -- Marshal record.actionType. BEGIN -- Marshal record.actionInfo: ROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[record.actionInfo, pkt, pktLength, FALSE]; END; -- Marshal record.actionInfo. END; -- OPEN record: report. END; -- Marshal report. [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 1; BEGIN -- OnePkt. -- Move statics from pkt now. [numReportsIssued: numReportsIssued] _ resPkt^; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, numReportsIssued]; END; -- OnePkt. END; -- UNWIND. END; -- ReportAction. GetConversationInfo: PUBLIC SAFE PROCEDURE [shh: SHHH, convID: ConversationID] RETURNS [nb: NB, cInfo: ConversationInfo] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ GetConversationInfo, convID (1): ConversationID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [convID: convID]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. BEGIN -- Unmarshal cInfo: ConversationInfo from pkt.data[pktLength]. pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: @cInfo, dataLength: SIZE[ConversationInfo], alwaysOnePkt: FALSE]; -- Restore garbled REFs to NIL following copy. BEGIN OPEN record: cInfo; LOOPHOLE[record.subject, LONG POINTER] _ NIL; LOOPHOLE[record.urgency, LONG POINTER] _ NIL; LOOPHOLE[record.alertKind, LONG POINTER] _ NIL; END; -- OPEN record: cInfo. BEGIN OPEN record: cInfo; BEGIN -- Unmarshal record.subject: ROPE from pkt.data[pktLength]. [record.subject, pktLength] _ Lupine.UnmarshalRope[pkt, pktLength, FALSE]; END; -- Unmarshal record.subject. BEGIN -- Unmarshal record.urgency: Thrush.CallUrgency from -- pkt.data[pktLength]. [record.urgency, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal record.urgency. BEGIN -- Unmarshal record.alertKind: Thrush.AlertKind from -- pkt.data[pktLength]. [record.alertKind, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal record.alertKind. END; -- OPEN record: cInfo. END; -- Unmarshal cInfo. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, cInfo]; END; -- UNWIND. END; -- GetConversationInfo. GetPartyInfo: PUBLIC SAFE PROCEDURE [shh: SHHH, credentials: Credentials, nameReq: NameReq, allParties: BOOL] RETURNS [nb: NB, pInfo: PartyInfo] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ GetPartyInfo, credentials (1): Credentials, allParties (9): BOOL]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 10; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [credentials: credentials, allParties: allParties]; BEGIN -- Marshal nameReq: NameReq to pkt.data[pktLength]. pktLength _ Lupine.MarshalAtom[nameReq, pkt, pktLength]; END; -- Marshal nameReq. [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. BEGIN -- Unmarshal pInfo: PartyInfo from pkt.data[pktLength]. [pInfo, pktLength] _ UnmarshalPartyInfo[pkt, pktLength]; END; -- Unmarshal pInfo. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, pInfo]; END; -- UNWIND. END; -- GetPartyInfo. DescribeParty: PUBLIC SAFE PROCEDURE [partyID: Thrush.PartyID, nameReq: NameReq] RETURNS [nb: NB, description: Thrush.ROPE] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ DescribeParty, partyID (1): Thrush.PartyID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt^ _ [partyID: partyID]; BEGIN -- Marshal nameReq: NameReq to pkt.data[pktLength]. pktLength _ Lupine.MarshalAtom[nameReq, pkt, pktLength]; END; -- Marshal nameReq. [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. BEGIN -- Unmarshal description: Thrush.ROPE from pkt.data[pktLength]. [description, pktLength] _ Lupine.UnmarshalRope[pkt, pktLength, FALSE]; END; -- Unmarshal description. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, description]; END; -- UNWIND. END; -- DescribeParty. RegisterServiceInterface: PUBLIC SAFE PROCEDURE [shhh: SHHH, credentials: Credentials, interfaceSpecPattern: Thrush.InterfaceSpec] RETURNS [nb: NB, interfaceSpec: Thrush.InterfaceSpec] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ RegisterServiceInterface, credentials (1): Credentials]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 9; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shhh]; argPkt^ _ [credentials: credentials]; BEGIN -- Marshal interfaceSpecPattern: Thrush.InterfaceSpec -- to pkt.data[pktLength]. pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: @interfaceSpecPattern, dataLength: SIZE[Thrush.InterfaceSpec], alwaysOnePkt: TRUE]; BEGIN OPEN record: interfaceSpecPattern; BEGIN -- Marshal record.interfaceName: RPC.InterfaceName to -- pkt.data[pktLength]. BEGIN OPEN record: record.interfaceName; BEGIN -- Marshal record.type: ShortROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[record.type, pkt, pktLength, TRUE]; END; -- Marshal record.type. BEGIN -- Marshal record.instance: ShortROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[record.instance, pkt, pktLength, TRUE]; END; -- Marshal record.instance. END; -- OPEN record: record.interfaceName. END; -- Marshal record.interfaceName. END; -- OPEN record: interfaceSpecPattern. END; -- Marshal interfaceSpecPattern. [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. BEGIN -- Unmarshal interfaceSpec: Thrush.InterfaceSpec from -- pkt.data[pktLength]. pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: @interfaceSpec, dataLength: SIZE[Thrush.InterfaceSpec], alwaysOnePkt: FALSE]; -- Restore garbled REFs to NIL following copy. BEGIN OPEN record: interfaceSpec; BEGIN OPEN record: record.interfaceName; LOOPHOLE[record.type, LONG POINTER] _ NIL; LOOPHOLE[record.instance, LONG POINTER] _ NIL; END; -- OPEN record: record.interfaceName. END; -- OPEN record: interfaceSpec. BEGIN OPEN record: interfaceSpec; BEGIN -- Unmarshal record.interfaceName: RPC.InterfaceName -- from pkt.data[pktLength]. BEGIN OPEN record: record.interfaceName; BEGIN -- Unmarshal record.type: ShortROPE from pkt.data[pktLength]. [record.type, pktLength] _ Lupine.UnmarshalRope[pkt, pktLength, TRUE]; END; -- Unmarshal record.type. BEGIN -- Unmarshal record.instance: ShortROPE from pkt.data[pktLength]. [record.instance, pktLength] _ Lupine.UnmarshalRope[pkt, pktLength, TRUE]; END; -- Unmarshal record.instance. END; -- OPEN record: record.interfaceName. END; -- Unmarshal record.interfaceName. END; -- OPEN record: interfaceSpec. END; -- Unmarshal interfaceSpec. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, interfaceSpec]; END; -- UNWIND. END; -- RegisterServiceInterface. LookupServiceInterface: PUBLIC SAFE PROCEDURE [shhh: SHHH, credentials: Credentials, serviceParty: PartyID, type: RPC.ShortROPE] RETURNS [nb: NB, interfaceSpec: Thrush.InterfaceSpec] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ LookupServiceInterface, credentials (1): Credentials, serviceParty (9): PartyID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 11; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shhh]; argPkt^ _ [credentials: credentials, serviceParty: serviceParty]; BEGIN -- Marshal type: RPC.ShortROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[type, pkt, pktLength, TRUE]; END; -- Marshal type. [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. BEGIN -- Unmarshal interfaceSpec: Thrush.InterfaceSpec from -- pkt.data[pktLength]. pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: @interfaceSpec, dataLength: SIZE[Thrush.InterfaceSpec], alwaysOnePkt: FALSE]; -- Restore garbled REFs to NIL following copy. BEGIN OPEN record: interfaceSpec; BEGIN OPEN record: record.interfaceName; LOOPHOLE[record.type, LONG POINTER] _ NIL; LOOPHOLE[record.instance, LONG POINTER] _ NIL; END; -- OPEN record: record.interfaceName. END; -- OPEN record: interfaceSpec. BEGIN OPEN record: interfaceSpec; BEGIN -- Unmarshal record.interfaceName: RPC.InterfaceName -- from pkt.data[pktLength]. BEGIN OPEN record: record.interfaceName; BEGIN -- Unmarshal record.type: ShortROPE from pkt.data[pktLength]. [record.type, pktLength] _ Lupine.UnmarshalRope[pkt, pktLength, TRUE]; END; -- Unmarshal record.type. BEGIN -- Unmarshal record.instance: ShortROPE from pkt.data[pktLength]. [record.instance, pktLength] _ Lupine.UnmarshalRope[pkt, pktLength, TRUE]; END; -- Unmarshal record.instance. END; -- OPEN record: record.interfaceName. END; -- Unmarshal record.interfaceName. END; -- OPEN record: interfaceSpec. END; -- Unmarshal interfaceSpec. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, interfaceSpec]; END; -- UNWIND. END; -- LookupServiceInterface. RegisterKey: PUBLIC SAFE PROCEDURE [shh: SHHH, credentials: Credentials, key: Thrush.EncryptionKey, reportNewKeys: BOOL] RETURNS [nb: NB, keyIndex: [0..15]] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ RegisterKey, credentials (1): Credentials, key (9): Thrush.EncryptionKey, reportNewKeys (13): BOOL]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ keyIndex (0): [0..15]]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 14; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [credentials: credentials, key: key, reportNewKeys: reportNewKeys]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 1; BEGIN -- OnePkt. -- Move statics from pkt now. [keyIndex: keyIndex] _ resPkt^; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, keyIndex]; END; -- OnePkt. END; -- UNWIND. END; -- RegisterKey. GetKeyTable: PUBLIC SAFE PROCEDURE [shh: SHHH, credentials: Credentials] RETURNS [nb: NB, keyTable: Thrush.KeyTable] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ GetKeyTable, credentials (1): Credentials]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 9; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [credentials: credentials]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. BEGIN -- Unmarshal keyTable: Thrush.KeyTable from pkt.data[pktLength]. [keyTable, pktLength] _ UnmarshalThrushDotKeyTable[pkt, pktLength]; END; -- Unmarshal keyTable. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, keyTable]; END; -- UNWIND. END; -- GetKeyTable. UnregisterKey: PUBLIC SAFE PROCEDURE [shh: SHHH, credentials: Credentials, key: Thrush.EncryptionKey] RETURNS [nb: NB] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ UnregisterKey, credentials (1): Credentials, key (9): Thrush.EncryptionKey]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 13; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [credentials: credentials, key: key]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb]; END; -- UNWIND. END; -- UnregisterKey. GetParty: PUBLIC SAFE PROCEDURE [shh: SHHH, partyID: PartyID, rName: ROPE, type: Thrush.PartyType] RETURNS [nb: NB, newPartyID: PartyID] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ GetParty, partyID (1): PartyID]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ newPartyID (0): PartyID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [partyID: partyID]; BEGIN -- Marshal rName: ROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[rName, pkt, pktLength, FALSE]; END; -- Marshal rName. BEGIN -- Marshal type: Thrush.PartyType to pkt.data[pktLength]. pktLength _ Lupine.MarshalAtom[type, pkt, pktLength]; END; -- Marshal type. [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 2; BEGIN -- OnePkt. -- Move statics from pkt now. [newPartyID: newPartyID] _ resPkt^; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, newPartyID]; END; -- OnePkt. END; -- UNWIND. END; -- GetParty. GetPartyFromNumber: PUBLIC SAFE PROCEDURE [shh: SHHH, partyID: PartyID, phoneNumber: Thrush.ROPE, description: ROPE] RETURNS [nb: NB, newPartyID: PartyID] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ GetPartyFromNumber, partyID (1): PartyID]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ newPartyID (0): PartyID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [partyID: partyID]; BEGIN -- Marshal phoneNumber: Thrush.ROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[phoneNumber, pkt, pktLength, FALSE]; END; -- Marshal phoneNumber. BEGIN -- Marshal description: ROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[description, pkt, pktLength, FALSE]; END; -- Marshal description. [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 2; BEGIN -- OnePkt. -- Move statics from pkt now. [newPartyID: newPartyID] _ resPkt^; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, newPartyID]; END; -- OnePkt. END; -- UNWIND. END; -- GetPartyFromNumber. GetPartyFromFeepNum: PUBLIC SAFE PROCEDURE [shh: SHHH, partyID: PartyID, feepNum: Thrush.ROPE] RETURNS [nb: NB, newPartyID: PartyID] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ GetPartyFromFeepNum, partyID (1): PartyID]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ newPartyID (0): PartyID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [partyID: partyID]; BEGIN -- Marshal feepNum: Thrush.ROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[feepNum, pkt, pktLength, FALSE]; END; -- Marshal feepNum. [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 2; BEGIN -- OnePkt. -- Move statics from pkt now. [newPartyID: newPartyID] _ resPkt^; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, newPartyID]; END; -- OnePkt. END; -- UNWIND. END; -- GetPartyFromFeepNum. GetCurrentParty: PUBLIC SAFE PROCEDURE [shh: SHHH, smartsID: SmartsID] RETURNS [nb: NB, partyID: Thrush.PartyID] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ GetCurrentParty, smartsID (1): SmartsID]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ partyID (0): Thrush.PartyID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [smartsID: smartsID]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 2; BEGIN -- OnePkt. -- Move statics from pkt now. [partyID: partyID] _ resPkt^; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, partyID]; END; -- OnePkt. END; -- UNWIND. END; -- GetCurrentParty. ReleaseParty: PUBLIC SAFE PROCEDURE [shh: SHHH, partyID: PartyID, targetPartyID: PartyID] RETURNS [nb: NB] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ ReleaseParty, partyID (1): PartyID, targetPartyID (3): PartyID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 5; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [partyID: partyID, targetPartyID: targetPartyID]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb]; END; -- UNWIND. END; -- ReleaseParty. GetNumbersForRName: PUBLIC SAFE PROCEDURE [shh: SHHH, rName: ROPE] RETURNS [fullRName: ROPE, number: ROPE, homeNumber: ROPE] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ GetNumbersForRName]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 1; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt.transferIndex _ GetNumbersForRName; BEGIN -- Marshal rName: ROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[rName, pkt, pktLength, FALSE]; END; -- Marshal rName. [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal fullRName: ROPE from pkt.data[pktLength]. [fullRName, pktLength] _ Lupine.UnmarshalRope[pkt, pktLength, FALSE]; END; -- Unmarshal fullRName. BEGIN -- Unmarshal number: ROPE from pkt.data[pktLength]. [number, pktLength] _ Lupine.UnmarshalRope[pkt, pktLength, FALSE]; END; -- Unmarshal number. BEGIN -- Unmarshal homeNumber: ROPE from pkt.data[pktLength]. [homeNumber, pktLength] _ Lupine.UnmarshalRope[pkt, pktLength, FALSE]; END; -- Unmarshal homeNumber. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[fullRName, number, homeNumber]; END; -- UNWIND. END; -- GetNumbersForRName. Register: PUBLIC SAFE PROCEDURE [shh: SHHH, rName: ROPE, type: Thrush.PartyType, clonePartyID: PartyID, interface: SmartsInterfaceName, properties: SmartsProperties] RETURNS [nb: NB, credentials: Credentials] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ Register, clonePartyID (1): PartyID]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ credentials (0): Credentials]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [clonePartyID: clonePartyID]; BEGIN -- Marshal rName: ROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[rName, pkt, pktLength, FALSE]; END; -- Marshal rName. BEGIN -- Marshal type: Thrush.PartyType to pkt.data[pktLength]. pktLength _ Lupine.MarshalAtom[type, pkt, pktLength]; END; -- Marshal type. BEGIN -- Marshal interface: SmartsInterfaceName to pkt.data[pktLength]. pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: @interface, dataLength: SIZE[SmartsInterfaceName], alwaysOnePkt: FALSE]; BEGIN OPEN record: interface; BEGIN -- Marshal record.type: RPC.ShortROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[record.type, pkt, pktLength, TRUE]; END; -- Marshal record.type. BEGIN -- Marshal record.instance: RPC.ShortROPE to pkt.data[pktLength]. pktLength _ Lupine.MarshalRope[record.instance, pkt, pktLength, TRUE]; END; -- Marshal record.instance. END; -- OPEN record: interface. END; -- Marshal interface. BEGIN -- Marshal properties: SmartsProperties to pkt.data[pktLength]. pktLength _ Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: @properties, dataLength: SIZE[SmartsProperties], alwaysOnePkt: FALSE]; BEGIN OPEN record: properties; BEGIN -- Marshal record.role: SmartsRole to pkt.data[pktLength]. pktLength _ Lupine.MarshalAtom[record.role, pkt, pktLength]; END; -- Marshal record.role. END; -- OPEN record: properties. END; -- Marshal properties. [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 8; BEGIN -- OnePkt. -- Move statics from pkt now. [credentials: credentials] _ resPkt^; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb, credentials]; END; -- OnePkt. END; -- UNWIND. END; -- Register. CheckIn: PUBLIC SAFE PROCEDURE [shh: SHHH, credentials: Credentials] RETURNS [nb: NB] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ CheckIn, credentials (1): Credentials]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 9; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [credentials: credentials]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb]; END; -- UNWIND. END; -- CheckIn. Deregister: PUBLIC SAFE PROCEDURE [shh: SHHH, smartsID: SmartsID] RETURNS [nb: NB] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ Deregister, smartsID (1): SmartsID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [smartsID: smartsID]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb]; END; -- UNWIND. END; -- Deregister. Enable: PUBLIC SAFE PROCEDURE [shh: SHHH, smartsID: SmartsID] RETURNS [nb: Thrush.NB] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ Enable, smartsID (1): SmartsID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [smartsID: smartsID]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: Thrush.NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb]; END; -- UNWIND. END; -- Enable. Disable: PUBLIC SAFE PROCEDURE [shh: SHHH, smartsID: SmartsID] RETURNS [nb: Thrush.NB] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ Disable, smartsID (1): SmartsID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [smartsID: smartsID]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: Thrush.NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb]; END; -- UNWIND. END; -- Disable. Visit: PUBLIC SAFE PROCEDURE [shh: SHHH, visitedParty: PartyID, visitingParty: PartyID] RETURNS [nb: Thrush.NB] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ Visit, visitedParty (1): PartyID, visitingParty (3): PartyID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 5; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [visitedParty: visitedParty, visitingParty: visitingParty]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: Thrush.NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb]; END; -- UNWIND. END; -- Visit. Unvisit: PUBLIC SAFE PROCEDURE [shh: SHHH, visitingParty: PartyID] RETURNS [nb: Thrush.NB] = TRUSTED BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex _ Unvisit, visitingParty (1): PartyID]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.Alloc[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength _ 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface, localConversation: shh]; argPkt^ _ [visitingParty: visitingParty]; [returnLength: , lastPkt: lastPkt] _ RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength _ 0; BEGIN -- Unmarshal nb: Thrush.NB from pkt.data[pktLength]. [nb, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal nb. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[nb]; END; -- UNWIND. END; -- Unvisit. -- Remote public signals and errors. -- Public signal and error dispatcher. ClientDispatcher: --PROCEDURE [pkt: RPCPkt, callLength: DataLength, -- lastPkt: BOOLEAN, localConversation: Conversation] RETURNS [returnLength: -- DataLength]-- RpcPrivate.Dispatcher = BEGIN SELECT LOOPHOLE[pkt.data[0], RpcControl.SignalIndex] FROM ENDCASE => RETURN[Lupine.DispatchingError[]]; END; -- ClientDispatcher -- Public signal and error dispatcher stubs. -- Marshall/Unmarshal procedures. UnmarshalThrushDotKeyTable: PROC[pkt: RpcPrivate.RPCPkt, pktLength0: RpcPrivate.DataLength] RETURNS[value: Thrush.KeyTable, pktLength: RpcPrivate.DataLength] = BEGIN pktLength _ pktLength0; { BEGIN -- Unmarshal value^: IV.KeyTableBody from pkt.data[pktLength]. recordIsNIL: Lupine.NilHeader; IF pktLength+3 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength]; recordIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF recordIsNIL THEN value _ NIL ELSE BEGIN seqLength: Lupine.SequenceHeader; seqLength _ Lupine.RpcPktDoubleWord[pkt, pktLength]^; pktLength _ pktLength + 2; value _ (paramZones.gc.NEW[IV.KeyTableBody[Lupine.SHORT[seqLength]]]); pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: LOOPHOLE[value], dataLength: SIZE[IV.KeyTableBody[LENGTH[DESCRIPTOR[value^]]]], alwaysOnePkt: FALSE]; END; -- IF recordIsNIL. END; -- Unmarshal value^. };END; UnmarshalPartyInfo: PROC[pkt: RpcPrivate.RPCPkt, pktLength0: RpcPrivate.DataLength] RETURNS[value: ThParty.PartyInfo, pktLength: RpcPrivate.DataLength] = BEGIN pktLength _ pktLength0; { BEGIN -- Unmarshal value^: ThParty.PartyInfoSeq from pkt.data[pktLength]. recordIsNIL: Lupine.NilHeader; IF pktLength+3 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength]; recordIsNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF recordIsNIL THEN value _ NIL ELSE BEGIN seqLength: Lupine.SequenceHeader; seqLength _ Lupine.RpcPktDoubleWord[pkt, pktLength]^; pktLength _ pktLength + 2; value _ (paramZones.gc.NEW[ThParty.PartyInfoSeq[Lupine.SHORT[seqLength]]]); pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: LOOPHOLE[value], dataLength: SIZE[ThParty.PartyInfoSeq[LENGTH[DESCRIPTOR[value^]]]], alwaysOnePkt: FALSE]; -- Restore garbled REFs to NIL following copy. BEGIN OPEN record: value^; FOR element2: NAT IN [FIRST[NAT]..FIRST[NAT]+LENGTH[DESCRIPTOR[record.parties]]) DO BEGIN OPEN record: record.parties[element2]; LOOPHOLE[record.name, LONG POINTER] _ NIL; LOOPHOLE[record.intendedName, LONG POINTER] _ NIL; LOOPHOLE[record.type, LONG POINTER] _ NIL; END; -- OPEN record: record.parties[element2]. ENDLOOP; -- FOR element2. END; -- OPEN record: value^. BEGIN OPEN record: value^; BEGIN -- Unmarshal record.parties: SEQUENCE len: NAT OF ThParty.PartyInfoSpec -- from pkt.data[pktLength]. -- The sequence's length was carried by its record. FOR element3: NAT IN [FIRST[NAT]..FIRST[NAT]+LENGTH[DESCRIPTOR[record.parties]]) DO BEGIN -- Unmarshal record.parties[element3]: ThParty.PartyInfoSpec -- from pkt.data[pktLength]. pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: @record.parties[element3], dataLength: SIZE[ThParty.PartyInfoSpec], alwaysOnePkt: FALSE]; -- Restore garbled REFs to NIL following copy. BEGIN OPEN record: record.parties[element3]; LOOPHOLE[record.name, LONG POINTER] _ NIL; LOOPHOLE[record.intendedName, LONG POINTER] _ NIL; LOOPHOLE[record.type, LONG POINTER] _ NIL; END; -- OPEN record: record.parties[element3]. BEGIN OPEN record: record.parties[element3]; BEGIN -- Unmarshal record.name: Thrush.ROPE from pkt.data[pktLength]. [record.name, pktLength] _ Lupine.UnmarshalRope[pkt, pktLength, FALSE]; END; -- Unmarshal record.name. BEGIN -- Unmarshal record.intendedName: Thrush.ROPE -- from pkt.data[pktLength]. [record.intendedName, pktLength] _ Lupine.UnmarshalRope[pkt, pktLength, FALSE]; END; -- Unmarshal record.intendedName. BEGIN -- Unmarshal record.type: Thrush.PartyType from -- pkt.data[pktLength]. [record.type, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal record.type. END; -- OPEN record: record.parties[element3]. END; -- Unmarshal record.parties[element3]. ENDLOOP; -- FOR element3. END; -- Unmarshal record.parties. END; -- OPEN record: value^. END; -- IF recordIsNIL. END; -- Unmarshal value^. };END; UnmarshalThrushDotConvEvent: PROC[pkt: RpcPrivate.RPCPkt, pktLength0: RpcPrivate.DataLength] RETURNS[value: Thrush.ConvEvent, pktLength: RpcPrivate.DataLength] = BEGIN pktLength _ pktLength0; { isNIL: Lupine.NilHeader; IF pktLength+1 > RpcPrivate.maxDataLength THEN pktLength _ Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength]; isNIL _ pkt.data[pktLength]; pktLength _ pktLength+1; IF isNIL THEN value _ NIL ELSE BEGIN value _ (paramZones.gc.NEW[Thrush.ConvEventBody]); BEGIN -- Unmarshal value^: Thrush.ConvEventBody from pkt.data[pktLength]. pktLength _ Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: LOOPHOLE[value], dataLength: SIZE[Thrush.ConvEventBody], alwaysOnePkt: FALSE]; -- Restore garbled REFs to NIL following copy. BEGIN OPEN record: value^; LOOPHOLE[record.reason, LONG POINTER] _ NIL; LOOPHOLE[record.comment, LONG POINTER] _ NIL; END; -- OPEN record: value^. BEGIN OPEN record: value^; BEGIN -- Unmarshal record.reason: Thrush.Reason from pkt.data[pktLength]. [record.reason, pktLength] _ Lupine.UnmarshalAtom[pkt, pktLength]; END; -- Unmarshal record.reason. BEGIN -- Unmarshal record.comment: Thrush.ROPE from pkt.data[pktLength]. [record.comment, pktLength] _ Lupine.UnmarshalRope[pkt, pktLength, FALSE]; END; -- Unmarshal record.comment. END; -- OPEN record: value^. END; -- Unmarshal value^. END; -- IF isNIL. };END; -- No module initialization. END. -- ThPartyRpcClientImpl.