xref: /freebsd/contrib/ldns/ldns/error.h (revision 5afab0e5e56fe90a378fb57249600e7924e1cab2)
1 /**
2  * \file error.h
3  *
4  * Defines error numbers and functions to translate those to a readable string.
5  *
6  */
7 
8 /**
9  * a Net::DNS like library for C
10  *
11  * (c) NLnet Labs, 2005-2006
12  *
13  * See the file LICENSE for the license
14  */
15 
16 #ifndef LDNS_ERROR_H
17 #define LDNS_ERROR_H
18 
19 #include <ldns/util.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 enum ldns_enum_status {
26 	LDNS_STATUS_OK,
27 	LDNS_STATUS_EMPTY_LABEL,
28 	LDNS_STATUS_LABEL_OVERFLOW,
29 	LDNS_STATUS_DOMAINNAME_OVERFLOW,
30 	LDNS_STATUS_DOMAINNAME_UNDERFLOW,
31 	LDNS_STATUS_DDD_OVERFLOW,
32 	LDNS_STATUS_PACKET_OVERFLOW,
33 	LDNS_STATUS_INVALID_POINTER,
34 	LDNS_STATUS_MEM_ERR,
35 	LDNS_STATUS_INTERNAL_ERR,
36 	LDNS_STATUS_SSL_ERR,
37 	LDNS_STATUS_ERR,
38 	LDNS_STATUS_INVALID_INT,
39 	LDNS_STATUS_INVALID_IP4,
40 	LDNS_STATUS_INVALID_IP6,
41 	LDNS_STATUS_INVALID_STR,
42 	LDNS_STATUS_INVALID_B32_EXT,
43 	LDNS_STATUS_INVALID_B64,
44 	LDNS_STATUS_INVALID_HEX,
45 	LDNS_STATUS_INVALID_TIME,
46 	LDNS_STATUS_NETWORK_ERR,
47 	LDNS_STATUS_ADDRESS_ERR,
48 	LDNS_STATUS_FILE_ERR,
49 	LDNS_STATUS_UNKNOWN_INET,
50 	LDNS_STATUS_NOT_IMPL,
51 	LDNS_STATUS_NULL,
52 	LDNS_STATUS_CRYPTO_UNKNOWN_ALGO,
53 	LDNS_STATUS_CRYPTO_ALGO_NOT_IMPL,
54 	LDNS_STATUS_CRYPTO_NO_RRSIG,
55 	LDNS_STATUS_CRYPTO_NO_DNSKEY,
56 	LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY,
57 	LDNS_STATUS_CRYPTO_NO_DS,
58 	LDNS_STATUS_CRYPTO_NO_TRUSTED_DS,
59 	LDNS_STATUS_CRYPTO_NO_MATCHING_KEYTAG_DNSKEY,
60 	LDNS_STATUS_CRYPTO_VALIDATED,
61 	LDNS_STATUS_CRYPTO_BOGUS,
62 	LDNS_STATUS_CRYPTO_SIG_EXPIRED,
63 	LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED,
64 	LDNS_STATUS_CRYPTO_TSIG_BOGUS,
65 	LDNS_STATUS_CRYPTO_TSIG_ERR,
66 	LDNS_STATUS_CRYPTO_EXPIRATION_BEFORE_INCEPTION,
67 	LDNS_STATUS_CRYPTO_TYPE_COVERED_ERR,
68 	LDNS_STATUS_ENGINE_KEY_NOT_LOADED,
69 	LDNS_STATUS_NSEC3_ERR,
70 	LDNS_STATUS_RES_NO_NS,
71 	LDNS_STATUS_RES_QUERY,
72 	LDNS_STATUS_WIRE_INCOMPLETE_HEADER,
73 	LDNS_STATUS_WIRE_INCOMPLETE_QUESTION,
74 	LDNS_STATUS_WIRE_INCOMPLETE_ANSWER,
75 	LDNS_STATUS_WIRE_INCOMPLETE_AUTHORITY,
76 	LDNS_STATUS_WIRE_INCOMPLETE_ADDITIONAL,
77 	LDNS_STATUS_NO_DATA,
78 	LDNS_STATUS_CERT_BAD_ALGORITHM,
79 	LDNS_STATUS_SYNTAX_TYPE_ERR,
80 	LDNS_STATUS_SYNTAX_CLASS_ERR,
81 	LDNS_STATUS_SYNTAX_TTL_ERR,
82 	LDNS_STATUS_SYNTAX_INCLUDE_ERR_NOTIMPL,
83 	LDNS_STATUS_SYNTAX_RDATA_ERR,
84 	LDNS_STATUS_SYNTAX_DNAME_ERR,
85 	LDNS_STATUS_SYNTAX_VERSION_ERR,
86 	LDNS_STATUS_SYNTAX_ALG_ERR,
87 	LDNS_STATUS_SYNTAX_KEYWORD_ERR,
88 	LDNS_STATUS_SYNTAX_TTL,
89 	LDNS_STATUS_SYNTAX_ORIGIN,
90 	LDNS_STATUS_SYNTAX_INCLUDE,
91 	LDNS_STATUS_SYNTAX_EMPTY,
92 	LDNS_STATUS_SYNTAX_ITERATIONS_OVERFLOW,
93 	LDNS_STATUS_SYNTAX_MISSING_VALUE_ERR,
94 	LDNS_STATUS_SYNTAX_INTEGER_OVERFLOW,
95 	LDNS_STATUS_SYNTAX_BAD_ESCAPE,
96 	LDNS_STATUS_SOCKET_ERROR,
97 	LDNS_STATUS_SYNTAX_ERR,
98 	LDNS_STATUS_DNSSEC_EXISTENCE_DENIED,
99 	LDNS_STATUS_DNSSEC_NSEC_RR_NOT_COVERED,
100 	LDNS_STATUS_DNSSEC_NSEC_WILDCARD_NOT_COVERED,
101 	LDNS_STATUS_DNSSEC_NSEC3_ORIGINAL_NOT_FOUND,
102 	LDNS_STATUS_MISSING_RDATA_FIELDS_RRSIG,
103 	LDNS_STATUS_MISSING_RDATA_FIELDS_KEY,
104 	LDNS_STATUS_CRYPTO_SIG_EXPIRED_WITHIN_MARGIN,
105 	LDNS_STATUS_CRYPTO_SIG_NOT_INCEPTED_WITHIN_MARGIN,
106 	LDNS_STATUS_DANE_STATUS_MESSAGES,
107 	LDNS_STATUS_DANE_UNKNOWN_CERTIFICATE_USAGE,
108 	LDNS_STATUS_DANE_UNKNOWN_SELECTOR,
109 	LDNS_STATUS_DANE_UNKNOWN_MATCHING_TYPE,
110 	LDNS_STATUS_DANE_UNKNOWN_PROTOCOL,
111 	LDNS_STATUS_DANE_UNKNOWN_TRANSPORT,
112 	LDNS_STATUS_DANE_MISSING_EXTRA_CERTS,
113 	LDNS_STATUS_DANE_EXTRA_CERTS_NOT_USED,
114 	LDNS_STATUS_DANE_OFFSET_OUT_OF_RANGE,
115 	LDNS_STATUS_DANE_INSECURE,
116 	LDNS_STATUS_DANE_BOGUS,
117 	LDNS_STATUS_DANE_TLSA_DID_NOT_MATCH,
118 	LDNS_STATUS_DANE_NON_CA_CERTIFICATE,
119 	LDNS_STATUS_DANE_PKIX_DID_NOT_VALIDATE,
120 	LDNS_STATUS_DANE_PKIX_NO_SELF_SIGNED_TRUST_ANCHOR,
121 	LDNS_STATUS_EXISTS_ERR,
122 	LDNS_STATUS_INVALID_ILNP64,
123 	LDNS_STATUS_INVALID_EUI48,
124 	LDNS_STATUS_INVALID_EUI64,
125 	LDNS_STATUS_WIRE_RDATA_ERR,
126 	LDNS_STATUS_INVALID_TAG,
127 	LDNS_STATUS_TYPE_NOT_IN_BITMAP,
128 	LDNS_STATUS_INVALID_RDF_TYPE,
129 	LDNS_STATUS_RDATA_OVERFLOW,
130 	LDNS_STATUS_SYNTAX_SUPERFLUOUS_TEXT_ERR,
131 	LDNS_STATUS_NSEC3_DOMAINNAME_OVERFLOW,
132 	LDNS_STATUS_DANE_NEED_OPENSSL_GE_1_1_FOR_DANE_TA,
133 	LDNS_STATUS_ZONEMD_DOUBLE_OCCURRENCE,
134 	LDNS_STATUS_ZONEMD_UNKNOWN_SCHEME,
135 	LDNS_STATUS_ZONEMD_UNKNOWN_HASH,
136 	LDNS_STATUS_ZONEMD_INVALID_SOA,
137 	LDNS_STATUS_NO_ZONEMD,
138 	LDNS_STATUS_NO_VALID_ZONEMD,
139 	LDNS_STATUS_SYNTAX_SVCPARAM_KEY_ERR,
140 	LDNS_STATUS_SYNTAX_SVCPARAM_VALUE_ERR,
141 	LDNS_STATUS_RESERVED_SVCPARAM_KEY,
142 	LDNS_STATUS_NO_SVCPARAM_VALUE_EXPECTED,
143 	LDNS_STATUS_SVCPARAM_KEY_MORE_THAN_ONCE,
144 	LDNS_STATUS_INVALID_SVCPARAM_VALUE
145 };
146 typedef enum ldns_enum_status ldns_status;
147 
148 extern ldns_lookup_table ldns_error_str[];
149 
150 /**
151  * look up a descriptive text by each error. This function
152  * could use a better name
153  * \param[in] err ldns_status number
154  * \return the string for that error
155  */
156 const char *ldns_get_errorstr_by_id(ldns_status err);
157 
158 #ifdef __cplusplus
159 }
160 #endif
161 
162 #endif /* LDNS_ERROR_H */
163