6 /* Windows-only header file provided by liren@vivisimo.com to make his Windows
10 #include <process.h> /* for the _getpid() proto */
12 #include <sys/types.h>
16 /* Structure for scatter/gather I/O. */
19 void *iov_base; /* Pointer to data. */
20 size_t iov_len; /* Length of data. */
24 #define getpid() _getpid()
27 int ares_writev (SOCKET s, const struct iovec *vector, size_t count);
28 #define writev(s,vect,count) ares_writev(s,vect,count)
32 #define NS_CMPRSFLGS 0xc0
33 #define NS_IN6ADDRSZ 16
37 /* Flag bits indicating name compression. */
38 #define INDIR_MASK NS_CMPRSFLGS
40 typedef enum __ns_class {
41 ns_c_invalid = 0, /* Cookie. */
42 ns_c_in = 1, /* Internet. */
43 ns_c_2 = 2, /* unallocated/unsupported. */
44 ns_c_chaos = 3, /* MIT Chaos-net. */
45 ns_c_hs = 4, /* MIT Hesiod. */
46 /* Query class values which do not appear in resource records */
47 ns_c_none = 254, /* for prereq. sections in update requests */
48 ns_c_any = 255, /* Wildcard match. */
54 typedef enum __ns_type {
55 ns_t_invalid = 0, /* Cookie. */
56 ns_t_a = 1, /* Host address. */
57 ns_t_ns = 2, /* Authoritative server. */
58 ns_t_md = 3, /* Mail destination. */
59 ns_t_mf = 4, /* Mail forwarder. */
60 ns_t_cname = 5, /* Canonical name. */
61 ns_t_soa = 6, /* Start of authority zone. */
62 ns_t_mb = 7, /* Mailbox domain name. */
63 ns_t_mg = 8, /* Mail group member. */
64 ns_t_mr = 9, /* Mail rename name. */
65 ns_t_null = 10, /* Null resource record. */
66 ns_t_wks = 11, /* Well known service. */
67 ns_t_ptr = 12, /* Domain name pointer. */
68 ns_t_hinfo = 13, /* Host information. */
69 ns_t_minfo = 14, /* Mailbox information. */
70 ns_t_mx = 15, /* Mail routing information. */
71 ns_t_txt = 16, /* Text strings. */
72 ns_t_rp = 17, /* Responsible person. */
73 ns_t_afsdb = 18, /* AFS cell database. */
74 ns_t_x25 = 19, /* X_25 calling address. */
75 ns_t_isdn = 20, /* ISDN calling address. */
76 ns_t_rt = 21, /* Router. */
77 ns_t_nsap = 22, /* NSAP address. */
78 ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
79 ns_t_sig = 24, /* Security signature. */
80 ns_t_key = 25, /* Security key. */
81 ns_t_px = 26, /* X.400 mail mapping. */
82 ns_t_gpos = 27, /* Geographical position (withdrawn). */
83 ns_t_aaaa = 28, /* Ip6 Address. */
84 ns_t_loc = 29, /* Location Information. */
85 ns_t_nxt = 30, /* Next domain (security). */
86 ns_t_eid = 31, /* Endpoint identifier. */
87 ns_t_nimloc = 32, /* Nimrod Locator. */
88 ns_t_srv = 33, /* Server Selection. */
89 ns_t_atma = 34, /* ATM Address */
90 ns_t_naptr = 35, /* Naming Authority PoinTeR */
91 ns_t_kx = 36, /* Key Exchange */
92 ns_t_cert = 37, /* Certification record */
93 ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */
94 ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */
95 ns_t_sink = 40, /* Kitchen sink (experimentatl) */
96 ns_t_opt = 41, /* EDNS0 option (meta-RR) */
97 ns_t_tsig = 250, /* Transaction signature. */
98 ns_t_ixfr = 251, /* Incremental zone transfer. */
99 ns_t_axfr = 252, /* Transfer zone of authority. */
100 ns_t_mailb = 253, /* Transfer mailbox records. */
101 ns_t_maila = 254, /* Transfer mail agent records. */
102 ns_t_any = 255, /* Wildcard match. */
103 ns_t_zxfr = 256, /* BIND-specific, nonstandard. */
107 #define T_PTR ns_t_ptr
111 #define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
112 #define NAMESERVER_PORT NS_DEFAULTPORT
114 #define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
115 #define HFIXEDSZ NS_HFIXEDSZ
117 #define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
118 #define QFIXEDSZ NS_QFIXEDSZ
120 typedef enum __ns_opcode {
121 ns_o_query = 0, /* Standard query. */
122 ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
123 ns_o_status = 2, /* Name server status query (unsupported). */
124 /* Opcode 3 is undefined/reserved. */
125 ns_o_notify = 4, /* Zone change notification. */
126 ns_o_update = 5, /* Zone update message. */
130 #define QUERY ns_o_query
132 #define NS_MAXLABEL 63
133 #define MAXLABEL NS_MAXLABEL
135 #define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
136 #define RRFIXEDSZ NS_RRFIXEDSZ
138 #define T_CNAME ns_t_cname
140 #define NS_MAXDNAME 256 /* maximum domain name */
141 #define MAXDNAME NS_MAXDNAME
143 #define NS_MAXCDNAME 255 /* maximum compressed domain name */
144 #define MAXCDNAME NS_MAXCDNAME
146 #define NS_PACKETSZ 512 /* maximum packet size */
147 #define PACKETSZ NS_PACKETSZ
149 typedef enum __ns_rcode {
150 ns_r_noerror = 0, /* No error occurred. */
151 ns_r_formerr = 1, /* Format error. */
152 ns_r_servfail = 2, /* Server failure. */
153 ns_r_nxdomain = 3, /* Name error. */
154 ns_r_notimpl = 4, /* Unimplemented. */
155 ns_r_refused = 5, /* Operation refused. */
156 /* these are for BIND_UPDATE */
157 ns_r_yxdomain = 6, /* Name exists */
158 ns_r_yxrrset = 7, /* RRset exists */
159 ns_r_nxrrset = 8, /* RRset does not exist */
160 ns_r_notauth = 9, /* Not authoritative for zone */
161 ns_r_notzone = 10, /* Zone of record different from zone section */
163 /* The following are TSIG extended errors */
169 #define SERVFAIL ns_r_servfail
170 #define NOTIMP ns_r_notimpl
171 #define REFUSED ns_r_refused
172 #undef NOERROR /* it seems this is already defined in winerror.h */
173 #define NOERROR ns_r_noerror
174 #define FORMERR ns_r_formerr
175 #define NXDOMAIN ns_r_nxdomain
177 #define C_CHAOS ns_c_chaos
179 #define C_NONE ns_c_none
180 #define C_ANY ns_c_any
186 #define T_CNAME ns_t_cname
187 #define T_SOA ns_t_soa
191 #define T_NULL ns_t_null
192 #define T_WKS ns_t_wks
193 #define T_PTR ns_t_ptr
194 #define T_HINFO ns_t_hinfo
195 #define T_MINFO ns_t_minfo
197 #define T_TXT ns_t_txt
199 #define T_AFSDB ns_t_afsdb
200 #define T_X25 ns_t_x25
201 #define T_ISDN ns_t_isdn
203 #define T_NSAP ns_t_nsap
204 #define T_NSAP_PTR ns_t_nsap_ptr
205 #define T_SIG ns_t_sig
206 #define T_KEY ns_t_key
208 #define T_GPOS ns_t_gpos
209 #define T_AAAA ns_t_aaaa
210 #define T_LOC ns_t_loc
211 #define T_NXT ns_t_nxt
212 #define T_EID ns_t_eid
213 #define T_NIMLOC ns_t_nimloc
214 #define T_SRV ns_t_srv
215 #define T_ATMA ns_t_atma
216 #define T_NAPTR ns_t_naptr
217 #define T_TSIG ns_t_tsig
218 #define T_IXFR ns_t_ixfr
219 #define T_AXFR ns_t_axfr
220 #define T_MAILB ns_t_mailb
221 #define T_MAILA ns_t_maila
222 #define T_ANY ns_t_any
224 #endif /* ARES_NAMESER_H */