57 #ifndef _ARPA_NAMESER_H_ 58 #define _ARPA_NAMESER_H_ 62 #include <sys/types.h> 63 #include <sys/cdefs.h> 74 #define __NAMESER 19961001 79 #define NS_PACKETSZ 512 80 #define NS_MAXDNAME 1025 81 #define NS_MAXCDNAME 255 82 #define NS_MAXLABEL 63 83 #define NS_HFIXEDSZ 12 85 #define NS_RRFIXEDSZ 10 90 #define NS_IN6ADDRSZ 16 91 #define NS_CMPRSFLGS 0xc0 92 #define NS_DEFAULTPORT 53 98 typedef enum __ns_sect {
115 const u_char *_msg, *_eom;
116 u_int16_t _id, _flags, _counts[ns_s_max];
117 const u_char *_sections[ns_s_max];
124 struct _ns_flagdata {
int mask, shift; };
125 extern struct _ns_flagdata _ns_flagdata[];
128 #define ns_msg_getflag(handle, flag) ( \ 129 ((handle)._flags & _ns_flagdata[flag].mask) \ 130 >> _ns_flagdata[flag].shift \ 132 #define ns_msg_id(handle) ((handle)._id + 0) 133 #define ns_msg_base(handle) ((handle)._msg + 0) 134 #define ns_msg_end(handle) ((handle)._eom + 0) 135 #define ns_msg_size(handle) ((handle)._eom - (handle)._msg) 136 #define ns_msg_count(handle, section) ((handle)._counts[section] + 0) 142 char name[NS_MAXDNAME];
151 #define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".") 152 #define ns_rr_type(rr) ((rr).type + 0) 153 #define ns_rr_class(rr) ((rr).rr_class + 0) 154 #define ns_rr_ttl(rr) ((rr).ttl + 0) 155 #define ns_rr_rdlen(rr) ((rr).rdlength + 0) 156 #define ns_rr_rdata(rr) ((rr).rdata + 0) 163 typedef enum __ns_flag {
180 typedef enum __ns_opcode {
193 typedef enum __ns_rcode {
210 typedef enum __ns_update_operation {
214 } ns_update_operation;
220 struct ns_updrec *r_prev;
221 struct ns_updrec *r_next;
231 struct ns_updrec *r_grpnext;
232 struct databuf *r_dp;
233 struct databuf *r_deldp;
236 typedef struct ns_updrec ns_updrec;
241 typedef enum __ns_type {
290 typedef enum __ns_class {
304 #define NS_KEY_TYPEMASK 0xC000 305 #define NS_KEY_TYPE_AUTH_CONF 0x0000 306 #define NS_KEY_TYPE_CONF_ONLY 0x8000 307 #define NS_KEY_TYPE_AUTH_ONLY 0x4000 308 #define NS_KEY_TYPE_NO_KEY 0xC000 310 #define NS_KEY_NO_AUTH 0x8000 311 #define NS_KEY_NO_CONF 0x4000 312 #define NS_KEY_EXPERIMENTAL 0x2000 313 #define NS_KEY_RESERVED3 0x1000 314 #define NS_KEY_RESERVED4 0x0800 315 #define NS_KEY_USERACCOUNT 0x0400 316 #define NS_KEY_ENTITY 0x0200 317 #define NS_KEY_ZONEKEY 0x0100 318 #define NS_KEY_IPSEC 0x0080 319 #define NS_KEY_EMAIL 0x0040 320 #define NS_KEY_RESERVED10 0x0020 321 #define NS_KEY_RESERVED11 0x0010 322 #define NS_KEY_SIGNATORYMASK 0x000F 324 #define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED3 | \ 326 NS_KEY_RESERVED10 | \ 330 #define NS_ALG_MD5RSA 1 331 #define NS_ALG_EXPIRE_ONLY 253 332 #define NS_ALG_PRIVATE_OID 254 335 #define NS_MD5RSA_MIN_BITS 512 336 #define NS_MD5RSA_MAX_BITS 2552 338 #define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3) 340 #define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4) 343 #define NS_SIG_TYPE 0 345 #define NS_SIG_LABELS 3 346 #define NS_SIG_OTTL 4 347 #define NS_SIG_EXPIR 8 348 #define NS_SIG_SIGNED 12 349 #define NS_SIG_FOOT 16 350 #define NS_SIG_SIGNER 18 353 #define NS_NXT_BITS 8 354 #define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS))) 355 #define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS))) 356 #define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS))) 362 #define NS_GET16(s, cp) { \ 363 register u_char *t_cp = (u_char *)(cp); \ 364 (s) = ((u_int16_t)t_cp[0] << 8) \ 365 | ((u_int16_t)t_cp[1]) \ 367 (cp) += NS_INT16SZ; \ 370 #define NS_GET32(l, cp) { \ 371 register u_char *t_cp = (u_char *)(cp); \ 372 (l) = ((u_int32_t)t_cp[0] << 24) \ 373 | ((u_int32_t)t_cp[1] << 16) \ 374 | ((u_int32_t)t_cp[2] << 8) \ 375 | ((u_int32_t)t_cp[3]) \ 377 (cp) += NS_INT32SZ; \ 380 #define NS_PUT16(s, cp) { \ 381 register u_int16_t t_s = (u_int16_t)(s); \ 382 register u_char *t_cp = (u_char *)(cp); \ 383 *t_cp++ = t_s >> 8; \ 385 (cp) += NS_INT16SZ; \ 388 #define NS_PUT32(l, cp) { \ 389 register u_int32_t t_l = (u_int32_t)(l); \ 390 register u_char *t_cp = (u_char *)(cp); \ 391 *t_cp++ = t_l >> 24; \ 392 *t_cp++ = t_l >> 16; \ 393 *t_cp++ = t_l >> 8; \ 395 (cp) += NS_INT32SZ; \ 401 #define ns_get16 __ns_get16 402 #define ns_get32 __ns_get32 403 #define ns_put16 __ns_put16 404 #define ns_put32 __ns_put32 405 #define ns_initparse __ns_initparse 406 #define ns_parserr __ns_parserr 407 #define ns_sprintrr __ns_sprintrr 408 #define ns_sprintrrf __ns_sprintrrf 409 #define ns_format_ttl __ns_format_ttl 410 #define ns_parse_ttl __ns_parse_ttl 411 #define ns_name_ntop __ns_name_ntop 412 #define ns_name_pton __ns_name_pton 413 #define ns_name_unpack __ns_name_unpack 414 #define ns_name_pack __ns_name_pack 415 #define ns_name_compress __ns_name_compress 416 #define ns_name_uncompress __ns_name_uncompress 419 u_int ns_get16(
const u_char *);
420 u_long ns_get32(
const u_char *);
421 void ns_put16(u_int, u_char *);
422 void ns_put32(u_long, u_char *);
423 int ns_initparse(
const u_char *,
int,
ns_msg *);
426 const char *,
const char *,
char *,
size_t);
427 int ns_sprintrrf(
const u_char *,
size_t,
const char *,
428 ns_class, ns_type, u_long,
const u_char *,
429 size_t,
const char *,
const char *,
431 int ns_format_ttl(u_long,
char *,
size_t);
432 int ns_parse_ttl(
const char *, u_long *);
433 int ns_name_ntop(
const u_char *,
char *,
size_t);
434 int ns_name_pton(
const char *, u_char *,
size_t);
435 int ns_name_unpack(
const u_char *,
const u_char *,
436 const u_char *, u_char *,
size_t);
437 int ns_name_pack(
const u_char *, u_char *,
int,
438 const u_char **,
const u_char **);
439 int ns_name_uncompress(
const u_char *,
const u_char *,
440 const u_char *,
char *,
size_t);
441 int ns_name_compress(
const char *, u_char *,
size_t,
442 const u_char **,
const u_char **);
443 int ns_name_skip(
const u_char **,
const u_char *);
Definition: nameser.h:115
Definition: nameser.h:142