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: ROPE ← NIL,
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: ROPE ← NIL,
type: RRType ← a,
class: RRClass ← in,
ttl: INT ← 0,
dataLength: CARDINAL ← 0,
v:
SELECT rrt: RRType
FROM
a => [address: Arpa.Address],
ns => [serverRope: ROPE ← NIL],
cName => [cNameRope: ROPE ← NIL],
ptr => [ptrRope: ROPE ← NIL],
mb => [mbRope: ROPE ← NIL],
mg => [mgRope: ROPE ← NIL],
mr => [mrRope: ROPE ← NIL],
md => [mdRope: ROPE ← NIL],
mf => [mfRope: ROPE ← NIL],
null => [nullRope: ROPE ← NIL],
soa => [soaRec: SourceOfAuthRecord],
wks => [wksRec: WellKnownServiceRecord],
hinfo => [hinfoRec: HostInfoRecord],
minfo => [minfoRec: MailListRecord],
mx => [mxRec: MailForwardRecord],
ENDCASE
SourceOfAuthRecord:
TYPE =
RECORD[
primaryServer: ROPE ← NIL,
domainContact: ROPE ← NIL,
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: ROPE ← NIL, -- responsible mail box (list owner)
emailbx: ROPE ← NIL -- mail box for list errors (Errors-To: )
];
HostInfoRecord:
TYPE =
RECORD[
cpu: ROPE ← NIL, -- hardware
os: ROPE ← NIL -- operating system
];
MailForwardRecord:
TYPE =
RECORD[
preference: CARDINAL ← 0, -- preference of this forwarding host
host: ROPE ← NIL -- forwarding host
];
domainPort: ArpaUDPBuf.Port = [0, 53];
Query:
PROC [
server: Arpa.Address ← Arpa.nullAddress,
query: Rope.ROPE ← NIL,
type: QType ← a,
class: QClass ← in,
recurDesired: BOOL ← FALSE,
port: ArpaUDPBuf.Port ← domainPort,
timeout: ArpaUDP.Milliseconds ← 20000,
retry: CARDINAL ← 0,
acceptErrors: BOOL ← FALSE
]
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.