DIRECTORY ArpaUDP USING [Address], Basics USING [HFromCard16], SunPMap USING [callit, dump, getPort, ipProtocolUDP, MapEntry, null, program, programVersion, set, udpPort, unset], SunPMapServer USING [Callit, Dump, GetPort, Null, Set, Unset], SunRPC USING [Error, GetCard32, GetRefText, Handle, PutCard32, PutRefText, StartReply], SunRPCOnUDP USING [CreateServer, Server, ServerProc], SunRPCAuth USING [Conversation] ; SunPMapServerStub: CEDAR PROGRAM IMPORTS Basics, SunRPC, SunRPCOnUDP, SunPMapServer ~ { Address: TYPE ~ ArpaUDP.Address; Handle: TYPE ~ SunRPC.Handle; Conversation: TYPE ~ SunRPCAuth.Conversation; MapEntry: TYPE ~ SunPMap.MapEntry; defaultReplyTTL: CARDINAL ¬ 2; Serve: SunRPCOnUDP.ServerProc -- [h: Handle, c: Conversation, proc: CARD, clientData: REF] RETURNS [doReply: BOOL, replyTimeToLive: CARDINAL] -- ~ { doReply ¬ TRUE; replyTimeToLive ¬ defaultReplyTTL; SELECT proc FROM SunPMap.null => ServeNull[h, c]; SunPMap.set => ServeSet[h, c]; SunPMap.unset => ServeUnset[h, c]; SunPMap.getPort => ServeGetPort[h, c]; SunPMap.dump => ServeDump[h, c]; SunPMap.callit => ServeCallit[h, c]; ENDCASE => ERROR SunRPC.Error[$wrongProc]; }; ServeNull: PROC [h: Handle, c: Conversation] ~ { SunRPC.StartReply[h]; SunPMapServer.Null[h, c]; }; ServeSet: PROC [h: Handle, c: Conversation] ~ { program, version, protocol, port: CARD32; success: BOOL; program ¬ SunRPC.GetCard32[h]; version ¬ SunRPC.GetCard32[h]; protocol ¬ SunRPC.GetCard32[h]; port ¬ SunRPC.GetCard32[h]; SunRPC.StartReply[h]; success ¬ SunPMapServer.Set[h, c, program, version, protocol, port]; SunRPC.PutCard32[h, IF success THEN 1 ELSE 0]; }; ServeUnset: PROC [h: Handle, c: Conversation] ~ { program, version: CARD32; success: BOOL; program ¬ SunRPC.GetCard32[h]; version ¬ SunRPC.GetCard32[h]; SunRPC.StartReply[h]; success ¬ SunPMapServer.Unset[h, c, program, version]; SunRPC.PutCard32[h, IF success THEN 1 ELSE 0]; }; ServeGetPort: PROC [h: Handle, c: Conversation] ~ { program, version, protocol: CARD32; port: CARD32; program ¬ SunRPC.GetCard32[h]; version ¬ SunRPC.GetCard32[h]; protocol ¬ SunRPC.GetCard32[h]; SunRPC.StartReply[h]; port ¬ SunPMapServer.GetPort[h, c, program, version, protocol]; SunRPC.PutCard32[h, port]; }; ServeDump: PROC [h: Handle, c: Conversation] ~ { EachMapEntry: PROC [mapEntry: MapEntry] ~ { SunRPC.PutCard32[h, 1]; SunRPC.PutCard32[h, mapEntry.program]; SunRPC.PutCard32[h, mapEntry.version]; SunRPC.PutCard32[h, mapEntry.protocol]; SunRPC.PutCard32[h, mapEntry.port]; }; SunRPC.StartReply[h]; SunPMapServer.Dump[h, c, EachMapEntry]; SunRPC.PutCard32[h, 0]; }; ServeCallit: PUBLIC PROC [h: Handle, c: Conversation] ~ { program, version, proc: CARD32; args: REF TEXT; port: CARD32; result: REF TEXT; program ¬ SunRPC.GetCard32[h]; version ¬ SunRPC.GetCard32[h]; proc¬ SunRPC.GetCard32[h]; args ¬ SunRPC.GetRefText[h]; SunRPC.StartReply[h]; [port, result] ¬ SunPMapServer.Callit[h, c, program, version, proc, args]; SunRPC.PutCard32[h, port]; SunRPC.PutRefText[h, result]; }; theServer: SunRPCOnUDP.Server; Init: PROC ~ { theServer ¬ SunRPCOnUDP.CreateServer[SunPMap.program, SunPMap.programVersion, Serve, Basics.HFromCard16[SunPMap.udpPort], 3, NIL]; [] ¬ SunPMapServer.Set[NIL, NIL, SunPMap.program, SunPMap.programVersion, SunPMap.ipProtocolUDP, SunPMap.udpPort]; }; Init[]; }... ϊ SunPMapServerStub.mesa Copyright Σ 1989, 1991, 1992 by Xerox Corporation. All rights reserved. Demers, January 5, 1988 5:44:51 pm PST Willie-Sue, March 16, 1989 6:56:33 pm PST Chauser, January 3, 1992 10:54 am PST Types Parameters Procedures ΚΝ•NewlineDelimiter –(cedarcode) style™code™Kšœ Οeœ=™HK™&K™)K™%K˜—šΟk ˜ Kšœžœ ˜Kšœžœ˜Kšœžœf˜sKšœžœ+˜>KšœžœK˜WKšœ5˜5Kšœ žœ˜K˜K˜—šΟnœžœž˜ Kšžœ+˜2K˜head™Kšœ žœ˜ K˜Kšœžœ˜Kšœžœ˜-K˜Kšœ žœ˜"—™ Kšœžœ˜—™ šŸœΟcrœ˜”Kšœ žœ˜Kšœ"˜"šžœž˜Kšœ ˜ K˜Kšœ"˜"Kšœ&˜&Kšœ ˜ Kšœ$˜$Kšžœžœ˜*—K˜K˜—šŸ œžœ!˜0K˜K˜K˜K˜—šŸœžœ!˜/Kšœ"žœ˜)Kšœ žœ˜K˜Kšœ˜Kšœ˜Kšœ˜K˜KšœD˜DKšœžœ žœžœ˜.K˜K˜—šŸ œžœ˜-Kšœ˜Kšœžœ˜Kšœ žœ˜K˜Kšœ˜K˜Kšœ6˜6Kšœžœ žœžœ˜.K˜K˜—šŸ œžœ!˜3Kšœžœ˜#Kšœžœ˜ K˜Kšœ˜Kšœ˜K˜Kšœ?˜?Kšœ˜K˜K˜—šŸ œžœ!˜0šŸ œžœ˜+Kšœ˜Kšœ&˜&Kšœ&˜&Kšœ'˜'Kšœ#˜#K˜—K˜Kšœ'˜'Kšœ˜K˜K˜—šŸ œžœžœ!˜9Kšœžœ˜Kšœžœžœ˜Kšœžœ˜ Kšœžœžœ˜K˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜K˜KšœJ˜JKšœ˜Kšœ˜K˜K˜—Kšœ˜K˜šŸœžœ˜Kšœ}žœ˜‚KšœžœžœS˜rK˜K˜—K˜—K˜—K˜K˜K˜—…— ςΉ