ThPartySunRPCServerStub.mesa
Copyright Ó 1989, 1990 by Xerox Corporation. All rights reserved.
Adapted from ThPartyP909V1ServerImpl.Mesa
Generated by PolleZ.pa at September 30, 1989 4:53:16 pm PDT
using Sirocco [2.0] of February 10, 1989 6:26:26 pm PST
Polle Zellweger (PTZ) May 23, 1990 6:57:42 pm PDT
DIRECTORY
Basics USING [Card16FromH],
SunPMap USING [ipProtocolUDP],
SunPMapLocal USING [SetLocal, UnsetLocal],
SunRPC,
ThPartySunRPC,
ThPartySunRPCServer,
ThrushSunRPC;
ThPartySunRPCServerStub: CEDAR PROGRAM
IMPORTS Basics, SunPMapLocal, SunRPC, ThPartySunRPCServer ~ {
OPEN ThPartySunRPC, ThPartySunRPCServer;
Types
Handle: TYPE ~ SunRPC.Handle;
LookupServiceInterfaceCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
credentials: ThrushSunRPC.Credentials;
serviceParty: CARD32;
type: ROPE;
nb: ROPE;
interfaceSpec: ThrushSunRPC.InterfaceSpec;
{
shhh ← SunRPC.GetCard32[h];
};
{
credentials.partyID ← SunRPC.GetCard32[h];
credentials.smartsID ← SunRPC.GetCard32[h];
credentials.convID ← SunRPC.GetCard32[h];
credentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
credentials.stateID ← SunRPC.GetCard32[h];
};
{
serviceParty ← SunRPC.GetCard32[h];
};
{
type ← SunRPC.GetRope[h];
};
[nb, interfaceSpec] ← LookupServiceInterface[h, shhh, credentials, serviceParty, type];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutRope[h, interfaceSpec.interfaceName.type];
SunRPC.PutRope[h, interfaceSpec.interfaceName.instance];
SunRPC.PutCard32[h, interfaceSpec.interfaceName.version.first];
SunRPC.PutCard32[h, interfaceSpec.interfaceName.version.last];
SunRPC.PutCard32[h, interfaceSpec.hostHint.net.net];
SunRPC.PutCard32[h, interfaceSpec.hostHint.host.host];
SunRPC.PutCard32[h, interfaceSpec.hostHint.socket.a];
SunRPC.PutCard32[h, interfaceSpec.hostHint.socket.b];
SunRPC.PutCard32[h, interfaceSpec.hostHint.socket.c];
SunRPC.PutCard32[h, interfaceSpec.hostHint.socket.d];
SunRPC.PutCard32[h, interfaceSpec.serviceID];
SunRPC.PutCard32[h, interfaceSpec.interfaceID];
};
};
RegisterCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
rName: ROPE;
type: ROPE;
clonePartyID: CARD32;
interface: ThrushSunRPC.InterfaceName;
properties: SmartsProperties;
nb: ROPE;
credentials: ThrushSunRPC.Credentials;
{
shh ← SunRPC.GetCard32[h];
};
{
rName ← SunRPC.GetRope[h];
};
{
type ← SunRPC.GetRope[h];
};
{
clonePartyID ← SunRPC.GetCard32[h];
};
{
interface.type ← SunRPC.GetRope[h];
interface.instance ← SunRPC.GetRope[h];
interface.version.first ← SunRPC.GetCard32[h];
interface.version.last ← SunRPC.GetCard32[h];
};
{
properties.role ← SunRPC.GetRope[h];
properties.netAddress.net.net ← SunRPC.GetCard32[h];
properties.netAddress.host.host ← SunRPC.GetCard32[h];
properties.netAddress.socket.a ← SunRPC.GetCard32[h];
properties.netAddress.socket.b ← SunRPC.GetCard32[h];
properties.netAddress.socket.c ← SunRPC.GetCard32[h];
properties.netAddress.socket.d ← SunRPC.GetCard32[h];
};
[nb, credentials] ← Register[h, shh, rName, type, clonePartyID, interface, properties];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutCard32[h, credentials.partyID];
SunRPC.PutCard32[h, credentials.smartsID];
SunRPC.PutCard32[h, credentials.convID];
SunRPC.PutCard32[h, ORD[credentials.state]];
SunRPC.PutCard32[h, credentials.stateID];
};
};
DisableCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
smartsID: CARD32;
nb: ROPE;
{
shh ← SunRPC.GetCard32[h];
};
{
smartsID ← SunRPC.GetCard32[h];
};
[nb] ← Disable[h, shh, smartsID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
DescribePartyCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
partyID: CARD32;
nameReq: ROPE;
nb: ROPE;
description: ROPE;
type: ROPE;
partner: CARD32;
visitee: CARD32;
visitors: VisitorList;
{
partyID ← SunRPC.GetCard32[h];
};
{
nameReq ← SunRPC.GetRope[h];
};
[nb, description, type, partner, visitee, visitors] ← DescribeParty[h, partyID, nameReq];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutRope[h, description];
};
{
SunRPC.PutRope[h, type];
};
{
SunRPC.PutCard32[h, partner];
};
{
SunRPC.PutCard32[h, visitee];
};
{
MProc25[h, visitors];
};
};
VisitCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
hostPartyID: CARD32;
guestPartyID: CARD32;
guestPassword: ThrushSunRPC.Password;
nb: ROPE;
{
shh ← SunRPC.GetCard32[h];
};
{
hostPartyID ← SunRPC.GetCard32[h];
};
{
guestPartyID ← SunRPC.GetCard32[h];
};
{
FOR i26: CARDINAL IN [0..2) DO
guestPassword[i26] ← SunRPC.GetCard32[h];
ENDLOOP;
};
[nb] ← Visit[h, shh, hostPartyID, guestPartyID, guestPassword];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
GetNumbersForRNameCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
rName: ROPE;
fullRName: ROPE;
number: ROPE;
homeNumber: ROPE;
{
shh ← SunRPC.GetCard32[h];
};
{
rName ← SunRPC.GetRope[h];
};
[fullRName, number, homeNumber] ← GetNumbersForRName[h, shh, rName];
beginReturn[h];
{
SunRPC.PutRope[h, fullRName];
};
{
SunRPC.PutRope[h, number];
};
{
SunRPC.PutRope[h, homeNumber];
};
};
UnregisterKeyCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
credentials: ThrushSunRPC.Credentials;
key: ThrushSunRPC.Key;
nb: ROPE;
{
shh ← SunRPC.GetCard32[h];
};
{
credentials.partyID ← SunRPC.GetCard32[h];
credentials.smartsID ← SunRPC.GetCard32[h];
credentials.convID ← SunRPC.GetCard32[h];
credentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
credentials.stateID ← SunRPC.GetCard32[h];
};
{
FOR i27: CARDINAL IN [0..2) DO
key[i27] ← SunRPC.GetCard32[h];
ENDLOOP;
};
[nb] ← UnregisterKey[h, shh, credentials, key];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
CheckInCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
credentials: ThrushSunRPC.Credentials;
nb: ROPE;
{
shh ← SunRPC.GetCard32[h];
};
{
credentials.partyID ← SunRPC.GetCard32[h];
credentials.smartsID ← SunRPC.GetCard32[h];
credentials.convID ← SunRPC.GetCard32[h];
credentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
credentials.stateID ← SunRPC.GetCard32[h];
};
[nb] ← CheckIn[h, shh, credentials];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
CreateConversationCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
credentials: ThrushSunRPC.Credentials;
state: ThrushSunRPC.StateInConv;
reason: ROPE;
comment: ROPE;
convAttributes: Entry;
partyAttributes: Entry;
checkConflict: BOOLEAN;
nb: ROPE;
convEvent: ThrushSunRPC.ConvEvent;
{
shhh ← SunRPC.GetCard32[h];
};
{
credentials.partyID ← SunRPC.GetCard32[h];
credentials.smartsID ← SunRPC.GetCard32[h];
credentials.convID ← SunRPC.GetCard32[h];
credentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
credentials.stateID ← SunRPC.GetCard32[h];
};
{
state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
};
{
reason ← SunRPC.GetRope[h];
};
{
comment ← SunRPC.GetRope[h];
};
{
convAttributes ← UProc28[h];
};
{
partyAttributes ← UProc28[h];
};
{
checkConflict ← SunRPCGetBool[h];
};
[nb, convEvent] ← CreateConversation[h, shhh, credentials, state, reason, comment, convAttributes, partyAttributes, checkConflict];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutCard32[h, convEvent.self.partyID];
SunRPC.PutCard32[h, convEvent.self.smartsID];
SunRPC.PutCard32[h, convEvent.self.convID];
SunRPC.PutCard32[h, ORD[convEvent.self.state]];
SunRPC.PutCard32[h, convEvent.self.stateID];
SunRPC.PutCard32[h, convEvent.other.partyID];
SunRPC.PutCard32[h, convEvent.other.smartsID];
SunRPC.PutCard32[h, convEvent.other.convID];
SunRPC.PutCard32[h, ORD[convEvent.other.state]];
SunRPC.PutCard32[h, convEvent.other.stateID];
SunRPC.PutCard32[h, convEvent.time];
SunRPC.PutRope[h, convEvent.reason];
SunRPC.PutRope[h, convEvent.comment];
};
};
UnvisitSelfCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
guestPartyID: CARD32;
nb: ROPE;
{
shh ← SunRPC.GetCard32[h];
};
{
guestPartyID ← SunRPC.GetCard32[h];
};
[nb] ← UnvisitSelf[h, shh, guestPartyID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
GetConversationInfoCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
convID: CARD32;
nb: ROPE;
cInfo: ConversationInfo;
{
shh ← SunRPC.GetCard32[h];
};
{
convID ← SunRPC.GetCard32[h];
};
[nb, cInfo] ← GetConversationInfo[h, shh, convID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutCard32[h, cInfo.convID];
SunRPC.PutCard32[h, cInfo.numParties];
SunRPC.PutCard32[h, cInfo.numActive];
SunRPC.PutCard32[h, cInfo.numIdle];
SunRPC.PutCard32[h, cInfo.originator];
SunRPC.PutCard32[h, cInfo.conferenceHost.net.net];
SunRPC.PutCard32[h, cInfo.conferenceHost.host.host];
SunRPC.PutCard32[h, cInfo.conferenceHost.socket.a];
SunRPC.PutCard32[h, cInfo.conferenceHost.socket.b];
SunRPC.PutCard32[h, cInfo.conferenceHost.socket.c];
SunRPC.PutCard32[h, cInfo.conferenceHost.socket.d];
SunRPC.PutCard32[h, ORD[cInfo.convType]];
SunRPCPutBool[h, cInfo.bilateralConv];
SunRPC.PutCard32[h, cInfo.startTime];
MProc29[h, cInfo.convAttributes];
SunRPC.PutCard32[h, cInfo.moderator];
SunRPC.PutCard32[h, cInfo.commentator];
};
};
GetKeyTableCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
credentials: ThrushSunRPC.Credentials;
nb: ROPE;
keyTable: ThrushSunRPC.KeyTable;
{
shh ← SunRPC.GetCard32[h];
};
{
credentials.partyID ← SunRPC.GetCard32[h];
credentials.smartsID ← SunRPC.GetCard32[h];
credentials.convID ← SunRPC.GetCard32[h];
credentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
credentials.stateID ← SunRPC.GetCard32[h];
};
[nb, keyTable] ← GetKeyTable[h, shh, credentials];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
MProc30[h, keyTable.s];
};
};
GetPartyFromFeepNumCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
partyID: CARD32;
feepNum: ROPE;
nb: ROPE;
newPartyID: CARD32;
{
shh ← SunRPC.GetCard32[h];
};
{
partyID ← SunRPC.GetCard32[h];
};
{
feepNum ← SunRPC.GetRope[h];
};
[nb, newPartyID] ← GetPartyFromFeepNum[h, shh, partyID, feepNum];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutCard32[h, newPartyID];
};
};
ReportActionCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
report: ThrushSunRPC.ActionReport;
reportToAll: BOOLEAN;
selfOnCompletion: BOOLEAN;
nb: ROPE;
numReportsIssued: CARD16;
{
shhh ← SunRPC.GetCard32[h];
};
{
report.self.partyID ← SunRPC.GetCard32[h];
report.self.smartsID ← SunRPC.GetCard32[h];
report.self.convID ← SunRPC.GetCard32[h];
report.self.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
report.self.stateID ← SunRPC.GetCard32[h];
report.other.partyID ← SunRPC.GetCard32[h];
report.other.smartsID ← SunRPC.GetCard32[h];
report.other.convID ← SunRPC.GetCard32[h];
report.other.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
report.other.stateID ← SunRPC.GetCard32[h];
report.requestingParty ← SunRPC.GetCard32[h];
report.actionID ← SunRPC.GetCard32[h];
report.actionClass ← SunRPC.GetRope[h];
report.actionType ← SunRPC.GetRope[h];
report.actionInfo ← SunRPC.GetRope[h];
};
{
reportToAll ← SunRPCGetBool[h];
};
{
selfOnCompletion ← SunRPCGetBool[h];
};
[nb, numReportsIssued] ← ReportAction[h, shhh, report, reportToAll, selfOnCompletion];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutCard32[h, numReportsIssued];
};
};
GetPartyCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
partyID: CARD32;
rName: ROPE;
type: ROPE;
nb: ROPE;
newPartyID: CARD32;
{
shh ← SunRPC.GetCard32[h];
};
{
partyID ← SunRPC.GetCard32[h];
};
{
rName ← SunRPC.GetRope[h];
};
{
type ← SunRPC.GetRope[h];
};
[nb, newPartyID] ← GetParty[h, shh, partyID, rName, type];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutCard32[h, newPartyID];
};
};
GetPartyInfoCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
credentials: ThrushSunRPC.Credentials;
nameReq: ROPE;
allParties: BOOLEAN;
nb: ROPE;
pInfo: PartyInfo;
{
shh ← SunRPC.GetCard32[h];
};
{
credentials.partyID ← SunRPC.GetCard32[h];
credentials.smartsID ← SunRPC.GetCard32[h];
credentials.convID ← SunRPC.GetCard32[h];
credentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
credentials.stateID ← SunRPC.GetCard32[h];
};
{
nameReq ← SunRPC.GetRope[h];
};
{
allParties ← SunRPCGetBool[h];
};
[nb, pInfo] ← GetPartyInfo[h, shh, credentials, nameReq, allParties];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutCard32[h, pInfo.numParties];
SunRPC.PutCard32[h, pInfo.conversationInfo.convID];
SunRPC.PutCard32[h, pInfo.conversationInfo.numParties];
SunRPC.PutCard32[h, pInfo.conversationInfo.numActive];
SunRPC.PutCard32[h, pInfo.conversationInfo.numIdle];
SunRPC.PutCard32[h, pInfo.conversationInfo.originator];
SunRPC.PutCard32[h, pInfo.conversationInfo.conferenceHost.net.net];
SunRPC.PutCard32[h, pInfo.conversationInfo.conferenceHost.host.host];
SunRPC.PutCard32[h, pInfo.conversationInfo.conferenceHost.socket.a];
SunRPC.PutCard32[h, pInfo.conversationInfo.conferenceHost.socket.b];
SunRPC.PutCard32[h, pInfo.conversationInfo.conferenceHost.socket.c];
SunRPC.PutCard32[h, pInfo.conversationInfo.conferenceHost.socket.d];
SunRPC.PutCard32[h, ORD[pInfo.conversationInfo.convType]];
SunRPCPutBool[h, pInfo.conversationInfo.bilateralConv];
SunRPC.PutCard32[h, pInfo.conversationInfo.startTime];
MProc29[h, pInfo.conversationInfo.convAttributes];
SunRPC.PutCard32[h, pInfo.conversationInfo.moderator];
SunRPC.PutCard32[h, pInfo.conversationInfo.commentator];
SunRPC.PutCard32[h, pInfo.ixSelf];
SunRPC.PutCard32[h, pInfo.ixOther];
SunRPC.PutCard32[h, pInfo.ixModerator];
SunRPC.PutCard32[h, pInfo.ixCommentator];
SunRPC.PutCard32[h, pInfo.ixCommSock];
SunRPC.PutCard32[h, pInfo.ixOriginator];
MProc31[h, pInfo.parties];
};
};
AdvanceCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
credentials: ThrushSunRPC.Credentials;
state: ThrushSunRPC.StateInConv;
reportToAll: BOOLEAN;
reason: ROPE;
comment: ROPE;
convAttributes: Entry;
partyAttributes: Entry;
bilateral: BOOLEAN;
checkConflict: BOOLEAN;
nb: ROPE;
convEvent: ThrushSunRPC.ConvEvent;
{
shhh ← SunRPC.GetCard32[h];
};
{
credentials.partyID ← SunRPC.GetCard32[h];
credentials.smartsID ← SunRPC.GetCard32[h];
credentials.convID ← SunRPC.GetCard32[h];
credentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
credentials.stateID ← SunRPC.GetCard32[h];
};
{
state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
};
{
reportToAll ← SunRPCGetBool[h];
};
{
reason ← SunRPC.GetRope[h];
};
{
comment ← SunRPC.GetRope[h];
};
{
convAttributes ← UProc28[h];
};
{
partyAttributes ← UProc28[h];
};
{
bilateral ← SunRPCGetBool[h];
};
{
checkConflict ← SunRPCGetBool[h];
};
[nb, convEvent] ← Advance[h, shhh, credentials, state, reportToAll, reason, comment, convAttributes, partyAttributes, bilateral, checkConflict];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutCard32[h, convEvent.self.partyID];
SunRPC.PutCard32[h, convEvent.self.smartsID];
SunRPC.PutCard32[h, convEvent.self.convID];
SunRPC.PutCard32[h, ORD[convEvent.self.state]];
SunRPC.PutCard32[h, convEvent.self.stateID];
SunRPC.PutCard32[h, convEvent.other.partyID];
SunRPC.PutCard32[h, convEvent.other.smartsID];
SunRPC.PutCard32[h, convEvent.other.convID];
SunRPC.PutCard32[h, ORD[convEvent.other.state]];
SunRPC.PutCard32[h, convEvent.other.stateID];
SunRPC.PutCard32[h, convEvent.time];
SunRPC.PutRope[h, convEvent.reason];
SunRPC.PutRope[h, convEvent.comment];
};
};
AlertCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
credentials: ThrushSunRPC.Credentials;
calledPartyID: CARD32;
comment: ROPE;
convAttributes: Entry;
partyAttributes: Entry;
nb: ROPE;
{
shhh ← SunRPC.GetCard32[h];
};
{
credentials.partyID ← SunRPC.GetCard32[h];
credentials.smartsID ← SunRPC.GetCard32[h];
credentials.convID ← SunRPC.GetCard32[h];
credentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
credentials.stateID ← SunRPC.GetCard32[h];
};
{
calledPartyID ← SunRPC.GetCard32[h];
};
{
comment ← SunRPC.GetRope[h];
};
{
convAttributes ← UProc28[h];
};
{
partyAttributes ← UProc28[h];
};
[nb] ← Alert[h, shhh, credentials, calledPartyID, comment, convAttributes, partyAttributes];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
UnvisitCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
hostPartyID: CARD32;
guestPartyID: CARD32;
guestPassword: ThrushSunRPC.Password;
nb: ROPE;
{
shh ← SunRPC.GetCard32[h];
};
{
hostPartyID ← SunRPC.GetCard32[h];
};
{
guestPartyID ← SunRPC.GetCard32[h];
};
{
FOR i32: CARDINAL IN [0..2) DO
guestPassword[i32] ← SunRPC.GetCard32[h];
ENDLOOP;
};
[nb] ← Unvisit[h, shh, hostPartyID, guestPartyID, guestPassword];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
EnableCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
smartsID: CARD32;
nb: ROPE;
{
shh ← SunRPC.GetCard32[h];
};
{
smartsID ← SunRPC.GetCard32[h];
};
[nb] ← Enable[h, shh, smartsID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
GetCurrentPartyCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
smartsID: CARD32;
nb: ROPE;
partyID: CARD32;
{
shh ← SunRPC.GetCard32[h];
};
{
smartsID ← SunRPC.GetCard32[h];
};
[nb, partyID] ← GetCurrentParty[h, shh, smartsID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutCard32[h, partyID];
};
};
ReleasePartyCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
partyID: CARD32;
targetPartyID: CARD32;
nb: ROPE;
{
shh ← SunRPC.GetCard32[h];
};
{
partyID ← SunRPC.GetCard32[h];
};
{
targetPartyID ← SunRPC.GetCard32[h];
};
[nb] ← ReleaseParty[h, shh, partyID, targetPartyID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
GetPartyFromNumberCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
partyID: CARD32;
phoneNumber: ROPE;
description: ROPE;
nb: ROPE;
newPartyID: CARD32;
{
shh ← SunRPC.GetCard32[h];
};
{
partyID ← SunRPC.GetCard32[h];
};
{
phoneNumber ← SunRPC.GetRope[h];
};
{
description ← SunRPC.GetRope[h];
};
[nb, newPartyID] ← GetPartyFromNumber[h, shh, partyID, phoneNumber, description];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutCard32[h, newPartyID];
};
};
EnumerateNamedConversationsCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
partyID: CARD32;
nb: ROPE;
candidates: CandidateList;
{
shhh ← SunRPC.GetCard32[h];
};
{
partyID ← SunRPC.GetCard32[h];
};
[nb, candidates] ← EnumerateNamedConversations[h, shhh, partyID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
MProc33[h, candidates];
};
};
RegisterConversationCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
credentials: ThrushSunRPC.Credentials;
name: ROPE;
convType: ConvType;
convAttributes: Entry;
accessList: AccessList;
nb: ROPE;
{
shhh ← SunRPC.GetCard32[h];
};
{
credentials.partyID ← SunRPC.GetCard32[h];
credentials.smartsID ← SunRPC.GetCard32[h];
credentials.convID ← SunRPC.GetCard32[h];
credentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
credentials.stateID ← SunRPC.GetCard32[h];
};
{
name ← SunRPC.GetRope[h];
};
{
convType ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
};
{
convAttributes ← UProc28[h];
};
{
accessList ← UProc34[h];
};
[nb] ← RegisterConversation[h, shhh, credentials, name, convType, convAttributes, accessList];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
AddAttributesCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
credentials: ThrushSunRPC.Credentials;
convAttributes: Entry;
partyAttributes: Entry;
nb: ROPE;
{
credentials.partyID ← SunRPC.GetCard32[h];
credentials.smartsID ← SunRPC.GetCard32[h];
credentials.convID ← SunRPC.GetCard32[h];
credentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
credentials.stateID ← SunRPC.GetCard32[h];
};
{
convAttributes ← UProc28[h];
};
{
partyAttributes ← UProc28[h];
};
[nb] ← AddAttributes[h, credentials, convAttributes, partyAttributes];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
RegisterServiceInterfaceCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
credentials: ThrushSunRPC.Credentials;
interfaceSpecPattern: ThrushSunRPC.InterfaceSpec;
nb: ROPE;
interfaceSpec: ThrushSunRPC.InterfaceSpec;
{
shhh ← SunRPC.GetCard32[h];
};
{
credentials.partyID ← SunRPC.GetCard32[h];
credentials.smartsID ← SunRPC.GetCard32[h];
credentials.convID ← SunRPC.GetCard32[h];
credentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
credentials.stateID ← SunRPC.GetCard32[h];
};
{
interfaceSpecPattern.interfaceName.type ← SunRPC.GetRope[h];
interfaceSpecPattern.interfaceName.instance ← SunRPC.GetRope[h];
interfaceSpecPattern.interfaceName.version.first ← SunRPC.GetCard32[h];
interfaceSpecPattern.interfaceName.version.last ← SunRPC.GetCard32[h];
interfaceSpecPattern.hostHint.net.net ← SunRPC.GetCard32[h];
interfaceSpecPattern.hostHint.host.host ← SunRPC.GetCard32[h];
interfaceSpecPattern.hostHint.socket.a ← SunRPC.GetCard32[h];
interfaceSpecPattern.hostHint.socket.b ← SunRPC.GetCard32[h];
interfaceSpecPattern.hostHint.socket.c ← SunRPC.GetCard32[h];
interfaceSpecPattern.hostHint.socket.d ← SunRPC.GetCard32[h];
interfaceSpecPattern.serviceID ← SunRPC.GetCard32[h];
interfaceSpecPattern.interfaceID ← SunRPC.GetCard32[h];
};
[nb, interfaceSpec] ← RegisterServiceInterface[h, shhh, credentials, interfaceSpecPattern];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutRope[h, interfaceSpec.interfaceName.type];
SunRPC.PutRope[h, interfaceSpec.interfaceName.instance];
SunRPC.PutCard32[h, interfaceSpec.interfaceName.version.first];
SunRPC.PutCard32[h, interfaceSpec.interfaceName.version.last];
SunRPC.PutCard32[h, interfaceSpec.hostHint.net.net];
SunRPC.PutCard32[h, interfaceSpec.hostHint.host.host];
SunRPC.PutCard32[h, interfaceSpec.hostHint.socket.a];
SunRPC.PutCard32[h, interfaceSpec.hostHint.socket.b];
SunRPC.PutCard32[h, interfaceSpec.hostHint.socket.c];
SunRPC.PutCard32[h, interfaceSpec.hostHint.socket.d];
SunRPC.PutCard32[h, interfaceSpec.serviceID];
SunRPC.PutCard32[h, interfaceSpec.interfaceID];
};
};
GetConversationFromNameCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
partyID: CARD32;
name: ROPE;
nb: ROPE;
cInfo: ConversationInfo;
{
shhh ← SunRPC.GetCard32[h];
};
{
partyID ← SunRPC.GetCard32[h];
};
{
name ← SunRPC.GetRope[h];
};
[nb, cInfo] ← GetConversationFromName[h, shhh, partyID, name];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutCard32[h, cInfo.convID];
SunRPC.PutCard32[h, cInfo.numParties];
SunRPC.PutCard32[h, cInfo.numActive];
SunRPC.PutCard32[h, cInfo.numIdle];
SunRPC.PutCard32[h, cInfo.originator];
SunRPC.PutCard32[h, cInfo.conferenceHost.net.net];
SunRPC.PutCard32[h, cInfo.conferenceHost.host.host];
SunRPC.PutCard32[h, cInfo.conferenceHost.socket.a];
SunRPC.PutCard32[h, cInfo.conferenceHost.socket.b];
SunRPC.PutCard32[h, cInfo.conferenceHost.socket.c];
SunRPC.PutCard32[h, cInfo.conferenceHost.socket.d];
SunRPC.PutCard32[h, ORD[cInfo.convType]];
SunRPCPutBool[h, cInfo.bilateralConv];
SunRPC.PutCard32[h, cInfo.startTime];
MProc29[h, cInfo.convAttributes];
SunRPC.PutCard32[h, cInfo.moderator];
SunRPC.PutCard32[h, cInfo.commentator];
};
};
RegisterKeyCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
credentials: ThrushSunRPC.Credentials;
key: ThrushSunRPC.Key;
reportNewKeys: BOOLEAN;
nb: ROPE;
keyIndex: CARD16;
{
shh ← SunRPC.GetCard32[h];
};
{
credentials.partyID ← SunRPC.GetCard32[h];
credentials.smartsID ← SunRPC.GetCard32[h];
credentials.convID ← SunRPC.GetCard32[h];
credentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
credentials.stateID ← SunRPC.GetCard32[h];
};
{
FOR i35: CARDINAL IN [0..2) DO
key[i35] ← SunRPC.GetCard32[h];
ENDLOOP;
};
{
reportNewKeys ← SunRPCGetBool[h];
};
[nb, keyIndex] ← RegisterKey[h, shh, credentials, key, reportNewKeys];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutCard32[h, keyIndex];
};
};
DeregisterCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
smartsID: CARD32;
nb: ROPE;
{
shh ← SunRPC.GetCard32[h];
};
{
smartsID ← SunRPC.GetCard32[h];
};
[nb] ← Deregister[h, shh, smartsID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
SunRPCBeginReturnProc: TYPE ~ PROC [h: Handle];
Server: SunRPC.ServerProc ~ {
[h: Handle, c: Conversation, proc: CARD, clientData: REF] RETURNS [doReply: BOOL, replyTimeToLive: CARDINAL]
ENABLE {
ThPartySunRPCServer.Error => { -- (1 )
SunRPC.StartReply[h];
SunRPC.PutRope[h, ec];
SunRPC.PutRope[h, explanation];
GOTO Finished;
};
};
beginReturn: SunRPCBeginReturnProc ~ {
SunRPC.StartReply[h];
SunRPC.PutRope[h, NIL]; -- no error
SunRPC.PutRope[h, NIL]; -- no explanation
No errors in ThParty interface.
};
doReply ← TRUE;
replyTimeToLive ← 2;
SELECT proc FROM
12 => LookupServiceInterfaceCaller[h, beginReturn];
22 => RegisterCaller[h, beginReturn];
26 => DisableCaller[h, beginReturn];
9 => DescribePartyCaller[h, beginReturn];
27 => VisitCaller[h, beginReturn];
21 => GetNumbersForRNameCaller[h, beginReturn];
15 => UnregisterKeyCaller[h, beginReturn];
23 => CheckInCaller[h, beginReturn];
0 => CreateConversationCaller[h, beginReturn];
29 => UnvisitSelfCaller[h, beginReturn];
4 => GetConversationInfoCaller[h, beginReturn];
14 => GetKeyTableCaller[h, beginReturn];
18 => GetPartyFromFeepNumCaller[h, beginReturn];
3 => ReportActionCaller[h, beginReturn];
16 => GetPartyCaller[h, beginReturn];
8 => GetPartyInfoCaller[h, beginReturn];
2 => AdvanceCaller[h, beginReturn];
1 => AlertCaller[h, beginReturn];
28 => UnvisitCaller[h, beginReturn];
25 => EnableCaller[h, beginReturn];
19 => GetCurrentPartyCaller[h, beginReturn];
20 => ReleasePartyCaller[h, beginReturn];
17 => GetPartyFromNumberCaller[h, beginReturn];
7 => EnumerateNamedConversationsCaller[h, beginReturn];
5 => RegisterConversationCaller[h, beginReturn];
10 => AddAttributesCaller[h, beginReturn];
11 => RegisterServiceInterfaceCaller[h, beginReturn];
6 => GetConversationFromNameCaller[h, beginReturn];
13 => RegisterKeyCaller[h, beginReturn];
24 => DeregisterCaller[h, beginReturn];
ENDCASE => ERROR SunRPC.Error[$wrongProc];
EXITS
Finished => { NULL };
};
Unmarshal / Marshal Procs --
SunRPCGetBool: PROC [h: SunRPC.Handle] RETURNS [BOOL] ~ INLINE {
RETURN [SunRPC.GetCard32[h] # 0] };
SunRPCPutBool: PROC [h: SunRPC.Handle, bool: BOOL] ~ INLINE {
SunRPC.PutCard32[h, IF bool THEN 1 ELSE 0] };
MProc25: PROC [h: Handle, val: VisitorList] ~ {
SunRPC.PutCard32[h, val.length];
FOR i36: CARDINAL IN [0..val.length) DO
SunRPC.PutCard32[h, val.body[i36]];
ENDLOOP;
};
MProc30: PROC [h: Handle, val: ThrushSunRPC.Keys] ~ {
SunRPC.PutCard32[h, val.length];
FOR i37: CARDINAL IN [0..val.length) DO
FOR i38: CARDINAL IN [0..2) DO
SunRPC.PutCard32[h, val.body[i37][i38]];
ENDLOOP;
ENDLOOP;
};
UProc28: PROC [h: Handle] RETURNS [res: Entry] ~ {
{
length40: CARDINAL ~ SunRPC.GetCard32[h];
res ← NEW[EntryObject[length40]];
FOR i39: CARDINAL IN [0..length40) DO
res.body[i39].type ← SunRPC.GetRope[h];
res.body[i39].value ← SunRPC.GetRope[h];
ENDLOOP;
};
};
MProc31: PROC [h: Handle, val: PartyList] ~ {
SunRPC.PutCard32[h, val.length];
FOR i41: CARDINAL IN [0..val.length) DO
SunRPC.PutCard32[h, val.body[i41].partyID];
SunRPC.PutRope[h, val.body[i41].name];
SunRPC.PutCard32[h, val.body[i41].intendedPartyID];
SunRPC.PutRope[h, val.body[i41].intendedName];
SunRPC.PutRope[h, val.body[i41].type];
SunRPC.PutCard32[h, ORD[val.body[i41].state]];
SunRPC.PutCard32[h, val.body[i41].numConvs];
SunRPCPutBool[h, val.body[i41].enabled];
SunRPCPutBool[h, val.body[i41].voicePath];
SunRPCPutBool[h, val.body[i41].partyActive];
SunRPCPutBool[h, val.body[i41].partyEngaged];
SunRPC.PutCard32[h, val.body[i41].socket.net.net];
SunRPC.PutCard32[h, val.body[i41].socket.host.host];
SunRPC.PutCard32[h, val.body[i41].socket.socket.a];
SunRPC.PutCard32[h, val.body[i41].socket.socket.b];
SunRPC.PutCard32[h, val.body[i41].socket.socket.c];
SunRPC.PutCard32[h, val.body[i41].socket.socket.d];
MProc29[h, val.body[i41].partyAttributes];
ENDLOOP;
};
UProc34: PROC [h: Handle] RETURNS [res: AccessList] ~ {
{
length43: CARDINAL ~ SunRPC.GetCard32[h];
res ← NEW[AccessListObject[length43]];
FOR i42: CARDINAL IN [0..length43) DO
res.body[i42] ← SunRPC.GetRope[h];
ENDLOOP;
};
};
MProc33: PROC [h: Handle, val: CandidateList] ~ {
SunRPC.PutCard32[h, val.length];
FOR i44: CARDINAL IN [0..val.length) DO
SunRPC.PutCard32[h, val.body[i44].convID];
SunRPC.PutCard32[h, val.body[i44].numParties];
SunRPC.PutCard32[h, val.body[i44].numActive];
SunRPC.PutCard32[h, val.body[i44].numIdle];
SunRPC.PutCard32[h, val.body[i44].originator];
SunRPC.PutCard32[h, val.body[i44].conferenceHost.net.net];
SunRPC.PutCard32[h, val.body[i44].conferenceHost.host.host];
SunRPC.PutCard32[h, val.body[i44].conferenceHost.socket.a];
SunRPC.PutCard32[h, val.body[i44].conferenceHost.socket.b];
SunRPC.PutCard32[h, val.body[i44].conferenceHost.socket.c];
SunRPC.PutCard32[h, val.body[i44].conferenceHost.socket.d];
SunRPC.PutCard32[h, ORD[val.body[i44].convType]];
SunRPCPutBool[h, val.body[i44].bilateralConv];
SunRPC.PutCard32[h, val.body[i44].startTime];
MProc29[h, val.body[i44].convAttributes];
SunRPC.PutCard32[h, val.body[i44].moderator];
SunRPC.PutCard32[h, val.body[i44].commentator];
ENDLOOP;
};
MProc29: PROC [h: Handle, val: Entry] ~ {
SunRPC.PutCard32[h, val.length];
FOR i45: CARDINAL IN [0..val.length) DO
SunRPC.PutRope[h, val.body[i45].type];
SunRPC.PutRope[h, val.body[i45].value];
ENDLOOP;
};
Initialize server
sunPgm: CARD ← 390909; -- decimal program number
sunPgmVersion: CARD ← 1;
theServer: SunRPC.Server;
[] ← SunPMapLocal.UnsetLocal[program~sunPgm, version~sunPgmVersion]; -- in case server already running
theServer ← SunRPC.CreateServer[pgm~sunPgm, serverProc~Server, version~sunPgmVersion];
[] ← SunPMapLocal.SetLocal[program~sunPgm, version~sunPgmVersion, protocol~SunPMap.ipProtocolUDP, port~Basics.Card16FromH[SunRPC.GetServerPort[theServer]]];
}...
Polle Zellweger (PTZ) May 8, 1990 9:09:52 pm PDT
Mistake in original Thrush.cr = hand edits. Key definition: 3 elements to 2.
changes to: UnregisterKeyCaller, RegisterKeyCaller, MProc30
Polle Zellweger (PTZ) May 23, 1990 6:53:02 pm PDT
Change Get/PutCard16 to Get/PutCard32, because the former are not aligned on the wire. Change VAL[CARD32] to VAL[CARDINAL[CARD32]].