diff --git a/lib/dns/Makefile.am b/lib/dns/Makefile.am index 6cb69a307f..15717a7bfe 100644 --- a/lib/dns/Makefile.am +++ b/lib/dns/Makefile.am @@ -147,8 +147,7 @@ libdns_la_HEADERS = \ dstdir = $(includedir)/dst dst_HEADERS = \ include/dst/dst.h \ - include/dst/gssapi.h \ - include/dst/result.h + include/dst/gssapi.h libdns_la_SOURCES = \ $(libdns_la_HEADERS) \ @@ -177,7 +176,6 @@ libdns_la_SOURCES = \ dst_parse.c \ dst_parse.h \ dst_pkcs11.h \ - dst_result.c \ dyndb.c \ ecs.c \ fixedname.c \ diff --git a/lib/dns/include/dns/result.h b/lib/dns/include/dns/result.h index 58e7426b3f..931e8ac766 100644 --- a/lib/dns/include/dns/result.h +++ b/lib/dns/include/dns/result.h @@ -27,180 +27,11 @@ */ #include /* Contractual promise. */ -/* - * DNS library result codes - */ -#define DNS_R_LABELTOOLONG (ISC_RESULTCLASS_DNS + 0) -#define DNS_R_BADESCAPE (ISC_RESULTCLASS_DNS + 1) -/* - * Since we dropped the support of bitstring labels, deprecate the related - * result codes too. - * - #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_INVALIDNS (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) -#define DNS_R_TEXTTOOLONG (ISC_RESULTCLASS_DNS + 14) -#define DNS_R_NOTZONETOP (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_NAMETOOLONG (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) -#define DNS_R_BADDB (ISC_RESULTCLASS_DNS + 33) -#define DNS_R_ZONECUT (ISC_RESULTCLASS_DNS + 34) -#define DNS_R_BADZONE (ISC_RESULTCLASS_DNS + 35) -#define DNS_R_MOREDATA (ISC_RESULTCLASS_DNS + 36) -#define DNS_R_UPTODATE (ISC_RESULTCLASS_DNS + 37) -#define DNS_R_TSIGVERIFYFAILURE (ISC_RESULTCLASS_DNS + 38) -#define DNS_R_TSIGERRORSET (ISC_RESULTCLASS_DNS + 39) -#define DNS_R_SIGINVALID (ISC_RESULTCLASS_DNS + 40) -#define DNS_R_SIGEXPIRED (ISC_RESULTCLASS_DNS + 41) -#define DNS_R_SIGFUTURE (ISC_RESULTCLASS_DNS + 42) -#define DNS_R_KEYUNAUTHORIZED (ISC_RESULTCLASS_DNS + 43) -#define DNS_R_INVALIDTIME (ISC_RESULTCLASS_DNS + 44) -#define DNS_R_EXPECTEDTSIG (ISC_RESULTCLASS_DNS + 45) -#define DNS_R_UNEXPECTEDTSIG (ISC_RESULTCLASS_DNS + 46) -#define DNS_R_INVALIDTKEY (ISC_RESULTCLASS_DNS + 47) -#define DNS_R_HINT (ISC_RESULTCLASS_DNS + 48) -#define DNS_R_DROP (ISC_RESULTCLASS_DNS + 49) -#define DNS_R_NOTLOADED (ISC_RESULTCLASS_DNS + 50) -#define DNS_R_NCACHENXDOMAIN (ISC_RESULTCLASS_DNS + 51) -#define DNS_R_NCACHENXRRSET (ISC_RESULTCLASS_DNS + 52) -#define DNS_R_WAIT (ISC_RESULTCLASS_DNS + 53) -#define DNS_R_NOTVERIFIEDYET (ISC_RESULTCLASS_DNS + 54) -#define DNS_R_NOIDENTITY (ISC_RESULTCLASS_DNS + 55) -#define DNS_R_NOJOURNAL (ISC_RESULTCLASS_DNS + 56) -#define DNS_R_ALIAS (ISC_RESULTCLASS_DNS + 57) -#define DNS_R_USETCP (ISC_RESULTCLASS_DNS + 58) -#define DNS_R_NOVALIDSIG (ISC_RESULTCLASS_DNS + 59) -#define DNS_R_NOVALIDNSEC (ISC_RESULTCLASS_DNS + 60) -#define DNS_R_NOTINSECURE (ISC_RESULTCLASS_DNS + 61) -#define DNS_R_UNKNOWNSERVICE (ISC_RESULTCLASS_DNS + 62) -#define DNS_R_RECOVERABLE (ISC_RESULTCLASS_DNS + 63) -#define DNS_R_UNKNOWNOPT (ISC_RESULTCLASS_DNS + 64) -#define DNS_R_UNEXPECTEDID (ISC_RESULTCLASS_DNS + 65) -#define DNS_R_SEENINCLUDE (ISC_RESULTCLASS_DNS + 66) -#define DNS_R_NOTEXACT (ISC_RESULTCLASS_DNS + 67) -#define DNS_R_BLACKHOLED (ISC_RESULTCLASS_DNS + 68) -#define DNS_R_BADALG (ISC_RESULTCLASS_DNS + 69) -#define DNS_R_METATYPE (ISC_RESULTCLASS_DNS + 70) -#define DNS_R_CNAMEANDOTHER (ISC_RESULTCLASS_DNS + 71) -#define DNS_R_SINGLETON (ISC_RESULTCLASS_DNS + 72) -#define DNS_R_HINTNXRRSET (ISC_RESULTCLASS_DNS + 73) -#define DNS_R_NOMASTERFILE (ISC_RESULTCLASS_DNS + 74) -#define DNS_R_UNKNOWNPROTO (ISC_RESULTCLASS_DNS + 75) -#define DNS_R_CLOCKSKEW (ISC_RESULTCLASS_DNS + 76) -#define DNS_R_BADIXFR (ISC_RESULTCLASS_DNS + 77) -#define DNS_R_NOTAUTHORITATIVE (ISC_RESULTCLASS_DNS + 78) -#define DNS_R_NOVALIDKEY (ISC_RESULTCLASS_DNS + 79) -#define DNS_R_OBSOLETE (ISC_RESULTCLASS_DNS + 80) -#define DNS_R_FROZEN (ISC_RESULTCLASS_DNS + 81) -#define DNS_R_UNKNOWNFLAG (ISC_RESULTCLASS_DNS + 82) -#define DNS_R_EXPECTEDRESPONSE (ISC_RESULTCLASS_DNS + 83) -#define DNS_R_NOVALIDDS (ISC_RESULTCLASS_DNS + 84) -#define DNS_R_NSISADDRESS (ISC_RESULTCLASS_DNS + 85) -#define DNS_R_REMOTEFORMERR (ISC_RESULTCLASS_DNS + 86) -#define DNS_R_TRUNCATEDTCP (ISC_RESULTCLASS_DNS + 87) -#define DNS_R_LAME (ISC_RESULTCLASS_DNS + 88) -#define DNS_R_UNEXPECTEDRCODE (ISC_RESULTCLASS_DNS + 89) -#define DNS_R_UNEXPECTEDOPCODE (ISC_RESULTCLASS_DNS + 90) -#define DNS_R_CHASEDSSERVERS (ISC_RESULTCLASS_DNS + 91) -#define DNS_R_EMPTYNAME (ISC_RESULTCLASS_DNS + 92) -#define DNS_R_EMPTYWILD (ISC_RESULTCLASS_DNS + 93) -#define DNS_R_BADBITMAP (ISC_RESULTCLASS_DNS + 94) -#define DNS_R_FROMWILDCARD (ISC_RESULTCLASS_DNS + 95) -#define DNS_R_BADOWNERNAME (ISC_RESULTCLASS_DNS + 96) -#define DNS_R_BADNAME (ISC_RESULTCLASS_DNS + 97) -#define DNS_R_DYNAMIC (ISC_RESULTCLASS_DNS + 98) -#define DNS_R_UNKNOWNCOMMAND (ISC_RESULTCLASS_DNS + 99) -#define DNS_R_MUSTBESECURE (ISC_RESULTCLASS_DNS + 100) -#define DNS_R_COVERINGNSEC (ISC_RESULTCLASS_DNS + 101) -#define DNS_R_MXISADDRESS (ISC_RESULTCLASS_DNS + 102) -#define DNS_R_DUPLICATE (ISC_RESULTCLASS_DNS + 103) -#define DNS_R_INVALIDNSEC3 (ISC_RESULTCLASS_DNS + 104) -#define DNS_R_NOTMASTER (ISC_RESULTCLASS_DNS + 105) -#define DNS_R_BROKENCHAIN (ISC_RESULTCLASS_DNS + 106) -#define DNS_R_EXPIRED (ISC_RESULTCLASS_DNS + 107) -#define DNS_R_NOTDYNAMIC (ISC_RESULTCLASS_DNS + 108) -#define DNS_R_BADEUI (ISC_RESULTCLASS_DNS + 109) -#define DNS_R_NTACOVERED (ISC_RESULTCLASS_DNS + 110) -#define DNS_R_BADCDS (ISC_RESULTCLASS_DNS + 111) -#define DNS_R_BADCDNSKEY (ISC_RESULTCLASS_DNS + 112) -#define DNS_R_OPTERR (ISC_RESULTCLASS_DNS + 113) -#define DNS_R_BADDNSTAP (ISC_RESULTCLASS_DNS + 114) -#define DNS_R_BADTSIG (ISC_RESULTCLASS_DNS + 115) -#define DNS_R_BADSIG0 (ISC_RESULTCLASS_DNS + 116) -#define DNS_R_TOOMANYRECORDS (ISC_RESULTCLASS_DNS + 117) -#define DNS_R_VERIFYFAILURE (ISC_RESULTCLASS_DNS + 118) -#define DNS_R_ATZONETOP (ISC_RESULTCLASS_DNS + 119) -#define DNS_R_NOKEYMATCH (ISC_RESULTCLASS_DNS + 120) -#define DNS_R_TOOMANYKEYS (ISC_RESULTCLASS_DNS + 121) -#define DNS_R_KEYNOTACTIVE (ISC_RESULTCLASS_DNS + 122) -#define DNS_R_NSEC3ITERRANGE (ISC_RESULTCLASS_DNS + 123) -#define DNS_R_NSEC3SALTRANGE (ISC_RESULTCLASS_DNS + 124) -#define DNS_R_NSEC3BADALG (ISC_RESULTCLASS_DNS + 125) -#define DNS_R_NSEC3RESALT (ISC_RESULTCLASS_DNS + 126) - -#define DNS_R_NRESULTS 127 /*%< Number of results */ - -/* - * 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_RCODE11 (ISC_RESULTCLASS_DNSRCODE + 11) -#define DNS_R_RCODE12 (ISC_RESULTCLASS_DNSRCODE + 12) -#define DNS_R_RCODE13 (ISC_RESULTCLASS_DNSRCODE + 13) -#define DNS_R_RCODE14 (ISC_RESULTCLASS_DNSRCODE + 14) -#define DNS_R_RCODE15 (ISC_RESULTCLASS_DNSRCODE + 15) -#define DNS_R_BADVERS (ISC_RESULTCLASS_DNSRCODE + 16) - -#define DNS_R_NRCODERESULTS 17 /*%< Number of rcode results */ - #define DNS_RESULT_ISRCODE(result) \ (ISC_RESULTCLASS_INCLASS(ISC_RESULTCLASS_DNSRCODE, (result))) ISC_LANG_BEGINDECLS -const char *dns_result_totext(isc_result_t); - -void -dns_result_register(void); - dns_rcode_t dns_result_torcode(isc_result_t result); diff --git a/lib/dns/result.c b/lib/dns/result.c index 0fa023431b..eaa0c254c1 100644 --- a/lib/dns/result.c +++ b/lib/dns/result.c @@ -11,331 +11,8 @@ /*! \file */ -#include - -static const char *text[DNS_R_NRESULTS] = { - "label too long", /*%< 0 DNS_R_LABELTOOLONG */ - "bad escape", /*%< 1 DNS_R_BADESCAPE */ - /*! - * Note that DNS_R_BADBITSTRING and DNS_R_BITSTRINGTOOLONG are - * deprecated. - */ - "bad bitstring", /*%< 2 DNS_R_BADBITSTRING */ - "bitstring too long", /*%< 3 DNS_R_BITSTRINGTOOLONG */ - "empty label", /*%< 4 DNS_R_EMPTYLABEL */ - - "bad dotted quad", /*%< 5 DNS_R_BADDOTTEDQUAD */ - "invalid NS owner name (wildcard)", /*%< 6 DNS_R_INVALIDNS */ - "unknown class/type", /*%< 7 DNS_R_UNKNOWN */ - "bad label type", /*%< 8 DNS_R_BADLABELTYPE */ - "bad compression pointer", /*%< 9 DNS_R_BADPOINTER */ - - "too many hops", /*%< 10 DNS_R_TOOMANYHOPS */ - "disallowed (by application policy)", /*%< 11 DNS_R_DISALLOWED */ - "extra input text", /*%< 12 DNS_R_EXTRATOKEN */ - "extra input data", /*%< 13 DNS_R_EXTRADATA */ - "text too long", /*%< 14 DNS_R_TEXTTOOLONG */ - - "not at top of zone", /*%< 15 DNS_R_NOTZONETOP */ - "syntax error", /*%< 16 DNS_R_SYNTAX */ - "bad checksum", /*%< 17 DNS_R_BADCKSUM */ - "bad IPv6 address", /*%< 18 DNS_R_BADAAAA */ - "no owner", /*%< 19 DNS_R_NOOWNER */ - - "no ttl", /*%< 20 DNS_R_NOTTL */ - "bad class", /*%< 21 DNS_R_BADCLASS */ - "name too long", /*%< 22 DNS_R_NAMETOOLONG */ - "partial match", /*%< 23 DNS_R_PARTIALMATCH */ - "new origin", /*%< 24 DNS_R_NEWORIGIN */ - - "unchanged", /*%< 25 DNS_R_UNCHANGED */ - "bad ttl", /*%< 26 DNS_R_BADTTL */ - "more data needed/to be rendered", /*%< 27 DNS_R_NOREDATA */ - "continue", /*%< 28 DNS_R_CONTINUE */ - "delegation", /*%< 29 DNS_R_DELEGATION */ - - "glue", /*%< 30 DNS_R_GLUE */ - "dname", /*%< 31 DNS_R_DNAME */ - "cname", /*%< 32 DNS_R_CNAME */ - "bad database", /*%< 33 DNS_R_BADDB */ - "zonecut", /*%< 34 DNS_R_ZONECUT */ - - "bad zone", /*%< 35 DNS_R_BADZONE */ - "more data", /*%< 36 DNS_R_MOREDATA */ - "up to date", /*%< 37 DNS_R_UPTODATE */ - "tsig verify failure", /*%< 38 DNS_R_TSIGVERIFYFAILURE */ - "tsig indicates error", /*%< 39 DNS_R_TSIGERRORSET */ - - "RRSIG failed to verify", /*%< 40 DNS_R_SIGINVALID */ - "RRSIG has expired", /*%< 41 DNS_R_SIGEXPIRED */ - "RRSIG validity period has not begun", /*%< 42 DNS_R_SIGFUTURE */ - "key is unauthorized to sign data", /*%< 43 DNS_R_KEYUNAUTHORIZED */ - "invalid time", /*%< 44 DNS_R_INVALIDTIME */ - - "expected a TSIG or SIG(0)", /*%< 45 DNS_R_EXPECTEDTSIG */ - "did not expect a TSIG or SIG(0)", /*%< 46 DNS_R_UNEXPECTEDTSIG */ - "TKEY is unacceptable", /*%< 47 DNS_R_INVALIDTKEY */ - "hint", /*%< 48 DNS_R_HINT */ - "drop", /*%< 49 DNS_R_DROP */ - - "zone not loaded", /*%< 50 DNS_R_NOTLOADED */ - "ncache nxdomain", /*%< 51 DNS_R_NCACHENXDOMAIN */ - "ncache nxrrset", /*%< 52 DNS_R_NCACHENXRRSET */ - "wait", /*%< 53 DNS_R_WAIT */ - "not verified yet", /*%< 54 DNS_R_NOTVERIFIEDYET */ - - "no identity", /*%< 55 DNS_R_NOIDENTITY */ - "no journal", /*%< 56 DNS_R_NOJOURNAL */ - "alias", /*%< 57 DNS_R_ALIAS */ - "use TCP", /*%< 58 DNS_R_USETCP */ - "no valid RRSIG", /*%< 59 DNS_R_NOVALIDSIG */ - - "no valid NSEC", /*%< 60 DNS_R_NOVALIDNSEC */ - "insecurity proof failed", /*%< 61 DNS_R_NOTINSECURE */ - "unknown service", /*%< 62 DNS_R_UNKNOWNSERVICE */ - "recoverable error occurred", /*%< 63 DNS_R_RECOVERABLE */ - "unknown opt attribute record", /*%< 64 DNS_R_UNKNOWNOPT */ - - "unexpected message id", /*%< 65 DNS_R_UNEXPECTEDID */ - "seen include file", /*%< 66 DNS_R_SEENINCLUDE */ - "not exact", /*%< 67 DNS_R_NOTEXACT */ - "address blackholed", /*%< 68 DNS_R_BLACKHOLED */ - "bad algorithm", /*%< 69 DNS_R_BADALG */ - - "invalid use of a meta type", /*%< 70 DNS_R_METATYPE */ - "CNAME and other data", /*%< 71 DNS_R_CNAMEANDOTHER */ - "multiple RRs of singleton type", /*%< 72 DNS_R_SINGLETON */ - "hint nxrrset", /*%< 73 DNS_R_HINTNXRRSET */ - "no master file configured", /*%< 74 DNS_R_NOMASTERFILE */ - - "unknown protocol", /*%< 75 DNS_R_UNKNOWNPROTO */ - "clocks are unsynchronized", /*%< 76 DNS_R_CLOCKSKEW */ - "IXFR failed", /*%< 77 DNS_R_BADIXFR */ - "not authoritative", /*%< 78 DNS_R_NOTAUTHORITATIVE */ - "no valid KEY", /*%< 79 DNS_R_NOVALIDKEY */ - - "obsolete", /*%< 80 DNS_R_OBSOLETE */ - "already frozen", /*%< 81 DNS_R_FROZEN */ - "unknown flag", /*%< 82 DNS_R_UNKNOWNFLAG */ - "expected a response", /*%< 83 DNS_R_EXPECTEDRESPONSE */ - "no valid DS", /*%< 84 DNS_R_NOVALIDDS */ - - "NS is an address", /*%< 85 DNS_R_NSISADDRESS */ - "received FORMERR", /*%< 86 DNS_R_REMOTEFORMERR */ - "truncated TCP response", /*%< 87 DNS_R_TRUNCATEDTCP */ - "lame server detected", /*%< 88 DNS_R_LAME */ - "unexpected RCODE", /*%< 89 DNS_R_UNEXPECTEDRCODE */ - - "unexpected OPCODE", /*%< 90 DNS_R_UNEXPECTEDOPCODE */ - "chase DS servers", /*%< 91 DNS_R_CHASEDSSERVERS */ - "empty name", /*%< 92 DNS_R_EMPTYNAME */ - "empty wild", /*%< 93 DNS_R_EMPTYWILD */ - "bad bitmap", /*%< 94 DNS_R_BADBITMAP */ - - "from wildcard", /*%< 95 DNS_R_FROMWILDCARD */ - "bad owner name (check-names)", /*%< 96 DNS_R_BADOWNERNAME */ - "bad name (check-names)", /*%< 97 DNS_R_BADNAME */ - "dynamic zone", /*%< 98 DNS_R_DYNAMIC */ - "unknown command", /*%< 99 DNS_R_UNKNOWNCOMMAND */ - - "must-be-secure", /*%< 100 DNS_R_MUSTBESECURE */ - "covering NSEC record returned", /*%< 101 DNS_R_COVERINGNSEC */ - "MX is an address", /*%< 102 DNS_R_MXISADDRESS */ - "duplicate query", /*%< 103 DNS_R_DUPLICATE */ - "invalid NSEC3 owner name (wildcard)", /*%< 104 DNS_R_INVALIDNSEC3 */ - - "not master", /*%< 105 DNS_R_NOTMASTER */ - "broken trust chain", /*%< 106 DNS_R_BROKENCHAIN */ - "expired", /*%< 107 DNS_R_EXPIRED */ - "not dynamic", /*%< 108 DNS_R_NOTDYNAMIC */ - "bad EUI", /*%< 109 DNS_R_BADEUI */ - - "covered by negative trust anchor", /*%< 110 DNS_R_NTACOVERED */ - "bad CDS", /*%< 111 DNS_R_BADCDS */ - "bad CDNSKEY", /*%< 112 DNS_R_BADCDNSKEY */ - "malformed OPT option", /*%< 113 DNS_R_OPTERR */ - "malformed DNSTAP data", /*%< 114 DNS_R_BADDNSTAP */ - - "TSIG in wrong location", /*%< 115 DNS_R_BADTSIG */ - "SIG(0) in wrong location", /*%< 116 DNS_R_BADSIG0 */ - "too many records", /*%< 117 DNS_R_TOOMANYRECORDS */ - "verify failure", /*%< 118 DNS_R_VERIFYFAILURE */ - "at top of zone", /*%< 119 DNS_R_ATZONETOP */ - - "no matching key found", /*%< 120 DNS_R_NOKEYMATCH */ - "too many keys matching", /*%< 121 DNS_R_TOOMANYKEYS */ - "key is not actively signing", /*%< 122 DNS_R_KEYNOTACTIVE */ - "NSEC3 iterations out of range", /*%< 123 DNS_R_NSEC3ITERRANGE */ - "NSEC3 salt length too high", /*%< 124 DNS_R_NSEC3SALTRANGE */ - - "cannot use NSEC3 with key algorithm", /*%< 125 DNS_R_NSEC3BADALG */ - "NSEC3 resalt", /*%< 126 DNS_R_NSEC3RESALT */ -}; - -static const char *ids[DNS_R_NRESULTS] = { - "DNS_R_LABELTOOLONG", - "DNS_R_BADESCAPE", - /*! - * Note that DNS_R_BADBITSTRING and DNS_R_BITSTRINGTOOLONG are - * deprecated. - */ - "DNS_R_BADBITSTRING", - "DNS_R_BITSTRINGTOOLONG", - "DNS_R_EMPTYLABEL", - "DNS_R_BADDOTTEDQUAD", - "DNS_R_INVALIDNS", - "DNS_R_UNKNOWN", - "DNS_R_BADLABELTYPE", - "DNS_R_BADPOINTER", - "DNS_R_TOOMANYHOPS", - "DNS_R_DISALLOWED", - "DNS_R_EXTRATOKEN", - "DNS_R_EXTRADATA", - "DNS_R_TEXTTOOLONG", - "DNS_R_NOTZONETOP", - "DNS_R_SYNTAX", - "DNS_R_BADCKSUM", - "DNS_R_BADAAAA", - "DNS_R_NOOWNER", - "DNS_R_NOTTL", - "DNS_R_BADCLASS", - "DNS_R_NAMETOOLONG", - "DNS_R_PARTIALMATCH", - "DNS_R_NEWORIGIN", - "DNS_R_UNCHANGED", - "DNS_R_BADTTL", - "DNS_R_NOREDATA", - "DNS_R_CONTINUE", - "DNS_R_DELEGATION", - "DNS_R_GLUE", - "DNS_R_DNAME", - "DNS_R_CNAME", - "DNS_R_BADDB", - "DNS_R_ZONECUT", - "DNS_R_BADZONE", - "DNS_R_MOREDATA", - "DNS_R_UPTODATE", - "DNS_R_TSIGVERIFYFAILURE", - "DNS_R_TSIGERRORSET", - "DNS_R_SIGINVALID", - "DNS_R_SIGEXPIRED", - "DNS_R_SIGFUTURE", - "DNS_R_KEYUNAUTHORIZED", - "DNS_R_INVALIDTIME", - "DNS_R_EXPECTEDTSIG", - "DNS_R_UNEXPECTEDTSIG", - "DNS_R_INVALIDTKEY", - "DNS_R_HINT", - "DNS_R_DROP", - "DNS_R_NOTLOADED", - "DNS_R_NCACHENXDOMAIN", - "DNS_R_NCACHENXRRSET", - "DNS_R_WAIT", - "DNS_R_NOTVERIFIEDYET", - "DNS_R_NOIDENTITY", - "DNS_R_NOJOURNAL", - "DNS_R_ALIAS", - "DNS_R_USETCP", - "DNS_R_NOVALIDSIG", - "DNS_R_NOVALIDNSEC", - "DNS_R_NOTINSECURE", - "DNS_R_UNKNOWNSERVICE", - "DNS_R_RECOVERABLE", - "DNS_R_UNKNOWNOPT", - "DNS_R_UNEXPECTEDID", - "DNS_R_SEENINCLUDE", - "DNS_R_NOTEXACT", - "DNS_R_BLACKHOLED", - "DNS_R_BADALG", - "DNS_R_METATYPE", - "DNS_R_CNAMEANDOTHER", - "DNS_R_SINGLETON", - "DNS_R_HINTNXRRSET", - "DNS_R_NOMASTERFILE", - "DNS_R_UNKNOWNPROTO", - "DNS_R_CLOCKSKEW", - "DNS_R_BADIXFR", - "DNS_R_NOTAUTHORITATIVE", - "DNS_R_NOVALIDKEY", - "DNS_R_OBSOLETE", - "DNS_R_FROZEN", - "DNS_R_UNKNOWNFLAG", - "DNS_R_EXPECTEDRESPONSE", - "DNS_R_NOVALIDDS", - "DNS_R_NSISADDRESS", - "DNS_R_REMOTEFORMERR", - "DNS_R_TRUNCATEDTCP", - "DNS_R_LAME", - "DNS_R_UNEXPECTEDRCODE", - "DNS_R_UNEXPECTEDOPCODE", - "DNS_R_CHASEDSSERVERS", - "DNS_R_EMPTYNAME", - "DNS_R_EMPTYWILD", - "DNS_R_BADBITMAP", - "DNS_R_FROMWILDCARD", - "DNS_R_BADOWNERNAME", - "DNS_R_BADNAME", - "DNS_R_DYNAMIC", - "DNS_R_UNKNOWNCOMMAND", - "DNS_R_MUSTBESECURE", - "DNS_R_COVERINGNSEC", - "DNS_R_MXISADDRESS", - "DNS_R_DUPLICATE", - "DNS_R_INVALIDNSEC3", - "DNS_R_NOTMASTER", - "DNS_R_BROKENCHAIN", - "DNS_R_EXPIRED", - "DNS_R_NOTDYNAMIC", - "DNS_R_BADEUI", - "DNS_R_NTACOVERED", - "DNS_R_BADCDS", - "DNS_R_BADCDNSKEY", - "DNS_R_OPTERR", - "DNS_R_BADDNSTAP", - "DNS_R_BADTSIG", - "DNS_R_BADSIG0", - "DNS_R_TOOMANYRECORDS", - "DNS_R_VERIFYFAILURE", - "DNS_R_ATZONETOP", - "DNS_R_NOKEYMATCH", - "DNS_R_TOOMANYKEYS", - "DNS_R_KEYNOTACTIVE", - "DNS_R_NSEC3ITERRANGE", - "DNS_R_NSEC3SALTRANGE", - "DNS_R_NSEC3BADALG", - "DNS_R_NSEC3RESALT", -}; - -static const char *rcode_text[DNS_R_NRCODERESULTS] = { - "NOERROR", /*%< 0 DNS_R_NOERROR */ - "FORMERR", /*%< 1 DNS_R_FORMERR */ - "SERVFAIL", /*%< 2 DNS_R_SERVFAIL */ - "NXDOMAIN", /*%< 3 DNS_R_NXDOMAIN */ - "NOTIMP", /*%< 4 DNS_R_NOTIMP */ - - "REFUSED", /*%< 5 DNS_R_REFUSED */ - "YXDOMAIN", /*%< 6 DNS_R_YXDOMAIN */ - "YXRRSET", /*%< 7 DNS_R_YXRRSET */ - "NXRRSET", /*%< 8 DNS_R_NXRRSET */ - "NOTAUTH", /*%< 9 DNS_R_NOTAUTH */ - - "NOTZONE", /*%< 10 DNS_R_NOTZONE */ - "", /*%< 11 DNS_R_RCODE11 */ - "", /*%< 12 DNS_R_RCODE12 */ - "", /*%< 13 DNS_R_RCODE13 */ - "", /*%< 14 DNS_R_RCODE14 */ - - "", /*%< 15 DNS_R_RCODE15 */ - "BADVERS", /*%< 16 DNS_R_BADVERS */ -}; - -static const char *rcode_ids[DNS_R_NRCODERESULTS] = { - "DNS_R_NOERROR", "DNS_R_FORMERR", "DNS_R_SERVFAIL", "DNS_R_NXDOMAIN", - "DNS_R_NOTIMP", "DNS_R_REFUSED", "DNS_R_YXDOMAIN", "DNS_R_YXRRSET", - "DNS_R_NXRRSET", "DNS_R_NOTAUTH", "DNS_R_NOTZONE", "DNS_R_RCODE11", - "RNS_R_RCODE12", "DNS_R_RCODE13", "DNS_R_RCODE14", "DNS_R_RCODE15", - "DNS_R_BADVERS", -}; +#include +#include dns_rcode_t dns_result_torcode(isc_result_t result) { diff --git a/lib/dns/result_dns.c.in b/lib/dns/result_dns.c.in new file mode 100644 index 0000000000..b329415fe7 --- /dev/null +++ b/lib/dns/result_dns.c.in @@ -0,0 +1,340 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +/*! \file */ + +#include + + +static const char *text[DNS_R_NRESULTS] = { + "label too long", /*%< 0 DNS_R_LABELTOOLONG */ + "bad escape", /*%< 1 DNS_R_BADESCAPE */ + /*! + * Note that DNS_R_BADBITSTRING and DNS_R_BITSTRINGTOOLONG are + * deprecated. + */ + "bad bitstring", /*%< 2 DNS_R_BADBITSTRING */ + "bitstring too long", /*%< 3 DNS_R_BITSTRINGTOOLONG */ + "empty label", /*%< 4 DNS_R_EMPTYLABEL */ + + "bad dotted quad", /*%< 5 DNS_R_BADDOTTEDQUAD */ + "invalid NS owner name (wildcard)", /*%< 6 DNS_R_INVALIDNS */ + "unknown class/type", /*%< 7 DNS_R_UNKNOWN */ + "bad label type", /*%< 8 DNS_R_BADLABELTYPE */ + "bad compression pointer", /*%< 9 DNS_R_BADPOINTER */ + + "too many hops", /*%< 10 DNS_R_TOOMANYHOPS */ + "disallowed (by application policy)", /*%< 11 DNS_R_DISALLOWED */ + "extra input text", /*%< 12 DNS_R_EXTRATOKEN */ + "extra input data", /*%< 13 DNS_R_EXTRADATA */ + "text too long", /*%< 14 DNS_R_TEXTTOOLONG */ + + "not at top of zone", /*%< 15 DNS_R_NOTZONETOP */ + "syntax error", /*%< 16 DNS_R_SYNTAX */ + "bad checksum", /*%< 17 DNS_R_BADCKSUM */ + "bad IPv6 address", /*%< 18 DNS_R_BADAAAA */ + "no owner", /*%< 19 DNS_R_NOOWNER */ + + "no ttl", /*%< 20 DNS_R_NOTTL */ + "bad class", /*%< 21 DNS_R_BADCLASS */ + "name too long", /*%< 22 DNS_R_NAMETOOLONG */ + "partial match", /*%< 23 DNS_R_PARTIALMATCH */ + "new origin", /*%< 24 DNS_R_NEWORIGIN */ + + "unchanged", /*%< 25 DNS_R_UNCHANGED */ + "bad ttl", /*%< 26 DNS_R_BADTTL */ + "more data needed/to be rendered", /*%< 27 DNS_R_NOREDATA */ + "continue", /*%< 28 DNS_R_CONTINUE */ + "delegation", /*%< 29 DNS_R_DELEGATION */ + + "glue", /*%< 30 DNS_R_GLUE */ + "dname", /*%< 31 DNS_R_DNAME */ + "cname", /*%< 32 DNS_R_CNAME */ + "bad database", /*%< 33 DNS_R_BADDB */ + "zonecut", /*%< 34 DNS_R_ZONECUT */ + + "bad zone", /*%< 35 DNS_R_BADZONE */ + "more data", /*%< 36 DNS_R_MOREDATA */ + "up to date", /*%< 37 DNS_R_UPTODATE */ + "tsig verify failure", /*%< 38 DNS_R_TSIGVERIFYFAILURE */ + "tsig indicates error", /*%< 39 DNS_R_TSIGERRORSET */ + + "RRSIG failed to verify", /*%< 40 DNS_R_SIGINVALID */ + "RRSIG has expired", /*%< 41 DNS_R_SIGEXPIRED */ + "RRSIG validity period has not begun", /*%< 42 DNS_R_SIGFUTURE */ + "key is unauthorized to sign data", /*%< 43 DNS_R_KEYUNAUTHORIZED */ + "invalid time", /*%< 44 DNS_R_INVALIDTIME */ + + "expected a TSIG or SIG(0)", /*%< 45 DNS_R_EXPECTEDTSIG */ + "did not expect a TSIG or SIG(0)", /*%< 46 DNS_R_UNEXPECTEDTSIG */ + "TKEY is unacceptable", /*%< 47 DNS_R_INVALIDTKEY */ + "hint", /*%< 48 DNS_R_HINT */ + "drop", /*%< 49 DNS_R_DROP */ + + "zone not loaded", /*%< 50 DNS_R_NOTLOADED */ + "ncache nxdomain", /*%< 51 DNS_R_NCACHENXDOMAIN */ + "ncache nxrrset", /*%< 52 DNS_R_NCACHENXRRSET */ + "wait", /*%< 53 DNS_R_WAIT */ + "not verified yet", /*%< 54 DNS_R_NOTVERIFIEDYET */ + + "no identity", /*%< 55 DNS_R_NOIDENTITY */ + "no journal", /*%< 56 DNS_R_NOJOURNAL */ + "alias", /*%< 57 DNS_R_ALIAS */ + "use TCP", /*%< 58 DNS_R_USETCP */ + "no valid RRSIG", /*%< 59 DNS_R_NOVALIDSIG */ + + "no valid NSEC", /*%< 60 DNS_R_NOVALIDNSEC */ + "insecurity proof failed", /*%< 61 DNS_R_NOTINSECURE */ + "unknown service", /*%< 62 DNS_R_UNKNOWNSERVICE */ + "recoverable error occurred", /*%< 63 DNS_R_RECOVERABLE */ + "unknown opt attribute record", /*%< 64 DNS_R_UNKNOWNOPT */ + + "unexpected message id", /*%< 65 DNS_R_UNEXPECTEDID */ + "seen include file", /*%< 66 DNS_R_SEENINCLUDE */ + "not exact", /*%< 67 DNS_R_NOTEXACT */ + "address blackholed", /*%< 68 DNS_R_BLACKHOLED */ + "bad algorithm", /*%< 69 DNS_R_BADALG */ + + "invalid use of a meta type", /*%< 70 DNS_R_METATYPE */ + "CNAME and other data", /*%< 71 DNS_R_CNAMEANDOTHER */ + "multiple RRs of singleton type", /*%< 72 DNS_R_SINGLETON */ + "hint nxrrset", /*%< 73 DNS_R_HINTNXRRSET */ + "no master file configured", /*%< 74 DNS_R_NOMASTERFILE */ + + "unknown protocol", /*%< 75 DNS_R_UNKNOWNPROTO */ + "clocks are unsynchronized", /*%< 76 DNS_R_CLOCKSKEW */ + "IXFR failed", /*%< 77 DNS_R_BADIXFR */ + "not authoritative", /*%< 78 DNS_R_NOTAUTHORITATIVE */ + "no valid KEY", /*%< 79 DNS_R_NOVALIDKEY */ + + "obsolete", /*%< 80 DNS_R_OBSOLETE */ + "already frozen", /*%< 81 DNS_R_FROZEN */ + "unknown flag", /*%< 82 DNS_R_UNKNOWNFLAG */ + "expected a response", /*%< 83 DNS_R_EXPECTEDRESPONSE */ + "no valid DS", /*%< 84 DNS_R_NOVALIDDS */ + + "NS is an address", /*%< 85 DNS_R_NSISADDRESS */ + "received FORMERR", /*%< 86 DNS_R_REMOTEFORMERR */ + "truncated TCP response", /*%< 87 DNS_R_TRUNCATEDTCP */ + "lame server detected", /*%< 88 DNS_R_LAME */ + "unexpected RCODE", /*%< 89 DNS_R_UNEXPECTEDRCODE */ + + "unexpected OPCODE", /*%< 90 DNS_R_UNEXPECTEDOPCODE */ + "chase DS servers", /*%< 91 DNS_R_CHASEDSSERVERS */ + "empty name", /*%< 92 DNS_R_EMPTYNAME */ + "empty wild", /*%< 93 DNS_R_EMPTYWILD */ + "bad bitmap", /*%< 94 DNS_R_BADBITMAP */ + + "from wildcard", /*%< 95 DNS_R_FROMWILDCARD */ + "bad owner name (check-names)", /*%< 96 DNS_R_BADOWNERNAME */ + "bad name (check-names)", /*%< 97 DNS_R_BADNAME */ + "dynamic zone", /*%< 98 DNS_R_DYNAMIC */ + "unknown command", /*%< 99 DNS_R_UNKNOWNCOMMAND */ + + "must-be-secure", /*%< 100 DNS_R_MUSTBESECURE */ + "covering NSEC record returned", /*%< 101 DNS_R_COVERINGNSEC */ + "MX is an address", /*%< 102 DNS_R_MXISADDRESS */ + "duplicate query", /*%< 103 DNS_R_DUPLICATE */ + "invalid NSEC3 owner name (wildcard)", /*%< 104 DNS_R_INVALIDNSEC3 */ + + "not master", /*%< 105 DNS_R_NOTMASTER */ + "broken trust chain", /*%< 106 DNS_R_BROKENCHAIN */ + "expired", /*%< 107 DNS_R_EXPIRED */ + "not dynamic", /*%< 108 DNS_R_NOTDYNAMIC */ + "bad EUI", /*%< 109 DNS_R_BADEUI */ + + "covered by negative trust anchor", /*%< 110 DNS_R_NTACOVERED */ + "bad CDS", /*%< 111 DNS_R_BADCDS */ + "bad CDNSKEY", /*%< 112 DNS_R_BADCDNSKEY */ + "malformed OPT option", /*%< 113 DNS_R_OPTERR */ + "malformed DNSTAP data", /*%< 114 DNS_R_BADDNSTAP */ + + "TSIG in wrong location", /*%< 115 DNS_R_BADTSIG */ + "SIG(0) in wrong location", /*%< 116 DNS_R_BADSIG0 */ + "too many records", /*%< 117 DNS_R_TOOMANYRECORDS */ + "verify failure", /*%< 118 DNS_R_VERIFYFAILURE */ + "at top of zone", /*%< 119 DNS_R_ATZONETOP */ + + "no matching key found", /*%< 120 DNS_R_NOKEYMATCH */ + "too many keys matching", /*%< 121 DNS_R_TOOMANYKEYS */ + "key is not actively signing", /*%< 122 DNS_R_KEYNOTACTIVE */ + "NSEC3 iterations out of range", /*%< 123 DNS_R_NSEC3ITERRANGE */ + "NSEC3 salt length too high", /*%< 124 DNS_R_NSEC3SALTRANGE */ + + "cannot use NSEC3 with key algorithm", /*%< 125 DNS_R_NSEC3BADALG */ + "NSEC3 resalt", /*%< 126 DNS_R_NSEC3RESALT */ +}; + +static const char *ids[DNS_R_NRESULTS] = { + "DNS_R_LABELTOOLONG", + "DNS_R_BADESCAPE", + /*! + * Note that DNS_R_BADBITSTRING and DNS_R_BITSTRINGTOOLONG are + * deprecated. + */ + "DNS_R_BADBITSTRING", + "DNS_R_BITSTRINGTOOLONG", + "DNS_R_EMPTYLABEL", + "DNS_R_BADDOTTEDQUAD", + "DNS_R_INVALIDNS", + "DNS_R_UNKNOWN", + "DNS_R_BADLABELTYPE", + "DNS_R_BADPOINTER", + "DNS_R_TOOMANYHOPS", + "DNS_R_DISALLOWED", + "DNS_R_EXTRATOKEN", + "DNS_R_EXTRADATA", + "DNS_R_TEXTTOOLONG", + "DNS_R_NOTZONETOP", + "DNS_R_SYNTAX", + "DNS_R_BADCKSUM", + "DNS_R_BADAAAA", + "DNS_R_NOOWNER", + "DNS_R_NOTTL", + "DNS_R_BADCLASS", + "DNS_R_NAMETOOLONG", + "DNS_R_PARTIALMATCH", + "DNS_R_NEWORIGIN", + "DNS_R_UNCHANGED", + "DNS_R_BADTTL", + "DNS_R_NOREDATA", + "DNS_R_CONTINUE", + "DNS_R_DELEGATION", + "DNS_R_GLUE", + "DNS_R_DNAME", + "DNS_R_CNAME", + "DNS_R_BADDB", + "DNS_R_ZONECUT", + "DNS_R_BADZONE", + "DNS_R_MOREDATA", + "DNS_R_UPTODATE", + "DNS_R_TSIGVERIFYFAILURE", + "DNS_R_TSIGERRORSET", + "DNS_R_SIGINVALID", + "DNS_R_SIGEXPIRED", + "DNS_R_SIGFUTURE", + "DNS_R_KEYUNAUTHORIZED", + "DNS_R_INVALIDTIME", + "DNS_R_EXPECTEDTSIG", + "DNS_R_UNEXPECTEDTSIG", + "DNS_R_INVALIDTKEY", + "DNS_R_HINT", + "DNS_R_DROP", + "DNS_R_NOTLOADED", + "DNS_R_NCACHENXDOMAIN", + "DNS_R_NCACHENXRRSET", + "DNS_R_WAIT", + "DNS_R_NOTVERIFIEDYET", + "DNS_R_NOIDENTITY", + "DNS_R_NOJOURNAL", + "DNS_R_ALIAS", + "DNS_R_USETCP", + "DNS_R_NOVALIDSIG", + "DNS_R_NOVALIDNSEC", + "DNS_R_NOTINSECURE", + "DNS_R_UNKNOWNSERVICE", + "DNS_R_RECOVERABLE", + "DNS_R_UNKNOWNOPT", + "DNS_R_UNEXPECTEDID", + "DNS_R_SEENINCLUDE", + "DNS_R_NOTEXACT", + "DNS_R_BLACKHOLED", + "DNS_R_BADALG", + "DNS_R_METATYPE", + "DNS_R_CNAMEANDOTHER", + "DNS_R_SINGLETON", + "DNS_R_HINTNXRRSET", + "DNS_R_NOMASTERFILE", + "DNS_R_UNKNOWNPROTO", + "DNS_R_CLOCKSKEW", + "DNS_R_BADIXFR", + "DNS_R_NOTAUTHORITATIVE", + "DNS_R_NOVALIDKEY", + "DNS_R_OBSOLETE", + "DNS_R_FROZEN", + "DNS_R_UNKNOWNFLAG", + "DNS_R_EXPECTEDRESPONSE", + "DNS_R_NOVALIDDS", + "DNS_R_NSISADDRESS", + "DNS_R_REMOTEFORMERR", + "DNS_R_TRUNCATEDTCP", + "DNS_R_LAME", + "DNS_R_UNEXPECTEDRCODE", + "DNS_R_UNEXPECTEDOPCODE", + "DNS_R_CHASEDSSERVERS", + "DNS_R_EMPTYNAME", + "DNS_R_EMPTYWILD", + "DNS_R_BADBITMAP", + "DNS_R_FROMWILDCARD", + "DNS_R_BADOWNERNAME", + "DNS_R_BADNAME", + "DNS_R_DYNAMIC", + "DNS_R_UNKNOWNCOMMAND", + "DNS_R_MUSTBESECURE", + "DNS_R_COVERINGNSEC", + "DNS_R_MXISADDRESS", + "DNS_R_DUPLICATE", + "DNS_R_INVALIDNSEC3", + "DNS_R_NOTMASTER", + "DNS_R_BROKENCHAIN", + "DNS_R_EXPIRED", + "DNS_R_NOTDYNAMIC", + "DNS_R_BADEUI", + "DNS_R_NTACOVERED", + "DNS_R_BADCDS", + "DNS_R_BADCDNSKEY", + "DNS_R_OPTERR", + "DNS_R_BADDNSTAP", + "DNS_R_BADTSIG", + "DNS_R_BADSIG0", + "DNS_R_TOOMANYRECORDS", + "DNS_R_VERIFYFAILURE", + "DNS_R_ATZONETOP", + "DNS_R_NOKEYMATCH", + "DNS_R_TOOMANYKEYS", + "DNS_R_KEYNOTACTIVE", + "DNS_R_NSEC3ITERRANGE", + "DNS_R_NSEC3SALTRANGE", + "DNS_R_NSEC3BADALG", + "DNS_R_NSEC3RESALT", +}; + +static const char *rcode_text[DNS_R_NRCODERESULTS] = { + "NOERROR", /*%< 0 DNS_R_NOERROR */ + "FORMERR", /*%< 1 DNS_R_FORMERR */ + "SERVFAIL", /*%< 2 DNS_R_SERVFAIL */ + "NXDOMAIN", /*%< 3 DNS_R_NXDOMAIN */ + "NOTIMP", /*%< 4 DNS_R_NOTIMP */ + + "REFUSED", /*%< 5 DNS_R_REFUSED */ + "YXDOMAIN", /*%< 6 DNS_R_YXDOMAIN */ + "YXRRSET", /*%< 7 DNS_R_YXRRSET */ + "NXRRSET", /*%< 8 DNS_R_NXRRSET */ + "NOTAUTH", /*%< 9 DNS_R_NOTAUTH */ + + "NOTZONE", /*%< 10 DNS_R_NOTZONE */ + "", /*%< 11 DNS_R_RCODE11 */ + "", /*%< 12 DNS_R_RCODE12 */ + "", /*%< 13 DNS_R_RCODE13 */ + "", /*%< 14 DNS_R_RCODE14 */ + + "", /*%< 15 DNS_R_RCODE15 */ + "BADVERS", /*%< 16 DNS_R_BADVERS */ +}; + +static const char *rcode_ids[DNS_R_NRCODERESULTS] = { + "DNS_R_NOERROR", "DNS_R_FORMERR", "DNS_R_SERVFAIL", "DNS_R_NXDOMAIN", + "DNS_R_NOTIMP", "DNS_R_REFUSED", "DNS_R_YXDOMAIN", "DNS_R_YXRRSET", + "DNS_R_NXRRSET", "DNS_R_NOTAUTH", "DNS_R_NOTZONE", "DNS_R_RCODE11", + "RNS_R_RCODE12", "DNS_R_RCODE13", "DNS_R_RCODE14", "DNS_R_RCODE15", + "DNS_R_BADVERS", +}; + diff --git a/lib/dns/result_dns.h.in b/lib/dns/result_dns.h.in new file mode 100644 index 0000000000..f7207a954b --- /dev/null +++ b/lib/dns/result_dns.h.in @@ -0,0 +1,183 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +#ifndef ISC_DNS_RESULT_H +#define ISC_DNS_RESULT_H 1 + +/*! \file isc/result_dns.h */ + +#include + +/* + * DNS library result codes + */ +#define DNS_R_LABELTOOLONG (ISC_RESULTCLASS_DNS + 0) +#define DNS_R_BADESCAPE (ISC_RESULTCLASS_DNS + 1) +/* + * Since we dropped the support of bitstring labels, deprecate the related + * result codes too. + * + #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_INVALIDNS (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) +#define DNS_R_TEXTTOOLONG (ISC_RESULTCLASS_DNS + 14) +#define DNS_R_NOTZONETOP (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_NAMETOOLONG (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) +#define DNS_R_BADDB (ISC_RESULTCLASS_DNS + 33) +#define DNS_R_ZONECUT (ISC_RESULTCLASS_DNS + 34) +#define DNS_R_BADZONE (ISC_RESULTCLASS_DNS + 35) +#define DNS_R_MOREDATA (ISC_RESULTCLASS_DNS + 36) +#define DNS_R_UPTODATE (ISC_RESULTCLASS_DNS + 37) +#define DNS_R_TSIGVERIFYFAILURE (ISC_RESULTCLASS_DNS + 38) +#define DNS_R_TSIGERRORSET (ISC_RESULTCLASS_DNS + 39) +#define DNS_R_SIGINVALID (ISC_RESULTCLASS_DNS + 40) +#define DNS_R_SIGEXPIRED (ISC_RESULTCLASS_DNS + 41) +#define DNS_R_SIGFUTURE (ISC_RESULTCLASS_DNS + 42) +#define DNS_R_KEYUNAUTHORIZED (ISC_RESULTCLASS_DNS + 43) +#define DNS_R_INVALIDTIME (ISC_RESULTCLASS_DNS + 44) +#define DNS_R_EXPECTEDTSIG (ISC_RESULTCLASS_DNS + 45) +#define DNS_R_UNEXPECTEDTSIG (ISC_RESULTCLASS_DNS + 46) +#define DNS_R_INVALIDTKEY (ISC_RESULTCLASS_DNS + 47) +#define DNS_R_HINT (ISC_RESULTCLASS_DNS + 48) +#define DNS_R_DROP (ISC_RESULTCLASS_DNS + 49) +#define DNS_R_NOTLOADED (ISC_RESULTCLASS_DNS + 50) +#define DNS_R_NCACHENXDOMAIN (ISC_RESULTCLASS_DNS + 51) +#define DNS_R_NCACHENXRRSET (ISC_RESULTCLASS_DNS + 52) +#define DNS_R_WAIT (ISC_RESULTCLASS_DNS + 53) +#define DNS_R_NOTVERIFIEDYET (ISC_RESULTCLASS_DNS + 54) +#define DNS_R_NOIDENTITY (ISC_RESULTCLASS_DNS + 55) +#define DNS_R_NOJOURNAL (ISC_RESULTCLASS_DNS + 56) +#define DNS_R_ALIAS (ISC_RESULTCLASS_DNS + 57) +#define DNS_R_USETCP (ISC_RESULTCLASS_DNS + 58) +#define DNS_R_NOVALIDSIG (ISC_RESULTCLASS_DNS + 59) +#define DNS_R_NOVALIDNSEC (ISC_RESULTCLASS_DNS + 60) +#define DNS_R_NOTINSECURE (ISC_RESULTCLASS_DNS + 61) +#define DNS_R_UNKNOWNSERVICE (ISC_RESULTCLASS_DNS + 62) +#define DNS_R_RECOVERABLE (ISC_RESULTCLASS_DNS + 63) +#define DNS_R_UNKNOWNOPT (ISC_RESULTCLASS_DNS + 64) +#define DNS_R_UNEXPECTEDID (ISC_RESULTCLASS_DNS + 65) +#define DNS_R_SEENINCLUDE (ISC_RESULTCLASS_DNS + 66) +#define DNS_R_NOTEXACT (ISC_RESULTCLASS_DNS + 67) +#define DNS_R_BLACKHOLED (ISC_RESULTCLASS_DNS + 68) +#define DNS_R_BADALG (ISC_RESULTCLASS_DNS + 69) +#define DNS_R_METATYPE (ISC_RESULTCLASS_DNS + 70) +#define DNS_R_CNAMEANDOTHER (ISC_RESULTCLASS_DNS + 71) +#define DNS_R_SINGLETON (ISC_RESULTCLASS_DNS + 72) +#define DNS_R_HINTNXRRSET (ISC_RESULTCLASS_DNS + 73) +#define DNS_R_NOMASTERFILE (ISC_RESULTCLASS_DNS + 74) +#define DNS_R_UNKNOWNPROTO (ISC_RESULTCLASS_DNS + 75) +#define DNS_R_CLOCKSKEW (ISC_RESULTCLASS_DNS + 76) +#define DNS_R_BADIXFR (ISC_RESULTCLASS_DNS + 77) +#define DNS_R_NOTAUTHORITATIVE (ISC_RESULTCLASS_DNS + 78) +#define DNS_R_NOVALIDKEY (ISC_RESULTCLASS_DNS + 79) +#define DNS_R_OBSOLETE (ISC_RESULTCLASS_DNS + 80) +#define DNS_R_FROZEN (ISC_RESULTCLASS_DNS + 81) +#define DNS_R_UNKNOWNFLAG (ISC_RESULTCLASS_DNS + 82) +#define DNS_R_EXPECTEDRESPONSE (ISC_RESULTCLASS_DNS + 83) +#define DNS_R_NOVALIDDS (ISC_RESULTCLASS_DNS + 84) +#define DNS_R_NSISADDRESS (ISC_RESULTCLASS_DNS + 85) +#define DNS_R_REMOTEFORMERR (ISC_RESULTCLASS_DNS + 86) +#define DNS_R_TRUNCATEDTCP (ISC_RESULTCLASS_DNS + 87) +#define DNS_R_LAME (ISC_RESULTCLASS_DNS + 88) +#define DNS_R_UNEXPECTEDRCODE (ISC_RESULTCLASS_DNS + 89) +#define DNS_R_UNEXPECTEDOPCODE (ISC_RESULTCLASS_DNS + 90) +#define DNS_R_CHASEDSSERVERS (ISC_RESULTCLASS_DNS + 91) +#define DNS_R_EMPTYNAME (ISC_RESULTCLASS_DNS + 92) +#define DNS_R_EMPTYWILD (ISC_RESULTCLASS_DNS + 93) +#define DNS_R_BADBITMAP (ISC_RESULTCLASS_DNS + 94) +#define DNS_R_FROMWILDCARD (ISC_RESULTCLASS_DNS + 95) +#define DNS_R_BADOWNERNAME (ISC_RESULTCLASS_DNS + 96) +#define DNS_R_BADNAME (ISC_RESULTCLASS_DNS + 97) +#define DNS_R_DYNAMIC (ISC_RESULTCLASS_DNS + 98) +#define DNS_R_UNKNOWNCOMMAND (ISC_RESULTCLASS_DNS + 99) +#define DNS_R_MUSTBESECURE (ISC_RESULTCLASS_DNS + 100) +#define DNS_R_COVERINGNSEC (ISC_RESULTCLASS_DNS + 101) +#define DNS_R_MXISADDRESS (ISC_RESULTCLASS_DNS + 102) +#define DNS_R_DUPLICATE (ISC_RESULTCLASS_DNS + 103) +#define DNS_R_INVALIDNSEC3 (ISC_RESULTCLASS_DNS + 104) +#define DNS_R_NOTMASTER (ISC_RESULTCLASS_DNS + 105) +#define DNS_R_BROKENCHAIN (ISC_RESULTCLASS_DNS + 106) +#define DNS_R_EXPIRED (ISC_RESULTCLASS_DNS + 107) +#define DNS_R_NOTDYNAMIC (ISC_RESULTCLASS_DNS + 108) +#define DNS_R_BADEUI (ISC_RESULTCLASS_DNS + 109) +#define DNS_R_NTACOVERED (ISC_RESULTCLASS_DNS + 110) +#define DNS_R_BADCDS (ISC_RESULTCLASS_DNS + 111) +#define DNS_R_BADCDNSKEY (ISC_RESULTCLASS_DNS + 112) +#define DNS_R_OPTERR (ISC_RESULTCLASS_DNS + 113) +#define DNS_R_BADDNSTAP (ISC_RESULTCLASS_DNS + 114) +#define DNS_R_BADTSIG (ISC_RESULTCLASS_DNS + 115) +#define DNS_R_BADSIG0 (ISC_RESULTCLASS_DNS + 116) +#define DNS_R_TOOMANYRECORDS (ISC_RESULTCLASS_DNS + 117) +#define DNS_R_VERIFYFAILURE (ISC_RESULTCLASS_DNS + 118) +#define DNS_R_ATZONETOP (ISC_RESULTCLASS_DNS + 119) +#define DNS_R_NOKEYMATCH (ISC_RESULTCLASS_DNS + 120) +#define DNS_R_TOOMANYKEYS (ISC_RESULTCLASS_DNS + 121) +#define DNS_R_KEYNOTACTIVE (ISC_RESULTCLASS_DNS + 122) +#define DNS_R_NSEC3ITERRANGE (ISC_RESULTCLASS_DNS + 123) +#define DNS_R_NSEC3SALTRANGE (ISC_RESULTCLASS_DNS + 124) +#define DNS_R_NSEC3BADALG (ISC_RESULTCLASS_DNS + 125) +#define DNS_R_NSEC3RESALT (ISC_RESULTCLASS_DNS + 126) + +#define DNS_R_NRESULTS 127 /*%< Number of results */ + +/* + * 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_RCODE11 (ISC_RESULTCLASS_DNSRCODE + 11) +#define DNS_R_RCODE12 (ISC_RESULTCLASS_DNSRCODE + 12) +#define DNS_R_RCODE13 (ISC_RESULTCLASS_DNSRCODE + 13) +#define DNS_R_RCODE14 (ISC_RESULTCLASS_DNSRCODE + 14) +#define DNS_R_RCODE15 (ISC_RESULTCLASS_DNSRCODE + 15) +#define DNS_R_BADVERS (ISC_RESULTCLASS_DNSRCODE + 16) + +#define DNS_R_NRCODERESULTS 17 /*%< Number of rcode results */ + +#endif /* DNS_RESULT_H */ diff --git a/lib/dns/dst_result.c b/lib/dns/result_dst.c.in similarity index 100% rename from lib/dns/dst_result.c rename to lib/dns/result_dst.c.in diff --git a/lib/dns/include/dst/result.h b/lib/dns/result_dst.h.in similarity index 81% rename from lib/dns/include/dst/result.h rename to lib/dns/result_dst.h.in index 120dd1443e..43a0db6ef4 100644 --- a/lib/dns/include/dst/result.h +++ b/lib/dns/result_dst.h.in @@ -16,13 +16,6 @@ #include -/* - * Nothing in this file truly depends on , but the - * DST result codes are considered to be publicly derived from - * the ISC result codes, so including this file buys you the ISC_R_ - * namespace too. - */ -#include /* Contractual promise. */ #define DST_R_UNSUPPORTEDALG (ISC_RESULTCLASS_DST + 0) #define DST_R_CRYPTOFAILURE (ISC_RESULTCLASS_DST + 1) @@ -52,13 +45,4 @@ #define DST_R_NRESULTS 23 /* Number of results */ -ISC_LANG_BEGINDECLS - -const char *dst_result_totext(isc_result_t); - -void -dst_result_register(void); - -ISC_LANG_ENDDECLS - #endif /* DST_RESULT_H */ diff --git a/lib/isc/Makefile.am b/lib/isc/Makefile.am index 71712754c1..1beef74615 100644 --- a/lib/isc/Makefile.am +++ b/lib/isc/Makefile.am @@ -113,7 +113,6 @@ pk11_HEADERS = \ include/pk11/constants.h \ include/pk11/internal.h \ include/pk11/pk11.h \ - include/pk11/result.h \ include/pk11/site.h pkcs11dir = $(includedir)/pkcs11 @@ -153,7 +152,6 @@ libisc_la_SOURCES = \ unix/time.c \ url.c \ pk11.c \ - pk11_result.c \ aes.c \ app.c \ assertions.c \ diff --git a/lib/isc/include/pk11/result.h b/lib/isc/include/pk11/result.h deleted file mode 100644 index 6b16ae6d50..0000000000 --- a/lib/isc/include/pk11/result.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) Internet Systems Consortium, Inc. ("ISC") - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at https://mozilla.org/MPL/2.0/. - * - * See the COPYRIGHT file distributed with this work for additional - * information regarding copyright ownership. - */ - -#ifndef PK11_RESULT_H -#define PK11_RESULT_H 1 - -/*! \file pk11/result.h */ - -#include -#include -#include - -/* - * Nothing in this file truly depends on , but the - * PK11 result codes are considered to be publicly derived from - * the ISC result codes, so including this file buys you the ISC_R_ - * namespace too. - */ -#include /* Contractual promise. */ - -#define PK11_R_INITFAILED (ISC_RESULTCLASS_PK11 + 0) -#define PK11_R_NOPROVIDER (ISC_RESULTCLASS_PK11 + 1) -#define PK11_R_NORANDOMSERVICE (ISC_RESULTCLASS_PK11 + 2) -#define PK11_R_NODIGESTSERVICE (ISC_RESULTCLASS_PK11 + 3) -#define PK11_R_NOAESSERVICE (ISC_RESULTCLASS_PK11 + 4) - -#define PK11_R_NRESULTS 5 /* Number of results */ - -ISC_LANG_BEGINDECLS - -const char *pk11_result_totext(isc_result_t); - -void -pk11_result_register(void); - -ISC_LANG_ENDDECLS - -#endif /* PK11_RESULT_H */ diff --git a/lib/isc/result_isc.h.in b/lib/isc/result_isc.h.in new file mode 100644 index 0000000000..a48bd63833 --- /dev/null +++ b/lib/isc/result_isc.h.in @@ -0,0 +1,90 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +/*! \file result_isc.h.in */ + +ISC_R_SUCCESS = ISC_RESULTCODE_ISC(0), /*%< success */ +ISC_R_NOMEMORY = ISC_RESULTCODE_ISC(1), /*%< out of memory */ +ISC_R_TIMEDOUT = ISC_RESULTCODE_ISC(2), /*%< timed out */ +ISC_R_NOTHREADS = ISC_RESULTCODE_ISC(3), /*%< no available threads */ +ISC_R_ADDRNOTAVAIL = ISC_RESULTCODE_ISC(4), /*%< address not available */ +ISC_R_ADDRINUSE = ISC_RESULTCODE_ISC(5), /*%< address in use */ +ISC_R_NOPERM = ISC_RESULTCODE_ISC(6), /*%< permission denied */ +ISC_R_NOCONN = ISC_RESULTCODE_ISC(7), /*%< no pending connections */ +ISC_R_NETUNREACH = ISC_RESULTCODE_ISC(8), /*%< network unreachable */ +ISC_R_HOSTUNREACH = ISC_RESULTCODE_ISC(9), /*%< host unreachable */ +ISC_R_NETDOWN = ISC_RESULTCODE_ISC(10), /*%< network down */ +ISC_R_HOSTDOWN = ISC_RESULTCODE_ISC(11), /*%< host down */ +ISC_R_CONNREFUSED = ISC_RESULTCODE_ISC(12), /*%< connection refused */ +ISC_R_NORESOURCES = ISC_RESULTCODE_ISC(13), /*%< not enough free resources */ +ISC_R_EOF = ISC_RESULTCODE_ISC(14), /*%< end of file */ +ISC_R_BOUND = ISC_RESULTCODE_ISC(15), /*%< socket already bound */ +ISC_R_RELOAD = ISC_RESULTCODE_ISC(16), /*%< reload */ +ISC_R_SUSPEND = ISC_R_RELOAD, /*%< alias of 'reload' */ +ISC_R_LOCKBUSY = ISC_RESULTCODE_ISC(17), /*%< lock busy */ +ISC_R_EXISTS = ISC_RESULTCODE_ISC(18), /*%< already exists */ +ISC_R_NOSPACE = ISC_RESULTCODE_ISC(19), /*%< ran out of space */ +ISC_R_CANCELED = ISC_RESULTCODE_ISC(20), /*%< operation canceled */ +ISC_R_NOTBOUND = ISC_RESULTCODE_ISC(21), /*%< socket is not bound */ +ISC_R_SHUTTINGDOWN = ISC_RESULTCODE_ISC(22), /*%< shutting down */ +ISC_R_NOTFOUND = ISC_RESULTCODE_ISC(23), /*%< not found */ +ISC_R_UNEXPECTEDEND = ISC_RESULTCODE_ISC(24), /*%< unexpected end of input */ +ISC_R_FAILURE = ISC_RESULTCODE_ISC(25), /*%< generic failure */ +ISC_R_IOERROR = ISC_RESULTCODE_ISC(26), /*%< I/O error */ +ISC_R_NOTIMPLEMENTED = ISC_RESULTCODE_ISC(27), /*%< not implemented */ +ISC_R_UNBALANCED = ISC_RESULTCODE_ISC(28), /*%< unbalanced parentheses */ +ISC_R_NOMORE = ISC_RESULTCODE_ISC(29), /*%< no more */ +ISC_R_INVALIDFILE = ISC_RESULTCODE_ISC(30), /*%< invalid file */ +ISC_R_BADBASE64 = ISC_RESULTCODE_ISC(31), /*%< bad base64 encoding */ +ISC_R_UNEXPECTEDTOKEN = ISC_RESULTCODE_ISC(32), /*%< unexpected token */ +ISC_R_QUOTA = ISC_RESULTCODE_ISC(33), /*%< quota reached */ +ISC_R_UNEXPECTED = ISC_RESULTCODE_ISC(34), /*%< unexpected error */ +ISC_R_ALREADYRUNNING = ISC_RESULTCODE_ISC(35), /*%< already running */ +ISC_R_IGNORE = ISC_RESULTCODE_ISC(36), /*%< ignore */ +ISC_R_MASKNONCONTIG = ISC_RESULTCODE_ISC(37), /*%< addr mask not contiguous */ +ISC_R_FILENOTFOUND = ISC_RESULTCODE_ISC(38), /*%< file not found */ +ISC_R_FILEEXISTS = ISC_RESULTCODE_ISC(39), /*%< file already exists */ +ISC_R_NOTCONNECTED = ISC_RESULTCODE_ISC(40), /*%< socket is not connected */ +ISC_R_RANGE = ISC_RESULTCODE_ISC(41), /*%< out of range */ +ISC_R_NOENTROPY = ISC_RESULTCODE_ISC(42), /*%< out of entropy */ +ISC_R_MULTICAST = ISC_RESULTCODE_ISC(43), /*%< invalid use of multicast */ +ISC_R_NOTFILE = ISC_RESULTCODE_ISC(44), /*%< not a file */ +ISC_R_NOTDIRECTORY = ISC_RESULTCODE_ISC(45), /*%< not a directory */ +ISC_R_QUEUEFULL = ISC_RESULTCODE_ISC(46), /*%< queue is full */ +ISC_R_FAMILYMISMATCH = ISC_RESULTCODE_ISC(47), /*%< address family mismatch */ +ISC_R_FAMILYNOSUPPORT = ISC_RESULTCODE_ISC(48), /*%< AF not supported */ +ISC_R_BADHEX = ISC_RESULTCODE_ISC(49), /*%< bad hex encoding */ +ISC_R_TOOMANYOPENFILES = ISC_RESULTCODE_ISC(50), /*%< too many open files */ +ISC_R_NOTBLOCKING = ISC_RESULTCODE_ISC(51), /*%< not blocking */ +ISC_R_UNBALANCEDQUOTES = ISC_RESULTCODE_ISC(52), /*%< unbalanced quotes */ +ISC_R_INPROGRESS = ISC_RESULTCODE_ISC(53), /*%< operation in progress */ +ISC_R_CONNECTIONRESET = ISC_RESULTCODE_ISC(54), /*%< connection reset */ +ISC_R_SOFTQUOTA = ISC_RESULTCODE_ISC(55), /*%< soft quota reached */ +ISC_R_BADNUMBER = ISC_RESULTCODE_ISC(56), /*%< not a valid number */ +ISC_R_DISABLED = ISC_RESULTCODE_ISC(57), /*%< disabled */ +ISC_R_MAXSIZE = ISC_RESULTCODE_ISC(58), /*%< max size */ +ISC_R_BADADDRESSFORM = ISC_RESULTCODE_ISC(59), /*%< invalid address format */ +ISC_R_BADBASE32 = ISC_RESULTCODE_ISC(60), /*%< bad base32 encoding */ +ISC_R_UNSET = ISC_RESULTCODE_ISC(61), /*%< unset */ +ISC_R_MULTIPLE = ISC_RESULTCODE_ISC(62), /*%< multiple */ +ISC_R_WOULDBLOCK = ISC_RESULTCODE_ISC(63), /*%< would block */ +ISC_R_COMPLETE = ISC_RESULTCODE_ISC(64), /*%< complete */ +ISC_R_CRYPTOFAILURE = ISC_RESULTCODE_ISC(65), /*%< cryptography library failure */ +ISC_R_DISCQUOTA = ISC_RESULTCODE_ISC(66), /*%< disc quota */ +ISC_R_DISCFULL = ISC_RESULTCODE_ISC(67), /*%< disc full */ +ISC_R_DEFAULT = ISC_RESULTCODE_ISC(68), /*%< default */ +ISC_R_IPV4PREFIX = ISC_RESULTCODE_ISC(69), /*%< IPv4 prefix */ +ISC_R_TLSERROR = ISC_RESULTCODE_ISC(70), /*%< TLS error */ +ISC_R_HTTP2ALPNERROR = ISC_RESULTCODE_ISC(71), /*%< ALPN for HTTP/2 failed */ + +/*% Not a result code: the number of results. */ +#define ISC_R_NRESULTS 72 + diff --git a/lib/isc/pk11_result.c b/lib/isc/result_pk11.c.in similarity index 100% rename from lib/isc/pk11_result.c rename to lib/isc/result_pk11.c.in diff --git a/lib/isc/result_pk11.h.in b/lib/isc/result_pk11.h.in new file mode 100644 index 0000000000..eda2f4f1ea --- /dev/null +++ b/lib/isc/result_pk11.h.in @@ -0,0 +1,21 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +/*! \file result_pk11.h.in */ + +PK11_R_INITFAILED = ISC_RESULTCODE_PK11(0), +PK11_R_NOPROVIDER = ISC_RESULTCODE_PK11(1), +PK11_R_NORANDOMSERVICE = ISC_RESULTCODE_PK11(2), +PK11_R_NODIGESTSERVICE = ISC_RESULTCODE_PK11(3), +PK11_R_NOAESSERVICE = ISC_RESULTCODE_PK11(4), + +#define PK11_R_NRESULTS 5 /* Number of results */ + diff --git a/lib/isccc/Makefile.am b/lib/isccc/Makefile.am index d5cc537ead..d187986d91 100644 --- a/lib/isccc/Makefile.am +++ b/lib/isccc/Makefile.am @@ -9,7 +9,6 @@ libisccc_la_HEADERS = \ include/isccc/cc.h \ include/isccc/ccmsg.h \ include/isccc/events.h \ - include/isccc/result.h \ include/isccc/sexpr.h \ include/isccc/symtab.h \ include/isccc/symtype.h \ @@ -22,7 +21,6 @@ libisccc_la_SOURCES = \ base64.c \ cc.c \ ccmsg.c \ - result.c \ sexpr.c \ symtab.c diff --git a/lib/isccc/result.c b/lib/isccc/result.c deleted file mode 100644 index 0217d68e5a..0000000000 --- a/lib/isccc/result.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Portions Copyright (C) Internet Systems Consortium, Inc. ("ISC") - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at https://mozilla.org/MPL/2.0/. - * - * See the COPYRIGHT file distributed with this work for additional - * information regarding copyright ownership. - * - * Portions Copyright (C) 2001 Nominum, Inc. - * - * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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. - */ - -/*! \file */ - -#include - -static const char *text[ISCCC_R_NRESULTS] = { - "unknown version", /* 1 */ - "syntax error", /* 2 */ - "bad auth", /* 3 */ - "expired", /* 4 */ - "clock skew", /* 5 */ - "duplicate" /* 6 */ -}; - -static const char *ids[ISCCC_R_NRESULTS] = { - "ISCCC_R_UNKNOWNVERSION", "ISCCC_R_SYNTAX", "ISCCC_R_BADAUTH", - "ISCCC_R_EXPIRED", "ISCCC_R_CLOCKSKEW", "ISCCC_R_DUPLICATE", -}; diff --git a/lib/isccc/result_isccc.c.in b/lib/isccc/result_isccc.c.in new file mode 100644 index 0000000000..440ea04956 --- /dev/null +++ b/lib/isccc/result_isccc.c.in @@ -0,0 +1,28 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +/*! \file */ + +#include + +static const char *text[ISCCC_R_NRESULTS] = { + "unknown version", /* 1 */ + "syntax error", /* 2 */ + "bad auth", /* 3 */ + "expired", /* 4 */ + "clock skew", /* 5 */ + "duplicate" /* 6 */ +}; + +static const char *ids[ISCCC_R_NRESULTS] = { + "ISCCC_R_UNKNOWNVERSION", "ISCCC_R_SYNTAX", "ISCCC_R_BADAUTH", + "ISCCC_R_EXPIRED", "ISCCC_R_CLOCKSKEW", "ISCCC_R_DUPLICATE", +}; diff --git a/lib/isccc/include/isccc/result.h b/lib/isccc/result_isccc.h.in similarity index 53% rename from lib/isccc/include/isccc/result.h rename to lib/isccc/result_isccc.h.in index 79979710e0..22264db5fc 100644 --- a/lib/isccc/include/isccc/result.h +++ b/lib/isccc/result_isccc.h.in @@ -1,5 +1,5 @@ /* - * Portions Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -7,20 +7,6 @@ * * See the COPYRIGHT file distributed with this work for additional * information regarding copyright ownership. - * - * Portions Copyright (C) 2001 Nominum, Inc. - * - * Permission to use, copy, modify, and/or 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 ISC AND NOMINUM DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC 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. */ #ifndef ISCCC_RESULT_H diff --git a/util/copyrights b/util/copyrights index 4d41e47efd..0234878dda 100644 --- a/util/copyrights +++ b/util/copyrights @@ -1345,7 +1345,6 @@ ./lib/dns/dst_parse.c C.NAI 1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 ./lib/dns/dst_parse.h C.NAI 2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2012,2014,2016,2017,2018,2019,2020,2021 ./lib/dns/dst_pkcs11.h C 2014,2016,2018,2019,2020,2021 -./lib/dns/dst_result.c C 1999,2000,2001,2004,2005,2007,2008,2012,2013,2014,2015,2016,2018,2019,2020,2021 ./lib/dns/dyndb.c C 2015,2016,2017,2018,2019,2020,2021 ./lib/dns/ecs.c C 2017,2018,2019,2020,2021 ./lib/dns/fixedname.c C 2018,2019,2020,2021 @@ -1455,7 +1454,6 @@ ./lib/dns/include/dns/zt.h C 1999,2000,2001,2002,2004,2005,2006,2007,2011,2016,2017,2018,2019,2020,2021 ./lib/dns/include/dst/dst.h C 2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 ./lib/dns/include/dst/gssapi.h C 2000,2001,2004,2005,2006,2007,2009,2010,2011,2013,2016,2017,2018,2019,2020,2021 -./lib/dns/include/dst/result.h C 1999,2000,2001,2004,2005,2006,2007,2008,2012,2014,2016,2018,2019,2020,2021 ./lib/dns/ipkeylist.c C 2016,2018,2019,2020,2021 ./lib/dns/iptable.c C 2007,2008,2009,2013,2014,2016,2017,2018,2019,2020,2021 ./lib/dns/journal.c C 1999,2000,2001,2002,2004,2005,2007,2008,2009,2010,2011,2013,2014,2015,2016,2017,2018,2019,2020,2021 @@ -1666,6 +1664,10 @@ ./lib/dns/request.c C 2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2018,2019,2020,2021 ./lib/dns/resolver.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 ./lib/dns/result.c C 1998,1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 +./lib/dns/result_dns.c.in X 2021 +./lib/dns/result_dns.h.in X 2021 +./lib/dns/result_dst.c.in X 2021 +./lib/dns/result_dst.h.in X 2021 ./lib/dns/rootns.c C 1999,2000,2001,2002,2004,2005,2007,2008,2010,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 ./lib/dns/rpz.c C 2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 ./lib/dns/rriterator.c C 2009,2011,2012,2015,2016,2018,2019,2020,2021 @@ -1920,7 +1922,6 @@ ./lib/isc/include/pk11/constants.h C 2014,2016,2017,2018,2019,2020,2021 ./lib/isc/include/pk11/internal.h C 2014,2016,2018,2019,2020,2021 ./lib/isc/include/pk11/pk11.h C 2014,2016,2018,2019,2020,2021 -./lib/isc/include/pk11/result.h C 2014,2016,2018,2019,2020,2021 ./lib/isc/include/pk11/site.h C 2016,2017,2018,2019,2020,2021 ./lib/isc/include/pkcs11/pkcs11.h X 2019,2020,2021 ./lib/isc/iterated_hash.c C 2006,2008,2009,2016,2018,2019,2020,2021 @@ -1950,7 +1951,6 @@ ./lib/isc/openssl_shim.h C 2020,2021 ./lib/isc/parseint.c C 2001,2002,2003,2004,2005,2007,2012,2016,2018,2019,2020,2021 ./lib/isc/pk11.c C 2014,2015,2016,2017,2018,2019,2020,2021 -./lib/isc/pk11_result.c C 2014,2015,2016,2018,2019,2020,2021 ./lib/isc/pool.c C 2013,2015,2016,2018,2019,2020,2021 ./lib/isc/portset.c C 2008,2016,2017,2018,2019,2020,2021 ./lib/isc/pthreads/condition.c C 1998,1999,2000,2001,2004,2005,2007,2012,2016,2018,2019,2020,2021 @@ -1968,6 +1968,8 @@ ./lib/isc/regex.c C 2013,2014.2015,2015,2016,2018,2019,2020,2021 ./lib/isc/region.c C 2002,2004,2005,2007,2016,2018,2019,2020,2021 ./lib/isc/result.c C 1998,1999,2000,2001,2003,2004,2005,2007,2008,2012,2014,2015,2016,2017,2018,2019,2020,2021 +./lib/isc/result_pk11.c.in X 2021 +./lib/isc/result_pk11.h.in X 2021 ./lib/isc/rwlock.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2011,2012,2015,2016,2017,2018,2019,2020,2021 ./lib/isc/safe.c C 2020,2021 ./lib/isc/serial.c C 1999,2000,2001,2004,2005,2007,2016,2018,2019,2020,2021 @@ -2115,13 +2117,13 @@ ./lib/isccc/include/isccc/cc.h C.NOM 2001,2004,2005,2006,2007,2013,2014,2016,2018,2019,2020,2021 ./lib/isccc/include/isccc/ccmsg.h C.NOM 2001,2004,2005,2006,2007,2016,2018,2019,2020,2021 ./lib/isccc/include/isccc/events.h C.NOM 2001,2004,2005,2006,2007,2016,2018,2019,2020,2021 -./lib/isccc/include/isccc/result.h C.NOM 2001,2003,2004,2005,2006,2007,2016,2018,2019,2020,2021 ./lib/isccc/include/isccc/sexpr.h C.NOM 2001,2004,2005,2006,2007,2016,2018,2019,2020,2021 ./lib/isccc/include/isccc/symtab.h C.NOM 2001,2004,2005,2006,2007,2016,2018,2019,2020,2021 ./lib/isccc/include/isccc/symtype.h C.NOM 2001,2004,2005,2006,2007,2016,2018,2019,2020,2021 ./lib/isccc/include/isccc/types.h C.NOM 2001,2004,2005,2006,2007,2016,2018,2019,2020,2021 ./lib/isccc/include/isccc/util.h C.NOM 2001,2004,2005,2006,2007,2014,2016,2018,2019,2020,2021 -./lib/isccc/result.c C.NOM 2001,2003,2004,2005,2007,2015,2016,2018,2019,2020,2021 +./lib/isccc/result_isccc.c.in X 2021 +./lib/isccc/result_isccc.h.in X 2021 ./lib/isccc/sexpr.c C.NOM 2001,2004,2005,2007,2014,2015,2016,2018,2019,2020,2021 ./lib/isccc/symtab.c C.NOM 2001,2004,2005,2007,2016,2018,2019,2020,2021 ./lib/isccc/tests/result_test.c C 2018,2019,2020,2021