/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 1983, 19894* The Regents of the University of California. All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14* 3. Neither the name of the University nor the names of its contributors15* may be used to endorse or promote products derived from this software16* without specific prior written permission.17*18* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND19* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE20* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE21* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE22* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL23* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS24* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)25* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT26* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY27* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF28* SUCH DAMAGE.29*/3031/*%32* from nameser.h 8.1 (Berkeley) 6/2/9333* $Id: nameser_compat.h,v 1.8 2006/05/19 02:33:40 marka Exp $34*/3536#ifndef _ARPA_NAMESER_COMPAT_37#define _ARPA_NAMESER_COMPAT_3839#define __BIND 19950621 /*%< (DEAD) interface version stamp. */4041#include <machine/endian.h>4243#if !defined(_BYTE_ORDER) || \44(_BYTE_ORDER != _BIG_ENDIAN && _BYTE_ORDER != _LITTLE_ENDIAN && \45_BYTE_ORDER != _PDP_ENDIAN)46/* you must determine what the correct bit order is for47* your compiler - the next line is an intentional error48* which will force your compiles to bomb until you fix49* the above macros.50*/51#error "Undefined or invalid _BYTE_ORDER";52#endif5354/*%55* Structure for query header. The order of the fields is machine- and56* compiler-dependent, depending on the byte/bit order and the layout57* of bit fields. We use bit fields only in int variables, as this58* is all ANSI requires. This requires a somewhat confusing rearrangement.59*/6061typedef struct {62unsigned id :16; /*%< query identification number */63#if _BYTE_ORDER == _BIG_ENDIAN64/* fields in third byte */65unsigned qr: 1; /*%< response flag */66unsigned opcode: 4; /*%< purpose of message */67unsigned aa: 1; /*%< authoritative answer */68unsigned tc: 1; /*%< truncated message */69unsigned rd: 1; /*%< recursion desired */70/* fields in fourth byte */71unsigned ra: 1; /*%< recursion available */72unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */73unsigned ad: 1; /*%< authentic data from named */74unsigned cd: 1; /*%< checking disabled by resolver */75unsigned rcode :4; /*%< response code */76#endif77#if _BYTE_ORDER == _LITTLE_ENDIAN || _BYTE_ORDER == _PDP_ENDIAN78/* fields in third byte */79unsigned rd :1; /*%< recursion desired */80unsigned tc :1; /*%< truncated message */81unsigned aa :1; /*%< authoritative answer */82unsigned opcode :4; /*%< purpose of message */83unsigned qr :1; /*%< response flag */84/* fields in fourth byte */85unsigned rcode :4; /*%< response code */86unsigned cd: 1; /*%< checking disabled by resolver */87unsigned ad: 1; /*%< authentic data from named */88unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */89unsigned ra :1; /*%< recursion available */90#endif91/* remaining bytes */92unsigned qdcount :16; /*%< number of question entries */93unsigned ancount :16; /*%< number of answer entries */94unsigned nscount :16; /*%< number of authority entries */95unsigned arcount :16; /*%< number of resource entries */96} HEADER;9798#define PACKETSZ NS_PACKETSZ99#define MAXDNAME NS_MAXDNAME100#define MAXCDNAME NS_MAXCDNAME101#define MAXLABEL NS_MAXLABEL102#define HFIXEDSZ NS_HFIXEDSZ103#define QFIXEDSZ NS_QFIXEDSZ104#define RRFIXEDSZ NS_RRFIXEDSZ105#define INT32SZ NS_INT32SZ106#define INT16SZ NS_INT16SZ107#define INT8SZ NS_INT8SZ108#define INADDRSZ NS_INADDRSZ109#define IN6ADDRSZ NS_IN6ADDRSZ110#define INDIR_MASK NS_CMPRSFLGS111#define NAMESERVER_PORT NS_DEFAULTPORT112113#define S_ZONE ns_s_zn114#define S_PREREQ ns_s_pr115#define S_UPDATE ns_s_ud116#define S_ADDT ns_s_ar117118#define QUERY ns_o_query119#define IQUERY ns_o_iquery120#define STATUS ns_o_status121#define NS_NOTIFY_OP ns_o_notify122#define NS_UPDATE_OP ns_o_update123124#define NOERROR ns_r_noerror125#define FORMERR ns_r_formerr126#define SERVFAIL ns_r_servfail127#define NXDOMAIN ns_r_nxdomain128#define NOTIMP ns_r_notimpl129#define REFUSED ns_r_refused130#define YXDOMAIN ns_r_yxdomain131#define YXRRSET ns_r_yxrrset132#define NXRRSET ns_r_nxrrset133#define NOTAUTH ns_r_notauth134#define NOTZONE ns_r_notzone135/*#define BADSIG ns_r_badsig*/136/*#define BADKEY ns_r_badkey*/137/*#define BADTIME ns_r_badtime*/138139140#define DELETE ns_uop_delete141#define ADD ns_uop_add142143#define T_A ns_t_a144#define T_NS ns_t_ns145#define T_MD ns_t_md146#define T_MF ns_t_mf147#define T_CNAME ns_t_cname148#define T_SOA ns_t_soa149#define T_MB ns_t_mb150#define T_MG ns_t_mg151#define T_MR ns_t_mr152#define T_NULL ns_t_null153#define T_WKS ns_t_wks154#define T_PTR ns_t_ptr155#define T_HINFO ns_t_hinfo156#define T_MINFO ns_t_minfo157#define T_MX ns_t_mx158#define T_TXT ns_t_txt159#define T_RP ns_t_rp160#define T_AFSDB ns_t_afsdb161#define T_X25 ns_t_x25162#define T_ISDN ns_t_isdn163#define T_RT ns_t_rt164#define T_NSAP ns_t_nsap165#define T_NSAP_PTR ns_t_nsap_ptr166#define T_SIG ns_t_sig167#define T_KEY ns_t_key168#define T_PX ns_t_px169#define T_GPOS ns_t_gpos170#define T_AAAA ns_t_aaaa171#define T_LOC ns_t_loc172#define T_NXT ns_t_nxt173#define T_EID ns_t_eid174#define T_NIMLOC ns_t_nimloc175#define T_SRV ns_t_srv176#define T_ATMA ns_t_atma177#define T_NAPTR ns_t_naptr178#define T_KX ns_t_kx179#define T_CERT ns_t_cert180#define T_A6 ns_t_a6181#define T_DNAME ns_t_dname182#define T_SINK ns_t_sink183#define T_OPT ns_t_opt184#define T_APL ns_t_apl185#define T_DS ns_t_ds186#define T_SSHFP ns_t_sshfp187#define T_IPSECKEY ns_t_ipseckey188#define T_RRSIG ns_t_rrsig189#define T_NSEC ns_t_nsec190#define T_DNSKEY ns_t_dnskey191#define T_DHCID ns_t_dhcid192#define T_NSEC3 ns_t_nsec3193#define T_NSEC3PARAM ns_t_nsec3param194#define T_HIP ns_t_hip195#define T_SPF ns_t_spf196#define T_TKEY ns_t_tkey197#define T_TSIG ns_t_tsig198#define T_IXFR ns_t_ixfr199#define T_AXFR ns_t_axfr200#define T_MAILB ns_t_mailb201#define T_MAILA ns_t_maila202#define T_ANY ns_t_any203#define T_ZXFR ns_t_zxfr204#define T_DLV ns_t_dlv205206#define C_IN ns_c_in207#define C_CHAOS ns_c_chaos208#define C_HS ns_c_hs209/* BIND_UPDATE */210#define C_NONE ns_c_none211#define C_ANY ns_c_any212213#define GETSHORT NS_GET16214#define GETLONG NS_GET32215#define PUTSHORT NS_PUT16216#define PUTLONG NS_PUT32217218#endif /* _ARPA_NAMESER_COMPAT_ */219/*! \file */220221222