NameService.mesa
Copyright Ó 1992 by Xerox Corporation. All rights reserved.
Theimer, March 10, 1993 2:50 pm PST
Interface to the NMS name service facilities.
DIRECTORY
List,
Rope,
SunRPC,
SunRPCBinding;
NameService: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
RegistrationRecord:
TYPE =
RECORD [
name: ROPE,
instance: ROPE,
host: ROPE,
sbh: ROPE,
appl: List.LORA
];
Registration: TYPE = REF RegistrationRecord;
ExportRPCSun:
PROC [name:
ROPE, sp: SunRPC.Server, prog, vers:
INT, proto: SunRPCBinding.Transport ¬ $TCP, instance:
ROPE ←
NIL, appl: List.
LORA ←
NIL]
RETURNS [sbh:
ROPE, uid:
ROPE];
Export to the NMS name service a registration consisting of attribute/values for Type, Host, Name, Instance and SBH. The string binding handle (SBH) is based on "prog" and "vers", and "proto". Additional attribute/values (placed in the "Appl" attribute) are specified in the association list "appl". appl must have the form:
(ROPE)
That is, appl is either a list containing a single ROPE or a list of DotCons pairs.
ReexportRPCSun:
PROC [uid:
ROPE, name:
ROPE, sp: SunRPC.Server, prog, vers:
INT, proto: SunRPCBinding.Transport ¬ $TCP, instance:
ROPE ←
NIL, appl: List.
LORA ←
NIL]
RETURNS [sbh:
ROPE];
Replace the previous NMS registration indicated by uid with a new one.
ImportRPCSun:
PROC [name:
ROPE ←
NIL, instance:
ROPE ←
NIL, host:
ROPE ←
NIL, appl: List.
LORA ←
NIL]
RETURNS [h: SunRPC.Handle, r: Registration];
Import from the NMS name service a SunRPC.Handle for the SunRPC interface that matches the specified attribute values in the local name service domain. "r" returns the description of the returned registration.
ImportRegistrations:
PROC [name:
ROPE ←
NIL, instance:
ROPE ←
NIL, host:
ROPE ←
NIL, appl: List.
LORA]
RETURNS [regList:
LIST OF Registration];
Return the set of registrations in the NMS name service matching the specified attribute values. The result consists of a list of registration records.
SBHToRope:
PROC [prog, vers:
INT, proto: SunRPCBinding.Transport, hostAddr:
ROPE, port:
CARD]
RETURNS [sbh:
ROPE];
Returns a string binding handle that represents the RPC interface denoted by {prog, vers, proto, hostAddr, port}.
SBHFromRope:
PROC [sbh:
ROPE]
RETURNS [prog, vers:
INT, proto: SunRPCBinding.Transport, hostAddr:
ROPE, port:
CARD];
Returns the prog, vers, proto, hostAddr, and port that are specified in the string binding handle sbh.
END.