ArpaName.mesa
Copyright © 1987 by Xerox Corporation. All rights reserved.
John Larson, October 31, 1987 4:01:49 pm PST
DIRECTORY
Arpa USING [Address],
Rope USING [ROPE];
ArpaName: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
Arpanet Domain Name/Address Resolver
Configuration operations
GetLocalRootServers: PROC RETURNS[addrs: LIST OF Arpa.Address];
Show local root server address list. These are used for proxy recursive name resolution. They should have UDP level Arpanet access and proxy recursive Arpanet name query capability.
SetLocalRootServers: PROC[addrs: LIST OF Arpa.Address];
Set local root server address list.
GetArpanetRootServers: PROC RETURNS[addrs: LIST OF Arpa.Address];
Show Arpanet root server address list. These are used for full recursive name resolution.
SetArpanetRootServers: PROC[addrs: LIST OF Arpa.Address];
Set Arpanet root server address list.
GetDefaultDomain: PROC RETURNS[domain: ROPE];
Show default domain (eg. PARC.Xerox.COM)
This is used on name lookups when no domain specified.
SetDefaultDomain: PROC[domain: ROPE];
Set default domain
Arpanet name/address resolution operations
Case is ignored in all lookup operations, but is preserved in returned value. All operations will cause cache load if item is not already there. Arpanet name resolution behaviour is controlled by the resolv boolean.
If resolv is TRUE, full recursive Arpanet name resolution will be performed locally (useful for external SMTP mail). The workstation running this code must then have Arpanet access in order to query various Arpanet name servers directly.
If resolv is FALSE, queries will be performed via the local root name servers and the workstation running this code requires no direct Arpanet access (no external SMTP access is needed).
Most operations return reply status information as well as the address of the server which provided the authorititive reply.
ReplyStatus: TYPE = {
ok, -- Query successful. Authoritative answer returned.
bogus, -- Invalid name/address. Should not retry.
other, -- Entry is of other type. Try a different type of query.
down -- Servers for address are not responding properly. Try again later.
};
Lookup operations
MyName: PROC RETURNS[name: ROPE];
Get Arpa name for this workstation. Returns Rope of form "[a.b.c.d]" if unregistered, or servers not responding.
NameToAddress: PROC[name: ROPE, resolv: BOOLFALSE]
RETURNS[addr: Arpa.Address, status: ReplyStatus, source: Arpa.Address];
Performs name query if not in cache. Returns best address for the name if found, or Arpa.nullAddress otherwise. name can be an IP address constant of the form "[a.b.c.d] or "a.b.c.d".
NameToAddressList: PROC[name: ROPE, resolv: BOOLFALSE]
RETURNS[addrs: LIST OF Arpa.Address, status: ReplyStatus, source: Arpa.Address];
Returns a sorted list of addresses for the name or NIL if the name is not found. name is allowed to be an Internet address constant of the form "[a.b.c.d]" or "a.b.c.d".
NameToMailHostList: PROC [name: ROPE, resolv: BOOLFALSE]
RETURNS [hosts: LIST OF ROPE, status: ReplyStatus, source: Arpa.Address];
Returns sorted list of mail forwarding hosts.
AddressToName: PROC [addr: Arpa.Address, resolv: BOOLFALSE]
RETURNS [name: ROPE, status: ReplyStatus, source: Arpa.Address];
Performs address query if not in cache. Returns rope "[a.b.c.d]" if name can't be looked up
and NIL if bad address
AddressRopeToName: PROC [addr: ROPE, resolv: BOOLFALSE]
RETURNS [name: ROPE, status: ReplyStatus, source: Arpa.Address];
addr should be an IP address rope of the form "[a.b.c.d] or "a.b.c.d". Performs address query if not in cache. Returns addr if name can't be looked up, and NIL if bad address
AliasToName: PROC [alias: ROPE, resolv: BOOLFALSE]
RETURNS [name: ROPE, status: ReplyStatus, source: Arpa.Address];
Converts alias to canonical name. Appends default domain if alias contains no "."
No change if already canonical name or servers are down. Returns NIL if bogus.
DomainServers: PROC [name: ROPE, resolv: BOOLFALSE]
RETURNS [servers: LIST OF ROPE, status: ReplyStatus, source: Arpa.Address];
Returns list of domain name servers if zone of authority exists for this domain name. NIL otherwise.
DomainInfo: PROC [name: ROPE, resolv: BOOLFALSE]
RETURNS [domainContact: ROPE, primaryServer: ROPE, status: ReplyStatus, source: Arpa.Address];
Returns contact mail address and primary server for domain if zone of authority exists for this domain name. NIL otherwise.
END.