/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1983, 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Portions Copyright (C) 2004, 2005, 2008, 2009
* Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1996-2003 Internet Software Consortium.
*
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
* $Id: nameser.h,v 8.50 2003/05/27 23:36:52 marka Exp $
*/
#ifndef _ARPA_NAMESER_H
#define _ARPA_NAMESER_H
#include <sys/isa_defs.h>
#ifdef __cplusplus
extern "C" {
#endif
#define BIND_4_COMPAT
/*
* Revision information. This is the release date in YYYYMMDD format.
* It can change every day so the right thing to do with it is use it
* in preprocessor commands such as "#if (__NAMESER > 19931104)". Do not
* compare for equality; rather, use it to determine whether your libresolv
*/
/*
* Define constants based on RFC 883, RFC 1034, RFC 1035
*/
/*
* These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
* in synch with it.
*/
typedef enum __ns_sect {
} ns_sect;
/*
* Network name (compressed or not) type. Equivalent to a pointer when used
* in a function prototype. Can be const'd.
*/
/*
* This is a message handle. It is caller allocated and has no dynamic data.
* This structure is intended to be opaque to all but ns_parse.c, thus the
* leading _'s on the member names. Use the accessor functions, not the _'s.
*/
typedef struct __ns_msg {
int _rrnum;
} ns_msg;
/*
* This is a newmsg handle, used when constructing new messages with
* ns_newmsg_init, et al.
*/
struct ns_newmsg {
};
/* Private data structure - do not use from outside library. */
extern struct _ns_flagdata _ns_flagdata[];
/* Accessor macros - this is part of the public interface. */
/*
* This is a parsed record. It is caller allocated and has no dynamic data.
*/
typedef struct __ns_rr {
} ns_rr;
/*
* Same thing, but using uncompressed network binary names, and real C types.
*/
typedef struct __ns_rr2 {
int type;
int rr_class;
int rdlength;
} ns_rr2;
/* Accessor macros - this is part of the public interface. */
/*
* These don't have to be in the same order as in the packet flags word,
* and they can even overlap in some cases, but they will need to be kept
* in synch with ns_parse.c:ns_flagdata[].
*/
typedef enum __ns_flag {
} ns_flag;
/*
* Currently defined opcodes.
*/
typedef enum __ns_opcode {
} ns_opcode;
/*
* Currently defined response codes.
*/
typedef enum __ns_rcode {
/* these are for BIND_UPDATE */
/* The following are EDNS extended rcodes */
/* The following are TSIG errors */
} ns_rcode;
/* BIND_UPDATE */
typedef enum __ns_update_operation {
ns_uop_delete = 0,
/*
* This RR-like structure is particular to UPDATE.
*/
struct ns_updrec {
};
/*
* This structure is used for TSIG authenticated messages
*/
struct ns_tsig_key {
unsigned char *data;
int len;
};
/*
* This structure is used for TSIG authenticated TCP messages
*/
struct ns_tcp_tsig_state {
int counter;
void *ctx;
int siglen;
};
/*
* Currently defined type values for resources and queries.
*/
typedef enum __ns_type {
} ns_type;
/* Exclusively a QTYPE? (not also an RTYPE) */
(t) == ns_t_mailb || (t) == ns_t_maila)
/* Some kind of meta-RR? (not a QTYPE, but also not an RTYPE) */
/* Exclusively an RTYPE? (not also a QTYPE or a meta-RR) */
(t) == ns_t_zxfr)
/*
* Values for class field
*/
typedef enum __ns_class {
/* Query class values which do not appear in resource records */
} ns_class;
/* DNSSEC constants. */
typedef enum __ns_key_types {
} ns_key_types;
typedef enum __ns_cert_types {
/* Flags field of the KEY RR rdata. */
/* The type bits can also be interpreted independently, as single bits: */
NS_KEY_RESERVED4 | \
NS_KEY_RESERVED5 | \
NS_KEY_RESERVED8 | \
NS_KEY_RESERVED9 | \
/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
/* Protocol values */
/* value 0 is reserved */
/* Signatures */
/* Total of binary mod and exp */
/* Max length of text sig block */
/* Offsets into SIG record rdata to find various values */
/* How RR types are represented as bit-flags in NXT records */
#define NS_NXT_BIT_SET(n, p) \
#define NS_NXT_BIT_CLEAR(n, p) \
#define NS_NXT_BIT_ISSET(n, p) \
/*
* EDNS0 extended flags, host order.
*/
/*
*/
; \
(cp) += NS_INT16SZ; \
} while (0)
; \
(cp) += NS_INT32SZ; \
} while (0)
(cp) += NS_INT16SZ; \
} while (0)
(cp) += NS_INT32SZ; \
} while (0)
/*
* ANSI C identifier hiding.
*/
int ns_msg_getflag(ns_msg, int);
const char *, const char *, char *, size_t);
size_t, const char *, const char *,
char *, size_t);
int ns_parse_ttl(const char *, ulong_t *);
const uchar_t **);
int ns_sign_tcp(uchar_t *, int *, int, int,
ns_tcp_tsig_state *, int);
int ns_sign_tcp2(uchar_t *, int *, int, int,
ns_tcp_tsig_state *, int,
int ns_sign_tcp_init(void *, const uchar_t *, int,
time_t *, int);
int ns_verify_tcp_init(void *, const uchar_t *, int,
int ns_samedomain(const char *, const char *);
int ns_subdomain(const char *, const char *);
int ns_makecanon(const char *, char *, size_t);
int ns_samename(const char *, const char *);
int ns_rdata_refers(ns_type,
const uchar_t *);
#ifdef BIND_4_COMPAT
#include <arpa/nameser_compat.h>
#endif
#ifdef __cplusplus
}
#endif
#endif /* !_ARPA_NAMESER_H */