result.h 4.9 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_RESULT_H
#define DNS_RESULT_H 1

Bob Halley's avatar
Bob Halley committed
21
#include <isc/lang.h>
Bob Halley's avatar
Bob Halley committed
22
23
#include <isc/result.h>
#include <isc/resultclass.h>
Bob Halley's avatar
Bob Halley committed
24

25
26
#include <dns/types.h>

Bob Halley's avatar
Bob Halley committed
27
28
ISC_LANG_BEGINDECLS

Bob Halley's avatar
Bob Halley committed
29
typedef isc_result_t dns_result_t;	/* XXXRTH for legacy use only */
Bob Halley's avatar
add    
Bob Halley committed
30

31
32
33
/*
 * XXXRTH  Legacy result codes, to be eliminated before public release.
 */
34
35
36
37
38
39
40
41
42
43
44
#define DNS_R_SUCCESS			ISC_R_SUCCESS
#define DNS_R_NOMEMORY			ISC_R_NOMEMORY
#define DNS_R_NOSPACE			ISC_R_NOSPACE
#define DNS_R_NOTIMPLEMENTED		ISC_R_NOTIMPLEMENTED
#define DNS_R_NOMORE			ISC_R_NOMORE
#define DNS_R_EXISTS			ISC_R_EXISTS
#define DNS_R_NOTFOUND			ISC_R_NOTFOUND
#define DNS_R_BADBASE64			ISC_R_BADBASE64
#define DNS_R_TIMEDOUT			ISC_R_TIMEDOUT
#define DNS_R_CANCELED			ISC_R_CANCELED
#define DNS_R_UNEXPECTED		ISC_R_UNEXPECTED
45
#define DNS_R_NXRDATASET		DNS_R_NXRRSET
Bob Halley's avatar
add    
Bob Halley committed
46

47
48
49
/*
 * DNS library result codes
 */
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#define DNS_R_LABELTOOLONG		(ISC_RESULTCLASS_DNS + 0)
#define DNS_R_BADESCAPE			(ISC_RESULTCLASS_DNS + 1)
#define DNS_R_BADBITSTRING		(ISC_RESULTCLASS_DNS + 2)
#define DNS_R_BITSTRINGTOOLONG		(ISC_RESULTCLASS_DNS + 3)
#define DNS_R_EMPTYLABEL		(ISC_RESULTCLASS_DNS + 4)
#define DNS_R_BADDOTTEDQUAD		(ISC_RESULTCLASS_DNS + 5)
#define DNS_R_UNEXPECTEDEND		(ISC_RESULTCLASS_DNS + 6)
#define DNS_R_UNKNOWN			(ISC_RESULTCLASS_DNS + 7)
#define DNS_R_BADLABELTYPE		(ISC_RESULTCLASS_DNS + 8)
#define DNS_R_BADPOINTER		(ISC_RESULTCLASS_DNS + 9)
#define DNS_R_TOOMANYHOPS		(ISC_RESULTCLASS_DNS + 10)
#define DNS_R_DISALLOWED		(ISC_RESULTCLASS_DNS + 11)
#define DNS_R_EXTRATOKEN		(ISC_RESULTCLASS_DNS + 12)
#define DNS_R_EXTRADATA			(ISC_RESULTCLASS_DNS + 13)
64
#define DNS_R_TEXTTOOLONG		(ISC_RESULTCLASS_DNS + 14)
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#define DNS_R_RANGE			(ISC_RESULTCLASS_DNS + 15)
#define DNS_R_SYNTAX			(ISC_RESULTCLASS_DNS + 16)
#define DNS_R_BADCKSUM			(ISC_RESULTCLASS_DNS + 17)
#define DNS_R_BADAAAA			(ISC_RESULTCLASS_DNS + 18)
#define DNS_R_NOOWNER			(ISC_RESULTCLASS_DNS + 19)
#define DNS_R_NOTTL			(ISC_RESULTCLASS_DNS + 20)
#define DNS_R_BADCLASS			(ISC_RESULTCLASS_DNS + 21)
#define DNS_R_UNEXPECTEDTOKEN		(ISC_RESULTCLASS_DNS + 22)
#define DNS_R_PARTIALMATCH		(ISC_RESULTCLASS_DNS + 23)
#define DNS_R_NEWORIGIN			(ISC_RESULTCLASS_DNS + 24)
#define DNS_R_UNCHANGED			(ISC_RESULTCLASS_DNS + 25)
#define DNS_R_BADTTL			(ISC_RESULTCLASS_DNS + 26)
#define DNS_R_NOREDATA			(ISC_RESULTCLASS_DNS + 27)
#define DNS_R_CONTINUE			(ISC_RESULTCLASS_DNS + 28)
#define DNS_R_DELEGATION		(ISC_RESULTCLASS_DNS + 29)
#define DNS_R_GLUE			(ISC_RESULTCLASS_DNS + 30)
#define DNS_R_DNAME			(ISC_RESULTCLASS_DNS + 31)
#define DNS_R_CNAME			(ISC_RESULTCLASS_DNS + 32)
83
84
85
86
#define DNS_R_BADDB			(ISC_RESULTCLASS_DNS + 33)
#define DNS_R_ZONECUT			(ISC_RESULTCLASS_DNS + 34)
#define DNS_R_BADZONE			(ISC_RESULTCLASS_DNS + 35) /* XXX MPA*/
#define DNS_R_MOREDATA			(ISC_RESULTCLASS_DNS + 36)
87
#define DNS_R_UPTODATE			(ISC_RESULTCLASS_DNS + 37)
88
89
#define DNS_R_TSIGVERIFYFAILURE		(ISC_RESULTCLASS_DNS + 38)
#define DNS_R_TSIGERRORSET		(ISC_RESULTCLASS_DNS + 39)
90

91
#define DNS_R_NRESULTS			40	/* Number of results */
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112

/*
 * DNS wire format rcodes
 *
 * By making these their own class we can easily convert them into the
 * wire-format rcode value simply by masking off the resultclass 
 */
#define DNS_R_NOERROR			(ISC_RESULTCLASS_DNSRCODE + 0)
#define DNS_R_FORMERR			(ISC_RESULTCLASS_DNSRCODE + 1)
#define DNS_R_SERVFAIL			(ISC_RESULTCLASS_DNSRCODE + 2)
#define DNS_R_NXDOMAIN			(ISC_RESULTCLASS_DNSRCODE + 3)
#define DNS_R_NOTIMP			(ISC_RESULTCLASS_DNSRCODE + 4)
#define DNS_R_REFUSED			(ISC_RESULTCLASS_DNSRCODE + 5)
#define DNS_R_YXDOMAIN			(ISC_RESULTCLASS_DNSRCODE + 6)
#define DNS_R_YXRRSET			(ISC_RESULTCLASS_DNSRCODE + 7)
#define DNS_R_NXRRSET			(ISC_RESULTCLASS_DNSRCODE + 8)
#define DNS_R_NOTAUTH			(ISC_RESULTCLASS_DNSRCODE + 9)
#define DNS_R_NOTZONE			(ISC_RESULTCLASS_DNSRCODE + 10)
#define DNS_R_BADVERS			(ISC_RESULTCLASS_DNSRCODE + 16)

#define DNS_R_NRCODERESULTS		17	/* Number of rcode results */
113

114
115
#define DNS_RESULT_ISRCODE(result) \
	(ISC_RESULTCLASS_INCLASS(ISC_RESULTCLASS_DNSRCODE, (result)))
Bob Halley's avatar
add    
Bob Halley committed
116

117
118
119
char *				dns_result_totext(isc_result_t);
void				dns_result_register(void);
dns_rcode_t			dns_result_torcode(isc_result_t result);
Bob Halley's avatar
add    
Bob Halley committed
120

Bob Halley's avatar
Bob Halley committed
121
122
ISC_LANG_ENDDECLS

Bob Halley's avatar
add    
Bob Halley committed
123
#endif /* DNS_RESULT_H */