<> <> <> 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; <> <> <<>> 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 }; <> <<>> 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]; <> <<>> Error: ERROR [code: ATOM]; <> <<$badRemoteAddress : attempt to set remote address of handle to broadcast.>> <<$destUnreachable : raised by Put or Send. >> <> <<$netUnreachable>> <<$hostUnreachable>> <<$portUnreachable>> <<$mustFragment>> <<$sourceRouteFailure>> <<$timeoutTimeToLive>> <<$timeoutReassembly>> <<$parameterProblem>> <<$sourceQuench>> END.