<> <> DIRECTORY Arpa USING [Address], SunRPC USING [Error, GetCard32, GetF, PutCard32, PutF, PutRope, ReleaseReply, SendCallAndReceiveReply, StartCall], SunYPBind USING [domain, DomainProc, ErrorCode, null, NullProc, program, programVersion, ResponseCode, setdom, SetdomProc], SunYPBindClient USING [] ; SunYPBindClientStub: CEDAR PROGRAM IMPORTS SunRPC EXPORTS SunYPBindClient ~ { <> fastTimeout: CARD _ 200; mediumTimeout: CARD _ 1000; slowTimeout: CARD _ 5000; defaultRetries: CARD _ 5; noRetries: CARD _ 0; <> Null: PUBLIC SunYPBind.NullProc -- [h: Handle, c: Conversation] -- ~ { SunRPC.StartCall[h, c, SunYPBind.program, SunYPBind.programVersion, SunYPBind.null]; [] _ SunRPC.SendCallAndReceiveReply[h, fastTimeout, defaultRetries]; SunRPC.ReleaseReply[h]; }; Domain: PUBLIC SunYPBind.DomainProc -- [h: Handle, c: Conversation, domainName: DomainName] RETURNS [resp: ResponseBinding] -- ~ { SunRPC.StartCall[h, c, SunYPBind.program, SunYPBind.programVersion, SunYPBind.domain]; SunRPC.PutRope[h, domainName]; [] _ SunRPC.SendCallAndReceiveReply[h, slowTimeout, defaultRetries]; SELECT SunRPC.GetCard32[h] FROM SunYPBind.ResponseCode.success.ORD => { address: Arpa.Address _ LOOPHOLE[SunRPC.GetF[h]]; port: CARD32 _ SunRPC.GetCard32[h]; SunRPC.ReleaseReply[h]; RETURN [[success[binding~[address, port]]]]; }; SunYPBind.ResponseCode.failure.ORD => { errorCode: SunYPBind.ErrorCode _ VAL[CARDINAL[SunRPC.GetCard32[h]]]; SunRPC.ReleaseReply[h]; RETURN [[failure[errorCode]]]; }; ENDCASE => ERROR SunRPC.Error[$protocolError]; }; Setdom: PUBLIC SunYPBind.SetdomProc -- [h: Handle, c: Conversation, req: RequestDomainBinding] -- ~ { SunRPC.StartCall[h, c, SunYPBind.program, SunYPBind.programVersion, SunYPBind.setdom]; SunRPC.PutRope[h, req.domainName]; SunRPC.PutF[h, LOOPHOLE[req.binding.address]]; SunRPC.PutCard32[h, req.binding.port]; SunRPC.PutCard32[h, req.version]; [] _ SunRPC.SendCallAndReceiveReply[h, mediumTimeout, defaultRetries]; SunRPC.ReleaseReply[h]; }; }...