"Fossies" - the Fresh Open Source Software Archive

Member "c-ares-1.17.2/src/lib/ares_nameser.h" (8 Aug 2021, 13391 Bytes) of package /linux/misc/dns/c-ares-1.17.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ares_nameser.h" see the Fossies "Dox" file reference documentation.

    1 
    2 #ifndef ARES_NAMESER_H
    3 #define ARES_NAMESER_H
    4 
    5 #ifdef HAVE_ARPA_NAMESER_H
    6 #  include <arpa/nameser.h>
    7 #endif
    8 #ifdef HAVE_ARPA_NAMESER_COMPAT_H
    9 #  include <arpa/nameser_compat.h>
   10 #endif
   11 
   12 /* ============================================================================
   13  * arpa/nameser.h may or may not provide ALL of the below defines, so check
   14  * each one individually and set if not
   15  * ============================================================================
   16  */
   17 
   18 #ifndef NS_PACKETSZ
   19 #  define NS_PACKETSZ     512   /* maximum packet size */
   20 #endif
   21 
   22 #ifndef NS_MAXDNAME
   23 #  define NS_MAXDNAME     256   /* maximum domain name */
   24 #endif
   25 
   26 #ifndef NS_MAXCDNAME
   27 #  define NS_MAXCDNAME    255   /* maximum compressed domain name */
   28 #endif
   29 
   30 #ifndef NS_MAXLABEL
   31 #  define NS_MAXLABEL     63
   32 #endif
   33 
   34 #ifndef NS_HFIXEDSZ
   35 #  define NS_HFIXEDSZ     12    /* #/bytes of fixed data in header */
   36 #endif
   37 
   38 #ifndef NS_QFIXEDSZ
   39 #  define NS_QFIXEDSZ     4     /* #/bytes of fixed data in query */
   40 #endif
   41 
   42 #ifndef NS_RRFIXEDSZ
   43 #  define NS_RRFIXEDSZ    10    /* #/bytes of fixed data in r record */
   44 #endif
   45 
   46 #ifndef NS_INT16SZ
   47 #  define NS_INT16SZ      2
   48 #endif
   49 
   50 #ifndef NS_INADDRSZ
   51 #  define NS_INADDRSZ     4
   52 #endif
   53 
   54 #ifndef NS_IN6ADDRSZ
   55 #  define NS_IN6ADDRSZ    16
   56 #endif
   57 
   58 #ifndef NS_CMPRSFLGS
   59 #  define NS_CMPRSFLGS    0xc0  /* Flag bits indicating name compression. */
   60 #endif
   61 
   62 #ifndef NS_DEFAULTPORT
   63 #  define NS_DEFAULTPORT  53    /* For both TCP and UDP. */
   64 #endif
   65 
   66 /* ============================================================================
   67  * arpa/nameser.h should provide these enumerations always, so if not found,
   68  * provide them
   69  * ============================================================================
   70  */
   71 #ifndef HAVE_ARPA_NAMESER_H
   72 
   73 typedef enum __ns_class {
   74     ns_c_invalid = 0,       /* Cookie. */
   75     ns_c_in = 1,            /* Internet. */
   76     ns_c_2 = 2,             /* unallocated/unsupported. */
   77     ns_c_chaos = 3,         /* MIT Chaos-net. */
   78     ns_c_hs = 4,            /* MIT Hesiod. */
   79     /* Query class values which do not appear in resource records */
   80     ns_c_none = 254,        /* for prereq. sections in update requests */
   81     ns_c_any = 255,         /* Wildcard match. */
   82     ns_c_max = 65536
   83 } ns_class;
   84 
   85 typedef enum __ns_type {
   86     ns_t_invalid = 0,       /* Cookie. */
   87     ns_t_a = 1,             /* Host address. */
   88     ns_t_ns = 2,            /* Authoritative server. */
   89     ns_t_md = 3,            /* Mail destination. */
   90     ns_t_mf = 4,            /* Mail forwarder. */
   91     ns_t_cname = 5,         /* Canonical name. */
   92     ns_t_soa = 6,           /* Start of authority zone. */
   93     ns_t_mb = 7,            /* Mailbox domain name. */
   94     ns_t_mg = 8,            /* Mail group member. */
   95     ns_t_mr = 9,            /* Mail rename name. */
   96     ns_t_null = 10,         /* Null resource record. */
   97     ns_t_wks = 11,          /* Well known service. */
   98     ns_t_ptr = 12,          /* Domain name pointer. */
   99     ns_t_hinfo = 13,        /* Host information. */
  100     ns_t_minfo = 14,        /* Mailbox information. */
  101     ns_t_mx = 15,           /* Mail routing information. */
  102     ns_t_txt = 16,          /* Text strings. */
  103     ns_t_rp = 17,           /* Responsible person. */
  104     ns_t_afsdb = 18,        /* AFS cell database. */
  105     ns_t_x25 = 19,          /* X_25 calling address. */
  106     ns_t_isdn = 20,         /* ISDN calling address. */
  107     ns_t_rt = 21,           /* Router. */
  108     ns_t_nsap = 22,         /* NSAP address. */
  109     ns_t_nsap_ptr = 23,     /* Reverse NSAP lookup (deprecated). */
  110     ns_t_sig = 24,          /* Security signature. */
  111     ns_t_key = 25,          /* Security key. */
  112     ns_t_px = 26,           /* X.400 mail mapping. */
  113     ns_t_gpos = 27,         /* Geographical position (withdrawn). */
  114     ns_t_aaaa = 28,         /* Ip6 Address. */
  115     ns_t_loc = 29,          /* Location Information. */
  116     ns_t_nxt = 30,          /* Next domain (security). */
  117     ns_t_eid = 31,          /* Endpoint identifier. */
  118     ns_t_nimloc = 32,       /* Nimrod Locator. */
  119     ns_t_srv = 33,          /* Server Selection. */
  120     ns_t_atma = 34,         /* ATM Address */
  121     ns_t_naptr = 35,        /* Naming Authority PoinTeR */
  122     ns_t_kx = 36,           /* Key Exchange */
  123     ns_t_cert = 37,         /* Certification record */
  124     ns_t_a6 = 38,           /* IPv6 address (deprecates AAAA) */
  125     ns_t_dname = 39,        /* Non-terminal DNAME (for IPv6) */
  126     ns_t_sink = 40,         /* Kitchen sink (experimentatl) */
  127     ns_t_opt = 41,          /* EDNS0 option (meta-RR) */
  128     ns_t_apl = 42,          /* Address prefix list (RFC3123) */
  129     ns_t_ds = 43,           /* Delegation Signer (RFC4034) */
  130     ns_t_sshfp = 44,        /* SSH Key Fingerprint (RFC4255) */
  131     ns_t_rrsig = 46,        /* Resource Record Signature (RFC4034) */
  132     ns_t_nsec = 47,         /* Next Secure (RFC4034) */
  133     ns_t_dnskey = 48,       /* DNS Public Key (RFC4034) */
  134     ns_t_tkey = 249,        /* Transaction key */
  135     ns_t_tsig = 250,        /* Transaction signature. */
  136     ns_t_ixfr = 251,        /* Incremental zone transfer. */
  137     ns_t_axfr = 252,        /* Transfer zone of authority. */
  138     ns_t_mailb = 253,       /* Transfer mailbox records. */
  139     ns_t_maila = 254,       /* Transfer mail agent records. */
  140     ns_t_any = 255,         /* Wildcard match. */
  141     ns_t_zxfr = 256,        /* BIND-specific, nonstandard. */
  142     ns_t_caa = 257,         /* Certification Authority Authorization. */
  143     ns_t_max = 65536
  144 } ns_type;
  145 
  146 typedef enum __ns_opcode {
  147     ns_o_query = 0,         /* Standard query. */
  148     ns_o_iquery = 1,        /* Inverse query (deprecated/unsupported). */
  149     ns_o_status = 2,        /* Name server status query (unsupported). */
  150                                 /* Opcode 3 is undefined/reserved. */
  151     ns_o_notify = 4,        /* Zone change notification. */
  152     ns_o_update = 5,        /* Zone update message. */
  153     ns_o_max = 6
  154 } ns_opcode;
  155 
  156 typedef enum __ns_rcode {
  157     ns_r_noerror = 0,       /* No error occurred. */
  158     ns_r_formerr = 1,       /* Format error. */
  159     ns_r_servfail = 2,      /* Server failure. */
  160     ns_r_nxdomain = 3,      /* Name error. */
  161     ns_r_notimpl = 4,       /* Unimplemented. */
  162     ns_r_refused = 5,       /* Operation refused. */
  163     /* these are for BIND_UPDATE */
  164     ns_r_yxdomain = 6,      /* Name exists */
  165     ns_r_yxrrset = 7,       /* RRset exists */
  166     ns_r_nxrrset = 8,       /* RRset does not exist */
  167     ns_r_notauth = 9,       /* Not authoritative for zone */
  168     ns_r_notzone = 10,      /* Zone of record different from zone section */
  169     ns_r_max = 11,
  170     /* The following are TSIG extended errors */
  171     ns_r_badsig = 16,
  172     ns_r_badkey = 17,
  173     ns_r_badtime = 18
  174 } ns_rcode;
  175 
  176 #endif /* HAVE_ARPA_NAMESER_H */
  177 
  178 
  179 /* ============================================================================
  180  * arpa/nameser_compat.h typically sets these.  However on some systems
  181  * arpa/nameser.h does, but may not set all of them.  Lets conditionally
  182  * define each
  183  * ============================================================================
  184  */
  185 
  186 #ifndef PACKETSZ
  187 #  define PACKETSZ         NS_PACKETSZ
  188 #endif
  189 
  190 #ifndef MAXDNAME
  191 #  define MAXDNAME         NS_MAXDNAME
  192 #endif
  193 
  194 #ifndef MAXCDNAME
  195 #  define MAXCDNAME        NS_MAXCDNAME
  196 #endif
  197 
  198 #ifndef MAXLABEL
  199 #  define MAXLABEL         NS_MAXLABEL
  200 #endif
  201 
  202 #ifndef HFIXEDSZ
  203 #  define HFIXEDSZ         NS_HFIXEDSZ
  204 #endif
  205 
  206 #ifndef QFIXEDSZ
  207 #  define QFIXEDSZ         NS_QFIXEDSZ
  208 #endif
  209 
  210 #ifndef RRFIXEDSZ
  211 #  define RRFIXEDSZ        NS_RRFIXEDSZ
  212 #endif
  213 
  214 #ifndef INDIR_MASK
  215 #  define INDIR_MASK       NS_CMPRSFLGS
  216 #endif
  217 
  218 #ifndef NAMESERVER_PORT
  219 #  define NAMESERVER_PORT  NS_DEFAULTPORT
  220 #endif
  221 
  222 
  223 /* opcodes */
  224 #ifndef O_QUERY
  225 #  define O_QUERY 0  /* ns_o_query */
  226 #endif
  227 #ifndef O_IQUERY
  228 #  define O_IQUERY 1 /* ns_o_iquery */
  229 #endif
  230 #ifndef O_STATUS
  231 #  define O_STATUS 2 /* ns_o_status */
  232 #endif
  233 #ifndef O_NOTIFY
  234 #  define O_NOTIFY 4 /* ns_o_notify */
  235 #endif
  236 #ifndef O_UPDATE
  237 #  define O_UPDATE 5 /* ns_o_update */
  238 #endif
  239 
  240 
  241 /* response codes */
  242 #ifndef SERVFAIL
  243 #  define SERVFAIL        ns_r_servfail
  244 #endif
  245 #ifndef NOTIMP
  246 #  define NOTIMP          ns_r_notimpl
  247 #endif
  248 #ifndef REFUSED
  249 #  define REFUSED         ns_r_refused
  250 #endif
  251 #if defined(_WIN32) && !defined(HAVE_ARPA_NAMESER_COMPAT_H) && defined(NOERROR)
  252 #  undef NOERROR /* it seems this is already defined in winerror.h */
  253 #endif
  254 #ifndef NOERROR
  255 #  define NOERROR         ns_r_noerror
  256 #endif
  257 #ifndef FORMERR
  258 #  define FORMERR         ns_r_formerr
  259 #endif
  260 #ifndef NXDOMAIN
  261 #  define NXDOMAIN        ns_r_nxdomain
  262 #endif
  263 /* Non-standard response codes, use numeric values */
  264 #ifndef YXDOMAIN
  265 #  define YXDOMAIN        6 /* ns_r_yxdomain */
  266 #endif
  267 #ifndef YXRRSET
  268 #  define YXRRSET         7 /* ns_r_yxrrset */
  269 #endif
  270 #ifndef NXRRSET
  271 #  define NXRRSET         8 /* ns_r_nxrrset */
  272 #endif
  273 #ifndef NOTAUTH
  274 #  define NOTAUTH         9 /* ns_r_notauth */
  275 #endif
  276 #ifndef NOTZONE
  277 #  define NOTZONE         10 /* ns_r_notzone */
  278 #endif
  279 #ifndef TSIG_BADSIG
  280 #  define TSIG_BADSIG     16 /* ns_r_badsig */
  281 #endif
  282 #ifndef TSIG_BADKEY
  283 #  define TSIG_BADKEY     17 /* ns_r_badkey */
  284 #endif
  285 #ifndef TSIG_BADTIME
  286 #  define TSIG_BADTIME    18 /* ns_r_badtime */
  287 #endif
  288 
  289 
  290 /* classes */
  291 #ifndef C_IN
  292 #  define C_IN            1 /* ns_c_in */
  293 #endif
  294 #ifndef C_CHAOS
  295 #  define C_CHAOS         3 /* ns_c_chaos */
  296 #endif
  297 #ifndef C_HS
  298 #  define C_HS            4 /* ns_c_hs */
  299 #endif
  300 #ifndef C_NONE
  301 #  define C_NONE          254 /* ns_c_none */
  302 #endif
  303 #ifndef C_ANY
  304 #  define C_ANY           255 /*  ns_c_any */
  305 #endif
  306 
  307 
  308 /* types */
  309 #ifndef T_A
  310 #  define T_A             1   /* ns_t_a */
  311 #endif
  312 #ifndef T_NS
  313 #  define T_NS            2   /* ns_t_ns */
  314 #endif
  315 #ifndef T_MD
  316 #  define T_MD            3   /* ns_t_md */
  317 #endif
  318 #ifndef T_MF
  319 #  define T_MF            4   /* ns_t_mf */
  320 #endif
  321 #ifndef T_CNAME
  322 #  define T_CNAME         5   /* ns_t_cname */
  323 #endif
  324 #ifndef T_SOA
  325 #  define T_SOA           6   /* ns_t_soa */
  326 #endif
  327 #ifndef T_MB
  328 #  define T_MB            7   /* ns_t_mb */
  329 #endif
  330 #ifndef T_MG
  331 #  define T_MG            8   /* ns_t_mg */
  332 #endif
  333 #ifndef T_MR
  334 #  define T_MR            9   /* ns_t_mr */
  335 #endif
  336 #ifndef T_NULL
  337 #  define T_NULL          10  /* ns_t_null */
  338 #endif
  339 #ifndef T_WKS
  340 #  define T_WKS           11  /* ns_t_wks */
  341 #endif
  342 #ifndef T_PTR
  343 #  define T_PTR           12  /* ns_t_ptr */
  344 #endif
  345 #ifndef T_HINFO
  346 #  define T_HINFO         13  /* ns_t_hinfo */
  347 #endif
  348 #ifndef T_MINFO
  349 #  define T_MINFO         14  /* ns_t_minfo */
  350 #endif
  351 #ifndef T_MX
  352 #  define T_MX            15  /* ns_t_mx */
  353 #endif
  354 #ifndef T_TXT
  355 #  define T_TXT           16  /* ns_t_txt */
  356 #endif
  357 #ifndef T_RP
  358 #  define T_RP            17  /* ns_t_rp */
  359 #endif
  360 #ifndef T_AFSDB
  361 #  define T_AFSDB         18  /* ns_t_afsdb */
  362 #endif
  363 #ifndef T_X25
  364 #  define T_X25           19  /* ns_t_x25 */
  365 #endif
  366 #ifndef T_ISDN
  367 #  define T_ISDN          20  /* ns_t_isdn */
  368 #endif
  369 #ifndef T_RT
  370 #  define T_RT            21  /* ns_t_rt */
  371 #endif
  372 #ifndef T_NSAP
  373 #  define T_NSAP          22  /* ns_t_nsap */
  374 #endif
  375 #ifndef T_NSAP_PTR
  376 #  define T_NSAP_PTR      23  /* ns_t_nsap_ptr */
  377 #endif
  378 #ifndef T_SIG
  379 #  define T_SIG           24  /* ns_t_sig */
  380 #endif
  381 #ifndef T_KEY
  382 #  define T_KEY           25  /* ns_t_key */
  383 #endif
  384 #ifndef T_PX
  385 #  define T_PX            26  /* ns_t_px */
  386 #endif
  387 #ifndef T_GPOS
  388 #  define T_GPOS          27  /* ns_t_gpos */
  389 #endif
  390 #ifndef T_AAAA
  391 #  define T_AAAA          28  /* ns_t_aaaa */
  392 #endif
  393 #ifndef T_LOC
  394 #  define T_LOC           29  /* ns_t_loc */
  395 #endif
  396 #ifndef T_NXT
  397 #  define T_NXT           30  /* ns_t_nxt */
  398 #endif
  399 #ifndef T_EID
  400 #  define T_EID           31  /* ns_t_eid */
  401 #endif
  402 #ifndef T_NIMLOC
  403 #  define T_NIMLOC        32  /* ns_t_nimloc */
  404 #endif
  405 #ifndef T_SRV
  406 #  define T_SRV           33  /* ns_t_srv */
  407 #endif
  408 #ifndef T_ATMA
  409 #  define T_ATMA          34  /* ns_t_atma */
  410 #endif
  411 #ifndef T_NAPTR
  412 #  define T_NAPTR         35  /* ns_t_naptr */
  413 #endif
  414 #ifndef T_KX
  415 #  define T_KX            36  /* ns_t_kx */
  416 #endif
  417 #ifndef T_CERT
  418 #  define T_CERT          37  /* ns_t_cert */
  419 #endif
  420 #ifndef T_A6
  421 #  define T_A6            38  /* ns_t_a6 */
  422 #endif
  423 #ifndef T_DNAME
  424 #  define T_DNAME         39  /* ns_t_dname */
  425 #endif
  426 #ifndef T_SINK
  427 #  define T_SINK          40  /* ns_t_sink */
  428 #endif
  429 #ifndef T_OPT
  430 #  define T_OPT           41  /* ns_t_opt */
  431 #endif
  432 #ifndef T_APL
  433 #  define T_APL           42  /* ns_t_apl */
  434 #endif
  435 #ifndef T_DS
  436 #  define T_DS            43  /* ns_t_ds */
  437 #endif
  438 #ifndef T_SSHFP
  439 #  define T_SSHFP         44  /* ns_t_sshfp */
  440 #endif
  441 #ifndef T_RRSIG
  442 #  define T_RRSIG         46  /* ns_t_rrsig */
  443 #endif
  444 #ifndef T_NSEC
  445 #  define T_NSEC          47  /* ns_t_nsec */
  446 #endif
  447 #ifndef T_DNSKEY
  448 #  define T_DNSKEY        48  /* ns_t_dnskey */
  449 #endif
  450 #ifndef T_TKEY
  451 #  define T_TKEY          249 /* ns_t_tkey */
  452 #endif
  453 #ifndef T_TSIG
  454 #  define T_TSIG          250 /* ns_t_tsig */
  455 #endif
  456 #ifndef T_IXFR
  457 #  define T_IXFR          251 /* ns_t_ixfr */
  458 #endif
  459 #ifndef T_AXFR
  460 #  define T_AXFR          252 /* ns_t_axfr */
  461 #endif
  462 #ifndef T_MAILB
  463 #  define T_MAILB         253 /* ns_t_mailb */
  464 #endif
  465 #ifndef T_MAILA
  466 #  define T_MAILA         254 /* ns_t_maila */
  467 #endif
  468 #ifndef T_ANY
  469 #  define T_ANY           255 /* ns_t_any */
  470 #endif
  471 #ifndef T_ZXFR
  472 #  define T_ZXFR          256 /* ns_t_zxfr */
  473 #endif
  474 #ifndef T_CAA
  475 #  define T_CAA           257 /* ns_t_caa */
  476 #endif
  477 #ifndef T_MAX
  478 #  define T_MAX         65536 /* ns_t_max */
  479 #endif
  480 
  481 
  482 #endif /* ARES_NAMESER_H */