epoc32/include/stdapis/arpa/nameser_compat.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/* Copyright (c) 1983, 1989
williamr@2
     2
 *    The Regents of the University of California.  All rights reserved.
williamr@2
     3
 * 
williamr@2
     4
 * Redistribution and use in source and binary forms, with or without
williamr@2
     5
 * modification, are permitted provided that the following conditions
williamr@2
     6
 * are met:
williamr@2
     7
 * 1. Redistributions of source code must retain the above copyright
williamr@2
     8
 *    notice, this list of conditions and the following disclaimer.
williamr@2
     9
 * 2. Redistributions in binary form must reproduce the above copyright
williamr@2
    10
 *    notice, this list of conditions and the following disclaimer in the
williamr@2
    11
 *    documentation and/or other materials provided with the distribution.
williamr@2
    12
 * 4. Neither the name of the University nor the names of its contributors
williamr@2
    13
 *    may be used to endorse or promote products derived from this software
williamr@2
    14
 *    without specific prior written permission.
williamr@2
    15
 * 
williamr@2
    16
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
williamr@2
    17
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
williamr@2
    18
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
williamr@2
    19
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
williamr@2
    20
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
williamr@2
    21
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
williamr@2
    22
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
williamr@2
    23
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
williamr@2
    24
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
williamr@2
    25
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
williamr@2
    26
 * SUCH DAMAGE.
williamr@2
    27
 */
williamr@2
    28
williamr@2
    29
/*
williamr@2
    30
 *      from nameser.h	8.1 (Berkeley) 6/2/93
williamr@2
    31
 *	From: Id: nameser_compat.h,v 8.9 1998/03/20 23:25:10 halley Exp
williamr@2
    32
 * $FreeBSD: src/include/arpa/nameser_compat.h,v 1.4 2002/05/28 04:32:25 mike Exp $
williamr@2
    33
 */
williamr@2
    34
williamr@2
    35
#ifndef _ARPA_NAMESER_COMPAT_
williamr@2
    36
#define	_ARPA_NAMESER_COMPAT_
williamr@2
    37
williamr@2
    38
#define	__BIND		19950621	/* (DEAD) interface version stamp. */
williamr@2
    39
williamr@4
    40
#include <stdapis/machine/endian.h>
williamr@2
    41
williamr@2
    42
#if !defined(_BYTE_ORDER) || \
williamr@2
    43
    (_BYTE_ORDER != _BIG_ENDIAN && _BYTE_ORDER != _LITTLE_ENDIAN && \
williamr@2
    44
    _BYTE_ORDER != _PDP_ENDIAN)
williamr@2
    45
	/* you must determine what the correct bit order is for
williamr@2
    46
	 * your compiler - the next line is an intentional error
williamr@2
    47
	 * which will force your compiles to bomb until you fix
williamr@2
    48
	 * the above macros.
williamr@2
    49
	 */
williamr@2
    50
#error "Undefined or invalid _BYTE_ORDER";
williamr@2
    51
#endif
williamr@2
    52
williamr@2
    53
/*
williamr@2
    54
 * Structure for query header.  The order of the fields is machine- and
williamr@2
    55
 * compiler-dependent, depending on the byte/bit order and the layout
williamr@2
    56
 * of bit fields.  We use bit fields only in int variables, as this
williamr@2
    57
 * is all ANSI requires.  This requires a somewhat confusing rearrangement.
williamr@2
    58
 */
williamr@2
    59
williamr@2
    60
typedef struct {
williamr@2
    61
	unsigned	id :16;		/* query identification number */
williamr@2
    62
#if _BYTE_ORDER == _BIG_ENDIAN
williamr@2
    63
			/* fields in third byte */
williamr@2
    64
	unsigned	qr: 1;		/* response flag */
williamr@2
    65
	unsigned	opcode: 4;	/* purpose of message */
williamr@2
    66
	unsigned	aa: 1;		/* authoritive answer */
williamr@2
    67
	unsigned	tc: 1;		/* truncated message */
williamr@2
    68
	unsigned	rd: 1;		/* recursion desired */
williamr@2
    69
			/* fields in fourth byte */
williamr@2
    70
	unsigned	ra: 1;		/* recursion available */
williamr@2
    71
	unsigned	unused :1;	/* unused bits (MBZ as of 4.9.3a3) */
williamr@2
    72
	unsigned	ad: 1;		/* authentic data from named */
williamr@2
    73
	unsigned	cd: 1;		/* checking disabled by resolver */
williamr@2
    74
	unsigned	rcode :4;	/* response code */
williamr@2
    75
#endif
williamr@2
    76
#if _BYTE_ORDER == _LITTLE_ENDIAN || _BYTE_ORDER == _PDP_ENDIAN
williamr@2
    77
			/* fields in third byte */
williamr@2
    78
	unsigned	rd :1;		/* recursion desired */
williamr@2
    79
	unsigned	tc :1;		/* truncated message */
williamr@2
    80
	unsigned	aa :1;		/* authoritive answer */
williamr@2
    81
	unsigned	opcode :4;	/* purpose of message */
williamr@2
    82
	unsigned	qr :1;		/* response flag */
williamr@2
    83
			/* fields in fourth byte */
williamr@2
    84
	unsigned	rcode :4;	/* response code */
williamr@2
    85
	unsigned	cd: 1;		/* checking disabled by resolver */
williamr@2
    86
	unsigned	ad: 1;		/* authentic data from named */
williamr@2
    87
	unsigned	unused :1;	/* unused bits (MBZ as of 4.9.3a3) */
williamr@2
    88
	unsigned	ra :1;		/* recursion available */
williamr@2
    89
#endif
williamr@2
    90
			/* remaining bytes */
williamr@2
    91
	unsigned	qdcount :16;	/* number of question entries */
williamr@2
    92
	unsigned	ancount :16;	/* number of answer entries */
williamr@2
    93
	unsigned	nscount :16;	/* number of authority entries */
williamr@2
    94
	unsigned	arcount :16;	/* number of resource entries */
williamr@2
    95
} HEADER;
williamr@2
    96
williamr@2
    97
#define PACKETSZ	NS_PACKETSZ
williamr@2
    98
#define MAXDNAME	NS_MAXDNAME
williamr@2
    99
#define MAXCDNAME	NS_MAXCDNAME
williamr@2
   100
#define MAXLABEL	NS_MAXLABEL
williamr@2
   101
#define	HFIXEDSZ	NS_HFIXEDSZ
williamr@2
   102
#define QFIXEDSZ	NS_QFIXEDSZ
williamr@2
   103
#define RRFIXEDSZ	NS_RRFIXEDSZ
williamr@2
   104
#define	INT32SZ		NS_INT32SZ
williamr@2
   105
#define	INT16SZ		NS_INT16SZ
williamr@2
   106
#define	INADDRSZ	NS_INADDRSZ
williamr@2
   107
#define	IN6ADDRSZ	NS_IN6ADDRSZ
williamr@2
   108
#define	INDIR_MASK	NS_CMPRSFLGS
williamr@2
   109
#define NAMESERVER_PORT	NS_DEFAULTPORT
williamr@2
   110
williamr@2
   111
#define S_ZONE		ns_s_zn
williamr@2
   112
#define S_PREREQ	ns_s_pr
williamr@2
   113
#define S_UPDATE	ns_s_ud
williamr@2
   114
#define S_ADDT		ns_s_ar
williamr@2
   115
williamr@2
   116
#define QUERY		ns_o_query
williamr@2
   117
#define IQUERY		ns_o_iquery
williamr@2
   118
#define STATUS		ns_o_status
williamr@2
   119
#define	NS_NOTIFY_OP	ns_o_notify
williamr@2
   120
#define	NS_UPDATE_OP	ns_o_update
williamr@2
   121
williamr@2
   122
#define NOERROR		ns_r_noerror
williamr@2
   123
#define FORMERR		ns_r_formerr
williamr@2
   124
#define SERVFAIL	ns_r_servfail
williamr@2
   125
#define NXDOMAIN	ns_r_nxdomain
williamr@2
   126
#define NOTIMP		ns_r_notimpl
williamr@2
   127
#define REFUSED		ns_r_refused
williamr@2
   128
#define YXDOMAIN	ns_r_yxdomain
williamr@2
   129
#define YXRRSET		ns_r_yxrrset
williamr@2
   130
#define NXRRSET		ns_r_nxrrset
williamr@2
   131
#define NOTAUTH		ns_r_notauth
williamr@2
   132
#define NOTZONE		ns_r_notzone
williamr@2
   133
williamr@2
   134
#define DELETE		ns_uop_delete
williamr@2
   135
#define ADD		ns_uop_add
williamr@2
   136
williamr@2
   137
#define T_A		ns_t_a
williamr@2
   138
#define T_NS		ns_t_ns
williamr@2
   139
#define T_MD		ns_t_md
williamr@2
   140
#define T_MF		ns_t_mf
williamr@2
   141
#define T_CNAME		ns_t_cname
williamr@2
   142
#define T_SOA		ns_t_soa
williamr@2
   143
#define T_MB		ns_t_mb
williamr@2
   144
#define T_MG		ns_t_mg
williamr@2
   145
#define T_MR		ns_t_mr
williamr@2
   146
#define T_NULL		ns_t_null
williamr@2
   147
#define T_WKS		ns_t_wks
williamr@2
   148
#define T_PTR		ns_t_ptr
williamr@2
   149
#define T_HINFO		ns_t_hinfo
williamr@2
   150
#define T_MINFO		ns_t_minfo
williamr@2
   151
#define T_MX		ns_t_mx
williamr@2
   152
#define T_TXT		ns_t_txt
williamr@2
   153
#define	T_RP		ns_t_rp
williamr@2
   154
#define T_AFSDB		ns_t_afsdb
williamr@2
   155
#define T_X25		ns_t_x25
williamr@2
   156
#define T_ISDN		ns_t_isdn
williamr@2
   157
#define T_RT		ns_t_rt
williamr@2
   158
#define T_NSAP		ns_t_nsap
williamr@2
   159
#define T_NSAP_PTR	ns_t_nsap_ptr
williamr@2
   160
#define	T_SIG		ns_t_sig
williamr@2
   161
#define	T_KEY		ns_t_key
williamr@2
   162
#define	T_PX		ns_t_px
williamr@2
   163
#define	T_GPOS		ns_t_gpos
williamr@2
   164
#define	T_AAAA		ns_t_aaaa
williamr@2
   165
#define	T_LOC		ns_t_loc
williamr@2
   166
#define	T_NXT		ns_t_nxt
williamr@2
   167
#define	T_EID		ns_t_eid
williamr@2
   168
#define	T_NIMLOC	ns_t_nimloc
williamr@2
   169
#define	T_SRV		ns_t_srv
williamr@2
   170
#define T_ATMA		ns_t_atma
williamr@2
   171
#define T_NAPTR		ns_t_naptr
williamr@2
   172
#define T_OPT		ns_t_opt
williamr@2
   173
#define	T_IXFR		ns_t_ixfr
williamr@2
   174
#define T_AXFR		ns_t_axfr
williamr@2
   175
#define T_MAILB		ns_t_mailb
williamr@2
   176
#define T_MAILA		ns_t_maila
williamr@2
   177
#define T_ANY		ns_t_any
williamr@2
   178
williamr@2
   179
#define C_IN		ns_c_in
williamr@2
   180
#define C_CHAOS		ns_c_chaos
williamr@2
   181
#define C_HS		ns_c_hs
williamr@2
   182
/* BIND_UPDATE */
williamr@2
   183
#define C_NONE		ns_c_none
williamr@2
   184
#define C_ANY		ns_c_any
williamr@2
   185
williamr@2
   186
#define	GETSHORT		NS_GET16
williamr@2
   187
#define	GETLONG			NS_GET32
williamr@2
   188
#define	PUTSHORT		NS_PUT16
williamr@2
   189
#define	PUTLONG			NS_PUT32
williamr@2
   190
williamr@2
   191
#endif /* _ARPA_NAMESER_COMPAT_ */