ArpaNameUDP.mesa
Copyright © 1987 by Xerox Corporation. All rights reserved.
John Larson, October 22, 1987 3:50:22 pm PDT
DIRECTORY
Arpa USING [Address, nullAddress],
ArpaUDP USING [Milliseconds],
ArpaUDPBuf USING [Port],
ArpaNameUDPBuf USING [Hdr],
Rope USING [ROPE];
ArpaNameUDP: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
See RFC2001 and RFC2002 for details about the Arpanet name protocol
Query types
QType: TYPE = MACHINE DEPENDENT {
a(1), -- address
ns(2), -- authoritative name servers
md(3), -- obsolete
mf(4), -- obsolete
cName(5), -- canonical name of alias
soa(6), -- start of zone of authority
mb(7), -- mailbox name
mg(8), -- mail group member
mr(9), -- mail rename
null(10), -- null resource record
wks(11), -- well known service description
ptr(12), -- domain name pointer
hinfo(13), -- host info
minfo(14), -- mailbox or list info
mx(15), -- mail forwarder (replaced md and mf)
axfr(252), -- request transfer of entire zone (secondary server operation)
mailb(253), -- mailbox related records
maila(254), -- mail agent records
star(255) -- all records
};
QClass: TYPE = MACHINE DEPENDENT {
in(1), -- DARPA Internet
cs(2), -- obsolete
ch(3), -- Chaos
star(255) -- any class
};
Resource Record types
RRType: TYPE = MACHINE DEPENDENT {
a(1), -- address
ns(2), -- authoritative name servers
md(3), -- obsolete
mf(4), -- obsolete
cName(5), -- canonical name of alias
soa(6), -- start of zone of authority
mb(7), -- mailbox name
mg(8), -- mail group member
mr(9), -- mail rename
null(10), -- null resource record
wks(11), -- well known service description
ptr(12), -- domain name pointer
hinfo(13), -- host info
minfo(14), -- mailbox or list info
mx(15) -- mail forwarder (replaced md and mf)
};
RRClass: TYPE = MACHINE DEPENDENT {
in(1), -- DARPA Internet type
cs(2), -- obsolete
ch(3) -- Chaos type
};
Reply: TYPE = REF ReplyRecord ← NIL;
ReplyRecord: TYPE = RECORD[
nRetries: CARDINAL ← 0,
responseTime: ArpaUDP.Milliseconds,
source: Arpa.Address ← Arpa.nullAddress, -- should be same as request address !
udpLength: CARDINAL ← 0,
hdr: ArpaNameUDPBuf.Hdr,
qdCount: CARDINAL ← 0, -- actual # of question records (hdr counts may be incorrect !)
anCount: CARDINAL ← 0, -- actual # of answer RRs
nsCount: CARDINAL ← 0, -- actual # of authority RRs
arCount: CARDINAL ← 0, -- actual # of additional RRs
questions: QSequence ← NIL,
answers: RRSequence ← NIL,
authority: RRSequence ← NIL,
additional: RRSequence ← NIL
];
RRSequence: TYPE = REF RRSequenceBody ← NIL;
RRSequenceBody: TYPE = RECORD[SEQUENCE n: INTEGER OF ResourceRecord];
QSequence: TYPE = REF QSequenceBody ← NIL;
QSequenceBody: TYPE = RECORD[SEQUENCE n: INTEGER OF QuestionRecord];
QuestionRecord: TYPE = REF QBody ← NIL;
QBody: TYPE = RECORD[
name: ROPENIL,
type: QType ← a,
class: QClass ← in
];
ResourceRecord: TYPE = REF RRBody ← NIL;
ARR: TYPE = REF a RRBody;
NsRR: TYPE = REF ns RRBody;
CNameRR: TYPE = REF cName RRBody;
PtrRR: TYPE = REF ptr RRBody;
MbRR: TYPE = REF mb RRBody;
MgRR: TYPE = REF mg RRBody;
MrRR: TYPE = REF mr RRBody;
MdRR: TYPE = REF md RRBody;
MfRR: TYPE = REF mf RRBody;
NullRR: TYPE = REF null RRBody;
SoaRR: TYPE = REF soa RRBody;
WksRR: TYPE = REF wks RRBody;
HinfoRR: TYPE = REF hinfo RRBody;
MinfoRR: TYPE = REF minfo RRBody;
MxRR: TYPE = REF mx RRBody;
RRBody: TYPE = RECORD[
name: ROPENIL,
type: RRType ← a,
class: RRClass ← in,
ttl: INT ← 0,
dataLength: CARDINAL ← 0,
v: SELECT rrt: RRType FROM
a => [address: Arpa.Address],
ns => [serverRope: ROPENIL],
cName => [cNameRope: ROPENIL],
ptr => [ptrRope: ROPENIL],
mb => [mbRope: ROPENIL],
mg => [mgRope: ROPENIL],
mr => [mrRope: ROPENIL],
md => [mdRope: ROPENIL],
mf => [mfRope: ROPENIL],
null => [nullRope: ROPENIL],
soa => [soaRec: SourceOfAuthRecord],
wks => [wksRec: WellKnownServiceRecord],
hinfo => [hinfoRec: HostInfoRecord],
minfo => [minfoRec: MailListRecord],
mx => [mxRec: MailForwardRecord],
ENDCASE
];
SourceOfAuthRecord: TYPE = RECORD[
primaryServer: ROPENIL,
domainContact: ROPENIL,
serial: CARD ← 0,
refresh: CARD ← 0,
retry: CARD ← 0,
expire: CARD ← 0,
minTtl: CARD ← 0
];
WellKnownServiceRecord: TYPE = RECORD[
address: Arpa.Address ← Arpa.nullAddress,
protocol: CARDINAL ← 0,
nPorts: CARDINAL ← 0,
ports: PortSequence ← NIL
];
PortSequence: TYPE = REF PortSequenceBody ← NIL;
PortSequenceBody: TYPE = RECORD[SEQUENCE n: INTEGER OF CARDINAL];
MailListRecord: TYPE = RECORD[
rmailbx: ROPENIL, -- responsible mail box (list owner)
emailbx: ROPENIL -- mail box for list errors (Errors-To: )
];
HostInfoRecord: TYPE = RECORD[
cpu: ROPENIL, -- hardware
os: ROPENIL -- operating system
];
MailForwardRecord: TYPE = RECORD[
preference: CARDINAL ← 0, -- preference of this forwarding host
host: ROPENIL -- forwarding host
];
domainPort: ArpaUDPBuf.Port = [0, 53];
Query: PROC [
server: Arpa.Address ← Arpa.nullAddress,
query: Rope.ROPENIL,
type: QType ← a,
class: QClass ← in,
recurDesired: BOOLFALSE,
port: ArpaUDPBuf.Port ← domainPort,
timeout: ArpaUDP.Milliseconds ← 20000,
retry: CARDINAL ← 0,
acceptErrors: BOOLFALSE
]
RETURNS [reply: Reply];
reply = NIL means no response. IF acceptErrors is TRUE ArpaUDP errors will be passed on through rather than dropped on the floor.
Error: ERROR [code: ATOM];
Codes raised by ArpaUDP.Error
$badRemoteAddress : attempt to set remote address of handle to broadcast.
$destUnreachable : raised by Put or Send.
Codes raised by ArpaUDP.ReceivedError
$netUnreachable
$hostUnreachable
$portUnreachable
$mustFragment
$sourceRouteFailure
$timeoutTimeToLive
$timeoutReassembly
$parameterProblem
$sourceQuench
END.