Branch: Tag:

2002-12-23

2002-12-23 18:59:54 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Grouped the T_* and C_* constants into the enums ResourceClass and EntryType.

Rev: lib/modules/Protocols.pmod/DNS.pmod:1.70

1: - // $Id: DNS.pmod,v 1.69 2002/12/01 22:54:25 nilsson Exp $ + // $Id: DNS.pmod,v 1.70 2002/12/23 18:59:54 grubba Exp $   // Not yet finished -- Fredrik Hubinette      //! Domain Name System
15:      constant QUERY=0;    + //! Resource classes + enum ResourceClass + {    //! Class Internet - constant C_IN=1; +  C_IN=1,    -  +  //! Class CSNET (Obsolete) +  C_CS=2, +     //! Class CHAOS - constant C_CH=3; +  C_CH=3,       //! Class Hesiod - constant C_HS=4; +  C_HS=4,       //! Class ANY - constant C_ANY=255; +  C_ANY=255, + };    -  + //! Entry types + enum EntryType + {    //! Type - host address - constant T_A=1; +  T_A=1,       //! Type - authoritative name server - constant T_NS=2; +  T_NS=2,       //! Type - mail destination (Obsolete - use MX) - constant T_MD=3; +  T_MD=3,       //! Type - mail forwarder (Obsolete - use MX) - constant T_MF=4; +  T_MF=4,       //! Type - canonical name for an alias - constant T_CNAME=5; +  T_CNAME=5,       //! Type - start of a zone of authority - constant T_SOA=6; +  T_SOA=6,       //! Type - mailbox domain name (EXPERIMENTAL) - constant T_MB=7; +  T_MB=7,       //! Type - mail group member (EXPERIMENTAL) - constant T_MG=8; +  T_MG=8,       //! Type - mail rename domain name (EXPERIMENTAL) - constant T_MR=9; +  T_MR=9,       //! Type - null RR (EXPERIMENTAL) - constant T_NULL=10; +  T_NULL=10,       //! Type - well known service description - constant T_WKS=11; +  T_WKS=11,       //! Type - domain name pointer - constant T_PTR=12; +  T_PTR=12,       //! Type - host information - constant T_HINFO=13; +  T_HINFO=13,       //! Type - mailbox or mail list information - constant T_MINFO=14; +  T_MINFO=14,       //! Type - mail exchange - constant T_MX=15; +  T_MX=15,       //! Type - text strings - constant T_TXT=16; +  T_TXT=16,       //! Type - IPv6 address record (RFC 1886, deprecated) - constant T_AAAA=28; +  T_AAAA=28,       //! Type - Service location record (RFC 2782) - constant T_SRV=33; +  T_SRV=33,       //! Type - IPv6 address record (RFC 2874, incomplete support) - constant T_A6=38; +  T_A6=38, + };      //! Low level DNS protocol   class protocol
410:    }   };    + //! Implements a Domain Name Service (DNS) server.   class server   {    inherit protocol;
429:    udp::send(m->ip, m->port, s);    }    -  static mapping reply_query(mapping q, mapping m) +  //! Reply to a query (stub). +  //! +  //! @param query +  //! Parsed query. +  //! +  //! @param udp_data +  //! Raw UDP data. +  //! +  //! Overload this function to implement the proper lookup. +  //! +  //! @returns +  //! Returns @tt{0@} (zero) on failure, or a result mapping on success: +  //! @mapping +  //! @member int "rcode" +  //! @member array(mapping(string:string|int))|void "qd" +  //! @array +  //! @elem mapping(string:string|int) entry +  //! @mapping +  //! @member string|array(string) "name" +  //! @member int "type" +  //! @member int "cl" +  //! @endmapping +  //! @endarray +  //! @member array|void "an" +  //! @member array|void "ns" +  //! @member array|void "ar" +  //! @endmapping +  static mapping reply_query(mapping query, mapping udp_data)    {    // Override this function.    //