DIRECTORY ArpaUDP USING [Address], SunPMap USING [callit, dump, DumpProc, getPort, GetPortProc, MapEntry, null, NullProc, program, programVersion, set, SetProc, unset, UnsetProc], SunPMapClient USING [ProcessResultProc], SunRPC USING [Error, GetCard32, GetRefText, Handle, PutCard32, PutRefText, ReceiveAnotherReply, ReleaseReply, SendCallAndReceiveReply, StartCall], SunRPCAuth USING [Conversation] ; SunPMapClientStub: CEDAR PROGRAM IMPORTS SunRPC EXPORTS SunPMapClient ~ { Address: TYPE ~ ArpaUDP.Address; Handle: TYPE ~ SunRPC.Handle; Conversation: TYPE ~ SunRPCAuth.Conversation; MapEntry: TYPE ~ SunPMap.MapEntry; ProcessResultProc: TYPE ~ SunPMapClient.ProcessResultProc; fastTimeout: CARD _ 500; mediumTimeout: CARD _ 2000; defaultRetries: CARD _ 5; noRetries: CARD _ 0; Null: PUBLIC SunPMap.NullProc -- [h: Handle, c: Conversation] -- ~ { SunRPC.StartCall[h, c, SunPMap.program, SunPMap.programVersion, SunPMap.null]; [] _ SunRPC.SendCallAndReceiveReply[h, fastTimeout, defaultRetries]; SunRPC.ReleaseReply[h]; }; Set: PUBLIC SunPMap.SetProc -- [h: Handle, c: Conversation, program, version, protocol, port: CARD32] RETURNS [success: BOOL] -- ~ { SunRPC.StartCall[h, c, SunPMap.program, SunPMap.programVersion, SunPMap.set]; SunRPC.PutCard32[h, program]; SunRPC.PutCard32[h, version]; SunRPC.PutCard32[h, protocol]; SunRPC.PutCard32[h, port]; [] _ SunRPC.SendCallAndReceiveReply[h, mediumTimeout, defaultRetries]; success _ (SunRPC.GetCard32[h] # 0); SunRPC.ReleaseReply[h]; }; Unset: PUBLIC SunPMap.UnsetProc -- [h: Handle, c: Conversation, program, version: CARD32] RETURNS [success: BOOL] -- ~ { SunRPC.StartCall[h, c, SunPMap.program, SunPMap.programVersion, SunPMap.unset]; SunRPC.PutCard32[h, program]; SunRPC.PutCard32[h, version]; SunRPC.PutCard32[h, 0]; -- dummy1 SunRPC.PutCard32[h, 0]; -- dummy2 [] _ SunRPC.SendCallAndReceiveReply[h, mediumTimeout, defaultRetries]; success _ (SunRPC.GetCard32[h] # 0); SunRPC.ReleaseReply[h]; }; GetPort: PUBLIC SunPMap.GetPortProc -- [h: Handle, c: Conversation, program, version, protocol: CARD32] RETURNS [port: CARD32] -- ~ { SunRPC.StartCall[h, c, SunPMap.program, SunPMap.programVersion, SunPMap.getPort]; SunRPC.PutCard32[h, program]; SunRPC.PutCard32[h, version]; SunRPC.PutCard32[h, protocol]; SunRPC.PutCard32[h, 0]; -- dummy [] _ SunRPC.SendCallAndReceiveReply[h, fastTimeout, defaultRetries]; port _ SunRPC.GetCard32[h]; SunRPC.ReleaseReply[h]; }; Dump: PUBLIC SunPMap.DumpProc -- [h: Handle, c: Conversation, eachMapEntry: PROC[MapEntry]] -- ~ { SunRPC.StartCall[h, c, SunPMap.program, SunPMap.programVersion, SunPMap.dump]; [] _ SunRPC.SendCallAndReceiveReply[h, mediumTimeout, defaultRetries]; DO newEntry: MapEntry; more: CARD; IF (more _ SunRPC.GetCard32[h]) = 0 THEN EXIT; newEntry.program _ SunRPC.GetCard32[h]; newEntry.version _ SunRPC.GetCard32[h]; newEntry.protocol _ SunRPC.GetCard32[h]; newEntry.port _ SunRPC.GetCard32[h]; eachMapEntry[newEntry]; ENDLOOP; SunRPC.ReleaseReply[h]; }; Callit: PUBLIC PROC [ h: Handle, c: Conversation, program, version, proc: CARD32, args: REF TEXT, timeout: CARD32] RETURNS [port: CARD32, result: REF TEXT] ~ { SunRPC.StartCall[h, c, SunPMap.program, SunPMap.programVersion, SunPMap.callit]; SunRPC.PutCard32[h, program]; SunRPC.PutCard32[h, version]; SunRPC.PutCard32[h, proc]; SunRPC.PutRefText[h, args]; [] _ SunRPC.SendCallAndReceiveReply[h, timeout, noRetries]; port _ SunRPC.GetCard32[h]; result _ SunRPC.GetRefText[h]; SunRPC.ReleaseReply[h]; }; CallWithMultipleReplies: PUBLIC PROC [ h: Handle, c: Conversation, program, version, proc: CARD32, args: REF TEXT, processResult: ProcessResultProc, timeout: CARD32] ~ { ENABLE SunRPC.Error => { SELECT code FROM $timeout => CONTINUE; ENDCASE => REJECT; }; address: Address; SunRPC.StartCall[h, c, SunPMap.program, SunPMap.programVersion, SunPMap.callit]; SunRPC.PutCard32[h, program]; SunRPC.PutCard32[h, version]; SunRPC.PutCard32[h, proc]; SunRPC.PutRefText[h, args]; [remoteAddress~address] _ SunRPC.SendCallAndReceiveReply[h, timeout, defaultRetries]; DO port: CARD32; result: REF TEXT; port _ SunRPC.GetCard32[h]; result _ SunRPC.GetRefText[h]; SunRPC.ReleaseReply[h]; IF processResult[address, port, result].quit THEN EXIT; [remoteAddress~address] _ SunRPC.ReceiveAnotherReply[h, timeout]; ENDLOOP; }; }... dSunPMapClientStub.mesa Demers, September 13, 1987 12:41:53 pm PDT Types Parameters Procedures Κ ˜code™K™*K˜—šΟk ˜ Kšœœ ˜Kšœœƒ˜Kšœœ˜(Kšœœ†˜’Kšœ œ˜K˜K˜—šΟnœœ˜ Kšœ˜Kšœ˜K˜head™Kšœ œ˜ K˜Kšœœ˜Kšœœ˜-K˜Kšœ œ˜"Kšœœ#˜:—™ Kšœ œ˜Kšœœ˜Kšœœ˜Kšœ œ˜—™ šžœœΟc"œ˜DKšœN˜NKšœD˜DK˜K˜K˜—šžœœŸdœ˜„KšœM˜MKšœ˜Kšœ˜Kšœ˜Kšœ˜KšœF˜FKšœ$˜$K˜K˜K˜—šžœœŸTœ˜xKšœO˜OKšœ˜Kšœ˜KšœŸ ˜!KšœŸ ˜!KšœF˜FKšœ$˜$K˜K˜K˜—šžœœŸ]œ˜…KšœQ˜QKšœ˜Kšœ˜Kšœ˜KšœŸ˜ KšœD˜DKšœ˜K˜K˜K˜—šžœœŸ@œ˜bKšœN˜NKšœF˜Fš˜K˜Kšœœ˜ Kšœ"œœ˜.Kšœ'˜'Kšœ'˜'Kšœ(˜(Kšœ$˜$Kšœ˜Kšœ˜—K˜K˜K˜—šžœœœ7œœœ œ˜rKšœœ œœ˜(K˜KšœP˜PKšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ;˜;Kšœ˜Kšœ˜K˜K˜K˜—šžœœœ7œœœ-œ˜₯K˜šœ˜šœ˜Kšœ œ˜Kšœœ˜—K˜—K˜K˜KšœP˜PKšœ˜Kšœ˜Kšœ˜Kšœ˜KšœU˜Uš˜Kšœœ˜ Kšœœœ˜Jšœ˜Kšœ˜K˜Kšœ+œœ˜7KšœA˜AKšœ˜—K˜K˜——K˜—J˜J˜—…—Ζ3