1968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 2968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#ifndef ARES_NAMESER_H 3968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define ARES_NAMESER_H 4968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 5968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold/* header file provided by liren@vivisimo.com */ 6968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 7968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#ifndef HAVE_ARPA_NAMESER_H 8968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 9968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NS_PACKETSZ 512 /* maximum packet size */ 10968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NS_MAXDNAME 256 /* maximum domain name */ 11968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NS_MAXCDNAME 255 /* maximum compressed domain name */ 12968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NS_MAXLABEL 63 13968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */ 14968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */ 15968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */ 16968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NS_INT16SZ 2 17968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NS_INADDRSZ 4 18968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NS_IN6ADDRSZ 16 19968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */ 20968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */ 21968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 22968bf19396ad404e89420f5d67900fce13f4186cGilad Arnoldtypedef enum __ns_class { 23968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_c_invalid = 0, /* Cookie. */ 24968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_c_in = 1, /* Internet. */ 25968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_c_2 = 2, /* unallocated/unsupported. */ 26968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_c_chaos = 3, /* MIT Chaos-net. */ 27968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_c_hs = 4, /* MIT Hesiod. */ 28968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold /* Query class values which do not appear in resource records */ 29968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_c_none = 254, /* for prereq. sections in update requests */ 30968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_c_any = 255, /* Wildcard match. */ 31968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_c_max = 65536 32968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold} ns_class; 33968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 34968bf19396ad404e89420f5d67900fce13f4186cGilad Arnoldtypedef enum __ns_type { 35968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_invalid = 0, /* Cookie. */ 36968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_a = 1, /* Host address. */ 37968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_ns = 2, /* Authoritative server. */ 38968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_md = 3, /* Mail destination. */ 39968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_mf = 4, /* Mail forwarder. */ 40968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_cname = 5, /* Canonical name. */ 41968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_soa = 6, /* Start of authority zone. */ 42968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_mb = 7, /* Mailbox domain name. */ 43968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_mg = 8, /* Mail group member. */ 44968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_mr = 9, /* Mail rename name. */ 45968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_null = 10, /* Null resource record. */ 46968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_wks = 11, /* Well known service. */ 47968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_ptr = 12, /* Domain name pointer. */ 48968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_hinfo = 13, /* Host information. */ 49968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_minfo = 14, /* Mailbox information. */ 50968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_mx = 15, /* Mail routing information. */ 51968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_txt = 16, /* Text strings. */ 52968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_rp = 17, /* Responsible person. */ 53968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_afsdb = 18, /* AFS cell database. */ 54968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_x25 = 19, /* X_25 calling address. */ 55968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_isdn = 20, /* ISDN calling address. */ 56968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_rt = 21, /* Router. */ 57968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_nsap = 22, /* NSAP address. */ 58968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */ 59968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_sig = 24, /* Security signature. */ 60968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_key = 25, /* Security key. */ 61968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_px = 26, /* X.400 mail mapping. */ 62968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_gpos = 27, /* Geographical position (withdrawn). */ 63968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_aaaa = 28, /* Ip6 Address. */ 64968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_loc = 29, /* Location Information. */ 65968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_nxt = 30, /* Next domain (security). */ 66968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_eid = 31, /* Endpoint identifier. */ 67968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_nimloc = 32, /* Nimrod Locator. */ 68968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_srv = 33, /* Server Selection. */ 69968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_atma = 34, /* ATM Address */ 70968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_naptr = 35, /* Naming Authority PoinTeR */ 71968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_kx = 36, /* Key Exchange */ 72968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_cert = 37, /* Certification record */ 73968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */ 74968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */ 75968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_sink = 40, /* Kitchen sink (experimentatl) */ 76968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_opt = 41, /* EDNS0 option (meta-RR) */ 77968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_apl = 42, /* Address prefix list (RFC3123) */ 78968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_ds = 43, /* Delegation Signer (RFC4034) */ 79968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_sshfp = 44, /* SSH Key Fingerprint (RFC4255) */ 80968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_rrsig = 46, /* Resource Record Signature (RFC4034) */ 81968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_nsec = 47, /* Next Secure (RFC4034) */ 82968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_dnskey = 48, /* DNS Public Key (RFC4034) */ 83968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_tkey = 249, /* Transaction key */ 84968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_tsig = 250, /* Transaction signature. */ 85968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_ixfr = 251, /* Incremental zone transfer. */ 86968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_axfr = 252, /* Transfer zone of authority. */ 87968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_mailb = 253, /* Transfer mailbox records. */ 88968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_maila = 254, /* Transfer mail agent records. */ 89968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_any = 255, /* Wildcard match. */ 90968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_zxfr = 256, /* BIND-specific, nonstandard. */ 91968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_t_max = 65536 92968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold} ns_type; 93968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 94968bf19396ad404e89420f5d67900fce13f4186cGilad Arnoldtypedef enum __ns_opcode { 95968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_o_query = 0, /* Standard query. */ 96968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */ 97968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_o_status = 2, /* Name server status query (unsupported). */ 98968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold /* Opcode 3 is undefined/reserved. */ 99968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_o_notify = 4, /* Zone change notification. */ 100968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_o_update = 5, /* Zone update message. */ 101968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_o_max = 6 102968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold} ns_opcode; 103968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 104968bf19396ad404e89420f5d67900fce13f4186cGilad Arnoldtypedef enum __ns_rcode { 105968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_noerror = 0, /* No error occurred. */ 106968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_formerr = 1, /* Format error. */ 107968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_servfail = 2, /* Server failure. */ 108968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_nxdomain = 3, /* Name error. */ 109968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_notimpl = 4, /* Unimplemented. */ 110968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_refused = 5, /* Operation refused. */ 111968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold /* these are for BIND_UPDATE */ 112968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_yxdomain = 6, /* Name exists */ 113968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_yxrrset = 7, /* RRset exists */ 114968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_nxrrset = 8, /* RRset does not exist */ 115968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_notauth = 9, /* Not authoritative for zone */ 116968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_notzone = 10, /* Zone of record different from zone section */ 117968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_max = 11, 118968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold /* The following are TSIG extended errors */ 119968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_badsig = 16, 120968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_badkey = 17, 121968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold ns_r_badtime = 18 122968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold} ns_rcode; 123968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 124968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#endif /* HAVE_ARPA_NAMESER_H */ 125968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 126968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#ifndef HAVE_ARPA_NAMESER_COMPAT_H 127968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 128968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define PACKETSZ NS_PACKETSZ 129968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define MAXDNAME NS_MAXDNAME 130968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define MAXCDNAME NS_MAXCDNAME 131968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define MAXLABEL NS_MAXLABEL 132968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define HFIXEDSZ NS_HFIXEDSZ 133968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define QFIXEDSZ NS_QFIXEDSZ 134968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define RRFIXEDSZ NS_RRFIXEDSZ 135968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define INDIR_MASK NS_CMPRSFLGS 136968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NAMESERVER_PORT NS_DEFAULTPORT 137968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 138968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define QUERY ns_o_query 139968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 140968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define SERVFAIL ns_r_servfail 141968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NOTIMP ns_r_notimpl 142968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define REFUSED ns_r_refused 143968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#undef NOERROR /* it seems this is already defined in winerror.h */ 144968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NOERROR ns_r_noerror 145968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define FORMERR ns_r_formerr 146968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define NXDOMAIN ns_r_nxdomain 147968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 148968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define C_IN ns_c_in 149968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define C_CHAOS ns_c_chaos 150968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define C_HS ns_c_hs 151968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define C_NONE ns_c_none 152968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define C_ANY ns_c_any 153968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 154968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_A ns_t_a 155968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_NS ns_t_ns 156968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_MD ns_t_md 157968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_MF ns_t_mf 158968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_CNAME ns_t_cname 159968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_SOA ns_t_soa 160968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_MB ns_t_mb 161968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_MG ns_t_mg 162968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_MR ns_t_mr 163968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_NULL ns_t_null 164968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_WKS ns_t_wks 165968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_PTR ns_t_ptr 166968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_HINFO ns_t_hinfo 167968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_MINFO ns_t_minfo 168968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_MX ns_t_mx 169968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_TXT ns_t_txt 170968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_RP ns_t_rp 171968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_AFSDB ns_t_afsdb 172968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_X25 ns_t_x25 173968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_ISDN ns_t_isdn 174968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_RT ns_t_rt 175968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_NSAP ns_t_nsap 176968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_NSAP_PTR ns_t_nsap_ptr 177968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_SIG ns_t_sig 178968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_KEY ns_t_key 179968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_PX ns_t_px 180968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_GPOS ns_t_gpos 181968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_AAAA ns_t_aaaa 182968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_LOC ns_t_loc 183968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_NXT ns_t_nxt 184968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_EID ns_t_eid 185968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_NIMLOC ns_t_nimloc 186968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_SRV ns_t_srv 187968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_ATMA ns_t_atma 188968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_NAPTR ns_t_naptr 189968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_DS ns_t_ds 190968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_SSHFP ns_t_sshfp 191968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_RRSIG ns_t_rrsig 192968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_NSEC ns_t_nsec 193968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_DNSKEY ns_t_dnskey 194968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_TSIG ns_t_tsig 195968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_IXFR ns_t_ixfr 196968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_AXFR ns_t_axfr 197968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_MAILB ns_t_mailb 198968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_MAILA ns_t_maila 199968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#define T_ANY ns_t_any 200968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 201968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#endif /* HAVE_ARPA_NAMESER_COMPAT_H */ 202968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold 203968bf19396ad404e89420f5d67900fce13f4186cGilad Arnold#endif /* ARES_NAMESER_H */ 204