reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ares_nameser.h
Go to the documentation of this file.
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
73typedef 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
84
85typedef 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
145
146typedef 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
155
156typedef 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 */
170 /* The following are TSIG extended errors */
173 ns_r_badtime = 18
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#ifndef QUERY
223# define QUERY ns_o_query
224#endif
225
226#ifndef SERVFAIL
227# define SERVFAIL ns_r_servfail
228#endif
229
230#ifndef NOTIMP
231# define NOTIMP ns_r_notimpl
232#endif
233
234#ifndef REFUSED
235# define REFUSED ns_r_refused
236#endif
237
238#if defined(_WIN32) && !defined(HAVE_ARPA_NAMESER_COMPAT_H) && defined(NOERROR)
239# undef NOERROR /* it seems this is already defined in winerror.h */
240#endif
241
242#ifndef NOERROR
243# define NOERROR ns_r_noerror
244#endif
245
246#ifndef FORMERR
247# define FORMERR ns_r_formerr
248#endif
249
250#ifndef NXDOMAIN
251# define NXDOMAIN ns_r_nxdomain
252#endif
253
254#ifndef C_IN
255# define C_IN ns_c_in
256#endif
257#ifndef C_CHAOS
258# define C_CHAOS ns_c_chaos
259#endif
260#ifndef C_HS
261# define C_HS ns_c_hs
262#endif
263#ifndef C_NONE
264# define C_NONE ns_c_none
265#endif
266#ifndef C_ANY
267# define C_ANY ns_c_any
268#endif
269
270#ifndef T_A
271# define T_A 1 /* ns_t_a */
272#endif
273#ifndef T_NS
274# define T_NS 2 /* ns_t_ns */
275#endif
276#ifndef T_MD
277# define T_MD 3 /* ns_t_md */
278#endif
279#ifndef T_MF
280# define T_MF 4 /* ns_t_mf */
281#endif
282#ifndef T_CNAME
283# define T_CNAME 5 /* ns_t_cname */
284#endif
285#ifndef T_SOA
286# define T_SOA 6 /* ns_t_soa */
287#endif
288#ifndef T_MB
289# define T_MB 7 /* ns_t_mb */
290#endif
291#ifndef T_MG
292# define T_MG 8 /* ns_t_mg */
293#endif
294#ifndef T_MR
295# define T_MR 9 /* ns_t_mr */
296#endif
297#ifndef T_NULL
298# define T_NULL 10 /* ns_t_null */
299#endif
300#ifndef T_WKS
301# define T_WKS 11 /* ns_t_wks */
302#endif
303#ifndef T_PTR
304# define T_PTR 12 /* ns_t_ptr */
305#endif
306#ifndef T_HINFO
307# define T_HINFO 13 /* ns_t_hinfo */
308#endif
309#ifndef T_MINFO
310# define T_MINFO 14 /* ns_t_minfo */
311#endif
312#ifndef T_MX
313# define T_MX 15 /* ns_t_mx */
314#endif
315#ifndef T_TXT
316# define T_TXT 16 /* ns_t_txt */
317#endif
318#ifndef T_RP
319# define T_RP 17 /* ns_t_rp */
320#endif
321#ifndef T_AFSDB
322# define T_AFSDB 18 /* ns_t_afsdb */
323#endif
324#ifndef T_X25
325# define T_X25 19 /* ns_t_x25 */
326#endif
327#ifndef T_ISDN
328# define T_ISDN 20 /* ns_t_isdn */
329#endif
330#ifndef T_RT
331# define T_RT 21 /* ns_t_rt */
332#endif
333#ifndef T_NSAP
334# define T_NSAP 22 /* ns_t_nsap */
335#endif
336#ifndef T_NSAP_PTR
337# define T_NSAP_PTR 23 /* ns_t_nsap_ptr */
338#endif
339#ifndef T_SIG
340# define T_SIG 24 /* ns_t_sig */
341#endif
342#ifndef T_KEY
343# define T_KEY 25 /* ns_t_key */
344#endif
345#ifndef T_PX
346# define T_PX 26 /* ns_t_px */
347#endif
348#ifndef T_GPOS
349# define T_GPOS 27 /* ns_t_gpos */
350#endif
351#ifndef T_AAAA
352# define T_AAAA 28 /* ns_t_aaaa */
353#endif
354#ifndef T_LOC
355# define T_LOC 29 /* ns_t_loc */
356#endif
357#ifndef T_NXT
358# define T_NXT 30 /* ns_t_nxt */
359#endif
360#ifndef T_EID
361# define T_EID 31 /* ns_t_eid */
362#endif
363#ifndef T_NIMLOC
364# define T_NIMLOC 32 /* ns_t_nimloc */
365#endif
366#ifndef T_SRV
367# define T_SRV 33 /* ns_t_srv */
368#endif
369#ifndef T_ATMA
370# define T_ATMA 34 /* ns_t_atma */
371#endif
372#ifndef T_NAPTR
373# define T_NAPTR 35 /* ns_t_naptr */
374#endif
375#ifndef T_KX
376# define T_KX 36 /* ns_t_kx */
377#endif
378#ifndef T_CERT
379# define T_CERT 37 /* ns_t_cert */
380#endif
381#ifndef T_A6
382# define T_A6 38 /* ns_t_a6 */
383#endif
384#ifndef T_DNAME
385# define T_DNAME 39 /* ns_t_dname */
386#endif
387#ifndef T_SINK
388# define T_SINK 40 /* ns_t_sink */
389#endif
390#ifndef T_OPT
391# define T_OPT 41 /* ns_t_opt */
392#endif
393#ifndef T_APL
394# define T_APL 42 /* ns_t_apl */
395#endif
396#ifndef T_DS
397# define T_DS 43 /* ns_t_ds */
398#endif
399#ifndef T_SSHFP
400# define T_SSHFP 44 /* ns_t_sshfp */
401#endif
402#ifndef T_RRSIG
403# define T_RRSIG 46 /* ns_t_rrsig */
404#endif
405#ifndef T_NSEC
406# define T_NSEC 47 /* ns_t_nsec */
407#endif
408#ifndef T_DNSKEY
409# define T_DNSKEY 48 /* ns_t_dnskey */
410#endif
411#ifndef T_TKEY
412# define T_TKEY 249 /* ns_t_tkey */
413#endif
414#ifndef T_TSIG
415# define T_TSIG 250 /* ns_t_tsig */
416#endif
417#ifndef T_IXFR
418# define T_IXFR 251 /* ns_t_ixfr */
419#endif
420#ifndef T_AXFR
421# define T_AXFR 252 /* ns_t_axfr */
422#endif
423#ifndef T_MAILB
424# define T_MAILB 253 /* ns_t_mailb */
425#endif
426#ifndef T_MAILA
427# define T_MAILA 254 /* ns_t_maila */
428#endif
429#ifndef T_ANY
430# define T_ANY 255 /* ns_t_any */
431#endif
432#ifndef T_ZXFR
433# define T_ZXFR 256 /* ns_t_zxfr */
434#endif
435#ifndef T_CAA
436# define T_CAA 257 /* ns_t_caa */
437#endif
438#ifndef T_MAX
439# define T_MAX 65536 /* ns_t_max */
440#endif
441
442
443#endif /* ARES_NAMESER_H */
enum __ns_class ns_class
__ns_class
@ ns_c_2
@ ns_c_chaos
@ ns_c_in
@ ns_c_max
@ ns_c_invalid
@ ns_c_hs
@ ns_c_none
@ ns_c_any
enum __ns_opcode ns_opcode
__ns_opcode
@ ns_o_notify
@ ns_o_iquery
@ ns_o_query
@ ns_o_status
@ ns_o_max
@ ns_o_update
__ns_rcode
@ ns_r_yxrrset
@ ns_r_badtime
@ ns_r_noerror
@ ns_r_formerr
@ ns_r_refused
@ ns_r_servfail
@ ns_r_nxdomain
@ ns_r_badkey
@ ns_r_notzone
@ ns_r_notauth
@ ns_r_max
@ ns_r_notimpl
@ ns_r_yxdomain
@ ns_r_badsig
@ ns_r_nxrrset
enum __ns_type ns_type
enum __ns_rcode ns_rcode
__ns_type
@ ns_t_gpos
@ ns_t_key
@ ns_t_axfr
@ ns_t_dname
@ ns_t_ds
@ ns_t_sink
@ ns_t_mr
@ ns_t_ptr
@ ns_t_null
@ ns_t_rp
@ ns_t_opt
@ ns_t_zxfr
@ ns_t_kx
@ ns_t_atma
@ ns_t_nsec
@ ns_t_a6
@ ns_t_mx
@ ns_t_soa
@ ns_t_isdn
@ ns_t_wks
@ ns_t_any
@ ns_t_rrsig
@ ns_t_invalid
@ ns_t_sig
@ ns_t_dnskey
@ ns_t_srv
@ ns_t_sshfp
@ ns_t_ns
@ ns_t_afsdb
@ ns_t_naptr
@ ns_t_nxt
@ ns_t_cert
@ ns_t_nimloc
@ ns_t_x25
@ ns_t_mf
@ ns_t_md
@ ns_t_apl
@ ns_t_a
@ ns_t_ixfr
@ ns_t_max
@ ns_t_mg
@ ns_t_tkey
@ ns_t_maila
@ ns_t_loc
@ ns_t_minfo
@ ns_t_txt
@ ns_t_hinfo
@ ns_t_aaaa
@ ns_t_nsap_ptr
@ ns_t_mb
@ ns_t_rt
@ ns_t_px
@ ns_t_nsap
@ ns_t_caa
@ ns_t_eid
@ ns_t_tsig
@ ns_t_cname
@ ns_t_mailb