00001 /* 00002 * Copyright (c) 1983, 1989 Regents of the University of California. 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms are permitted 00006 * provided that: (1) source distributions retain this entire copyright 00007 * notice and comment, and (2) distributions including binaries display 00008 * the following acknowledgement: ``This product includes software 00009 * developed by the University of California, Berkeley and its contributors'' 00010 * in the documentation or other materials provided with the distribution 00011 * and in all advertising materials mentioning features or use of this 00012 * software. Neither the name of the University nor the names of its 00013 * contributors may be used to endorse or promote products derived 00014 * from this software without specific prior written permission. 00015 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 00016 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 00017 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00018 * 00019 * @(#)nameser.h 5.24 (Berkeley) 6/1/90 00020 */ 00021 00022 /* 00023 server/ip/gen/nameser.h 00024 00025 Created Sept 18, 1991 by Philip Homburg 00026 */ 00027 00028 #ifndef __SERVER__IP__GEN__NAEMSER_H__ 00029 #define __SERVER__IP__GEN__NAEMSER_H__ 00030 00031 typedef struct dns_hdr 00032 { 00033 u16_t dh_id; 00034 u8_t dh_flag1; 00035 u8_t dh_flag2; 00036 u16_t dh_qdcount; 00037 u16_t dh_ancount; 00038 u16_t dh_nscount; 00039 u16_t dh_arcount; 00040 } dns_hdr_t; 00041 00042 typedef dns_hdr_t HEADER; 00043 00044 #define DHF_QR 0x80 00045 #define DHF_OPCODE 0x78 00046 #define DHF_AA 0x04 00047 #define DHF_TC 0x02 00048 #define DHF_RD 0x01 00049 00050 #define DHF_RA 0x80 00051 #define DHF_PR 0x40 00052 #define DHF_UNUSED 0x30 00053 #define DHF_RCODE 0x0F 00054 00055 /* 00056 Define constants based on rfc883 00057 */ 00058 #define PACKETSZ 512 /* maximum packet size */ 00059 #define MAXDNAME 256 /* maximum domain name */ 00060 #define MAXCDNAME 255 /* maximum compressed domain name */ 00061 #define MAXLABEL 63 /* maximum length of domain label */ 00062 /* Number of bytes of fixed size data in query structure */ 00063 #define QFIXEDSZ 4 00064 /* number of bytes of fixed size data in resource record */ 00065 #define RRFIXEDSZ 10 00066 #define INDIR_MASK 0xc0 00067 /* Defines for handling compressed domain names */ 00068 00069 /* 00070 Opcodes for DNS 00071 */ 00072 00073 #define QUERY 0x0 /* standard query */ 00074 #define IQUERY 0x1 /* inverse query */ 00075 00076 /* 00077 Error codes 00078 */ 00079 #define NOERROR 0 /* no error */ 00080 #define FORMERR 1 /* format error */ 00081 #define SERVFAIL 2 /* server failure */ 00082 #define NXDOMAIN 3 /* non existent domain */ 00083 #define NOTIMP 4 /* not implemented */ 00084 #define REFUSED 5 /* query refused */ 00085 /* non standard */ 00086 #define NOCHANGE 0xf /* update failed to change db */ 00087 00088 /* Valid types */ 00089 00090 #define T_A 1 /* host address */ 00091 #define T_NS 2 /* authoritative server */ 00092 #define T_MD 3 /* mail destination */ 00093 #define T_MF 4 /* mail forwarder */ 00094 #define T_CNAME 5 /* connonical name */ 00095 #define T_SOA 6 /* start of authority zone */ 00096 #define T_MB 7 /* mailbox domain name */ 00097 #define T_MG 8 /* mail group member */ 00098 #define T_MR 9 /* mail rename name */ 00099 #define T_NULL 10 /* null resource record */ 00100 #define T_WKS 11 /* well known service */ 00101 #define T_PTR 12 /* domain name pointer */ 00102 #define T_HINFO 13 /* host information */ 00103 #define T_MINFO 14 /* mailbox information */ 00104 #define T_MX 15 /* mail routing information */ 00105 #define T_TXT 16 /* text strings */ 00106 /* non standard */ 00107 #define T_UINFO 100 /* user (finger) information */ 00108 #define T_UID 101 /* user ID */ 00109 #define T_GID 102 /* group ID */ 00110 #define T_UNSPEC 103 /* Unspecified format (binary data) */ 00111 /* Query type values which do not appear in resource records */ 00112 #define T_AXFR 252 /* transfer zone of authority */ 00113 #define T_MAILB 253 /* transfer mailbox records */ 00114 #define T_MAILA 254 /* transfer mail agent records */ 00115 #define T_ANY 255 /* wildcard match */ 00116 00117 /* Valid classes */ 00118 00119 #define C_IN 1 /* the internet */ 00120 #define C_CHAOS 3 /* for chaos net (MIT) */ 00121 #define C_HS 4 /* for Hesiod name server at MIT */ 00122 00123 #define C_ANY 255 /* wildcard */ 00124 00125 #endif /* __SERVER__IP__GEN__NAEMSER_H__ */
1.4.6