Print this page
2169 arpa/nameser_compat.h: wrong macros
Reviewed by: Dan McDonald <danmcd@omniti.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/head/arpa/nameser_compat.h
+++ new/usr/src/head/arpa/nameser_compat.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 27 /*
28 28 * Copyright(c) 1983, 1989
29 29 * The Regents of the University of California. All rights reserved.
30 30 *
31 31 * Redistribution and use in source and binary forms, with or without
32 32 * modification, are permitted provided that the following conditions
33 33 * are met:
34 34 * 1. Redistributions of source code must retain the above copyright
35 35 * notice, this list of conditions and the following disclaimer.
36 36 * 2. Redistributions in binary form must reproduce the above copyright
37 37 * notice, this list of conditions and the following disclaimer in the
38 38 * documentation and/or other materials provided with the distribution.
39 39 * 3. All advertising materials mentioning features or use of this software
40 40 * must display the following acknowledgement:
41 41 * This product includes software developed by the University of
42 42 * California, Berkeley and its contributors.
43 43 * 4. Neither the name of the University nor the names of its contributors
44 44 * may be used to endorse or promote products derived from this software
45 45 * without specific prior written permission.
46 46 *
47 47 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
48 48 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
49 49 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
50 50 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
51 51 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
52 52 * DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
53 53 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
54 54 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
55 55 * LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
56 56 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
57 57 * SUCH DAMAGE.
|
↓ open down ↓ |
57 lines elided |
↑ open up ↑ |
58 58 */
59 59
60 60 /*
61 61 * from nameser.h 8.1 (Berkeley) 6/2/93
62 62 * $Id: nameser_compat.h,v 8.15 2002/07/17 07:01:02 marka Exp $
63 63 */
64 64
65 65 #ifndef _ARPA_NAMESER_COMPAT_H
66 66 #define _ARPA_NAMESER_COMPAT_H
67 67
68 -#pragma ident "%Z%%M% %I% %E% SMI"
69 -
70 68 #ifdef __cplusplus
71 69 extern "C" {
72 70 #endif
73 71
74 72 #define __BIND 19950621 /* (DEAD) interface version stamp. */
75 73
76 74 #ifndef BYTE_ORDER
77 75 #if (BSD >= 199103)
78 76 #include <machine/endian.h>
79 77 #else
80 78 #ifdef linux
81 79 #include <endian.h>
82 80 #else
83 81 #define LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */
84 82 #define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
85 83 #define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */
86 84
87 85 #if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \
88 86 defined(__i386) || defined(__amd64) || \
89 87 defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \
90 88 defined(__alpha__) || defined(__alpha) || \
91 89 (defined(__Lynx__) && defined(__x86__))
92 90 #define BYTE_ORDER LITTLE_ENDIAN
93 91 #endif
94 92
95 93 #if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
96 94 defined(__sparc) || \
97 95 defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
98 96 defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\
99 97 defined(apollo) || defined(__convex__) || defined(_CRAY) || \
100 98 defined(__hppa) || defined(__hp9000) || \
101 99 defined(__hp9000s300) || defined(__hp9000s700) || \
102 100 defined(__hp3000s900) || defined(MPE) || \
|
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
103 101 defined(BIT_ZERO_ON_LEFT) || defined(m68k) || \
104 102 (defined(__Lynx__) && \
105 103 (defined(__68k__) || defined(__sparc__) || defined(__powerpc__)))
106 104 #define BYTE_ORDER BIG_ENDIAN
107 105 #endif
108 106 #endif /* linux */
109 107 #endif /* BSD */
110 108 #endif /* BYTE_ORDER */
111 109
112 110 #if !defined(BYTE_ORDER) || \
113 - (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
114 - BYTE_ORDER != PDP_ENDIAN)
115 - /*
116 - * you must determine what the correct bit order is for
117 - * your compiler - the next line is an intentional error
118 - * which will force your compiles to bomb until you fix
119 - * the above macros.
120 - */
121 - error "Undefined or invalid BYTE_ORDER";
111 + ((BYTE_ORDER != BIG_ENDIAN) && (BYTE_ORDER != LITTLE_ENDIAN) && \
112 + (BYTE_ORDER != PDP_ENDIAN))
113 +/*
114 + * you must determine what the correct bit order is for
115 + * your compiler - the next line is an intentional error
116 + * which will force your compiles to bomb until you fix
117 + * the above macros.
118 + */
119 +#error "Undefined or invalid BYTE_ORDER";
122 120 #endif
123 121
124 122 /*
125 123 * Structure for query header. The order of the fields is machine- and
126 124 * compiler-dependent, depending on the byte/bit order and the layout
127 125 * of bit fields. We use bit fields only in int variables, as this
128 126 * is all ANSI requires. This requires a somewhat confusing rearrangement.
129 127 */
130 128
131 129 typedef struct {
132 130 unsigned id :16; /* query identification number */
133 131 #if BYTE_ORDER == BIG_ENDIAN
134 132 /* fields in third byte */
135 133 unsigned qr: 1; /* response flag */
136 134 unsigned opcode: 4; /* purpose of message */
137 135 unsigned aa: 1; /* authoritive answer */
138 136 unsigned tc: 1; /* truncated message */
139 137 unsigned rd: 1; /* recursion desired */
140 138 /* fields in fourth byte */
141 139 unsigned ra: 1; /* recursion available */
142 140 unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
143 141 unsigned ad: 1; /* authentic data from named */
144 142 unsigned cd: 1; /* checking disabled by resolver */
145 143 unsigned rcode :4; /* response code */
146 144 #endif
147 145 #if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
148 146 /* fields in third byte */
149 147 unsigned rd :1; /* recursion desired */
150 148 unsigned tc :1; /* truncated message */
151 149 unsigned aa :1; /* authoritive answer */
152 150 unsigned opcode :4; /* purpose of message */
153 151 unsigned qr :1; /* response flag */
154 152 /* fields in fourth byte */
155 153 unsigned rcode :4; /* response code */
156 154 unsigned cd: 1; /* checking disabled by resolver */
157 155 unsigned ad: 1; /* authentic data from named */
158 156 unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
159 157 unsigned ra :1; /* recursion available */
160 158 #endif
161 159 /* remaining bytes */
162 160 unsigned qdcount :16; /* number of question entries */
163 161 unsigned ancount :16; /* number of answer entries */
164 162 unsigned nscount :16; /* number of authority entries */
165 163 unsigned arcount :16; /* number of resource entries */
166 164 } HEADER;
167 165
168 166 #define PACKETSZ NS_PACKETSZ
169 167 #define MAXDNAME NS_MAXDNAME
170 168 #define MAXCDNAME NS_MAXCDNAME
171 169 #define MAXLABEL NS_MAXLABEL
172 170 #define HFIXEDSZ NS_HFIXEDSZ
173 171 #define QFIXEDSZ NS_QFIXEDSZ
174 172 #define RRFIXEDSZ NS_RRFIXEDSZ
175 173 #define INT32SZ NS_INT32SZ
176 174 #define INT16SZ NS_INT16SZ
177 175 #define INT8SZ NS_INT8SZ
178 176 #define INADDRSZ NS_INADDRSZ
179 177 #define IN6ADDRSZ NS_IN6ADDRSZ
180 178 #define INDIR_MASK NS_CMPRSFLGS
181 179 #define NAMESERVER_PORT NS_DEFAULTPORT
182 180
183 181 #define S_ZONE ns_s_zn
184 182 #define S_PREREQ ns_s_pr
185 183 #define S_UPDATE ns_s_ud
186 184 #define S_ADDT ns_s_ar
187 185
188 186 #define QUERY ns_o_query
189 187 #define IQUERY ns_o_iquery
190 188 #define STATUS ns_o_status
191 189 #define NS_NOTIFY_OP ns_o_notify
192 190 #define NS_UPDATE_OP ns_o_update
193 191
194 192 #define NOERROR ns_r_noerror
195 193 #define FORMERR ns_r_formerr
196 194 #define SERVFAIL ns_r_servfail
197 195 #define NXDOMAIN ns_r_nxdomain
198 196 #define NOTIMP ns_r_notimpl
199 197 #define REFUSED ns_r_refused
200 198 #define YXDOMAIN ns_r_yxdomain
201 199 #define YXRRSET ns_r_yxrrset
202 200 #define NXRRSET ns_r_nxrrset
203 201 #define NOTAUTH ns_r_notauth
204 202 #define NOTZONE ns_r_notzone
205 203 /* #define BADSIG ns_r_badsig */
206 204 /* #define BADKEY ns_r_badkey */
207 205 /* #define BADTIME ns_r_badtime */
208 206
209 207 #define DELETE ns_uop_delete
210 208 #ifndef ADD
211 209 #define ADD ns_uop_add
212 210 #endif
213 211
214 212 #define T_A ns_t_a
215 213 #define T_NS ns_t_ns
216 214 #define T_MD ns_t_md
217 215 #define T_MF ns_t_mf
218 216 #define T_CNAME ns_t_cname
219 217 #define T_SOA ns_t_soa
220 218 #define T_MB ns_t_mb
221 219 #define T_MG ns_t_mg
222 220 #define T_MR ns_t_mr
223 221 #define T_NULL ns_t_null
224 222 #define T_WKS ns_t_wks
225 223 #define T_PTR ns_t_ptr
226 224 #define T_HINFO ns_t_hinfo
227 225 #define T_MINFO ns_t_minfo
228 226 #define T_MX ns_t_mx
229 227 #define T_TXT ns_t_txt
230 228 #define T_RP ns_t_rp
231 229 #define T_AFSDB ns_t_afsdb
232 230 #define T_X25 ns_t_x25
233 231 #define T_ISDN ns_t_isdn
234 232 #define T_RT ns_t_rt
235 233 #define T_NSAP ns_t_nsap
236 234 #define T_NSAP_PTR ns_t_nsap_ptr
237 235 #define T_SIG ns_t_sig
238 236 #define T_KEY ns_t_key
239 237 #define T_PX ns_t_px
240 238 #define T_GPOS ns_t_gpos
241 239 #define T_AAAA ns_t_aaaa
242 240 #define T_LOC ns_t_loc
243 241 #define T_NXT ns_t_nxt
244 242 #define T_EID ns_t_eid
245 243 #define T_NIMLOC ns_t_nimloc
246 244 #define T_SRV ns_t_srv
247 245 #define T_ATMA ns_t_atma
248 246 #define T_NAPTR ns_t_naptr
249 247 #define T_A6 ns_t_a6
250 248 #define T_TSIG ns_t_tsig
251 249 #define T_IXFR ns_t_ixfr
252 250 #define T_AXFR ns_t_axfr
253 251 #define T_MAILB ns_t_mailb
254 252 #define T_MAILA ns_t_maila
255 253 #define T_ANY ns_t_any
256 254
257 255 #define C_IN ns_c_in
258 256 #define C_CHAOS ns_c_chaos
259 257 #define C_HS ns_c_hs
260 258 /* BIND_UPDATE */
261 259 #define C_NONE ns_c_none
262 260 #define C_ANY ns_c_any
263 261
264 262 #define GETSHORT NS_GET16
265 263 #define GETLONG NS_GET32
266 264 #define PUTSHORT NS_PUT16
267 265 #define PUTLONG NS_PUT32
268 266
269 267 #ifdef __cplusplus
270 268 }
271 269 #endif
272 270
273 271 #endif /* _ARPA_NAMESER_COMPAT_H */
|
↓ open down ↓ |
142 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX