Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
3 * Portions copyright (c) 1993-1999 Symbian Ltd. All rights reserved.
12 * Copyright (c) 1983, 1989, 1993
13 * The Regents of the University of California. All rights reserved.
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 * 3. All advertising materials mentioning features or use of this software
24 * must display the following acknowledgement:
25 * This product includes software developed by the University of
26 * California, Berkeley and its contributors.
27 * 4. Neither the name of the University nor the names of its contributors
28 * may be used to endorse or promote products derived from this software
29 * without specific prior written permission.
31 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
32 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
35 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
39 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
40 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
46 * Permission to use, copy, modify, and distribute this software for any
47 * purpose with or without fee is hereby granted, provided that the above
48 * copyright notice and this permission notice appear in all copies, and that
49 * the name of Digital Equipment Corporation not be used in advertising or
50 * publicity pertaining to distribution of the document or software without
51 * specific, written prior permission.
53 * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
54 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
55 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
56 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
57 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
58 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
59 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
62 * Portions Copyright (c) 1995 by International Business Machines, Inc.
64 * International Business Machines, Inc. (hereinafter called IBM) grants
65 * permission under its copyrights to use, copy, modify, and distribute this
66 * Software with or without fee, provided that the above copyright notice and
67 * all paragraphs of this notice appear in all copies, and that the name of IBM
68 * not be used in connection with the marketing of any product incorporating
69 * the Software or modifications thereof, without specific, written prior
72 * To the extent it has a right to do so, IBM grants an immunity from suit
73 * under its patents, if any, for the use, sale or manufacture of products to
74 * the extent that such products are used for performing Domain Name System
75 * dynamic updates in TCP/IP networks by means of the Software. No immunity is
76 * granted for any product per se or for any other function of any product.
77 * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
78 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
79 * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
80 * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
81 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
82 * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
84 * @(#)nameser.h 8.2 (Berkeley) 2/16/94
85 * From Id: nameser.h,v 8.11 1996/10/08 04:51:02 vixie Exp
86 * $Id: nameser.h,v 1.11 1997/02/23 09:17:20 peter Exp $
89 #ifndef _ARPA_NAMESER_H_
90 #define _ARPA_NAMESER_H_
96 #include <sys/param.h>
97 #include <sys/types.h>
100 revision information. this is the release date in YYYYMMDD format.
101 it can change every day so the right thing to do with it is use it
102 in preprocessor commands such as "#if (__BIND > 19931104)". do not
103 compare for equality; rather, use it to determine whether your resolver
104 is new enough to contain a certain feature.
107 #define __BIND 19960801 /* interface version stamp */
110 Define constants based on rfc883
113 /** maximum packet size */
116 /** maximum presentation domain name */
117 #define MAXDNAME 1025
119 /** maximum compressed domain name */
120 #define MAXCDNAME 255
122 /** maximum length of domain label */
125 /** #/bytes of fixed data in header */
128 /** #/bytes of fixed data in query */
131 /** #/bytes of fixed data in r record */
134 /** for systems without 32-bit ints */
137 /** for systems without 16-bit ints */
147 Internet nameserver port number
149 #define NAMESERVER_PORT 53
153 Currently defined opcodes
156 /** standard query */
162 /** nameserver status query */
167 #define NS_NOTIFY_OP 0x4 /* notify secondary of SOA change */
171 Currently defined response codes
180 /** server failure */
183 /** non existent domain */
186 /** not implemented */
195 Type values for resources and queries
201 /** authoritative server */
204 /** mail destination */
207 /** mail forwarder */
210 /** canonical name */
213 /** start of authority zone */
216 /** mailbox domain name */
219 /** mail group member */
222 /** mail rename name */
225 /** null resource record */
228 /** well known service */
231 /** domain name pointer */
234 /** host information */
237 /** mailbox information */
240 /** mail routing information */
246 /** responsible person */
249 /** AFS cell database */
252 /** X_25 calling address */
255 /** ISDN calling address */
264 /** reverse NSAP lookup (deprecated) */
265 #define T_NSAP_PTR 23
267 /** security signature */
273 /** X.400 mail mapping */
276 /** geographical position (withdrawn) */
282 /** Location Information */
285 /** Next Valid Name in Zone */
288 /** Endpoint identifier */
291 /** Nimrod locator */
294 /** Server selection */
300 /** Naming Authority PoinTeR */
303 /** user (finger) information
314 /** Unspecified format (binary data) */
317 /** Query type values which do not appear in resource records
318 incremental zone transfer */
321 /** transfer zone of authority */
324 /** transfer mailbox records */
327 /** transfer mail agent records */
330 /** wildcard match */
334 Values for class field
336 #define C_IN 1 /* the arpa internet */
337 #define C_CHAOS 3 /* for chaos net (MIT) */
338 #define C_HS 4 /* for Hesiod name server (MIT) (XXX) */
339 /* Query class values which do not appear in resource records */
340 #define C_ANY 255 /* wildcard match */
343 Flags field of the KEY RR rdata
345 #define KEYFLAG_TYPEMASK 0xC000 /* Mask for "type" bits */
346 #define KEYFLAG_TYPE_AUTH_CONF 0x0000 /* Key usable for both */
347 #define KEYFLAG_TYPE_CONF_ONLY 0x8000 /* Key usable for confidentiality */
348 #define KEYFLAG_TYPE_AUTH_ONLY 0x4000 /* Key usable for authentication */
349 #define KEYFLAG_TYPE_NO_KEY 0xC000 /* No key usable for either; no key */
350 /** The type bits can also be interpreted independently, as single bits: */
351 #define KEYFLAG_NO_AUTH 0x8000 /* Key not usable for authentication */
352 #define KEYFLAG_NO_CONF 0x4000 /* Key not usable for confidentiality */
354 #define KEYFLAG_EXPERIMENTAL 0x2000 /* Security is *mandatory* if bit=0 */
355 #define KEYFLAG_RESERVED3 0x1000 /* reserved - must be zero */
356 #define KEYFLAG_RESERVED4 0x0800 /* reserved - must be zero */
357 #define KEYFLAG_USERACCOUNT 0x0400 /* key is assoc. with a user acct */
358 #define KEYFLAG_ENTITY 0x0200 /* key is assoc. with entity eg host */
359 #define KEYFLAG_ZONEKEY 0x0100 /* key is zone key for the zone named */
360 #define KEYFLAG_IPSEC 0x0080 /* key is for IPSEC use (host or user)*/
361 #define KEYFLAG_EMAIL 0x0040 /* key is for email (MIME security) */
362 #define KEYFLAG_RESERVED10 0x0020 /* reserved - must be zero */
363 #define KEYFLAG_RESERVED11 0x0010 /* reserved - must be zero */
364 #define KEYFLAG_SIGNATORYMASK 0x000F /* key can sign DNS RR's of same name */
366 #define KEYFLAG_RESERVED_BITMASK ( KEYFLAG_RESERVED3 | \
367 KEYFLAG_RESERVED4 | \
368 KEYFLAG_RESERVED10| KEYFLAG_RESERVED11)
371 The Algorithm field of the KEY and SIG RR's is an integer, {1..254}
373 #define ALGORITHM_MD5RSA 1 /* MD5 with RSA */
374 #define ALGORITHM_EXPIRE_ONLY 253 /* No alg, no security */
375 #define ALGORITHM_PRIVATE_OID 254 /* Key begins with OID indicating alg */
380 /** Size of a mod or exp in bits */
381 #define MIN_MD5RSA_KEY_PART_BITS 512
382 #define MAX_MD5RSA_KEY_PART_BITS 2552
383 /** Total of binary mod and exp, bytes */
384 #define MAX_MD5RSA_KEY_BYTES ((MAX_MD5RSA_KEY_PART_BITS+7/8)*2+3)
385 /** Max length of text sig block */
386 #define MAX_KEY_BASE64 (((MAX_MD5RSA_KEY_BYTES+2)/3)*4)
389 Status return codes for T_UNSPEC conversion routines
391 #define CONV_SUCCESS 0
392 #define CONV_OVERFLOW (-1)
393 #define CONV_BADFMT (-2)
394 #define CONV_BADCKSUM (-3)
395 #define CONV_BADBUFLEN (-4)
398 Structure for query header. The order of the fields is machine- and
399 compiler-dependent, depending on the byte/bit order and the layout
400 of bit fields. We use bit fields only in int variables, as this
401 is all ANSI requires. This requires a somewhat confusing rearrangement.
402 EPOC32 is little-endian
405 unsigned id :16; /* query identification number */
406 /* fields in third byte */
407 unsigned rd :1; /* recursion desired */
408 unsigned tc :1; /* truncated message */
409 unsigned aa :1; /* authoritative answer */
410 unsigned opcode :4; /* purpose of message */
411 unsigned qr :1; /* response flag */
412 /* fields in fourth byte */
413 unsigned rcode :4; /* response code */
414 unsigned cd: 1; /* checking disabled by resolver */
415 unsigned ad: 1; /* authentic data from named */
416 unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
417 unsigned ra :1; /* recursion available */
418 /* remaining bytes */
419 unsigned qdcount :16; /* number of question entries */
420 unsigned ancount :16; /* number of answer entries */
421 unsigned nscount :16; /* number of authority entries */
422 unsigned arcount :16; /* number of resource entries */
426 Defines for handling compressed domain names
428 #define INDIR_MASK 0xc0
430 extern u_int16_t _getshort (const u_char *);
431 extern u_int32_t _getlong (const u_char *);
434 Inline versions of get/put short/long. Pointer is advanced.
436 These macros demonstrate the property of C whereby it can be
437 portable or it can be elegant but rarely both.
439 #define GETSHORT(s, cp) { \
440 register u_char *t_cp = (u_char *)(cp); \
441 (s) = ((u_int16_t)t_cp[0] << 8) \
442 | ((u_int16_t)t_cp[1]) \
447 #define GETLONG(l, cp) { \
448 register u_char *t_cp = (u_char *)(cp); \
449 (l) = ((u_int32_t)t_cp[0] << 24) \
450 | ((u_int32_t)t_cp[1] << 16) \
451 | ((u_int32_t)t_cp[2] << 8) \
452 | ((u_int32_t)t_cp[3]) \
457 #define PUTSHORT(s, cp) { \
458 register u_int16_t t_s = (u_int16_t)(s); \
459 register u_char *t_cp = (u_char *)(cp); \
460 *t_cp++ = t_s >> 8; \
465 #define PUTLONG(l, cp) { \
466 register u_int32_t t_l = (u_int32_t)(l); \
467 register u_char *t_cp = (u_char *)(cp); \
468 *t_cp++ = t_l >> 24; \
469 *t_cp++ = t_l >> 16; \
470 *t_cp++ = t_l >> 8; \
478 #endif /* !_ARPA_NAMESER_H_ */