types.h 3.8 KB
Newer Older
Bob Halley's avatar
Bob Halley committed
1
/*
Bob Halley's avatar
Bob Halley committed
2
 * Copyright (C) 1998, 1999  Internet Software Consortium.
Bob Halley's avatar
Bob Halley committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16
 * 
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
 * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
 * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 * SOFTWARE.
 */
Bob Halley's avatar
add  
Bob Halley committed
17 18 19 20

#ifndef DNS_TYPES_H
#define DNS_TYPES_H 1

Bob Halley's avatar
Bob Halley committed
21 22 23 24 25 26 27 28
/*
 * Including this file gives you type declarations suitable for use in
 * .h files, which lets us avoid circular type reference problems.
 *
 * To actually use a type or get declarations of its methods, you must
 * include the appropriate .h file too.
 */

Bob Halley's avatar
Bob Halley committed
29
#include <isc/lang.h>
Bob Halley's avatar
add  
Bob Halley committed
30
#include <isc/region.h>
31 32
#include <isc/int.h>
#include <isc/list.h>
Bob Halley's avatar
add  
Bob Halley committed
33

Bob Halley's avatar
Bob Halley committed
34 35
ISC_LANG_BEGINDECLS

36
typedef isc_region_t				dns_label_t;
Bob Halley's avatar
Bob Halley committed
37
typedef struct dns_name				dns_name_t;
Bob Halley's avatar
Bob Halley committed
38
typedef ISC_LIST(dns_name_t)			dns_namelist_t;
Bob Halley's avatar
Bob Halley committed
39
typedef struct dns_fixedname			dns_fixedname_t;
Bob Halley's avatar
Bob Halley committed
40
typedef struct dns_db				dns_db_t;
Bob Halley's avatar
Bob Halley committed
41 42
typedef void					dns_dbnode_t;
typedef void					dns_dbversion_t;
Bob Halley's avatar
Bob Halley committed
43
typedef struct dns_dbiterator			dns_dbiterator_t;
44
typedef unsigned char				dns_offsets_t[128];
Bob Halley's avatar
Bob Halley committed
45 46
typedef struct dns_compress			dns_compress_t;
typedef struct dns_decompress			dns_decompress_t;
Mark Andrews's avatar
Mark Andrews committed
47
typedef isc_uint8_t				dns_secalg_t;
Mark Andrews's avatar
Mark Andrews committed
48 49
typedef isc_uint16_t				dns_rdataclass_t;
typedef isc_uint16_t				dns_rdatatype_t;
Mark Andrews's avatar
Mark Andrews committed
50 51
typedef isc_uint16_t				dns_rcode_t;
typedef isc_uint16_t				dns_cert_t;
52
typedef isc_uint32_t				dns_ttl_t;
Bob Halley's avatar
Bob Halley committed
53
typedef struct dns_rdata			dns_rdata_t;
Bob Halley's avatar
Bob Halley committed
54
typedef struct dns_rdatalist			dns_rdatalist_t;
55 56
typedef struct dns_signature			dns_signature_t;
typedef struct dns_rdataset			dns_rdataset_t;
Bob Halley's avatar
Bob Halley committed
57
typedef ISC_LIST(dns_rdataset_t)		dns_rdatasetlist_t;
58
typedef struct dns_rdatasetiter			dns_rdatasetiter_t;
Bob Halley's avatar
Bob Halley committed
59
typedef struct dns_dbtable			dns_dbtable_t;
Bob Halley's avatar
Bob Halley committed
60 61 62 63
typedef struct dns_resolver			dns_resolver_t;
typedef struct dns_fetch			dns_fetch_t;
typedef struct dns_delegation			dns_delegation_t;
typedef struct dns_forwarders			dns_forwarders_t;
64
typedef isc_uint16_t				dns_messageid_t;
Bob Halley's avatar
Bob Halley committed
65
typedef isc_uint16_t				dns_trust_t;
66
typedef struct dns_dispatch			dns_dispatch_t;
67
typedef struct dns_tsig_key			dns_tsig_key_t;
Bob Halley's avatar
add  
Bob Halley committed
68

Bob Halley's avatar
Bob Halley committed
69 70 71 72 73 74 75 76 77 78
typedef enum {
	dns_labeltype_ordinary = 0,
	dns_labeltype_bitstring = 1
} dns_labeltype_t;

typedef enum {
	dns_bitlabel_0 = 0,
	dns_bitlabel_1 = 1
} dns_bitlabel_t;

Bob Halley's avatar
Bob Halley committed
79 80 81 82 83 84 85 86
typedef enum {
	dns_namereln_none = 0,
	dns_namereln_contains = 1,
	dns_namereln_subdomain = 2,
	dns_namereln_equal = 3,
	dns_namereln_commonancestor = 4
} dns_namereln_t;

Mark Andrews's avatar
Mark Andrews committed
87
#include <dns/enumtype.h>
Bob Halley's avatar
types.h  
Bob Halley committed
88

Bob Halley's avatar
Bob Halley committed
89 90 91
/*
 * XXXRTH why don't these enums have typedefs?
 */
Bob Halley's avatar
types.h  
Bob Halley committed
92

Mark Andrews's avatar
Mark Andrews committed
93
enum {
94
	dns_rdatatype_none = 0,
Mark Andrews's avatar
Mark Andrews committed
95
	TYPEENUM
96
	dns_rdatatype_any = 255
Bob Halley's avatar
Bob Halley committed
97
};
Bob Halley's avatar
Bob Halley committed
98

Mark Andrews's avatar
Mark Andrews committed
99
#include <dns/enumclass.h>
Mark Andrews's avatar
Mark Andrews committed
100
enum {
Mark Andrews's avatar
Mark Andrews committed
101
	CLASSENUM
Mark Andrews's avatar
Mark Andrews committed
102
	dns_rdataclass_none = 0
103
	/* dns_rdataclass_any = 255  TSIG is class ANY specific */
Bob Halley's avatar
Bob Halley committed
104
};
105

Mark Andrews's avatar
Mark Andrews committed
106
enum {
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
	/* standard rcodes */
	dns_rcode_noerror = 0,
	dns_rcode_formerr = 1,
	dns_rcode_servfail = 2,
	dns_rcode_nxdomain = 3,
	dns_rcode_notimp = 4,
	dns_rcode_refused = 5,
	dns_rcode_yxdomain = 6,
	dns_rcode_yxrrset = 7,
	dns_rcode_nxrrset = 8,
	dns_rcode_notauth = 9,
	dns_rcode_notzone = 10,
	/* extended rcodes */
	dns_rcode_badsig = 16,
	dns_rcode_badkey = 17,
	dns_rcode_badtime = 18,
	dns_rcode_badmode = 19
Mark Andrews's avatar
Mark Andrews committed
124
};
Mark Andrews's avatar
Mark Andrews committed
125

126 127 128 129 130 131 132
/*
 * opcodes
 */
enum {
	dns_opcode_query = 0,
	dns_opcode_iquery = 1,
	dns_opcode_status = 2,
Andreas Gustafsson's avatar
Andreas Gustafsson committed
133
	dns_opcode_notify = 4,
134 135 136
	dns_opcode_update = 5		/* dynamic update */
};

Bob Halley's avatar
Bob Halley committed
137 138
ISC_LANG_ENDDECLS

Bob Halley's avatar
add  
Bob Halley committed
139
#endif /* DNS_TYPES_H */