Blame resolv/arpa/nameser.h

Packit 6c4009
/*
Packit 6c4009
 * Copyright (c) 1983, 1989, 1993
Packit 6c4009
 *    The Regents of the University of California.  All rights reserved.
Packit 6c4009
 *
Packit 6c4009
 * Redistribution and use in source and binary forms, with or without
Packit 6c4009
 * modification, are permitted provided that the following conditions
Packit 6c4009
 * are met:
Packit 6c4009
 * 1. Redistributions of source code must retain the above copyright
Packit 6c4009
 *    notice, this list of conditions and the following disclaimer.
Packit 6c4009
 * 2. Redistributions in binary form must reproduce the above copyright
Packit 6c4009
 *    notice, this list of conditions and the following disclaimer in the
Packit 6c4009
 *    documentation and/or other materials provided with the distribution.
Packit 6c4009
 * 4. Neither the name of the University nor the names of its contributors
Packit 6c4009
 *    may be used to endorse or promote products derived from this software
Packit 6c4009
 *    without specific prior written permission.
Packit 6c4009
 *
Packit 6c4009
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
Packit 6c4009
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit 6c4009
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit 6c4009
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
Packit 6c4009
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 6c4009
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Packit 6c4009
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Packit 6c4009
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
Packit 6c4009
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
Packit 6c4009
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
Packit 6c4009
 * SUCH DAMAGE.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
Packit 6c4009
 * Copyright (c) 1996-1999 by Internet Software Consortium.
Packit 6c4009
 *
Packit 6c4009
 * Permission to use, copy, modify, and distribute this software for any
Packit 6c4009
 * purpose with or without fee is hereby granted, provided that the above
Packit 6c4009
 * copyright notice and this permission notice appear in all copies.
Packit 6c4009
 *
Packit 6c4009
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
Packit 6c4009
 * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
Packit 6c4009
 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
Packit 6c4009
 * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
Packit 6c4009
 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
Packit 6c4009
 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
Packit 6c4009
 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
Packit 6c4009
 * SOFTWARE.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#ifndef _ARPA_NAMESER_H_
Packit 6c4009
#define _ARPA_NAMESER_H_
Packit 6c4009
Packit 6c4009
#include <sys/param.h>
Packit 6c4009
#include <sys/types.h>
Packit 6c4009
#include <stdint.h>
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Define constants based on RFC 883, RFC 1034, RFC 1035
Packit 6c4009
 */
Packit 6c4009
#define NS_PACKETSZ	512	/*%< default UDP packet size */
Packit 6c4009
#define NS_MAXDNAME	1025	/*%< maximum domain name */
Packit 6c4009
#define NS_MAXMSG	65535	/*%< maximum message size */
Packit 6c4009
#define NS_MAXCDNAME	255	/*%< maximum compressed domain name */
Packit 6c4009
#define NS_MAXLABEL	63	/*%< maximum length of domain label */
Packit 6c4009
#define NS_HFIXEDSZ	12	/*%< #/bytes of fixed data in header */
Packit 6c4009
#define NS_QFIXEDSZ	4	/*%< #/bytes of fixed data in query */
Packit 6c4009
#define NS_RRFIXEDSZ	10	/*%< #/bytes of fixed data in r record */
Packit 6c4009
#define NS_INT32SZ	4	/*%< #/bytes of data in a uint32_t */
Packit 6c4009
#define NS_INT16SZ	2	/*%< #/bytes of data in a uint16_t */
Packit 6c4009
#define NS_INT8SZ	1	/*%< #/bytes of data in a uint8_t */
Packit 6c4009
#define NS_INADDRSZ	4	/*%< IPv4 T_A */
Packit 6c4009
#define NS_IN6ADDRSZ	16	/*%< IPv6 T_AAAA */
Packit 6c4009
#define NS_CMPRSFLGS	0xc0	/*%< Flag bits indicating name compression. */
Packit 6c4009
#define NS_DEFAULTPORT	53	/*%< For both TCP and UDP. */
Packit 6c4009
/*
Packit 6c4009
 * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
Packit 6c4009
 * in synch with it.
Packit 6c4009
 */
Packit 6c4009
typedef enum __ns_sect {
Packit 6c4009
	ns_s_qd = 0,		/*%< Query: Question. */
Packit 6c4009
	ns_s_zn = 0,		/*%< Update: Zone. */
Packit 6c4009
	ns_s_an = 1,		/*%< Query: Answer. */
Packit 6c4009
	ns_s_pr = 1,		/*%< Update: Prerequisites. */
Packit 6c4009
	ns_s_ns = 2,		/*%< Query: Name servers. */
Packit 6c4009
	ns_s_ud = 2,		/*%< Update: Update. */
Packit 6c4009
	ns_s_ar = 3,		/*%< Query|Update: Additional records. */
Packit 6c4009
	ns_s_max = 4
Packit 6c4009
} ns_sect;
Packit 6c4009
Packit 6c4009
/*%
Packit 6c4009
 * This is a message handle.  It is caller allocated and has no dynamic data.
Packit 6c4009
 * This structure is intended to be opaque to all but ns_parse.c, thus the
Packit 6c4009
 * leading _'s on the member names.  Use the accessor functions, not the _'s.
Packit 6c4009
 */
Packit 6c4009
typedef struct __ns_msg {
Packit 6c4009
	const unsigned char	*_msg, *_eom;
Packit 6c4009
	uint16_t		_id, _flags, _counts[ns_s_max];
Packit 6c4009
	const unsigned char	*_sections[ns_s_max];
Packit 6c4009
	ns_sect			_sect;
Packit 6c4009
	int			_rrnum;
Packit 6c4009
	const unsigned char	*_msg_ptr;
Packit 6c4009
} ns_msg;
Packit 6c4009
Packit 6c4009
/* Private data structure - do not use from outside library. */
Packit 6c4009
struct _ns_flagdata {  int mask, shift;  };
Packit 6c4009
extern const struct _ns_flagdata _ns_flagdata[];
Packit 6c4009
Packit 6c4009
/* Accessor macros - this is part of the public interface. */
Packit 6c4009
Packit 6c4009
#define ns_msg_id(handle) ((handle)._id + 0)
Packit 6c4009
#define ns_msg_base(handle) ((handle)._msg + 0)
Packit 6c4009
#define ns_msg_end(handle) ((handle)._eom + 0)
Packit 6c4009
#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
Packit 6c4009
#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
Packit 6c4009
Packit 6c4009
/*%
Packit 6c4009
 * This is a parsed record.  It is caller allocated and has no dynamic data.
Packit 6c4009
 */
Packit 6c4009
typedef	struct __ns_rr {
Packit 6c4009
	char			name[NS_MAXDNAME];
Packit 6c4009
	uint16_t		type;
Packit 6c4009
	uint16_t		rr_class;
Packit 6c4009
	uint32_t		ttl;
Packit 6c4009
	uint16_t		rdlength;
Packit 6c4009
	const unsigned char *	rdata;
Packit 6c4009
} ns_rr;
Packit 6c4009
Packit 6c4009
/* Accessor macros - this is part of the public interface. */
Packit 6c4009
#define ns_rr_name(rr)	(((rr).name[0] != '\0') ? (rr).name : ".")
Packit 6c4009
#define ns_rr_type(rr)	((ns_type)((rr).type + 0))
Packit 6c4009
#define ns_rr_class(rr)	((ns_class)((rr).rr_class + 0))
Packit 6c4009
#define ns_rr_ttl(rr)	((rr).ttl + 0)
Packit 6c4009
#define ns_rr_rdlen(rr)	((rr).rdlength + 0)
Packit 6c4009
#define ns_rr_rdata(rr)	((rr).rdata + 0)
Packit 6c4009
Packit 6c4009
/*%
Packit 6c4009
 * These don't have to be in the same order as in the packet flags word,
Packit 6c4009
 * and they can even overlap in some cases, but they will need to be kept
Packit 6c4009
 * in synch with ns_parse.c:ns_flagdata[].
Packit 6c4009
 */
Packit 6c4009
typedef enum __ns_flag {
Packit 6c4009
	ns_f_qr,		/*%< Question/Response. */
Packit 6c4009
	ns_f_opcode,		/*%< Operation code. */
Packit 6c4009
	ns_f_aa,		/*%< Authoritative Answer. */
Packit 6c4009
	ns_f_tc,		/*%< Truncation occurred. */
Packit 6c4009
	ns_f_rd,		/*%< Recursion Desired. */
Packit 6c4009
	ns_f_ra,		/*%< Recursion Available. */
Packit 6c4009
	ns_f_z,			/*%< MBZ. */
Packit 6c4009
	ns_f_ad,		/*%< Authentic Data (DNSSEC). */
Packit 6c4009
	ns_f_cd,		/*%< Checking Disabled (DNSSEC). */
Packit 6c4009
	ns_f_rcode,		/*%< Response code. */
Packit 6c4009
	ns_f_max
Packit 6c4009
} ns_flag;
Packit 6c4009
Packit 6c4009
/*%
Packit 6c4009
 * Currently defined opcodes.
Packit 6c4009
 */
Packit 6c4009
typedef enum __ns_opcode {
Packit 6c4009
	ns_o_query = 0,		/*%< Standard query. */
Packit 6c4009
	ns_o_iquery = 1,	/*%< Inverse query (deprecated/unsupported). */
Packit 6c4009
	ns_o_status = 2,	/*%< Name server status query (unsupported). */
Packit 6c4009
				/* Opcode 3 is undefined/reserved. */
Packit 6c4009
	ns_o_notify = 4,	/*%< Zone change notification. */
Packit 6c4009
	ns_o_update = 5,	/*%< Zone update message. */
Packit 6c4009
	ns_o_max = 6
Packit 6c4009
} ns_opcode;
Packit 6c4009
Packit 6c4009
/*%
Packit 6c4009
 * Currently defined response codes.
Packit 6c4009
 */
Packit 6c4009
typedef	enum __ns_rcode {
Packit 6c4009
	ns_r_noerror = 0,	/*%< No error occurred. */
Packit 6c4009
	ns_r_formerr = 1,	/*%< Format error. */
Packit 6c4009
	ns_r_servfail = 2,	/*%< Server failure. */
Packit 6c4009
	ns_r_nxdomain = 3,	/*%< Name error. */
Packit 6c4009
	ns_r_notimpl = 4,	/*%< Unimplemented. */
Packit 6c4009
	ns_r_refused = 5,	/*%< Operation refused. */
Packit 6c4009
	/* these are for BIND_UPDATE */
Packit 6c4009
	ns_r_yxdomain = 6,	/*%< Name exists */
Packit 6c4009
	ns_r_yxrrset = 7,	/*%< RRset exists */
Packit 6c4009
	ns_r_nxrrset = 8,	/*%< RRset does not exist */
Packit 6c4009
	ns_r_notauth = 9,	/*%< Not authoritative for zone */
Packit 6c4009
	ns_r_notzone = 10,	/*%< Zone of record different from zone section */
Packit 6c4009
	ns_r_max = 11,
Packit 6c4009
	/* The following are EDNS extended rcodes */
Packit 6c4009
	ns_r_badvers = 16,
Packit 6c4009
	/* The following are TSIG errors */
Packit 6c4009
	ns_r_badsig = 16,
Packit 6c4009
	ns_r_badkey = 17,
Packit 6c4009
	ns_r_badtime = 18
Packit 6c4009
} ns_rcode;
Packit 6c4009
Packit 6c4009
/* BIND_UPDATE */
Packit 6c4009
typedef enum __ns_update_operation {
Packit 6c4009
	ns_uop_delete = 0,
Packit 6c4009
	ns_uop_add = 1,
Packit 6c4009
	ns_uop_max = 2
Packit 6c4009
} ns_update_operation;
Packit 6c4009
Packit 6c4009
/*%
Packit 6c4009
 * This structure is used for TSIG authenticated messages
Packit 6c4009
 */
Packit 6c4009
struct ns_tsig_key {
Packit 6c4009
        char name[NS_MAXDNAME], alg[NS_MAXDNAME];
Packit 6c4009
        unsigned char *data;
Packit 6c4009
        int len;
Packit 6c4009
};
Packit 6c4009
typedef struct ns_tsig_key ns_tsig_key;
Packit 6c4009
Packit 6c4009
/*%
Packit 6c4009
 * This structure is used for TSIG authenticated TCP messages
Packit 6c4009
 */
Packit 6c4009
struct ns_tcp_tsig_state {
Packit 6c4009
	int counter;
Packit 6c4009
	struct dst_key *key;
Packit 6c4009
	void *ctx;
Packit 6c4009
	unsigned char sig[NS_PACKETSZ];
Packit 6c4009
	int siglen;
Packit 6c4009
};
Packit 6c4009
typedef struct ns_tcp_tsig_state ns_tcp_tsig_state;
Packit 6c4009
Packit 6c4009
#define NS_TSIG_FUDGE 300
Packit 6c4009
#define NS_TSIG_TCP_COUNT 100
Packit 6c4009
#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT"
Packit 6c4009
Packit 6c4009
#define NS_TSIG_ERROR_NO_TSIG -10
Packit 6c4009
#define NS_TSIG_ERROR_NO_SPACE -11
Packit 6c4009
#define NS_TSIG_ERROR_FORMERR -12
Packit 6c4009
Packit 6c4009
/*%
Packit 6c4009
 * Currently defined type values for resources and queries.
Packit 6c4009
 */
Packit 6c4009
typedef enum __ns_type
Packit 6c4009
  {
Packit 6c4009
    ns_t_invalid = 0,
Packit 6c4009
Packit 6c4009
    ns_t_a = 1,
Packit 6c4009
    ns_t_ns = 2,
Packit 6c4009
    ns_t_md = 3,
Packit 6c4009
    ns_t_mf = 4,
Packit 6c4009
    ns_t_cname = 5,
Packit 6c4009
    ns_t_soa = 6,
Packit 6c4009
    ns_t_mb = 7,
Packit 6c4009
    ns_t_mg = 8,
Packit 6c4009
    ns_t_mr = 9,
Packit 6c4009
    ns_t_null = 10,
Packit 6c4009
    ns_t_wks = 11,
Packit 6c4009
    ns_t_ptr = 12,
Packit 6c4009
    ns_t_hinfo = 13,
Packit 6c4009
    ns_t_minfo = 14,
Packit 6c4009
    ns_t_mx = 15,
Packit 6c4009
    ns_t_txt = 16,
Packit 6c4009
    ns_t_rp = 17,
Packit 6c4009
    ns_t_afsdb = 18,
Packit 6c4009
    ns_t_x25 = 19,
Packit 6c4009
    ns_t_isdn = 20,
Packit 6c4009
    ns_t_rt = 21,
Packit 6c4009
    ns_t_nsap = 22,
Packit 6c4009
    ns_t_nsap_ptr = 23,
Packit 6c4009
    ns_t_sig = 24,
Packit 6c4009
    ns_t_key = 25,
Packit 6c4009
    ns_t_px = 26,
Packit 6c4009
    ns_t_gpos = 27,
Packit 6c4009
    ns_t_aaaa = 28,
Packit 6c4009
    ns_t_loc = 29,
Packit 6c4009
    ns_t_nxt = 30,
Packit 6c4009
    ns_t_eid = 31,
Packit 6c4009
    ns_t_nimloc = 32,
Packit 6c4009
    ns_t_srv = 33,
Packit 6c4009
    ns_t_atma = 34,
Packit 6c4009
    ns_t_naptr = 35,
Packit 6c4009
    ns_t_kx = 36,
Packit 6c4009
    ns_t_cert = 37,
Packit 6c4009
    ns_t_a6 = 38,
Packit 6c4009
    ns_t_dname = 39,
Packit 6c4009
    ns_t_sink = 40,
Packit 6c4009
    ns_t_opt = 41,
Packit 6c4009
    ns_t_apl = 42,
Packit 6c4009
    ns_t_ds = 43,
Packit 6c4009
    ns_t_sshfp = 44,
Packit 6c4009
    ns_t_ipseckey = 45,
Packit 6c4009
    ns_t_rrsig = 46,
Packit 6c4009
    ns_t_nsec = 47,
Packit 6c4009
    ns_t_dnskey = 48,
Packit 6c4009
    ns_t_dhcid = 49,
Packit 6c4009
    ns_t_nsec3 = 50,
Packit 6c4009
    ns_t_nsec3param = 51,
Packit 6c4009
    ns_t_tlsa = 52,
Packit 6c4009
    ns_t_smimea = 53,
Packit 6c4009
    ns_t_hip = 55,
Packit 6c4009
    ns_t_ninfo = 56,
Packit 6c4009
    ns_t_rkey = 57,
Packit 6c4009
    ns_t_talink = 58,
Packit 6c4009
    ns_t_cds = 59,
Packit 6c4009
    ns_t_cdnskey = 60,
Packit 6c4009
    ns_t_openpgpkey = 61,
Packit 6c4009
    ns_t_csync = 62,
Packit 6c4009
    ns_t_spf = 99,
Packit 6c4009
    ns_t_uinfo = 100,
Packit 6c4009
    ns_t_uid = 101,
Packit 6c4009
    ns_t_gid = 102,
Packit 6c4009
    ns_t_unspec = 103,
Packit 6c4009
    ns_t_nid = 104,
Packit 6c4009
    ns_t_l32 = 105,
Packit 6c4009
    ns_t_l64 = 106,
Packit 6c4009
    ns_t_lp = 107,
Packit 6c4009
    ns_t_eui48 = 108,
Packit 6c4009
    ns_t_eui64 = 109,
Packit 6c4009
    ns_t_tkey = 249,
Packit 6c4009
    ns_t_tsig = 250,
Packit 6c4009
    ns_t_ixfr = 251,
Packit 6c4009
    ns_t_axfr = 252,
Packit 6c4009
    ns_t_mailb = 253,
Packit 6c4009
    ns_t_maila = 254,
Packit 6c4009
    ns_t_any = 255,
Packit 6c4009
    ns_t_uri = 256,
Packit 6c4009
    ns_t_caa = 257,
Packit 6c4009
    ns_t_avc = 258,
Packit 6c4009
    ns_t_ta = 32768,
Packit 6c4009
    ns_t_dlv = 32769,
Packit 6c4009
Packit 6c4009
    ns_t_max = 65536
Packit 6c4009
  } ns_type;
Packit 6c4009
Packit 6c4009
/*%
Packit 6c4009
 * Values for class field
Packit 6c4009
 */
Packit 6c4009
typedef enum __ns_class {
Packit 6c4009
	ns_c_invalid = 0,	/*%< Cookie. */
Packit 6c4009
	ns_c_in = 1,		/*%< Internet. */
Packit 6c4009
	ns_c_2 = 2,		/*%< unallocated/unsupported. */
Packit 6c4009
	ns_c_chaos = 3,		/*%< MIT Chaos-net. */
Packit 6c4009
	ns_c_hs = 4,		/*%< MIT Hesiod. */
Packit 6c4009
	/* Query class values which do not appear in resource records */
Packit 6c4009
	ns_c_none = 254,	/*%< for prereq. sections in update requests */
Packit 6c4009
	ns_c_any = 255,		/*%< Wildcard match. */
Packit 6c4009
	ns_c_max = 65536
Packit 6c4009
} ns_class;
Packit 6c4009
Packit 6c4009
/* Certificate type values in CERT resource records.  */
Packit 6c4009
typedef enum __ns_cert_types {
Packit 6c4009
	cert_t_pkix = 1,	/*%< PKIX (X.509v3) */
Packit 6c4009
	cert_t_spki = 2,	/*%< SPKI */
Packit 6c4009
	cert_t_pgp  = 3,	/*%< PGP */
Packit 6c4009
	cert_t_url  = 253,	/*%< URL private type */
Packit 6c4009
	cert_t_oid  = 254	/*%< OID private type */
Packit 6c4009
} ns_cert_types;
Packit 6c4009
Packit 6c4009
/*%
Packit 6c4009
 * EDNS0 extended flags and option codes, host order.
Packit 6c4009
 */
Packit 6c4009
#define NS_OPT_DNSSEC_OK        0x8000U
Packit 6c4009
#define NS_OPT_NSID		3
Packit 6c4009
Packit 6c4009
/*%
Packit 6c4009
 * Inline versions of get/put short/long.  Pointer is advanced.
Packit 6c4009
 */
Packit 6c4009
#define NS_GET16(s, cp) do { \
Packit 6c4009
	const unsigned char *t_cp = (const unsigned char *)(cp); \
Packit 6c4009
	(s) = ((uint16_t)t_cp[0] << 8) \
Packit 6c4009
	    | ((uint16_t)t_cp[1]) \
Packit 6c4009
	    ; \
Packit 6c4009
	(cp) += NS_INT16SZ; \
Packit 6c4009
} while (0)
Packit 6c4009
Packit 6c4009
#define NS_GET32(l, cp) do { \
Packit 6c4009
	const unsigned char *t_cp = (const unsigned char *)(cp); \
Packit 6c4009
	(l) = ((uint32_t)t_cp[0] << 24) \
Packit 6c4009
	    | ((uint32_t)t_cp[1] << 16) \
Packit 6c4009
	    | ((uint32_t)t_cp[2] << 8) \
Packit 6c4009
	    | ((uint32_t)t_cp[3]) \
Packit 6c4009
	    ; \
Packit 6c4009
	(cp) += NS_INT32SZ; \
Packit 6c4009
} while (0)
Packit 6c4009
Packit 6c4009
#define NS_PUT16(s, cp) do { \
Packit 6c4009
	uint16_t t_s = (uint16_t)(s); \
Packit 6c4009
	unsigned char *t_cp = (unsigned char *)(cp); \
Packit 6c4009
	*t_cp++ = t_s >> 8; \
Packit 6c4009
	*t_cp   = t_s; \
Packit 6c4009
	(cp) += NS_INT16SZ; \
Packit 6c4009
} while (0)
Packit 6c4009
Packit 6c4009
#define NS_PUT32(l, cp) do { \
Packit 6c4009
	uint32_t t_l = (uint32_t)(l); \
Packit 6c4009
	unsigned char *t_cp = (unsigned char *)(cp); \
Packit 6c4009
	*t_cp++ = t_l >> 24; \
Packit 6c4009
	*t_cp++ = t_l >> 16; \
Packit 6c4009
	*t_cp++ = t_l >> 8; \
Packit 6c4009
	*t_cp   = t_l; \
Packit 6c4009
	(cp) += NS_INT32SZ; \
Packit 6c4009
} while (0)
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
int		ns_msg_getflag (ns_msg, int) __THROW;
Packit 6c4009
unsigned int	ns_get16 (const unsigned char *) __THROW;
Packit 6c4009
unsigned long	ns_get32 (const unsigned char *) __THROW;
Packit 6c4009
void		ns_put16 (unsigned int, unsigned char *) __THROW;
Packit 6c4009
void		ns_put32 (unsigned long, unsigned char *) __THROW;
Packit 6c4009
int		ns_initparse (const unsigned char *, int, ns_msg *) __THROW;
Packit 6c4009
int		ns_skiprr (const unsigned char *, const unsigned char *,
Packit 6c4009
			   ns_sect, int) __THROW;
Packit 6c4009
int		ns_parserr (ns_msg *, ns_sect, int, ns_rr *) __THROW;
Packit 6c4009
int		ns_sprintrr (const ns_msg *, const ns_rr *,
Packit 6c4009
			     const char *, const char *, char *, size_t)
Packit 6c4009
     __THROW;
Packit 6c4009
int		ns_sprintrrf (const unsigned char *, size_t, const char *,
Packit 6c4009
			      ns_class, ns_type, unsigned long,
Packit 6c4009
			      const unsigned char *, size_t, const char *,
Packit 6c4009
			      const char *, char *, size_t) __THROW;
Packit 6c4009
int		ns_format_ttl (unsigned long, char *, size_t) __THROW;
Packit 6c4009
int		ns_parse_ttl (const char *, unsigned long *) __THROW;
Packit 6c4009
uint32_t	ns_datetosecs (const char *, int *) __THROW;
Packit 6c4009
int		ns_name_ntol (const unsigned char *, unsigned char *, size_t)
Packit 6c4009
     __THROW;
Packit 6c4009
int		ns_name_ntop (const unsigned char *, char *, size_t) __THROW;
Packit 6c4009
int		ns_name_pton (const char *, unsigned char *, size_t) __THROW;
Packit 6c4009
int		ns_name_unpack (const unsigned char *, const unsigned char *,
Packit 6c4009
				const unsigned char *, unsigned char *, size_t)
Packit 6c4009
     __THROW;
Packit 6c4009
int		ns_name_pack (const unsigned char *, unsigned char *, int,
Packit 6c4009
			      const unsigned char **, const unsigned char **)
Packit 6c4009
     __THROW;
Packit 6c4009
int		ns_name_uncompress (const unsigned char *,
Packit 6c4009
				    const unsigned char *,
Packit 6c4009
				    const unsigned char *,
Packit 6c4009
				    char *, size_t) __THROW;
Packit 6c4009
int		ns_name_compress (const char *, unsigned char *, size_t,
Packit 6c4009
				  const unsigned char **,
Packit 6c4009
				  const unsigned char **) __THROW;
Packit 6c4009
int		ns_name_skip (const unsigned char **, const unsigned char *)
Packit 6c4009
     __THROW;
Packit 6c4009
void		ns_name_rollback (const unsigned char *,
Packit 6c4009
				  const unsigned char **,
Packit 6c4009
				  const unsigned char **) __THROW;
Packit 6c4009
int		ns_samedomain (const char *, const char *) __THROW;
Packit 6c4009
int		ns_subdomain (const char *, const char *) __THROW;
Packit 6c4009
int		ns_makecanon (const char *, char *, size_t) __THROW;
Packit 6c4009
int		ns_samename (const char *, const char *) __THROW;
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#include <arpa/nameser_compat.h>
Packit 6c4009
Packit 6c4009
#endif /* !_ARPA_NAMESER_H_ */
Packit 6c4009
/*! \file */