Parameters
fastTimeout: CARD ← 200;
mediumTimeout: CARD ← 1000;
slowTimeout: CARD ← 5000;
defaultRetries: CARD ← 5;
noRetries: CARD ← 0;
Procedures
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];
};
}...