Please wait until the page is fully downloaded and then press the "Expand" button or the blue line numbers.

0089000 /*
0089001  * Copyright (c) 1983, 1989 Regents of the University of California.
0089002  * All rights reserved.
0089003  *
0089004  * Redistribution and use in source and binary forms are permitted
0089005  * provided that: (1) source distributions retain this entire copyright
0089006  * notice and comment, and (2) distributions including binaries display
0089007  * the following acknowledgement: ``This product includes software
0089008  * developed by the University of California, Berkeley and its contributors''
0089009  * in the documentation or other materials provided with the distribution
0089010  * and in all advertising materials mentioning features or use of this
0089011  * software. Neither the name of the University nor the names of its
0089012  * contributors may be used to endorse or promote products derived
0089013  * from this software without specific prior written permission.
0089014  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
0089015  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
0089016  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
0089017  *
0089018  *       @(#)nameser.h       5.24 (Berkeley) 6/1/90
0089019  */
0089020 
0089021 /*
0089022 server/ip/gen/nameser.h
0089023 
0089024 Created Sept 18, 1991 by Philip Homburg
0089025 */
0089026 
0089027 #ifndef __SERVER__IP__GEN__NAEMSER_H__
0089028 #define __SERVER__IP__GEN__NAEMSER_H__
0089029 
0089030 typedef struct dns_hdr
0089031 {
0089032          u16_t dh_id;
0089033          u8_t dh_flag1;
0089034          u8_t dh_flag2;
0089035          u16_t dh_qdcount;
0089036          u16_t dh_ancount;
0089037          u16_t dh_nscount;
0089038          u16_t dh_arcount;
0089039 } dns_hdr_t;
0089040 
0089041 #define DHF_QR              0x80
0089042 #define DHF_OPCODE       0x78
0089043 #define DHF_AA              0x04
0089044 #define DHF_TC              0x02
0089045 #define DHF_RD              0x01
0089046 
0089047 #define DHF_RA              0x80
0089048 #define DHF_PR              0x40
0089049 #define DHF_UNUSED       0x30
0089050 #define DHF_RCODE       0x0F
0089051 
0089052 
0089053 /*
0089054 Define constants based on rfc883
0089055 */
0089056 #define PACKETSZ       512              /* maximum packet size */
0089057 #define MAXDNAME       256              /* maximum domain name */
0089058 #define MAXCDNAME       255              /* maximum compressed domain name */
0089059 #define MAXLABEL       63              /* maximum length of domain label */
0089060          /* Number of bytes of fixed size data in query structure */
0089061 #define QFIXEDSZ       4
0089062          /* number of bytes of fixed size data in resource record */
0089063 #define RRFIXEDSZ       10
0089064 #define INDIR_MASK       0xc0
0089065                            /* Defines for handling compressed domain names */
0089066 
0089067 /*
0089068 Opcodes for DNS
0089069 */
0089070 
0089071 #define QUERY              0x0                     /* standard query */
0089072 #define IQUERY              0x1                     /* inverse query */
0089073 
0089074 /*
0089075 Error codes
0089076 */
0089077 #define NOERROR              0                     /* no error */
0089078 #define FORMERR              1                     /* format error */
0089079 #define SERVFAIL       2                     /* server failure */
0089080 #define NXDOMAIN       3                     /* non existent domain */
0089081 #define NOTIMP              4                     /* not implemented */
0089082 #define REFUSED              5                     /* query refused */
0089083          /* non standard */
0089084 #define NOCHANGE       0xf                     /* update failed to change db */
0089085 
0089086 /* Valid types */
0089087 
0089088 #define T_A              1              /* host address */
0089089 #define T_NS              2              /* authoritative server */
0089090 #define T_MD              3              /* mail destination */
0089091 #define T_MF              4              /* mail forwarder */
0089092 #define T_CNAME              5              /* connonical name */
0089093 #define T_SOA              6              /* start of authority zone */
0089094 #define T_MB              7              /* mailbox domain name */
0089095 #define T_MG              8              /* mail group member */
0089096 #define T_MR              9              /* mail rename name */
0089097 #define T_NULL              10              /* null resource record */
0089098 #define T_WKS              11              /* well known service */
0089099 #define T_PTR              12              /* domain name pointer */
0089100 #define T_HINFO              13              /* host information */
0089101 #define T_MINFO              14              /* mailbox information */
0089102 #define T_MX              15              /* mail routing information */
0089103 #define T_TXT              16              /* text strings */
0089104          /* non standard */
0089105 #define T_UINFO              100              /* user (finger) information */
0089106 #define T_UID              101              /* user ID */
0089107 #define T_GID              102              /* group ID */
0089108 #define T_UNSPEC       103              /* Unspecified format (binary data) */
0089109          /* Query type values which do not appear in resource records */
0089110 #define T_AXFR              252              /* transfer zone of authority */
0089111 #define T_MAILB              253              /* transfer mailbox records */
0089112 #define T_MAILA              254              /* transfer mail agent records */
0089113 #define T_ANY              255              /* wildcard match */
0089114 
0089115 /* Valid classes */
0089116 
0089117 #define C_IN              1                     /* the internet */
0089118 #define C_CHAOS              3                     /* for chaos net (MIT) */
0089119 #define C_HS              4              /* for Hesiod name server at MIT */
0089120 
0089121 #define C_ANY              255                     /* wildcard */
0089122 
0089123 #endif /* __SERVER__IP__GEN__NAEMSER_H__ */