williamr@2: /* Copyright (c) 1983, 1989 williamr@2: * The Regents of the University of California. All rights reserved. williamr@2: * williamr@2: * Redistribution and use in source and binary forms, with or without williamr@2: * modification, are permitted provided that the following conditions williamr@2: * are met: williamr@2: * 1. Redistributions of source code must retain the above copyright williamr@2: * notice, this list of conditions and the following disclaimer. williamr@2: * 2. Redistributions in binary form must reproduce the above copyright williamr@2: * notice, this list of conditions and the following disclaimer in the williamr@2: * documentation and/or other materials provided with the distribution. williamr@2: * 4. Neither the name of the University nor the names of its contributors williamr@2: * may be used to endorse or promote products derived from this software williamr@2: * without specific prior written permission. williamr@2: * williamr@2: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND williamr@2: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE williamr@2: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE williamr@2: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE williamr@2: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL williamr@2: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS williamr@2: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) williamr@2: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT williamr@2: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY williamr@2: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF williamr@2: * SUCH DAMAGE. williamr@2: */ williamr@2: williamr@2: /* williamr@2: * from nameser.h 8.1 (Berkeley) 6/2/93 williamr@2: * From: Id: nameser_compat.h,v 8.9 1998/03/20 23:25:10 halley Exp williamr@2: * $FreeBSD: src/include/arpa/nameser_compat.h,v 1.4 2002/05/28 04:32:25 mike Exp $ williamr@2: */ williamr@2: williamr@2: #ifndef _ARPA_NAMESER_COMPAT_ williamr@2: #define _ARPA_NAMESER_COMPAT_ williamr@2: williamr@2: #define __BIND 19950621 /* (DEAD) interface version stamp. */ williamr@2: williamr@4: #include williamr@2: williamr@2: #if !defined(_BYTE_ORDER) || \ williamr@2: (_BYTE_ORDER != _BIG_ENDIAN && _BYTE_ORDER != _LITTLE_ENDIAN && \ williamr@2: _BYTE_ORDER != _PDP_ENDIAN) williamr@2: /* you must determine what the correct bit order is for williamr@2: * your compiler - the next line is an intentional error williamr@2: * which will force your compiles to bomb until you fix williamr@2: * the above macros. williamr@2: */ williamr@2: #error "Undefined or invalid _BYTE_ORDER"; williamr@2: #endif williamr@2: williamr@2: /* williamr@2: * Structure for query header. The order of the fields is machine- and williamr@2: * compiler-dependent, depending on the byte/bit order and the layout williamr@2: * of bit fields. We use bit fields only in int variables, as this williamr@2: * is all ANSI requires. This requires a somewhat confusing rearrangement. williamr@2: */ williamr@2: williamr@2: typedef struct { williamr@2: unsigned id :16; /* query identification number */ williamr@2: #if _BYTE_ORDER == _BIG_ENDIAN williamr@2: /* fields in third byte */ williamr@2: unsigned qr: 1; /* response flag */ williamr@2: unsigned opcode: 4; /* purpose of message */ williamr@2: unsigned aa: 1; /* authoritive answer */ williamr@2: unsigned tc: 1; /* truncated message */ williamr@2: unsigned rd: 1; /* recursion desired */ williamr@2: /* fields in fourth byte */ williamr@2: unsigned ra: 1; /* recursion available */ williamr@2: unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */ williamr@2: unsigned ad: 1; /* authentic data from named */ williamr@2: unsigned cd: 1; /* checking disabled by resolver */ williamr@2: unsigned rcode :4; /* response code */ williamr@2: #endif williamr@2: #if _BYTE_ORDER == _LITTLE_ENDIAN || _BYTE_ORDER == _PDP_ENDIAN williamr@2: /* fields in third byte */ williamr@2: unsigned rd :1; /* recursion desired */ williamr@2: unsigned tc :1; /* truncated message */ williamr@2: unsigned aa :1; /* authoritive answer */ williamr@2: unsigned opcode :4; /* purpose of message */ williamr@2: unsigned qr :1; /* response flag */ williamr@2: /* fields in fourth byte */ williamr@2: unsigned rcode :4; /* response code */ williamr@2: unsigned cd: 1; /* checking disabled by resolver */ williamr@2: unsigned ad: 1; /* authentic data from named */ williamr@2: unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */ williamr@2: unsigned ra :1; /* recursion available */ williamr@2: #endif williamr@2: /* remaining bytes */ williamr@2: unsigned qdcount :16; /* number of question entries */ williamr@2: unsigned ancount :16; /* number of answer entries */ williamr@2: unsigned nscount :16; /* number of authority entries */ williamr@2: unsigned arcount :16; /* number of resource entries */ williamr@2: } HEADER; williamr@2: williamr@2: #define PACKETSZ NS_PACKETSZ williamr@2: #define MAXDNAME NS_MAXDNAME williamr@2: #define MAXCDNAME NS_MAXCDNAME williamr@2: #define MAXLABEL NS_MAXLABEL williamr@2: #define HFIXEDSZ NS_HFIXEDSZ williamr@2: #define QFIXEDSZ NS_QFIXEDSZ williamr@2: #define RRFIXEDSZ NS_RRFIXEDSZ williamr@2: #define INT32SZ NS_INT32SZ williamr@2: #define INT16SZ NS_INT16SZ williamr@2: #define INADDRSZ NS_INADDRSZ williamr@2: #define IN6ADDRSZ NS_IN6ADDRSZ williamr@2: #define INDIR_MASK NS_CMPRSFLGS williamr@2: #define NAMESERVER_PORT NS_DEFAULTPORT williamr@2: williamr@2: #define S_ZONE ns_s_zn williamr@2: #define S_PREREQ ns_s_pr williamr@2: #define S_UPDATE ns_s_ud williamr@2: #define S_ADDT ns_s_ar williamr@2: williamr@2: #define QUERY ns_o_query williamr@2: #define IQUERY ns_o_iquery williamr@2: #define STATUS ns_o_status williamr@2: #define NS_NOTIFY_OP ns_o_notify williamr@2: #define NS_UPDATE_OP ns_o_update williamr@2: williamr@2: #define NOERROR ns_r_noerror williamr@2: #define FORMERR ns_r_formerr williamr@2: #define SERVFAIL ns_r_servfail williamr@2: #define NXDOMAIN ns_r_nxdomain williamr@2: #define NOTIMP ns_r_notimpl williamr@2: #define REFUSED ns_r_refused williamr@2: #define YXDOMAIN ns_r_yxdomain williamr@2: #define YXRRSET ns_r_yxrrset williamr@2: #define NXRRSET ns_r_nxrrset williamr@2: #define NOTAUTH ns_r_notauth williamr@2: #define NOTZONE ns_r_notzone williamr@2: williamr@2: #define DELETE ns_uop_delete williamr@2: #define ADD ns_uop_add williamr@2: williamr@2: #define T_A ns_t_a williamr@2: #define T_NS ns_t_ns williamr@2: #define T_MD ns_t_md williamr@2: #define T_MF ns_t_mf williamr@2: #define T_CNAME ns_t_cname williamr@2: #define T_SOA ns_t_soa williamr@2: #define T_MB ns_t_mb williamr@2: #define T_MG ns_t_mg williamr@2: #define T_MR ns_t_mr williamr@2: #define T_NULL ns_t_null williamr@2: #define T_WKS ns_t_wks williamr@2: #define T_PTR ns_t_ptr williamr@2: #define T_HINFO ns_t_hinfo williamr@2: #define T_MINFO ns_t_minfo williamr@2: #define T_MX ns_t_mx williamr@2: #define T_TXT ns_t_txt williamr@2: #define T_RP ns_t_rp williamr@2: #define T_AFSDB ns_t_afsdb williamr@2: #define T_X25 ns_t_x25 williamr@2: #define T_ISDN ns_t_isdn williamr@2: #define T_RT ns_t_rt williamr@2: #define T_NSAP ns_t_nsap williamr@2: #define T_NSAP_PTR ns_t_nsap_ptr williamr@2: #define T_SIG ns_t_sig williamr@2: #define T_KEY ns_t_key williamr@2: #define T_PX ns_t_px williamr@2: #define T_GPOS ns_t_gpos williamr@2: #define T_AAAA ns_t_aaaa williamr@2: #define T_LOC ns_t_loc williamr@2: #define T_NXT ns_t_nxt williamr@2: #define T_EID ns_t_eid williamr@2: #define T_NIMLOC ns_t_nimloc williamr@2: #define T_SRV ns_t_srv williamr@2: #define T_ATMA ns_t_atma williamr@2: #define T_NAPTR ns_t_naptr williamr@2: #define T_OPT ns_t_opt williamr@2: #define T_IXFR ns_t_ixfr williamr@2: #define T_AXFR ns_t_axfr williamr@2: #define T_MAILB ns_t_mailb williamr@2: #define T_MAILA ns_t_maila williamr@2: #define T_ANY ns_t_any williamr@2: williamr@2: #define C_IN ns_c_in williamr@2: #define C_CHAOS ns_c_chaos williamr@2: #define C_HS ns_c_hs williamr@2: /* BIND_UPDATE */ williamr@2: #define C_NONE ns_c_none williamr@2: #define C_ANY ns_c_any williamr@2: williamr@2: #define GETSHORT NS_GET16 williamr@2: #define GETLONG NS_GET32 williamr@2: #define PUTSHORT NS_PUT16 williamr@2: #define PUTLONG NS_PUT32 williamr@2: williamr@2: #endif /* _ARPA_NAMESER_COMPAT_ */