From 2e3a2eecfe1e73665e4f4963f5a2cfe9f34e54cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Mon, 4 Oct 2021 17:14:53 +0200 Subject: [PATCH] Make isc_result a static enum Remove the dynamic registration of result codes. Convert isc_result_t from unsigned + #defines into 32-bit enum type in grand unified header. Keep the existing values of the result codes even at the expense of the description and identifier tables being unnecessary large. Additionally, add couple of: switch (result) { [...] default: break; } statements where compiler now complains about missing enum values in the switch statement. --- bin/check/check-tool.c | 2 +- bin/check/named-checkconf.c | 5 +- bin/check/named-checkzone.c | 6 +- bin/confgen/tsig-keygen.c | 3 - bin/delv/delv.c | 5 +- bin/dig/dig.c | 2 +- bin/dig/dighost.c | 4 - bin/dnssec/dnssec-cds.c | 8 +- bin/dnssec/dnssec-dsfromkey.c | 4 +- bin/dnssec/dnssec-importkey.c | 4 +- bin/dnssec/dnssec-keyfromlabel.c | 4 +- bin/dnssec/dnssec-keygen.c | 4 +- bin/dnssec/dnssec-revoke.c | 4 +- bin/dnssec/dnssec-settime.c | 4 +- bin/dnssec/dnssec-signzone.c | 6 +- bin/dnssec/dnssec-verify.c | 4 +- bin/dnssec/dnssectool.c | 2 +- bin/named/builtin.c | 1 - bin/named/control.c | 4 +- bin/named/controlconf.c | 3 - bin/named/dlz_dlopen_driver.c | 1 - bin/named/main.c | 10 +- bin/named/server.c | 18 +- bin/named/tsigconf.c | 2 +- bin/named/zoneconf.c | 2 +- bin/nsupdate/nsupdate.c | 10 +- bin/plugins/filter-a.c | 1 - bin/plugins/filter-aaaa.c | 1 - bin/rndc/rndc.c | 4 +- bin/tests/system/dyndb/driver/log.h | 4 +- bin/tests/system/dyndb/driver/zone.c | 2 +- bin/tests/system/hooks/driver/test-async.c | 2 - bin/tests/system/makejournal.c | 4 +- bin/tests/system/pipelined/pipequeries.c | 7 +- bin/tests/system/resolve.c | 4 +- bin/tests/system/rsabigexponent/bigkey.c | 6 +- bin/tests/system/tkey/keycreate.c | 7 +- bin/tests/system/tkey/keydelete.c | 7 +- bin/tests/wire_test.c | 4 +- bin/tools/dnstap-read.c | 4 +- bin/tools/mdig.c | 6 +- bin/tools/named-journalprint.c | 4 +- bin/tools/named-rrchecker.c | 22 +- configure.ac | 1 - doc/design/logging | 2 +- fuzz/dns_message_parse.c | 2 +- lib/bind9/check.c | 2 - lib/dns/Makefile.am | 4 +- lib/dns/adb.c | 6 +- lib/dns/byaddr.c | 2 +- lib/dns/cache.c | 14 +- lib/dns/client.c | 2 +- lib/dns/compress.c | 2 +- lib/dns/db.c | 2 +- lib/dns/diff.c | 4 +- lib/dns/dns64.c | 2 +- lib/dns/dnsrps.c | 3 +- lib/dns/dnssec.c | 4 +- lib/dns/dnstap.c | 2 +- lib/dns/ds.c | 2 +- lib/dns/dst_api.c | 6 +- lib/dns/dst_parse.c | 2 +- lib/dns/dst_result.c | 108 --- lib/dns/forward.c | 2 +- lib/dns/gssapi_link.c | 2 +- lib/dns/gssapictx.c | 3 +- lib/dns/hmac_link.c | 3 +- lib/dns/include/dns/result.h | 186 +---- lib/dns/include/dst/result.h | 65 -- lib/dns/journal.c | 2 +- lib/dns/keymgr.c | 3 +- lib/dns/keytable.c | 2 +- lib/dns/lookup.c | 2 +- lib/dns/master.c | 26 +- lib/dns/masterdump.c | 2 +- lib/dns/message.c | 2 +- lib/dns/name.c | 2 +- lib/dns/nsec.c | 2 +- lib/dns/nsec3.c | 2 +- lib/dns/nta.c | 2 +- lib/dns/openssl_link.c | 3 +- lib/dns/openssldh_link.c | 3 +- lib/dns/opensslecdsa_link.c | 3 +- lib/dns/openssleddsa_link.c | 2 - lib/dns/opensslrsa_link.c | 3 +- lib/dns/rbt.c | 5 +- lib/dns/rbtdb.c | 4 +- lib/dns/rcode.c | 1 - lib/dns/rdata.c | 18 +- lib/dns/rdataslab.c | 2 +- lib/dns/request.c | 8 +- lib/dns/resolver.c | 4 +- lib/dns/result.c | 389 +---------- lib/dns/rootns.c | 6 +- lib/dns/rpz.c | 2 +- lib/dns/rriterator.c | 2 +- lib/dns/rrl.c | 2 +- lib/dns/sdb.c | 2 +- lib/dns/sdlz.c | 2 +- lib/dns/tests/Makefile.am | 1 - lib/dns/tests/dh_test.c | 3 +- lib/dns/tests/dnstest.c | 4 +- lib/dns/tests/dnstest.h | 2 +- lib/dns/tests/dst_test.c | 2 +- lib/dns/tests/nsec3param_test.c | 2 +- lib/dns/tests/rbt_test.c | 2 +- lib/dns/tests/rdata_test.c | 10 +- lib/dns/tests/result_test.c | 130 ---- lib/dns/tests/sigs_test.c | 1 - lib/dns/time.c | 2 +- lib/dns/tkey.c | 11 +- lib/dns/transport.c | 1 - lib/dns/tsec.c | 2 +- lib/dns/tsig.c | 4 +- lib/dns/ttl.c | 2 +- lib/dns/update.c | 2 +- lib/dns/validator.c | 4 +- lib/dns/view.c | 2 +- lib/dns/xfrin.c | 5 +- lib/dns/zone.c | 218 +++--- lib/dns/zoneverify.c | 3 +- lib/dns/zt.c | 2 +- lib/isc/Makefile.am | 1 - lib/isc/include/isc/app.h | 1 + lib/isc/include/isc/commandline.h | 1 + lib/isc/include/isc/result.h | 336 ++++++--- lib/isc/include/isc/resultclass.h | 41 -- lib/isc/include/isc/types.h | 2 +- lib/isc/result.c | 758 +++++++++++++-------- lib/isc/tests/result_test.c | 31 - lib/isccc/Makefile.am | 6 - lib/isccc/alist.c | 2 +- lib/isccc/base64.c | 1 - lib/isccc/cc.c | 2 +- lib/isccc/include/isccc/result.h | 65 -- lib/isccc/result.c | 85 --- lib/isccc/symtab.c | 2 +- lib/isccc/tests/Makefile.am | 14 - lib/isccc/tests/result_test.c | 82 --- lib/isccfg/kaspconf.c | 2 +- lib/isccfg/namedconf.c | 1 - lib/ns/client.c | 1 + lib/ns/include/ns/interfacemgr.h | 2 +- lib/ns/include/ns/update.h | 3 +- lib/ns/notify.c | 1 + lib/ns/query.c | 1 + lib/ns/sortlist.c | 2 +- lib/ns/tests/nstest.c | 4 +- lib/ns/tests/nstest.h | 2 +- lib/ns/update.c | 19 +- lib/ns/xfrout.c | 2 +- util/check-includes.pl | 6 - util/copyrights | 7 - 153 files changed, 1088 insertions(+), 1962 deletions(-) delete mode 100644 lib/dns/dst_result.c delete mode 100644 lib/dns/include/dst/result.h delete mode 100644 lib/dns/tests/result_test.c delete mode 100644 lib/isc/include/isc/resultclass.h delete mode 100644 lib/isccc/include/isccc/result.h delete mode 100644 lib/isccc/result.c delete mode 100644 lib/isccc/tests/Makefile.am delete mode 100644 lib/isccc/tests/result_test.c diff --git a/bin/check/check-tool.c b/bin/check/check-tool.c index 5e2ac4df39..6768fbea54 100644 --- a/bin/check/check-tool.c +++ b/bin/check/check-tool.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,6 @@ #include #include #include -#include #include #include diff --git a/bin/check/named-checkconf.c b/bin/check/named-checkconf.c index df8d34bf2a..3240e0cb34 100644 --- a/bin/check/named-checkconf.c +++ b/bin/check/named-checkconf.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include @@ -451,7 +450,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig, NULL); if (result != ISC_R_SUCCESS) { fprintf(stderr, "%s/%s/%s: %s\n", view, zname, zclass, - dns_result_totext(result)); + isc_result_totext(result)); } return (result); } @@ -708,8 +707,6 @@ main(int argc, char **argv) { RUNTIME_CHECK(setup_logging(mctx, stdout, &logc) == ISC_R_SUCCESS); - dns_result_register(); - RUNTIME_CHECK(cfg_parser_create(mctx, logc, &parser) == ISC_R_SUCCESS); if (nodeprecate) { diff --git a/bin/check/named-checkzone.c b/bin/check/named-checkzone.c index 72370e9fbd..ec7a69db89 100644 --- a/bin/check/named-checkzone.c +++ b/bin/check/named-checkzone.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,6 @@ #include #include #include -#include #include #include @@ -59,7 +59,7 @@ static enum { progmode_check, progmode_compile } progmode; if (result != ISC_R_SUCCESS) { \ if (!quiet) \ fprintf(stderr, "%s() returned %s\n", \ - function, dns_result_totext(result)); \ + function, isc_result_totext(result)); \ return (result); \ } \ } while (0) @@ -521,8 +521,6 @@ main(int argc, char **argv) { ISC_R_SUCCESS); } - dns_result_register(); - origin = argv[isc_commandline_index++]; if (isc_commandline_index == argc) { diff --git a/bin/confgen/tsig-keygen.c b/bin/confgen/tsig-keygen.c index 54d84595d5..aa9939b07b 100644 --- a/bin/confgen/tsig-keygen.c +++ b/bin/confgen/tsig-keygen.c @@ -36,7 +36,6 @@ #include #include -#include #include @@ -97,8 +96,6 @@ main(int argc, char **argv) { int len = 0; int ch; - dns_result_register(); - result = isc_file_progname(*argv, program, sizeof(program)); if (result != ISC_R_SUCCESS) { memmove(program, "tsig-keygen", 11); diff --git a/bin/delv/delv.c b/bin/delv/delv.c index 960695cb89..64ab63ba24 100644 --- a/bin/delv/delv.c +++ b/bin/delv/delv.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -55,12 +56,10 @@ #include #include #include -#include #include #include #include -#include #include #include @@ -1736,8 +1735,6 @@ main(int argc, char *argv[]) { isc_mem_create(&mctx); - dns_result_register(); - result = dst_lib_init(mctx, NULL); if (result != ISC_R_SUCCESS) { fatal("dst_lib_init failed: %d", result); diff --git a/bin/dig/dig.c b/bin/dig/dig.c index 0b1a0bfcb9..2de1728a61 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,6 @@ #include #include #include -#include #include #include "dighost.h" diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 2397ac7c81..b4e6b75a55 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -68,11 +68,9 @@ #include #include #include -#include #include #include -#include #include @@ -1332,8 +1330,6 @@ setup_libs(void) { debug("setup_libs()"); - dns_result_register(); - result = isc_net_probeipv4(); if (result == ISC_R_SUCCESS) { have_ipv4 = true; diff --git a/bin/dnssec/dnssec-cds.c b/bin/dnssec/dnssec-cds.c index aebd9e9786..234eca5744 100644 --- a/bin/dnssec/dnssec-cds.c +++ b/bin/dnssec/dnssec-cds.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -50,7 +51,6 @@ #include #include #include -#include #include #include @@ -475,7 +475,7 @@ match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness) { "dns_ds_buildrdata(" "keytag=%d, algo=%d, digest=%d): %s\n", ds.key_tag, ds.algorithm, ds.digest_type, - dns_result_totext(result)); + isc_result_totext(result)); continue; } /* allow for both DS and CDS */ @@ -552,7 +552,7 @@ match_keyset_dsset(dns_rdataset_t *keyset, dns_rdataset_t *dsset, vbprintf(3, "dns_dnssec_keyfromrdata(" "keytag=%d, algo=%d): %s\n", - ki->tag, ki->algo, dns_result_totext(result)); + ki->tag, ki->algo, isc_result_totext(result)); } } @@ -1057,8 +1057,6 @@ main(int argc, char *argv[]) { isc_mem_create(&mctx); - dns_result_register(); - isc_commandline_errprint = false; #define OPTIONS "a:c:Dd:f:i:ms:T:uv:V" diff --git a/bin/dnssec/dnssec-dsfromkey.c b/bin/dnssec/dnssec-dsfromkey.c index 07371acc4a..0214e72579 100644 --- a/bin/dnssec/dnssec-dsfromkey.c +++ b/bin/dnssec/dnssec-dsfromkey.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -39,7 +40,6 @@ #include #include #include -#include #include @@ -373,8 +373,6 @@ main(int argc, char **argv) { isc_mem_create(&mctx); - dns_result_register(); - isc_commandline_errprint = false; #define OPTIONS "12Aa:Cc:d:Ff:K:l:sT:v:hV" diff --git a/bin/dnssec/dnssec-importkey.c b/bin/dnssec/dnssec-importkey.c index 7f7fd2dc64..e71d49e05e 100644 --- a/bin/dnssec/dnssec-importkey.c +++ b/bin/dnssec/dnssec-importkey.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -37,7 +38,6 @@ #include #include #include -#include #include @@ -312,8 +312,6 @@ main(int argc, char **argv) { isc_mem_create(&mctx); - dns_result_register(); - isc_commandline_errprint = false; #define CMDLINE_FLAGS "D:f:hK:L:P:v:V" diff --git a/bin/dnssec/dnssec-keyfromlabel.c b/bin/dnssec/dnssec-keyfromlabel.c index aca17aea1d..17e6505cfc 100644 --- a/bin/dnssec/dnssec-keyfromlabel.c +++ b/bin/dnssec/dnssec-keyfromlabel.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include #include #include @@ -157,8 +157,6 @@ main(int argc, char **argv) { isc_mem_create(&mctx); - dns_result_register(); - isc_commandline_errprint = false; isc_stdtime_get(&now); diff --git a/bin/dnssec/dnssec-keygen.c b/bin/dnssec/dnssec-keygen.c index a3f0b4f168..ce223d3f62 100644 --- a/bin/dnssec/dnssec-keygen.c +++ b/bin/dnssec/dnssec-keygen.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -47,7 +48,6 @@ #include #include #include -#include #include #include @@ -868,8 +868,6 @@ main(int argc, char **argv) { usage(); } - dns_result_register(); - isc_commandline_errprint = false; /* diff --git a/bin/dnssec/dnssec-revoke.c b/bin/dnssec/dnssec-revoke.c index f21bb5e72c..2184b0d7f3 100644 --- a/bin/dnssec/dnssec-revoke.c +++ b/bin/dnssec/dnssec-revoke.c @@ -23,11 +23,11 @@ #include #include #include +#include #include #include #include -#include #include @@ -83,8 +83,6 @@ main(int argc, char **argv) { isc_mem_create(&mctx); - dns_result_register(); - isc_commandline_errprint = false; while ((ch = isc_commandline_parse(argc, argv, "E:fK:rRhv:V")) != -1) { diff --git a/bin/dnssec/dnssec-settime.c b/bin/dnssec/dnssec-settime.c index c6a1c40376..54f32dde93 100644 --- a/bin/dnssec/dnssec-settime.c +++ b/bin/dnssec/dnssec-settime.c @@ -25,13 +25,13 @@ #include #include #include +#include #include #include #include #include #include -#include #include @@ -248,8 +248,6 @@ main(int argc, char **argv) { setup_logging(mctx, &log); - dns_result_register(); - isc_commandline_errprint = false; isc_stdtime_get(&now); diff --git a/bin/dnssec/dnssec-signzone.c b/bin/dnssec/dnssec-signzone.c index 5c5f316155..42cfa19ac5 100644 --- a/bin/dnssec/dnssec-signzone.c +++ b/bin/dnssec/dnssec-signzone.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -76,7 +77,6 @@ #include #include #include -#include #include #include #include @@ -455,6 +455,8 @@ expecttofindkey(dns_name_t *name) { case DNS_R_CNAME: case DNS_R_DNAME: return (false); + default: + break; } dns_name_format(name, namestr, sizeof(namestr)); fatal("failure looking for '%s DNSKEY' in database: %s", namestr, @@ -3390,8 +3392,6 @@ main(int argc, char *argv[]) { isc_mem_create(&mctx); - dns_result_register(); - isc_commandline_errprint = false; while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) { diff --git a/bin/dnssec/dnssec-verify.c b/bin/dnssec/dnssec-verify.c index 11d020b6bf..e5ec0635f4 100644 --- a/bin/dnssec/dnssec-verify.c +++ b/bin/dnssec/dnssec-verify.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -54,7 +55,6 @@ #include #include #include -#include #include #include #include @@ -208,8 +208,6 @@ main(int argc, char *argv[]) { isc_mem_create(&mctx); - dns_result_register(); - isc_commandline_errprint = false; while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) { diff --git a/bin/dnssec/dnssectool.c b/bin/dnssec/dnssectool.c index 4d931bc90c..873699ef93 100644 --- a/bin/dnssec/dnssectool.c +++ b/bin/dnssec/dnssectool.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -46,7 +47,6 @@ #include #include #include -#include #include #include diff --git a/bin/named/builtin.c b/bin/named/builtin.c index c2bbc59655..b4e4bf8ab1 100644 --- a/bin/named/builtin.c +++ b/bin/named/builtin.c @@ -22,7 +22,6 @@ #include #include -#include #include #include diff --git a/bin/named/control.c b/bin/named/control.c index 55a469925d..bdf8e19016 100644 --- a/bin/named/control.c +++ b/bin/named/control.c @@ -17,15 +17,13 @@ #include #include #include +#include #include #include #include -#include - #include #include -#include #include #include diff --git a/bin/named/controlconf.c b/bin/named/controlconf.c index caa1055877..63c4d272e4 100644 --- a/bin/named/controlconf.c +++ b/bin/named/controlconf.c @@ -32,13 +32,10 @@ #include #include -#include - #include #include #include #include -#include #include #include #include diff --git a/bin/named/dlz_dlopen_driver.c b/bin/named/dlz_dlopen_driver.c index e88ea6fc52..9288de3b71 100644 --- a/bin/named/dlz_dlopen_driver.c +++ b/bin/named/dlz_dlopen_driver.c @@ -23,7 +23,6 @@ #include #include -#include #include #include diff --git a/bin/named/main.c b/bin/named/main.c index 72b6166329..f0bf372def 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -47,13 +48,8 @@ #include #include #include -#include #include -#include - -#include - #include #ifdef HAVE_GPERFTOOLS_PROFILER @@ -1433,10 +1429,6 @@ main(int argc, char *argv[]) { named_os_init(program_name); - dns_result_register(); - dst_result_register(); - isccc_result_register(); - parse_command_line(argc, argv); #ifdef ENABLE_AFL diff --git a/bin/named/server.c b/bin/named/server.c index 602afc089a..a54317ebe7 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -100,7 +101,6 @@ #include #include -#include #include #include @@ -11326,7 +11326,7 @@ cleanup: isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, "dumpstats failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); } return (result); } @@ -11465,7 +11465,7 @@ resume: } if (result == ISC_R_NOTIMPLEMENTED) { fprintf(dctx->fp, "; %s\n", - dns_result_totext(result)); + isc_result_totext(result)); } else if (result != ISC_R_SUCCESS) { goto cleanup; } @@ -11513,7 +11513,7 @@ resume: result = dns_zone_getdb(dctx->zone->zone, &dctx->db); if (result != ISC_R_SUCCESS) { fprintf(dctx->fp, "; %s\n", - dns_result_totext(result)); + isc_result_totext(result)); goto nextzone; } dns_db_currentversion(dctx->db, &dctx->version); @@ -11526,7 +11526,7 @@ resume: } if (result == ISC_R_NOTIMPLEMENTED) { fprintf(dctx->fp, "; %s\n", - dns_result_totext(result)); + isc_result_totext(result)); result = ISC_R_SUCCESS; POST(result); goto nextzone; @@ -11554,7 +11554,7 @@ cleanup: if (result != ISC_R_SUCCESS) { isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, - "dumpdb failed: %s", dns_result_totext(result)); + "dumpdb failed: %s", isc_result_totext(result)); } dumpcontext_destroy(dctx); } @@ -11797,7 +11797,7 @@ cleanup: isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, "dumpsecroots failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); } return (result); } @@ -11836,7 +11836,7 @@ cleanup: isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, "dumprecursing failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); } return (result); } @@ -12850,6 +12850,8 @@ named_server_freeze(named_server_t *server, bool freeze, isc_lex_t *lex, "Check the logs to see the result."; result = ISC_R_SUCCESS; break; + default: + break; } } } diff --git a/bin/named/tsigconf.c b/bin/named/tsigconf.c index ef6d91a764..96589f1c68 100644 --- a/bin/named/tsigconf.c +++ b/bin/named/tsigconf.c @@ -16,10 +16,10 @@ #include #include #include +#include #include #include -#include #include #include diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index b99899f50f..c041b99219 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include /* Required for HP/UX (and others?) */ #include @@ -34,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c index 4aa9289cb2..52d482f909 100644 --- a/bin/nsupdate/nsupdate.c +++ b/bin/nsupdate/nsupdate.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -63,7 +64,6 @@ #include #include #include -#include #include #include @@ -532,7 +532,7 @@ setup_keystr(void) { false, NULL, 0, 0, gmctx, NULL, &tsigkey); if (result != ISC_R_SUCCESS) { fprintf(stderr, "could not create key from %s: %s\n", keystr, - dns_result_totext(result)); + isc_result_totext(result)); } else { dst_key_setbits(tsigkey->key, digestbits); } @@ -805,8 +805,6 @@ setup_system(void) { ddebug("setup_system()"); - dns_result_register(); - isc_log_create(gmctx, &glctx, &logconfig); isc_log_setcontext(glctx); dns_log_init(glctx); @@ -1642,7 +1640,7 @@ evaluate_key(char *cmdline) { isc_mem_free(gmctx, secret); if (result != ISC_R_SUCCESS) { fprintf(stderr, "could not create key from %s %s: %s\n", - namestr, secretstr, dns_result_totext(result)); + namestr, secretstr, isc_result_totext(result)); return (STATUS_SYNTAX); } dst_key_setbits(tsigkey->key, digestbits); @@ -3184,7 +3182,7 @@ recvgss(isc_task_t *task, isc_event_t *event) { result = dns_message_settsigkey(rcvmsg, tsigkey); check_result(result, "dns_message_settsigkey"); result = dns_message_checksig(rcvmsg, NULL); - ddebug("tsig verification: %s", dns_result_totext(result)); + ddebug("tsig verification: %s", isc_result_totext(result)); check_result(result, "dns_message_checksig"); #endif /* 0 */ diff --git a/bin/plugins/filter-a.c b/bin/plugins/filter-a.c index f72d6e54ab..88978daab1 100644 --- a/bin/plugins/filter-a.c +++ b/bin/plugins/filter-a.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/bin/plugins/filter-aaaa.c b/bin/plugins/filter-aaaa.c index ec741835b8..ae906b009b 100644 --- a/bin/plugins/filter-aaaa.c +++ b/bin/plugins/filter-aaaa.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/bin/rndc/rndc.c b/bin/rndc/rndc.c index 620af62a36..f22c9fedf0 100644 --- a/bin/rndc/rndc.c +++ b/bin/rndc/rndc.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -42,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -1046,8 +1046,6 @@ main(int argc, char **argv) { parse_config(rndc_mctx, log, keyname, &pctx, &config); - isccc_result_register(); - isc_buffer_allocate(rndc_mctx, &databuf, 2048); /* diff --git a/bin/tests/system/dyndb/driver/log.h b/bin/tests/system/dyndb/driver/log.h index 1a73ea36ab..e0d9e66017 100644 --- a/bin/tests/system/dyndb/driver/log.h +++ b/bin/tests/system/dyndb/driver/log.h @@ -6,14 +6,14 @@ #define _LD_LOG_H_ #include +#include #include -#include #define fatal_error(...) isc_error_fatal(__FILE__, __LINE__, __VA_ARGS__) #define log_error_r(fmt, ...) \ - log_error(fmt ": %s", ##__VA_ARGS__, dns_result_totext(result)) + log_error(fmt ": %s", ##__VA_ARGS__, isc_result_totext(result)) #define log_error(format, ...) log_write(ISC_LOG_ERROR, format, ##__VA_ARGS__) diff --git a/bin/tests/system/dyndb/driver/zone.c b/bin/tests/system/dyndb/driver/zone.c index 68857aa2c4..c7306b69cc 100644 --- a/bin/tests/system/dyndb/driver/zone.c +++ b/bin/tests/system/dyndb/driver/zone.c @@ -222,7 +222,7 @@ activate_zone(sample_instance_t *inst, dns_zone_t *raw) { result = publish_zone(inst, raw); if (result != ISC_R_SUCCESS) { dns_zone_log(raw, ISC_LOG_ERROR, "cannot add zone to view: %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } diff --git a/bin/tests/system/hooks/driver/test-async.c b/bin/tests/system/hooks/driver/test-async.c index d52f2eb688..d4c6c08779 100644 --- a/bin/tests/system/hooks/driver/test-async.c +++ b/bin/tests/system/hooks/driver/test-async.c @@ -27,8 +27,6 @@ #include #include -#include - #include #include #include diff --git a/bin/tests/system/makejournal.c b/bin/tests/system/makejournal.c index 3dbd582e75..94d41a769e 100644 --- a/bin/tests/system/makejournal.c +++ b/bin/tests/system/makejournal.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -25,7 +26,6 @@ #include #include #include -#include #include #define CHECK(r) \ @@ -115,8 +115,6 @@ main(int argc, char **argv) { CHECK(isc_log_usechannel(logconfig, "stderr", NULL, NULL)); - dns_result_register(); - result = loadzone(&olddb, origin, file1); if (result != ISC_R_SUCCESS) { fprintf(stderr, "Couldn't load %s: ", file1); diff --git a/bin/tests/system/pipelined/pipequeries.c b/bin/tests/system/pipelined/pipequeries.c index 342ff12039..3ee5fade07 100644 --- a/bin/tests/system/pipelined/pipequeries.c +++ b/bin/tests/system/pipelined/pipequeries.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -42,8 +43,6 @@ #include #include -#include - #define CHECK(str, x) \ { \ if ((x) != ISC_R_SUCCESS) { \ @@ -93,7 +92,7 @@ recvresponse(isc_task_t *task, isc_event_t *event) { CHECK("dns_request_getresponse", result); if (response->rcode != dns_rcode_noerror) { - result = ISC_RESULTCLASS_DNSRCODE + response->rcode; + result = dns_result_fromrcode(response->rcode); fprintf(stderr, "I:response rcode: %s\n", isc_result_totext(result)); exit(-1); @@ -243,8 +242,6 @@ main(int argc, char *argv[]) { have_src = true; } - dns_result_register(); - isc_sockaddr_any(&bind_any); result = ISC_R_FAILURE; diff --git a/bin/tests/system/resolve.c b/bin/tests/system/resolve.c index ee94fe98ad..1735f1cc6e 100644 --- a/bin/tests/system/resolve.c +++ b/bin/tests/system/resolve.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -42,7 +43,6 @@ #include #include #include -#include #include #include @@ -471,7 +471,7 @@ main(int argc, char *argv[]) { resopt, &namelist); if (result != ISC_R_SUCCESS) { fprintf(stderr, "resolution failed: %s\n", - dns_result_totext(result)); + isc_result_totext(result)); } for (name = ISC_LIST_HEAD(namelist); name != NULL; name = ISC_LIST_NEXT(name, link)) diff --git a/bin/tests/system/rsabigexponent/bigkey.c b/bin/tests/system/rsabigexponent/bigkey.c index 00928ada6a..6c8bdf6952 100644 --- a/bin/tests/system/rsabigexponent/bigkey.c +++ b/bin/tests/system/rsabigexponent/bigkey.c @@ -28,17 +28,17 @@ #include #include +#include + #include #include #include #include #include #include -#include #include #include -#include dst_key_t *key; dns_fixedname_t fname; @@ -100,8 +100,6 @@ main(int argc, char **argv) { exit(1); } - dns_result_register(); - isc_mem_create(&mctx); CHECK(dst_lib_init(mctx, NULL), "dst_lib_init()"); isc_log_create(mctx, &log_, &logconfig); diff --git a/bin/tests/system/tkey/keycreate.c b/bin/tests/system/tkey/keycreate.c index 79cfdeeb2c..085648c178 100644 --- a/bin/tests/system/tkey/keycreate.c +++ b/bin/tests/system/tkey/keycreate.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -37,8 +38,6 @@ #include #include -#include - #define CHECK(str, x) \ { \ if ((x) != ISC_R_SUCCESS) { \ @@ -92,7 +91,7 @@ recvquery(isc_task_t *task, isc_event_t *event) { CHECK("dns_request_getresponse", result); if (response->rcode != dns_rcode_noerror) { - result = ISC_RESULTCLASS_DNSRCODE + response->rcode; + result = dns_result_fromrcode(response->rcode); fprintf(stderr, "I:response rcode: %s\n", isc_result_totext(result)); exit(-1); @@ -213,8 +212,6 @@ main(int argc, char *argv[]) { ownername_str = argv[4]; } - dns_result_register(); - isc_mem_debugging = ISC_MEM_DEBUGRECORD; isc_mem_create(&mctx); diff --git a/bin/tests/system/tkey/keydelete.c b/bin/tests/system/tkey/keydelete.c index f5a2a17472..6175748957 100644 --- a/bin/tests/system/tkey/keydelete.c +++ b/bin/tests/system/tkey/keydelete.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -36,8 +37,6 @@ #include #include -#include - #define CHECK(str, x) \ { \ if ((x) != ISC_R_SUCCESS) { \ @@ -83,7 +82,7 @@ recvquery(isc_task_t *task, isc_event_t *event) { CHECK("dns_request_getresponse", result); if (response->rcode != dns_rcode_noerror) { - result = ISC_RESULTCLASS_DNSRCODE + response->rcode; + result = dns_result_fromrcode(response->rcode); fprintf(stderr, "I:response rcode: %s\n", isc_result_totext(result)); exit(-1); @@ -158,8 +157,6 @@ main(int argc, char **argv) { port = atoi(argv[2]); keyname = argv[3]; - dns_result_register(); - isc_mem_create(&mctx); isc_log_create(mctx, &log, &logconfig); diff --git a/bin/tests/wire_test.c b/bin/tests/wire_test.c index 7b290f8cd9..da967cfe08 100644 --- a/bin/tests/wire_test.c +++ b/bin/tests/wire_test.c @@ -18,11 +18,11 @@ #include #include #include +#include #include #include #include -#include int parseflags = 0; isc_mem_t *mctx = NULL; @@ -38,7 +38,7 @@ printmessage(dns_message_t *msg); static inline void CHECKRESULT(isc_result_t result, const char *msg) { if (result != ISC_R_SUCCESS) { - printf("%s: %s\n", msg, dns_result_totext(result)); + printf("%s: %s\n", msg, isc_result_totext(result)); exit(1); } diff --git a/bin/tools/dnstap-read.c b/bin/tools/dnstap-read.c index 5b15fa8153..18699c95ee 100644 --- a/bin/tools/dnstap-read.c +++ b/bin/tools/dnstap-read.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -47,7 +48,6 @@ #include #include #include -#include #include "dnstap.pb-c.h" @@ -360,8 +360,6 @@ main(int argc, char *argv[]) { isc_mem_create(&mctx); - dns_result_register(); - CHECKM(dns_dt_open(argv[0], dns_dtmode_file, mctx, &handle), "dns_dt_openfile"); diff --git a/bin/tools/mdig.c b/bin/tools/mdig.c index 2c88c90908..7f59d5cc01 100644 --- a/bin/tools/mdig.c +++ b/bin/tools/mdig.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -46,12 +47,9 @@ #include #include #include -#include #include #include -#include - #include #define CHECK(str, x) \ @@ -2075,8 +2073,6 @@ main(int argc, char *argv[]) { RUNCHECK(isc_app_start()); - dns_result_register(); - if (isc_net_probeipv4() == ISC_R_SUCCESS) { have_ipv4 = true; } diff --git a/bin/tools/named-journalprint.c b/bin/tools/named-journalprint.c index 74b7227059..be4c5a4b6d 100644 --- a/bin/tools/named-journalprint.c +++ b/bin/tools/named-journalprint.c @@ -17,11 +17,11 @@ #include #include #include +#include #include #include #include -#include #include const char *progname = NULL; @@ -123,7 +123,7 @@ main(int argc, char **argv) { } else { result = dns_journal_print(mctx, flags, file, stdout); if (result == DNS_R_NOJOURNAL) { - fprintf(stderr, "%s\n", dns_result_totext(result)); + fprintf(stderr, "%s\n", isc_result_totext(result)); } } isc_log_destroy(&lctx); diff --git a/bin/tools/named-rrchecker.c b/bin/tools/named-rrchecker.c index 806b7011e6..d424b34c96 100644 --- a/bin/tools/named-rrchecker.c +++ b/bin/tools/named-rrchecker.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -26,7 +27,6 @@ #include #include #include -#include static isc_mem_t *mctx; static isc_lex_t *lex; @@ -175,7 +175,7 @@ main(int argc, char *argv[]) { result = dns_name_fromstring(name, origin, 0, NULL); if (result != ISC_R_SUCCESS) { fatal("dns_name_fromstring: %s", - dns_result_totext(result)); + isc_result_totext(result)); } } @@ -209,7 +209,7 @@ main(int argc, char *argv[]) { &rdclass, &token.value.as_textregion); if (result != ISC_R_SUCCESS) { fatal("dns_rdataclass_fromtext: %s", - dns_result_totext(result)); + isc_result_totext(result)); } if (dns_rdataclass_ismeta(rdclass)) { fatal("class %.*s(%d) is a meta value", @@ -250,7 +250,7 @@ main(int argc, char *argv[]) { &rdtype, &token.value.as_textregion); if (result != ISC_R_SUCCESS) { fatal("dns_rdatatype_fromtext: %s", - dns_result_totext(result)); + isc_result_totext(result)); } if (dns_rdatatype_ismeta(rdtype)) { fatal("type %.*s(%d) is a meta value", @@ -266,7 +266,7 @@ main(int argc, char *argv[]) { 0, mctx, &dbuf, NULL); if (result != ISC_R_SUCCESS) { fatal("dns_rdata_fromtext: %s", - dns_result_totext(result)); + isc_result_totext(result)); } once = true; } @@ -282,19 +282,19 @@ main(int argc, char *argv[]) { result = dns_rdataclass_totext(rdclass, &tbuf); if (result != ISC_R_SUCCESS) { fatal("dns_rdataclass_totext: %s", - dns_result_totext(result)); + isc_result_totext(result)); } isc_buffer_putstr(&tbuf, "\t"); result = dns_rdatatype_totext(rdtype, &tbuf); if (result != ISC_R_SUCCESS) { fatal("dns_rdatatype_totext: %s", - dns_result_totext(result)); + isc_result_totext(result)); } isc_buffer_putstr(&tbuf, "\t"); result = dns_rdata_totext(&rdata, NULL, &tbuf); if (result != ISC_R_SUCCESS) { fatal("dns_rdata_totext: %s", - dns_result_totext(result)); + isc_result_totext(result)); } printf("%.*s\n", (int)tbuf.used, (char *)tbuf.base); @@ -306,13 +306,13 @@ main(int argc, char *argv[]) { result = dns_rdataclass_tounknowntext(rdclass, &tbuf); if (result != ISC_R_SUCCESS) { fatal("dns_rdataclass_tounknowntext: %s", - dns_result_totext(result)); + isc_result_totext(result)); } isc_buffer_putstr(&tbuf, "\t"); result = dns_rdatatype_tounknowntext(rdtype, &tbuf); if (result != ISC_R_SUCCESS) { fatal("dns_rdatatype_tounknowntext: %s", - dns_result_totext(result)); + isc_result_totext(result)); } isc_buffer_putstr(&tbuf, "\t"); result = dns_rdata_tofmttext(&rdata, NULL, @@ -320,7 +320,7 @@ main(int argc, char *argv[]) { "", &tbuf); if (result != ISC_R_SUCCESS) { fatal("dns_rdata_tofmttext: %sn", - dns_result_totext(result)); + isc_result_totext(result)); } printf("%.*s\n", (int)tbuf.used, (char *)tbuf.base); diff --git a/configure.ac b/configure.ac index e6435b96b5..e68e78b1cc 100644 --- a/configure.ac +++ b/configure.ac @@ -1549,7 +1549,6 @@ AC_CONFIG_FILES([lib/isc/tests/Makefile lib/dns/tests/Makefile lib/ns/tests/Makefile lib/irs/tests/Makefile - lib/isccc/tests/Makefile lib/isccfg/tests/Makefile]) AC_CONFIG_FILES([lib/unit-test-driver.sh], diff --git a/doc/design/logging b/doc/design/logging index 74087eec56..19accc1fc0 100644 --- a/doc/design/logging +++ b/doc/design/logging @@ -479,7 +479,7 @@ differentiate very similar messages in the same module. When available, include standard library return codes via %s in the format string, with strerrr(errno) from the system library or functions -like isc_result_totext(result) and dns_result_totext(result). +like isc_result_totext(result) and isc_result_totext(result). THINGS I AM NOT KEEN ABOUT diff --git a/fuzz/dns_message_parse.c b/fuzz/dns_message_parse.c index 01d42068bb..76dfc83ebe 100644 --- a/fuzz/dns_message_parse.c +++ b/fuzz/dns_message_parse.c @@ -18,11 +18,11 @@ #include #include #include +#include #include #include #include -#include #include "fuzz.h" diff --git a/lib/bind9/check.c b/lib/bind9/check.c index ac1ab2f4a9..f78671054f 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -50,13 +50,11 @@ #include #include #include -#include #include #include #include #include -#include #include #include diff --git a/lib/dns/Makefile.am b/lib/dns/Makefile.am index b763756b5e..8fc70b5524 100644 --- a/lib/dns/Makefile.am +++ b/lib/dns/Makefile.am @@ -145,8 +145,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) \ @@ -174,7 +173,6 @@ libdns_la_SOURCES = \ dst_openssl.h \ dst_parse.c \ dst_parse.h \ - dst_result.c \ dyndb.c \ ecs.c \ fixedname.c \ diff --git a/lib/dns/adb.c b/lib/dns/adb.c index e3a469222f..f2fdb8622f 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include /* Required for HP/UX (and others?) */ #include @@ -40,7 +41,6 @@ #include #include #include -#include #include #define DNS_ADB_MAGIC ISC_MAGIC('D', 'a', 'd', 'b') @@ -3825,6 +3825,8 @@ dbfind_name(dns_adbname_t *adbname, isc_stdtime_t now, dns_rdatatype_t rdtype) { adbname->fetch6_err = FIND_ERR_SUCCESS; } break; + default: + break; } if (dns_rdataset_isassociated(&rdataset)) { @@ -3976,7 +3978,7 @@ fetch_callback(isc_task_t *task, isc_event_t *ev) { dns_name_format(&name->name, buf, sizeof(buf)); DP(DEF_LEVEL, "adb: fetch of '%s' %s failed: %s", buf, address_type == DNS_ADBFIND_INET ? "A" : "AAAA", - dns_result_totext(dev->result)); + isc_result_totext(dev->result)); /* * Don't record a failure unless this is the initial * fetch of a chain. diff --git a/lib/dns/byaddr.c b/lib/dns/byaddr.c index 6cd24371a4..86d9de1859 100644 --- a/lib/dns/byaddr.c +++ b/lib/dns/byaddr.c @@ -16,6 +16,7 @@ #include #include #include +#include #include /* Required for HP/UX (and others?) */ #include #include @@ -28,7 +29,6 @@ #include #include #include -#include #include /* diff --git a/lib/dns/cache.c b/lib/dns/cache.c index 60de98f2bf..14c56afb0e 100644 --- a/lib/dns/cache.c +++ b/lib/dns/cache.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -33,7 +34,6 @@ #include #include #include -#include #include #ifdef HAVE_JSON_C @@ -467,7 +467,7 @@ cache_cleaner_init(dns_cache_t *cache, isc_taskmgr_t *taskmgr, if (result != ISC_R_SUCCESS) { UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_task_create() failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); result = ISC_R_UNEXPECTED; goto cleanup; } @@ -481,7 +481,7 @@ cache_cleaner_init(dns_cache_t *cache, isc_taskmgr_t *taskmgr, UNEXPECTED_ERROR(__FILE__, __LINE__, "cache cleaner: " "isc_task_onshutdown() failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } @@ -548,7 +548,7 @@ begin_cleaning(cache_cleaner_t *cleaner) { UNEXPECTED_ERROR(__FILE__, __LINE__, "cache cleaner: " "dns_dbiterator_first() failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); dns_dbiterator_destroy(&cleaner->iterator); } else if (cleaner->iterator != NULL) { result = dns_dbiterator_pause(cleaner->iterator); @@ -689,7 +689,7 @@ incremental_cleaning_action(isc_task_t *task, isc_event_t *event) { "cache cleaner: " "dns_dbiterator_current() " "failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); end_cleaning(cleaner, event); return; @@ -718,7 +718,7 @@ incremental_cleaning_action(isc_task_t *task, isc_event_t *event) { "cache cleaner: " "dns_dbiterator_next() " "failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); } else if (cleaner->overmem) { result = dns_dbiterator_first(cleaner->iterator); @@ -793,7 +793,7 @@ dns_cache_clean(dns_cache_t *cache, isc_stdtime_t now) { UNEXPECTED_ERROR(__FILE__, __LINE__, "cache cleaner: dns_db_expirenode() " "failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); /* * Continue anyway. */ diff --git a/lib/dns/client.c b/lib/dns/client.c index 9902e2d571..1e18f96e69 100644 --- a/lib/dns/client.c +++ b/lib/dns/client.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -43,7 +44,6 @@ #include #include #include -#include #include #include #include diff --git a/lib/dns/compress.c b/lib/dns/compress.c index c78e643290..01d2d31225 100644 --- a/lib/dns/compress.c +++ b/lib/dns/compress.c @@ -17,13 +17,13 @@ #include #include +#include #include #include #include #include #include -#include #define CCTX_MAGIC ISC_MAGIC('C', 'C', 'T', 'X') #define VALID_CCTX(x) ISC_MAGIC_VALID(x, CCTX_MAGIC) diff --git a/lib/dns/db.c b/lib/dns/db.c index 3a96f1d934..c25b07d47f 100644 --- a/lib/dns/db.c +++ b/lib/dns/db.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,6 @@ #include #include #include -#include /*** *** Private Types diff --git a/lib/dns/diff.c b/lib/dns/diff.c index 2adce92ec4..44aa9c61f6 100644 --- a/lib/dns/diff.c +++ b/lib/dns/diff.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -30,7 +31,6 @@ #include #include #include -#include #include #define CHECK(op) \ @@ -616,7 +616,7 @@ dns_diff_print(dns_diff_t *diff, FILE *file) { if (result != ISC_R_SUCCESS) { UNEXPECTED_ERROR(__FILE__, __LINE__, "diff_tuple_tordataset failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); result = ISC_R_UNEXPECTED; goto cleanup; } diff --git a/lib/dns/dns64.c b/lib/dns/dns64.c index cc99a1639e..f394aa1250 100644 --- a/lib/dns/dns64.c +++ b/lib/dns/dns64.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -22,7 +23,6 @@ #include #include #include -#include struct dns_dns64 { unsigned char bits[16]; /* diff --git a/lib/dns/dnsrps.c b/lib/dns/dnsrps.c index ecc9b8f5a1..fba9889c0e 100644 --- a/lib/dns/dnsrps.c +++ b/lib/dns/dnsrps.c @@ -24,10 +24,11 @@ #include #define LIBRPZ_LIB_OPEN DNSRPS_LIB_OPEN +#include + #include #include #include -#include #include librpz_t *librpz; diff --git a/lib/dns/dnssec.c b/lib/dns/dnssec.c index af94681df2..6e1dc30f7c 100644 --- a/lib/dns/dnssec.c +++ b/lib/dns/dnssec.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -36,12 +37,9 @@ #include #include #include -#include #include #include /* for DNS_TSIG_FUDGE */ -#include - isc_stats_t *dns_dnssec_stats; #define is_response(msg) ((msg->flags & DNS_MESSAGEFLAG_QR) != 0) diff --git a/lib/dns/dnstap.c b/lib/dns/dnstap.c index 56649f33c0..0f44b77fa5 100644 --- a/lib/dns/dnstap.c +++ b/lib/dns/dnstap.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -72,7 +73,6 @@ #include #include #include -#include #include #include #include diff --git a/lib/dns/ds.c b/lib/dns/ds.c index d357e6602b..26e5cefcb5 100644 --- a/lib/dns/ds.c +++ b/lib/dns/ds.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -23,7 +24,6 @@ #include #include #include -#include #include diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c index f530371668..9b4f28f49f 100644 --- a/lib/dns/dst_api.c +++ b/lib/dns/dst_api.c @@ -47,6 +47,8 @@ #define DST_KEY_INTERNAL +#include + #include #include #include @@ -55,8 +57,6 @@ #include #include -#include - #include "dst_internal.h" #define DST_AS_STR(t) ((t).value.as_textregion.base) @@ -190,8 +190,6 @@ dst_lib_init(isc_mem_t *mctx, const char *engine) { UNUSED(engine); - dst_result_register(); - memset(dst_t_func, 0, sizeof(dst_t_func)); RETERR(dst__hmacmd5_init(&dst_t_func[DST_ALG_HMACMD5])); RETERR(dst__hmacsha1_init(&dst_t_func[DST_ALG_HMACSHA1])); diff --git a/lib/dns/dst_parse.c b/lib/dns/dst_parse.c index e4bc9778ef..dc47c5892e 100644 --- a/lib/dns/dst_parse.c +++ b/lib/dns/dst_parse.c @@ -41,8 +41,8 @@ #include #include -#include "dst/result.h" #include "dst_internal.h" +#include "isc/result.h" #define DST_AS_STR(t) ((t).value.as_textregion.base) diff --git a/lib/dns/dst_result.c b/lib/dns/dst_result.c deleted file mode 100644 index 0bcfb3c4c1..0000000000 --- a/lib/dns/dst_result.c +++ /dev/null @@ -1,108 +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. - */ - -#include -#include - -#include - -static const char *text[DST_R_NRESULTS] = { - "algorithm is unsupported", /*%< 0 */ - "crypto failure", /*%< 1 */ - "built with no crypto support", /*%< 2 */ - "illegal operation for a null key", /*%< 3 */ - "public key is invalid", /*%< 4 */ - "private key is invalid", /*%< 5 */ - "external key", /*%< 6 */ - "error occurred writing key to disk", /*%< 7 */ - "invalid algorithm specific parameter", /*%< 8 */ - "UNUSED9", /*%< 9 */ - "UNUSED10", /*%< 10 */ - "sign failure", /*%< 11 */ - "UNUSED12", /*%< 12 */ - "UNUSED13", /*%< 13 */ - "verify failure", /*%< 14 */ - "not a public key", /*%< 15 */ - "not a private key", /*%< 16 */ - "not a key that can compute a secret", /*%< 17 */ - "failure computing a shared secret", /*%< 18 */ - "no randomness available", /*%< 19 */ - "bad key type", /*%< 20 */ - "no engine", /*%< 21 */ - "illegal operation for an external key", /*%< 22 */ -}; - -static const char *ids[DST_R_NRESULTS] = { - "DST_R_UNSUPPORTEDALG", - "DST_R_CRYPTOFAILURE", - "DST_R_NOCRYPTO", - "DST_R_NULLKEY", - "DST_R_INVALIDPUBLICKEY", - "DST_R_INVALIDPRIVATEKEY", - "UNUSED", - "DST_R_WRITEERROR", - "DST_R_INVALIDPARAM", - "UNUSED", - "UNUSED", - "DST_R_SIGNFAILURE", - "UNUSED", - "UNUSED", - "DST_R_VERIFYFAILURE", - "DST_R_NOTPUBLICKEY", - "DST_R_NOTPRIVATEKEY", - "DST_R_KEYCANNOTCOMPUTESECRET", - "DST_R_COMPUTESECRETFAILURE", - "DST_R_NORANDOMNESS", - "DST_R_BADKEYTYPE", - "DST_R_NOENGINE", - "DST_R_EXTERNALKEY", -}; - -#define DST_RESULT_RESULTSET 2 - -static isc_once_t once = ISC_ONCE_INIT; - -static void -initialize_action(void) { - isc_result_t result; - - result = isc_result_register(ISC_RESULTCLASS_DST, DST_R_NRESULTS, text, - DST_RESULT_RESULTSET); - if (result != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_result_register() failed: %u", result); - } - result = isc_result_registerids(ISC_RESULTCLASS_DST, DST_R_NRESULTS, - ids, DST_RESULT_RESULTSET); - if (result != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_result_registerids() failed: %u", result); - } -} - -static void -initialize(void) { - RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); -} - -const char * -dst_result_totext(isc_result_t result) { - initialize(); - - return (isc_result_totext(result)); -} - -void -dst_result_register(void) { - initialize(); -} - -/*! \file */ diff --git a/lib/dns/forward.c b/lib/dns/forward.c index b8602324f0..ad4848122e 100644 --- a/lib/dns/forward.c +++ b/lib/dns/forward.c @@ -13,12 +13,12 @@ #include #include +#include #include #include #include #include -#include #include struct dns_fwdtable { diff --git a/lib/dns/gssapi_link.c b/lib/dns/gssapi_link.c index f595d3c87e..ff6f322d75 100644 --- a/lib/dns/gssapi_link.c +++ b/lib/dns/gssapi_link.c @@ -29,11 +29,11 @@ #include #include #include +#include #include #include #include -#include #include "dst_internal.h" #include "dst_parse.h" diff --git a/lib/dns/gssapictx.c b/lib/dns/gssapictx.c index 546bfa1a9d..e2201e1ab5 100644 --- a/lib/dns/gssapictx.c +++ b/lib/dns/gssapictx.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -52,11 +53,9 @@ #include #include #include -#include #include #include -#include #include "dst_internal.h" diff --git a/lib/dns/hmac_link.c b/lib/dns/hmac_link.c index 881a9d1193..dae5b93861 100644 --- a/lib/dns/hmac_link.c +++ b/lib/dns/hmac_link.c @@ -32,12 +32,11 @@ #include #include #include +#include #include #include #include -#include - #include "dst_internal.h" #ifdef HAVE_FIPS_MODE #include "dst_openssl.h" /* FIPS_mode() prototype */ diff --git a/lib/dns/include/dns/result.h b/lib/dns/include/dns/result.h index 22a75b5d24..a4dbc9cff6 100644 --- a/lib/dns/include/dns/result.h +++ b/lib/dns/include/dns/result.h @@ -15,196 +15,18 @@ /*! \file dns/result.h */ #include -#include +#include #include -/* - * Nothing in this file truly depends on , but the - * DNS 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. */ - -/* - * 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_INCONSISTENTRR (ISC_RESULTCLASS_DNS + 127) - -#define DNS_R_NRESULTS 128 /*%< 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); +isc_result_t +dns_result_fromrcode(dns_rcode_t rcode); + ISC_LANG_ENDDECLS #endif /* DNS_RESULT_H */ diff --git a/lib/dns/include/dst/result.h b/lib/dns/include/dst/result.h deleted file mode 100644 index 16e2c83870..0000000000 --- a/lib/dns/include/dst/result.h +++ /dev/null @@ -1,65 +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 DST_RESULT_H -#define DST_RESULT_H 1 - -/*! \file dst/result.h */ - -#include -#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) -/* compat */ -#define DST_R_OPENSSLFAILURE DST_R_CRYPTOFAILURE -#define DST_R_NOCRYPTO (ISC_RESULTCLASS_DST + 2) -#define DST_R_NULLKEY (ISC_RESULTCLASS_DST + 3) -#define DST_R_INVALIDPUBLICKEY (ISC_RESULTCLASS_DST + 4) -#define DST_R_INVALIDPRIVATEKEY (ISC_RESULTCLASS_DST + 5) -/* 6 is unused */ -#define DST_R_WRITEERROR (ISC_RESULTCLASS_DST + 7) -#define DST_R_INVALIDPARAM (ISC_RESULTCLASS_DST + 8) -/* 9 is unused */ -/* 10 is unused */ -#define DST_R_SIGNFAILURE (ISC_RESULTCLASS_DST + 11) -/* 12 is unused */ -/* 13 is unused */ -#define DST_R_VERIFYFAILURE (ISC_RESULTCLASS_DST + 14) -#define DST_R_NOTPUBLICKEY (ISC_RESULTCLASS_DST + 15) -#define DST_R_NOTPRIVATEKEY (ISC_RESULTCLASS_DST + 16) -#define DST_R_KEYCANNOTCOMPUTESECRET (ISC_RESULTCLASS_DST + 17) -#define DST_R_COMPUTESECRETFAILURE (ISC_RESULTCLASS_DST + 18) -#define DST_R_NORANDOMNESS (ISC_RESULTCLASS_DST + 19) -#define DST_R_BADKEYTYPE (ISC_RESULTCLASS_DST + 20) -#define DST_R_NOENGINE (ISC_RESULTCLASS_DST + 21) -#define DST_R_EXTERNALKEY (ISC_RESULTCLASS_DST + 22) - -#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/dns/journal.c b/lib/dns/journal.c index 6639ddc3f3..e900d230c2 100644 --- a/lib/dns/journal.c +++ b/lib/dns/journal.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -33,7 +34,6 @@ #include #include #include -#include #include /*! \file diff --git a/lib/dns/keymgr.c b/lib/dns/keymgr.c index 6c04682004..f94de5148e 100644 --- a/lib/dns/keymgr.c +++ b/lib/dns/keymgr.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -28,10 +29,8 @@ #include #include #include -#include #include -#include #define RETERR(x) \ do { \ diff --git a/lib/dns/keytable.c b/lib/dns/keytable.c index ea84269d57..f980bc5565 100644 --- a/lib/dns/keytable.c +++ b/lib/dns/keytable.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include /* Required for HP/UX (and others?) */ #include @@ -28,7 +29,6 @@ #include #include #include -#include #define KEYTABLE_MAGIC ISC_MAGIC('K', 'T', 'b', 'l') #define VALID_KEYTABLE(kt) ISC_MAGIC_VALID(kt, KEYTABLE_MAGIC) diff --git a/lib/dns/lookup.c b/lib/dns/lookup.c index 6d9dadd165..b72bbf7758 100644 --- a/lib/dns/lookup.c +++ b/lib/dns/lookup.c @@ -15,6 +15,7 @@ #include #include +#include #include /* Required for HP/UX (and others?) */ #include #include @@ -26,7 +27,6 @@ #include #include #include -#include #include struct dns_lookup { diff --git a/lib/dns/master.c b/lib/dns/master.c index 4caf56c7ce..0233057499 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -39,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -305,18 +305,18 @@ loadctx_destroy(dns_loadctx_t *lctx); result == ISC_R_NOPERM) \ (*callbacks->error)(callbacks, "%s: %s:%lu: %s: %s", \ "dns_master_load", source, line, filename, \ - dns_result_totext(result)); \ + isc_result_totext(result)); \ else \ LOGIT(result) #define LOGIT(result) \ if (result == ISC_R_NOMEMORY) \ (*callbacks->error)(callbacks, "dns_master_load: %s", \ - dns_result_totext(result)); \ + isc_result_totext(result)); \ else \ (*callbacks->error)(callbacks, "%s: %s:%lu: %s", \ "dns_master_load", source, line, \ - dns_result_totext(result)) + isc_result_totext(result)) static unsigned char in_addr_arpa_data[] = "\007IN-ADDR\004ARPA"; static unsigned char in_addr_arpa_offsets[] = { 0, 8, 13 }; @@ -914,10 +914,10 @@ generate(dns_loadctx_t *lctx, char *range, char *lhs, char *gtype, char *rhs, error_cleanup: if (result == ISC_R_NOMEMORY) { (*callbacks->error)(callbacks, "$GENERATE: %s", - dns_result_totext(result)); + isc_result_totext(result)); } else { (*callbacks->error)(callbacks, "$GENERATE: %s:%lu: %s", source, - line, dns_result_totext(result)); + line, isc_result_totext(result)); } insist_cleanup: @@ -1738,7 +1738,7 @@ load_text(dns_loadctx_t *lctx) { dns_rdatatype_format(type, typebuf, sizeof(typebuf)); (*callbacks->error)(callbacks, "%s:%lu: %s '%s': %s", source, line, "type", typebuf, - dns_result_totext(result)); + isc_result_totext(result)); if (MANYERRS(lctx, result)) { SETRESULT(lctx, result); } else { @@ -1758,7 +1758,7 @@ load_text(dns_loadctx_t *lctx) { dns_rdatatype_format(type, typebuf, sizeof(typebuf)); (*callbacks->error)(callbacks, "%s:%lu: %s '%s': %s", source, line, "type", typebuf, - dns_result_totext(result)); + isc_result_totext(result)); if (MANYERRS(lctx, result)) { SETRESULT(lctx, result); } else { @@ -1817,7 +1817,7 @@ load_text(dns_loadctx_t *lctx) { const char *desc; dns_name_format(name, namebuf, sizeof(namebuf)); result = DNS_R_BADOWNERNAME; - desc = dns_result_totext(result); + desc = isc_result_totext(result); if (CHECKNAMESFAIL(lctx->options) || type == dns_rdatatype_nsec3) { (*callbacks->error)( @@ -2614,7 +2614,7 @@ cleanup: } if (result != ISC_R_SUCCESS && result != DNS_R_CONTINUE) { (*callbacks->error)(callbacks, "dns_master_load: %s", - dns_result_totext(result)); + isc_result_totext(result)); } return (result); @@ -3064,17 +3064,17 @@ commit(dns_rdatacallbacks_t *callbacks, dns_loadctx_t *lctx, &dataset)); if (result == ISC_R_NOMEMORY) { (*error)(callbacks, "dns_master_load: %s", - dns_result_totext(result)); + isc_result_totext(result)); } else if (result != ISC_R_SUCCESS) { dns_name_format(owner, namebuf, sizeof(namebuf)); if (source != NULL) { (*error)(callbacks, "%s: %s:%lu: %s: %s", "dns_master_load", source, line, - namebuf, dns_result_totext(result)); + namebuf, isc_result_totext(result)); } else { (*error)(callbacks, "%s: %s: %s", "dns_master_load", namebuf, - dns_result_totext(result)); + isc_result_totext(result)); } } if (MANYERRS(lctx, result)) { diff --git a/lib/dns/masterdump.c b/lib/dns/masterdump.c index f761376347..b1c94c6332 100644 --- a/lib/dns/masterdump.c +++ b/lib/dns/masterdump.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -43,7 +44,6 @@ #include #include #include -#include #include #include diff --git a/lib/dns/message.c b/lib/dns/message.c index ad36e1887b..76bf8435b0 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -22,6 +22,7 @@ #include #include #include +#include #include /* Required for HP/UX (and others?) */ #include #include @@ -37,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/lib/dns/name.c b/lib/dns/name.c index f3333ba38e..909064c19d 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -29,7 +30,6 @@ #include #include #include -#include #define VALID_NAME(n) ISC_MAGIC_VALID(n, DNS_NAME_MAGIC) diff --git a/lib/dns/nsec.c b/lib/dns/nsec.c index 7a59e0d81c..cbb27d6062 100644 --- a/lib/dns/nsec.c +++ b/lib/dns/nsec.c @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -24,7 +25,6 @@ #include #include #include -#include #include diff --git a/lib/dns/nsec3.c b/lib/dns/nsec3.c index 8a5c99a081..639d47ece7 100644 --- a/lib/dns/nsec3.c +++ b/lib/dns/nsec3.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,6 @@ #include #include #include -#include #include #include diff --git a/lib/dns/nta.c b/lib/dns/nta.c index b4033b4aa9..a281e35c1b 100644 --- a/lib/dns/nta.c +++ b/lib/dns/nta.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -33,7 +34,6 @@ #include #include #include -#include #include struct dns_nta { diff --git a/lib/dns/openssl_link.c b/lib/dns/openssl_link.c index e6f8a5a409..0f32c75305 100644 --- a/lib/dns/openssl_link.c +++ b/lib/dns/openssl_link.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -33,8 +34,6 @@ #include -#include - #include "dst_internal.h" #include "dst_openssl.h" diff --git a/lib/dns/openssldh_link.c b/lib/dns/openssldh_link.c index b49f26fe56..5bee2fc6f1 100644 --- a/lib/dns/openssldh_link.c +++ b/lib/dns/openssldh_link.c @@ -32,12 +32,11 @@ #include #include +#include #include #include #include -#include - #include "dst_internal.h" #include "dst_openssl.h" #include "dst_parse.h" diff --git a/lib/dns/opensslecdsa_link.c b/lib/dns/opensslecdsa_link.c index 3d74630ff9..e6fa3dd07b 100644 --- a/lib/dns/opensslecdsa_link.c +++ b/lib/dns/opensslecdsa_link.c @@ -22,14 +22,13 @@ #endif #include +#include #include #include #include #include -#include - #include "dst_internal.h" #include "dst_openssl.h" #include "dst_parse.h" diff --git a/lib/dns/openssleddsa_link.c b/lib/dns/openssleddsa_link.c index f083a6911c..a81e0faa8a 100644 --- a/lib/dns/openssleddsa_link.c +++ b/lib/dns/openssleddsa_link.c @@ -31,8 +31,6 @@ #include -#include - #include "dst_internal.h" #include "dst_openssl.h" #include "dst_parse.h" diff --git a/lib/dns/opensslrsa_link.c b/lib/dns/opensslrsa_link.c index c0c2eccc0f..f378abf420 100644 --- a/lib/dns/opensslrsa_link.c +++ b/lib/dns/opensslrsa_link.c @@ -20,12 +20,11 @@ #include #include +#include #include #include #include -#include - #include "dst_internal.h" #include "dst_openssl.h" #include "dst_parse.h" diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c index a39ecc8d7a..42f2594407 100644 --- a/lib/dns/rbt.c +++ b/lib/dns/rbt.c @@ -35,10 +35,11 @@ #include +#include + #include #include #include -#include #define CHECK(x) \ do { \ @@ -1545,7 +1546,7 @@ dns_rbt_formatnodename(dns_rbtnode_t *node, char *printname, dns_name_format(name, printname, size); } else { snprintf(printname, size, "", - dns_result_totext(result)); + isc_result_totext(result)); } return (printname); diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 97b8e6e804..7577bbe999 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -55,7 +56,6 @@ #include #include #include -#include #include #include #include @@ -2594,7 +2594,7 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp, bool commit) { DNS_LOGMODULE_ZONE, ISC_LOG_ERROR, "Unable to reinsert header to " "re-signing heap: %s", - dns_result_totext(result)); + isc_result_totext(result)); } } decrement_reference(rbtdb, header->node, least_serial, diff --git a/lib/dns/rcode.c b/lib/dns/rcode.c index b1a62f1e5f..91bf3409e3 100644 --- a/lib/dns/rcode.c +++ b/lib/dns/rcode.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index a655233204..2e6ca29b7a 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -39,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -2100,7 +2100,7 @@ warn_badmx(isc_token_t *token, isc_lex_t *lexer, line = isc_lex_getsourceline(lexer); (*callbacks->warn)(callbacks, "%s:%u: warning: '%s': %s", file, line, DNS_AS_STR(*token), - dns_result_totext(DNS_R_MXISADDRESS)); + isc_result_totext(DNS_R_MXISADDRESS)); } } @@ -2117,7 +2117,7 @@ warn_badname(const dns_name_t *name, isc_lex_t *lexer, dns_name_format(name, namebuf, sizeof(namebuf)); (*callbacks->warn)(callbacks, "%s:%u: warning: %s: %s", file, line, namebuf, - dns_result_totext(DNS_R_BADNAME)); + isc_result_totext(DNS_R_BADNAME)); } } @@ -2134,35 +2134,35 @@ fromtext_error(void (*callback)(dns_rdatacallbacks_t *, const char *, ...), case isc_tokentype_eol: (*callback)(callbacks, "%s: %s:%lu: near eol: %s", "dns_rdata_fromtext", name, line, - dns_result_totext(result)); + isc_result_totext(result)); break; case isc_tokentype_eof: (*callback)(callbacks, "%s: %s:%lu: near eof: %s", "dns_rdata_fromtext", name, line, - dns_result_totext(result)); + isc_result_totext(result)); break; case isc_tokentype_number: (*callback)(callbacks, "%s: %s:%lu: near %lu: %s", "dns_rdata_fromtext", name, line, token->value.as_ulong, - dns_result_totext(result)); + isc_result_totext(result)); break; case isc_tokentype_string: case isc_tokentype_qstring: (*callback)(callbacks, "%s: %s:%lu: near '%s': %s", "dns_rdata_fromtext", name, line, DNS_AS_STR(*token), - dns_result_totext(result)); + isc_result_totext(result)); break; default: (*callback)(callbacks, "%s: %s:%lu: %s", "dns_rdata_fromtext", name, line, - dns_result_totext(result)); + isc_result_totext(result)); break; } } else { (*callback)(callbacks, "dns_rdata_fromtext: %s:%lu: %s", name, - line, dns_result_totext(result)); + line, isc_result_totext(result)); } } diff --git a/lib/dns/rdataslab.c b/lib/dns/rdataslab.c index 1d5e88f745..f027cad376 100644 --- a/lib/dns/rdataslab.c +++ b/lib/dns/rdataslab.c @@ -16,13 +16,13 @@ #include #include +#include #include /* Required for HP/UX (and others?) */ #include #include #include #include -#include /* * The rdataslab structure allows iteration to occur in both load order diff --git a/lib/dns/request.c b/lib/dns/request.c index 0e3619d93a..98a389b594 100644 --- a/lib/dns/request.c +++ b/lib/dns/request.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -29,7 +30,6 @@ #include #include #include -#include #include #define REQUESTMGR_MAGIC ISC_MAGIC('R', 'q', 'u', 'M') @@ -619,7 +619,7 @@ cleanup: } req_detach(&request); req_log(ISC_LOG_DEBUG(3), "dns_request_createraw: failed %s", - dns_result_totext(result)); + isc_result_totext(result)); return (result); } @@ -792,7 +792,7 @@ cleanup: } req_detach(&request); req_log(ISC_LOG_DEBUG(3), "dns_request_createvia: failed %s", - dns_result_totext(result)); + isc_result_totext(result)); return (result); } @@ -1055,7 +1055,7 @@ req_response(isc_result_t result, isc_region_t *region, void *arg) { dns_request_t *request = (dns_request_t *)arg; req_log(ISC_LOG_DEBUG(3), "req_response: request %p: %s", request, - dns_result_totext(result)); + isc_result_totext(result)); if (result == ISC_R_CANCELED || result == ISC_R_EOF) { return; diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 828f732c47..7a50004310 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -56,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -3107,7 +3107,7 @@ add_bad(fetchctx_t *fctx, dns_message_t *rmessage, dns_adbaddrinfo_t *addrinfo, isc_log_write( dns_lctx, DNS_LOGCATEGORY_LAME_SERVERS, DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, "%s%s%s resolving '%s/%s/%s': %s", code, spc, - dns_result_totext(reason), namebuf, typebuf, classbuf, addrbuf); + isc_result_totext(reason), namebuf, typebuf, classbuf, addrbuf); } /* diff --git a/lib/dns/result.c b/lib/dns/result.c index b037e7f609..fa6395327e 100644 --- a/lib/dns/result.c +++ b/lib/dns/result.c @@ -12,386 +12,12 @@ /*! \file */ #include +#include #include #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 */ - "inconsistent resource record", /*%< 127 DNS_R_INCONSISTENTRR */ -}; - -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", - "DNS_R_INCONSISTENTRR", -}; - -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", -}; - -#define DNS_RESULT_RESULTSET 2 -#define DNS_RESULT_RCODERESULTSET 3 - -static isc_once_t once = ISC_ONCE_INIT; - -static void -initialize_action(void) { - isc_result_t result; - - result = isc_result_register(ISC_RESULTCLASS_DNS, DNS_R_NRESULTS, text, - DNS_RESULT_RESULTSET); - if (result == ISC_R_SUCCESS) { - result = isc_result_register(ISC_RESULTCLASS_DNSRCODE, - DNS_R_NRCODERESULTS, rcode_text, - DNS_RESULT_RCODERESULTSET); - } - if (result != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_result_register() failed: %u", result); - } - - result = isc_result_registerids(ISC_RESULTCLASS_DNS, DNS_R_NRESULTS, - ids, DNS_RESULT_RESULTSET); - if (result == ISC_R_SUCCESS) { - result = isc_result_registerids(ISC_RESULTCLASS_DNSRCODE, - DNS_R_NRCODERESULTS, rcode_ids, - DNS_RESULT_RCODERESULTSET); - } - if (result != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_result_registerids() failed: %u", result); - } -} - -static void -initialize(void) { - RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); -} - -const char * -dns_result_totext(isc_result_t result) { - initialize(); - - return (isc_result_totext(result)); -} - -void -dns_result_register(void) { - initialize(); -} +#define DNS_RESULT_ISRCODE(result) (DNS_R_NOERROR == ((result)&0xFFFF0000)) dns_rcode_t dns_result_torcode(isc_result_t result) { @@ -449,3 +75,14 @@ dns_result_torcode(isc_result_t result) { return (rcode); } + +isc_result_t +dns_result_fromrcode(dns_rcode_t rcode) { + /* + * Rcodes can't be bigger than 12 bits, which is why we + * AND with 0xFFF instead of 0xFFFF. + */ + REQUIRE((rcode & 0xFFF) == rcode); + + return ((isc_result_t)rcode + DNS_R_NOERROR); +} diff --git a/lib/dns/rootns.c b/lib/dns/rootns.c index 885c2fb3ef..c3b3bb7abe 100644 --- a/lib/dns/rootns.c +++ b/lib/dns/rootns.c @@ -14,6 +14,7 @@ #include #include +#include #include /* Required for HP/UX (and others?) */ #include @@ -28,7 +29,6 @@ #include #include #include -#include #include #include @@ -484,7 +484,7 @@ dns_root_checkhints(dns_view_t *view, dns_db_t *hints, dns_db_t *db) { DNS_LOGMODULE_HINTS, ISC_LOG_WARNING, "checkhints%s%s: unable to get root NS rrset " "from hints: %s", - sep, viewname, dns_result_totext(result)); + sep, viewname, isc_result_totext(result)); goto cleanup; } @@ -495,7 +495,7 @@ dns_root_checkhints(dns_view_t *view, dns_db_t *hints, dns_db_t *db) { DNS_LOGMODULE_HINTS, ISC_LOG_WARNING, "checkhints%s%s: unable to get root NS rrset " "from cache: %s", - sep, viewname, dns_result_totext(result)); + sep, viewname, isc_result_totext(result)); goto cleanup; } diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index d3baa71c0d..b5f882b364 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -36,7 +37,6 @@ #include #include #include -#include #include #include diff --git a/lib/dns/rriterator.c b/lib/dns/rriterator.c index b519b93391..5c130601b0 100644 --- a/lib/dns/rriterator.c +++ b/lib/dns/rriterator.c @@ -17,6 +17,7 @@ #include +#include #include #include @@ -25,7 +26,6 @@ #include #include #include -#include #include /*** diff --git a/lib/dns/rrl.c b/lib/dns/rrl.c index 758bb1ed8d..0dda39b131 100644 --- a/lib/dns/rrl.c +++ b/lib/dns/rrl.c @@ -24,13 +24,13 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include diff --git a/lib/dns/sdb.c b/lib/dns/sdb.c index de2eb69ff8..da6c9e02d5 100644 --- a/lib/dns/sdb.c +++ b/lib/dns/sdb.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -36,7 +37,6 @@ #include #include #include -#include #include #include diff --git a/lib/dns/sdlz.c b/lib/dns/sdlz.c index 4077707c03..24957d5fed 100644 --- a/lib/dns/sdlz.c +++ b/lib/dns/sdlz.c @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -74,7 +75,6 @@ #include #include #include -#include #include #include diff --git a/lib/dns/tests/Makefile.am b/lib/dns/tests/Makefile.am index a90f97c79e..2441b42785 100644 --- a/lib/dns/tests/Makefile.am +++ b/lib/dns/tests/Makefile.am @@ -39,7 +39,6 @@ check_PROGRAMS = \ rdataset_test \ rdatasetstats_test \ resolver_test \ - result_test \ rsa_test \ sigs_test \ time_test \ diff --git a/lib/dns/tests/dh_test.c b/lib/dns/tests/dh_test.c index 2adc8f4b82..06f49f106d 100644 --- a/lib/dns/tests/dh_test.c +++ b/lib/dns/tests/dh_test.c @@ -22,13 +22,12 @@ #define UNIT_TESTING #include +#include #include #include #include -#include - #include "../dst_internal.h" #include "dnstest.h" diff --git a/lib/dns/tests/dnstest.c b/lib/dns/tests/dnstest.c index 990bc8ceb9..e415e7a0e0 100644 --- a/lib/dns/tests/dnstest.c +++ b/lib/dns/tests/dnstest.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,6 @@ #include #include #include -#include #include #include @@ -165,8 +165,6 @@ dns_test_begin(FILE *logfile, bool start_managers) { CHECK(isc_log_usechannel(logconfig, "stderr", NULL, NULL)); } - dns_result_register(); - if (start_managers) { CHECK(create_managers()); } diff --git a/lib/dns/tests/dnstest.h b/lib/dns/tests/dnstest.h index adc88913c2..d638e5bf24 100644 --- a/lib/dns/tests/dnstest.h +++ b/lib/dns/tests/dnstest.h @@ -18,13 +18,13 @@ #include #include #include +#include #include #include #include #include #include -#include #include typedef struct { diff --git a/lib/dns/tests/dst_test.c b/lib/dns/tests/dst_test.c index 288ac5b7b7..018f06a49b 100644 --- a/lib/dns/tests/dst_test.c +++ b/lib/dns/tests/dst_test.c @@ -24,12 +24,12 @@ #include #include +#include #include #include #include #include -#include #include "../dst_internal.h" #include "dnstest.h" diff --git a/lib/dns/tests/nsec3param_test.c b/lib/dns/tests/nsec3param_test.c index 65206bed7a..12ad4018c1 100644 --- a/lib/dns/tests/nsec3param_test.c +++ b/lib/dns/tests/nsec3param_test.c @@ -23,12 +23,12 @@ #include #include +#include #include #include #include #include -#include #include "../zone_p.h" #include "dnstest.h" diff --git a/lib/dns/tests/rbt_test.c b/lib/dns/tests/rbt_test.c index 08276827b7..3839ebc0cb 100644 --- a/lib/dns/tests/rbt_test.c +++ b/lib/dns/tests/rbt_test.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,6 @@ #include #include #include -#include #include diff --git a/lib/dns/tests/rdata_test.c b/lib/dns/tests/rdata_test.c index d64ffce789..4e7c2f7319 100644 --- a/lib/dns/tests/rdata_test.c +++ b/lib/dns/tests/rdata_test.c @@ -398,7 +398,7 @@ check_text_ok_single(const text_ok_t *text_ok, dns_rdataclass_t rdclass, if (debug && result != ISC_R_SUCCESS) { fprintf(stdout, "# '%s'\n", text_ok->text_in); fprintf(stdout, "# result=%s\n", - dns_result_totext(result)); + isc_result_totext(result)); } assert_int_equal(result, ISC_R_SUCCESS); } else { @@ -425,7 +425,7 @@ check_text_ok_single(const text_ok_t *text_ok, dns_rdataclass_t rdclass, if (result != ISC_R_SUCCESS && debug) { size_t i; fprintf(stdout, "# dns_rdata_totext -> %s", - dns_result_totext(result)); + isc_result_totext(result)); for (i = 0; i < rdata.length; i++) { if ((i % 16) == 0) { fprintf(stdout, "\n#"); @@ -528,7 +528,7 @@ check_text_conversions(dns_rdata_t *rdata) { buf_fromtext, sizeof(buf_fromtext), buf_totext, false); if (debug && result != ISC_R_SUCCESS) { - fprintf(stdout, "# result = %s\n", dns_result_totext(result)); + fprintf(stdout, "# result = %s\n", isc_result_totext(result)); fprintf(stdout, "# '%s'\n", buf_fromtext); } assert_int_equal(result, ISC_R_SUCCESS); @@ -809,7 +809,7 @@ check_textvsunknown_single(const textvsunknown_t *textvsunknown, false); if (debug && result != ISC_R_SUCCESS) { fprintf(stdout, "# '%s'\n", textvsunknown->text1); - fprintf(stdout, "# result=%s\n", dns_result_totext(result)); + fprintf(stdout, "# result=%s\n", isc_result_totext(result)); } assert_int_equal(result, ISC_R_SUCCESS); result = dns_test_rdatafromstring(&rdata2, rdclass, type, buf2, @@ -817,7 +817,7 @@ check_textvsunknown_single(const textvsunknown_t *textvsunknown, false); if (debug && result != ISC_R_SUCCESS) { fprintf(stdout, "# '%s'\n", textvsunknown->text2); - fprintf(stdout, "# result=%s\n", dns_result_totext(result)); + fprintf(stdout, "# result=%s\n", isc_result_totext(result)); } assert_int_equal(result, ISC_R_SUCCESS); if (debug && rdata1.length != rdata2.length) { diff --git a/lib/dns/tests/result_test.c b/lib/dns/tests/result_test.c deleted file mode 100644 index 66eeade0ec..0000000000 --- a/lib/dns/tests/result_test.c +++ /dev/null @@ -1,130 +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. - */ - -#if HAVE_CMOCKA - -#include -#include -#include -#include -#include - -#define UNIT_TESTING -#include - -#include -#include - -#include - -#include - -/* - * Check ids array is populated. - */ -static void -ids(void **state) { - const char *str; - isc_result_t result; - - UNUSED(state); - - dns_result_register(); - dst_result_register(); - - for (result = ISC_RESULTCLASS_DNS; - result < (ISC_RESULTCLASS_DNS + DNS_R_NRESULTS); result++) - { - str = isc_result_toid(result); - assert_non_null(str); - assert_string_not_equal(str, "(result code text not " - "available)"); - - str = isc_result_totext(result); - assert_non_null(str); - assert_string_not_equal(str, "(result code text not " - "available)"); - } - - str = isc_result_toid(result); - assert_non_null(str); - assert_string_equal(str, "(result code text not available)"); - - str = isc_result_totext(result); - assert_non_null(str); - assert_string_equal(str, "(result code text not available)"); - - for (result = ISC_RESULTCLASS_DST; - result < (ISC_RESULTCLASS_DST + DST_R_NRESULTS); result++) - { - str = isc_result_toid(result); - assert_non_null(str); - assert_string_not_equal(str, "(result code text not " - "available)"); - - str = isc_result_totext(result); - assert_non_null(str); - assert_string_not_equal(str, "(result code text not " - "available)"); - } - - str = isc_result_toid(result); - assert_non_null(str); - assert_string_equal(str, "(result code text not available)"); - - str = isc_result_totext(result); - assert_non_null(str); - assert_string_equal(str, "(result code text not available)"); - - for (result = ISC_RESULTCLASS_DNSRCODE; - result < (ISC_RESULTCLASS_DNSRCODE + DNS_R_NRCODERESULTS); - result++) - { - str = isc_result_toid(result); - assert_non_null(str); - assert_string_not_equal(str, "(result code text not " - "available)"); - - str = isc_result_totext(result); - assert_non_null(str); - assert_string_not_equal(str, "(result code text not " - "available)"); - } - - str = isc_result_toid(result); - assert_non_null(str); - assert_string_equal(str, "(result code text not available)"); - - str = isc_result_totext(result); - assert_non_null(str); - assert_string_equal(str, "(result code text not available)"); -} - -int -main(void) { - const struct CMUnitTest tests[] = { - cmocka_unit_test(ids), - }; - - return (cmocka_run_group_tests(tests, NULL, NULL)); -} - -#else /* HAVE_CMOCKA */ - -#include - -int -main(void) { - printf("1..0 # Skipped: cmocka not available\n"); - return (SKIPPED_TEST_EXIT_CODE); -} - -#endif /* if HAVE_CMOCKA */ diff --git a/lib/dns/tests/sigs_test.c b/lib/dns/tests/sigs_test.c index 9c59afa770..df1db3bb47 100644 --- a/lib/dns/tests/sigs_test.c +++ b/lib/dns/tests/sigs_test.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include diff --git a/lib/dns/time.c b/lib/dns/time.c index adeb419b23..5c635a8901 100644 --- a/lib/dns/time.c +++ b/lib/dns/time.c @@ -18,12 +18,12 @@ #include #include +#include #include #include #include /* Required for HP/UX (and others?) */ #include -#include #include static const int days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; diff --git a/lib/dns/tkey.c b/lib/dns/tkey.c index 29ac687b5a..d55e061678 100644 --- a/lib/dns/tkey.c +++ b/lib/dns/tkey.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -95,7 +96,7 @@ dumpmessage(dns_message_t *msg) { (char *)isc_buffer_base(&outbuf)); } else { tkey_log("Warning: dns_message_totext: %s", - dns_result_totext(result)); + isc_result_totext(result)); } break; } @@ -1221,7 +1222,7 @@ dns_tkey_processdhresponse(dns_message_t *qmsg, dns_message_t *rmsg, } if (rmsg->rcode != dns_rcode_noerror) { - return (ISC_RESULTCLASS_DNSRCODE + rmsg->rcode); + return (dns_result_fromrcode(rmsg->rcode)); } RETERR(find_tkey(rmsg, &tkeyname, &rtkeyrdata, DNS_SECTION_ANSWER)); RETERR(dns_rdata_tostruct(&rtkeyrdata, &rtkey, NULL)); @@ -1349,7 +1350,7 @@ dns_tkey_processgssresponse(dns_message_t *qmsg, dns_message_t *rmsg, } if (rmsg->rcode != dns_rcode_noerror) { - return (ISC_RESULTCLASS_DNSRCODE + rmsg->rcode); + return (dns_result_fromrcode(rmsg->rcode)); } RETERR(find_tkey(rmsg, &tkeyname, &rtkeyrdata, DNS_SECTION_ANSWER)); RETERR(dns_rdata_tostruct(&rtkeyrdata, &rtkey, NULL)); @@ -1422,7 +1423,7 @@ dns_tkey_processdeleteresponse(dns_message_t *qmsg, dns_message_t *rmsg, REQUIRE(rmsg != NULL); if (rmsg->rcode != dns_rcode_noerror) { - return (ISC_RESULTCLASS_DNSRCODE + rmsg->rcode); + return (dns_result_fromrcode(rmsg->rcode)); } RETERR(find_tkey(rmsg, &tkeyname, &rtkeyrdata, DNS_SECTION_ANSWER)); @@ -1485,7 +1486,7 @@ dns_tkey_gssnegotiate(dns_message_t *qmsg, dns_message_t *rmsg, } if (rmsg->rcode != dns_rcode_noerror) { - return (ISC_RESULTCLASS_DNSRCODE + rmsg->rcode); + return (dns_result_fromrcode(rmsg->rcode)); } RETERR(find_tkey(rmsg, &tkeyname, &rtkeyrdata, DNS_SECTION_ANSWER)); diff --git a/lib/dns/transport.c b/lib/dns/transport.c index 0ad1159fb3..64fe5f6ce4 100644 --- a/lib/dns/transport.c +++ b/lib/dns/transport.c @@ -20,7 +20,6 @@ #include #include -#include #include #define TRANSPORT_MAGIC ISC_MAGIC('T', 'r', 'n', 's') diff --git a/lib/dns/tsec.c b/lib/dns/tsec.c index 2cd18b6e30..fce05ea46b 100644 --- a/lib/dns/tsec.c +++ b/lib/dns/tsec.c @@ -10,9 +10,9 @@ */ #include +#include #include -#include #include #include diff --git a/lib/dns/tsig.c b/lib/dns/tsig.c index 772cd7028c..7f7d4b7d7c 100644 --- a/lib/dns/tsig.c +++ b/lib/dns/tsig.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include /* Required for HP/UX (and others?) */ #include @@ -33,11 +34,8 @@ #include #include #include -#include #include -#include - #include "tsig_p.h" #define TSIG_MAGIC ISC_MAGIC('T', 'S', 'I', 'G') diff --git a/lib/dns/ttl.c b/lib/dns/ttl.c index d69405c728..fdd337855f 100644 --- a/lib/dns/ttl.c +++ b/lib/dns/ttl.c @@ -22,10 +22,10 @@ #include #include #include +#include #include #include -#include #include #define RETERR(x) \ diff --git a/lib/dns/update.c b/lib/dns/update.c index 5f1212b16b..cfbe4405c4 100644 --- a/lib/dns/update.c +++ b/lib/dns/update.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -46,7 +47,6 @@ #include #include #include -#include #include #include #include diff --git a/lib/dns/validator.c b/lib/dns/validator.c index 1ea26f8343..fa41322cb7 100644 --- a/lib/dns/validator.c +++ b/lib/dns/validator.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -36,7 +37,6 @@ #include #include #include -#include #include #include @@ -568,7 +568,7 @@ fetch_callback_ds(isc_task_t *task, isc_event_t *event) { */ validator_log(val, ISC_LOG_DEBUG(3), "falling back to insecurity proof (%s)", - dns_result_totext(eresult)); + isc_result_totext(eresult)); result = proveunsecure(val, false, false); if (result != DNS_R_WAIT) { validator_done(val, result); diff --git a/lib/dns/view.c b/lib/dns/view.c index ed2045f131..fad58e57d6 100644 --- a/lib/dns/view.c +++ b/lib/dns/view.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include /* Required for HP/UX (and others?) */ #include @@ -52,7 +53,6 @@ #include #include #include -#include #include #include #include diff --git a/lib/dns/xfrin.c b/lib/dns/xfrin.c index 4ebc09e67c..e46c0c993e 100644 --- a/lib/dns/xfrin.c +++ b/lib/dns/xfrin.c @@ -18,6 +18,7 @@ #include #include #include +#include #include /* Required for HP/UX (and others?) */ #include @@ -1295,7 +1296,7 @@ xfrin_recv_done(isc_nmhandle_t *handle, isc_result_t result, xfr->mctx); } else { xfrin_log(xfr, ISC_LOG_DEBUG(10), "dns_message_parse: %s", - dns_result_totext(result)); + isc_result_totext(result)); } if (result != ISC_R_SUCCESS || msg->rcode != dns_rcode_noerror || @@ -1304,7 +1305,7 @@ xfrin_recv_done(isc_nmhandle_t *handle, isc_result_t result, { if (result == ISC_R_SUCCESS && msg->rcode != dns_rcode_noerror) { - result = ISC_RESULTCLASS_DNSRCODE + msg->rcode; /*XXX*/ + result = dns_result_fromrcode(msg->rcode); } else if (result == ISC_R_SUCCESS && msg->opcode != dns_opcode_query) { result = DNS_R_UNEXPECTEDOPCODE; diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 5fbe523b22..3da3109aa3 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -71,7 +72,6 @@ #include #include #include -#include #include #include #include @@ -3619,7 +3619,7 @@ resume_signingwithkey(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_signwithkey failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); } dns_rdata_reset(&rdata); } @@ -3909,7 +3909,7 @@ resume_addnsec3chain(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_addnsec3chain failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); } } } @@ -3998,7 +3998,7 @@ check_nsec3param(dns_zone_t *zone, dns_db_t *db) { if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "nsec3param lookup failure: %s", - dns_result_totext(result)); + isc_result_totext(result)); return (result); } dns_db_currentversion(db, &version); @@ -4015,7 +4015,7 @@ check_nsec3param(dns_zone_t *zone, dns_db_t *db) { INSIST(!dns_rdataset_isassociated(&rdataset)); dns_zone_log(zone, ISC_LOG_ERROR, "nsec3param lookup failure: %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } @@ -4469,7 +4469,7 @@ zone_journal(dns_zone_t *zone, dns_diff_t *diff, uint32_t *sourceserial, if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "%s:dns_journal_open -> %s", caller, - dns_result_totext(result)); + isc_result_totext(result)); return (result); } @@ -4481,7 +4481,7 @@ zone_journal(dns_zone_t *zone, dns_diff_t *diff, uint32_t *sourceserial, if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "%s:dns_journal_write_transaction -> %s", - caller, dns_result_totext(result)); + caller, isc_result_totext(result)); } dns_journal_destroy(&journal); } @@ -4507,7 +4507,7 @@ add_soa(dns_zone_t *zone, dns_db_t *db) { if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "add_soa:dns_db_newversion -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -4517,7 +4517,7 @@ add_soa(dns_zone_t *zone, dns_db_t *db) { if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "add_soa:dns_soa_buildrdata -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -4627,7 +4627,7 @@ sync_keyzone(dns_zone_t *zone, dns_db_t *db) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "sync_keyzone:dns_db_newversion -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -4704,7 +4704,7 @@ failure: { dnssec_log(zone, ISC_LOG_ERROR, "unable to synchronize managed keys: %s", - dns_result_totext(result)); + isc_result_totext(result)); isc_time_settoepoch(&zone->refreshkeytime); } if (keynode != NULL) { @@ -4840,7 +4840,7 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime, "loading from master file %s " "failed: %s", zone->masterfile, - dns_result_totext(result)); + isc_result_totext(result)); } } else if (zone->type == dns_zone_primary && inline_secure(zone) && result == ISC_R_FILENOTFOUND) @@ -4858,7 +4858,7 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime, dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD, level, "loading from master file %s failed: %s", zone->masterfile, - dns_result_totext(result)); + isc_result_totext(result)); nomaster = true; } @@ -7345,7 +7345,7 @@ zone_resigninc(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "zone_resigninc:dns_db_newversion -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -7356,7 +7356,7 @@ zone_resigninc(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "zone_resigninc:dns__zone_findkeys -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -7402,7 +7402,7 @@ zone_resigninc(dns_zone_t *zone) { if (result != ISC_R_SUCCESS && result != ISC_R_NOTFOUND) { dns_zone_log(zone, ISC_LOG_ERROR, "zone_resigninc:dns_db_getsigningtime -> %s", - dns_result_totext(result)); + isc_result_totext(result)); } i = 0; @@ -7430,7 +7430,7 @@ zone_resigninc(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "zone_resigninc:del_sigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); break; } @@ -7448,7 +7448,7 @@ zone_resigninc(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "zone_resigninc:add_sigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); break; } result = dns_db_getsigningtime(db, &rdataset, name); @@ -7460,7 +7460,7 @@ zone_resigninc(dns_zone_t *zone) { dns_zone_log(zone, ISC_LOG_ERROR, "zone_resigninc:dns_db_getsigningtime -> " "%s", - dns_result_totext(result)); + isc_result_totext(result)); } } @@ -7473,7 +7473,7 @@ zone_resigninc(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "zone_resigninc:del_sigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -7496,7 +7496,7 @@ zone_resigninc(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "zone_resigninc:update_soa_serial -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -7510,7 +7510,7 @@ zone_resigninc(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "zone_resigninc:add_sigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -8433,7 +8433,7 @@ dns__zone_updatesigs(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *version, if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "dns__zone_updatesigs:del_sigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); return (result); } result = add_sigs(db, version, &tuple->name, zone, @@ -8443,7 +8443,7 @@ dns__zone_updatesigs(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *version, if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "dns__zone_updatesigs:add_sigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); return (result); } @@ -8541,7 +8541,7 @@ zone_nsec3chain(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:dns_db_newversion -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -8552,7 +8552,7 @@ zone_nsec3chain(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:dns__zone_findkeys -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -8742,7 +8742,7 @@ zone_nsec3chain(dns_zone_t *zone) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:" "dns_nsec3_addnsec3 -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -8799,7 +8799,7 @@ zone_nsec3chain(dns_zone_t *zone) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:" "dns_dbiterator_next -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } else if (delegation) { dns_dbiterator_current(nsec3chain->dbiterator, @@ -8879,7 +8879,7 @@ zone_nsec3chain(dns_zone_t *zone) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:" "need_nsec_chain -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } } @@ -8906,7 +8906,7 @@ zone_nsec3chain(dns_zone_t *zone) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:" "fixup_nsec3param -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } } @@ -8921,7 +8921,7 @@ zone_nsec3chain(dns_zone_t *zone) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:" "deletematchingnsec3 -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } goto next_removenode; @@ -9029,7 +9029,7 @@ zone_nsec3chain(dns_zone_t *zone) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:" "fixup_nsec3param -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } goto next_removechain; @@ -9037,7 +9037,7 @@ zone_nsec3chain(dns_zone_t *zone) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:" "dns_dbiterator_next -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } else if (delegation) { dns_dbiterator_current(nsec3chain->dbiterator, @@ -9076,7 +9076,7 @@ skip_removals: if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:dns_db_allrdatasets -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } for (result = dns_rdatasetiter_first(iterator); @@ -9105,7 +9105,7 @@ skip_removals: if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:updatesecure -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } } @@ -9122,7 +9122,7 @@ skip_removals: dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:" "dns_nsec3_addnsec3s -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } } @@ -9140,7 +9140,7 @@ skip_removals: if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:dns__zone_updatesigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -9154,7 +9154,7 @@ skip_removals: if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:dns__zone_updatesigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -9164,7 +9164,7 @@ skip_removals: if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:updatesecure -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } } @@ -9175,7 +9175,7 @@ skip_removals: if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:dns__zone_updatesigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -9196,7 +9196,7 @@ skip_removals: if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:del_sigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -9205,7 +9205,7 @@ skip_removals: if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:update_soa_serial -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -9215,7 +9215,7 @@ skip_removals: if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain:add_sigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -9264,7 +9264,7 @@ done: failure: if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_nsec3chain: %s", - dns_result_totext(result)); + isc_result_totext(result)); } /* @@ -9527,7 +9527,7 @@ zone_sign(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_sign:dns_db_newversion -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } @@ -9538,7 +9538,7 @@ zone_sign(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_sign:dns__zone_findkeys -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } @@ -9872,7 +9872,7 @@ zone_sign(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "updatesecure -> %s", - dns_result_totext( + isc_result_totext( result)); goto cleanup; } @@ -9883,7 +9883,7 @@ zone_sign(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "updatesignwithkey -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } build_nsec = false; @@ -9892,7 +9892,7 @@ zone_sign(dns_zone_t *zone) { dnssec_log(zone, ISC_LOG_ERROR, "zone_sign:" "dns_dbiterator_next -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } else if (is_bottom_of_zone) { dns_dbiterator_current(signing->dbiterator, @@ -9921,7 +9921,7 @@ zone_sign(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_sign:dns__zone_updatesigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } } @@ -9943,7 +9943,7 @@ zone_sign(dns_zone_t *zone) { &zonediff, zone_keys, nkeys, now, false); if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_sign:del_sigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } @@ -9952,7 +9952,7 @@ zone_sign(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_sign:update_soa_serial -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } @@ -9965,7 +9965,7 @@ zone_sign(dns_zone_t *zone) { inception, soaexpire, check_ksk, keyset_kskonly); if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_sign:add_sigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } @@ -10018,7 +10018,7 @@ pauseall: failure: if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_sign: failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); } cleanup: @@ -10342,7 +10342,7 @@ revocable(dns_keyfetch_t *kfetch, dns_rdata_keydata_t *keydata) { dnssec_log(kfetch->zone, ISC_LOG_DEBUG(3), "Confirm revoked DNSKEY is self-signed: %s", - dns_result_totext(result)); + isc_result_totext(result)); if (result == ISC_R_SUCCESS) { answer = true; @@ -10441,13 +10441,13 @@ keyfetch_done(isc_task_t *task, isc_event_t *event) { dnssec_log(zone, ISC_LOG_DEBUG(3), "Returned from key fetch in keyfetch_done() for '%s': %s", - namebuf, dns_result_totext(eresult)); + namebuf, isc_result_totext(eresult)); /* Fetch failed */ if (eresult != ISC_R_SUCCESS || !dns_rdataset_isassociated(dnskeys)) { dnssec_log(zone, ISC_LOG_WARNING, "Unable to fetch DNSKEY set '%s': %s", namebuf, - dns_result_totext(eresult)); + isc_result_totext(eresult)); CHECK(minimal_update(kfetch, ver, &diff)); goto done; } @@ -10456,7 +10456,7 @@ keyfetch_done(isc_task_t *task, isc_event_t *event) { if (!dns_rdataset_isassociated(dnskeysigs)) { dnssec_log(zone, ISC_LOG_WARNING, "No DNSKEY RRSIGs found for '%s': %s", namebuf, - dns_result_totext(eresult)); + isc_result_totext(eresult)); CHECK(minimal_update(kfetch, ver, &diff)); goto done; } @@ -10534,7 +10534,7 @@ keyfetch_done(isc_task_t *task, isc_event_t *event) { "Verifying DNSKEY set for zone " "'%s' using DS %d/%d: %s", namebuf, sig.keyid, sig.algorithm, - dns_result_totext(result)); + isc_result_totext(result)); if (result == ISC_R_SUCCESS) { dnskeys->trust = dns_trust_secure; @@ -10599,7 +10599,7 @@ anchors_done: "Cannot compute tag for key in zone %s: " "%s " "(skipping)", - namebuf, dns_result_totext(result)); + namebuf, isc_result_totext(result)); continue; } RUNTIME_CHECK(result == ISC_R_SUCCESS); @@ -10725,7 +10725,7 @@ anchors_done: "Cannot compute tag for key in zone %s: " "%s " "(skipping)", - namebuf, dns_result_totext(result)); + namebuf, isc_result_totext(result)); continue; } RUNTIME_CHECK(result == ISC_R_SUCCESS); @@ -11362,7 +11362,7 @@ zone_maintenance(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_WARNING, "dump failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); } } break; @@ -11609,7 +11609,7 @@ zone_refresh(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_WARNING, "isc_time_nowplusinterval() failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); } /* @@ -11661,7 +11661,7 @@ zone_journal_rollforward(dns_zone_t *zone, dns_db_t *db, bool *needdump, } else if (result != ISC_R_SUCCESS) { dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD, ISC_LOG_ERROR, "journal open failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); return (result); } @@ -11685,13 +11685,13 @@ zone_journal_rollforward(dns_zone_t *zone, dns_db_t *db, bool *needdump, ISC_LOG_DEBUG(1), "journal rollforward completed successfully " "using old journal format: %s", - dns_result_totext(result)); + isc_result_totext(result)); } else { dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD, ISC_LOG_DEBUG(1), "journal rollforward completed " "successfully: %s", - dns_result_totext(result)); + isc_result_totext(result)); } dns_journal_destroy(&journal); @@ -11706,7 +11706,7 @@ zone_journal_rollforward(dns_zone_t *zone, dns_db_t *db, bool *needdump, default: dns_zone_logc(zone, DNS_LOGCATEGORY_ZONELOAD, ISC_LOG_ERROR, "journal rollforward failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); dns_journal_destroy(&journal); return (result); } @@ -11756,12 +11756,12 @@ zone_journal_compact(dns_zone_t *zone, dns_db_t *db, uint32_t serial) { case ISC_R_NOSPACE: case ISC_R_NOTFOUND: dns_zone_log(zone, ISC_LOG_DEBUG(3), "dns_journal_compact: %s", - dns_result_totext(result)); + isc_result_totext(result)); break; default: dns_zone_log(zone, ISC_LOG_ERROR, "dns_journal_compact failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); break; } } @@ -13168,7 +13168,7 @@ stub_glue_response_cb(isc_task_t *task, isc_event_t *event) { dns_zone_log(zone, ISC_LOG_INFO, "could not refresh stub from master %s" " (source %s): %s", - master, source, dns_result_totext(revent->result)); + master, source, isc_result_totext(revent->result)); goto cleanup; } @@ -13290,7 +13290,7 @@ stub_glue_response_cb(isc_task_t *task, isc_event_t *event) { dns_zone_log(zone, ISC_LOG_INFO, "refreshing stub: " "dns_db_findnode() failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } @@ -13300,7 +13300,7 @@ stub_glue_response_cb(isc_task_t *task, isc_event_t *event) { dns_zone_log(zone, ISC_LOG_INFO, "refreshing stub: " "dns_db_addrdataset() failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); } dns_db_detachnode(stub->db, &node); @@ -13357,7 +13357,7 @@ stub_request_nameserver_address(struct stub_cb_args *args, bool ipv4, if (result != ISC_R_SUCCESS) { zone_debuglog(zone, "stub_send_query", 1, "unable to add opt record: %s", - dns_result_totext(result)); + isc_result_totext(result)); goto fail; } } @@ -13375,7 +13375,7 @@ stub_request_nameserver_address(struct stub_cb_args *args, bool ipv4, 1) > 1); zone_debuglog(zone, "stub_send_query", 1, "dns_request_createvia() failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); goto fail; } @@ -13599,7 +13599,7 @@ stub_callback(isc_task_t *task, isc_event_t *event) { dns_zone_log(zone, ISC_LOG_INFO, "could not refresh stub from master %s" " (source %s): %s", - master, source, dns_result_totext(revent->result)); + master, source, isc_result_totext(revent->result)); goto next_master; } @@ -13909,7 +13909,7 @@ setmodtime(dns_zone_t *zone, isc_time_t *expiretime) { dns_zone_log(zone, ISC_LOG_ERROR, "refresh: could not set " "file modification time of '%s': %s", - zone->masterfile, dns_result_totext(result)); + zone->masterfile, isc_result_totext(result)); } } @@ -14001,7 +14001,7 @@ refresh_callback(isc_task_t *task, isc_event_t *event) { "refresh: failure trying master " "%s (source %s): %s", master, source, - dns_result_totext(revent->result)); + isc_result_totext(revent->result)); } goto next_master; } @@ -14012,7 +14012,7 @@ refresh_callback(isc_task_t *task, isc_event_t *event) { dns_zone_log(zone, ISC_LOG_INFO, "refresh: unable to get response, master " "%s, source %s: %s", - master, source, dns_result_totext(result)); + master, source, isc_result_totext(result)); goto next_master; } @@ -14587,7 +14587,7 @@ again: if (result != ISC_R_SUCCESS) { zone_debuglog(zone, me, 1, "unable to add opt record: %s", - dns_result_totext(result)); + isc_result_totext(result)); } } @@ -14603,7 +14603,7 @@ again: if (result != ISC_R_SUCCESS) { zone_idetach(&dummy); zone_debuglog(zone, me, 1, "dns_request_createvia() failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); goto skip_master; } else { if (isc_sockaddr_pf(&zone->masteraddr) == PF_INET) { @@ -14720,7 +14720,7 @@ ns_query(dns_zone_t *zone, dns_rdataset_t *soardataset, dns_stub_t *stub) { "refreshing stub: " "could not create " "database: %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } dns_db_settask(stub->db, zone->task); @@ -14731,7 +14731,7 @@ ns_query(dns_zone_t *zone, dns_rdataset_t *soardataset, dns_stub_t *stub) { dns_zone_log(zone, ISC_LOG_INFO, "refreshing stub: " "dns_db_newversion() failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } @@ -14743,7 +14743,7 @@ ns_query(dns_zone_t *zone, dns_rdataset_t *soardataset, dns_stub_t *stub) { dns_zone_log(zone, ISC_LOG_INFO, "refreshing stub: " "dns_db_findnode() failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } @@ -14754,7 +14754,7 @@ ns_query(dns_zone_t *zone, dns_rdataset_t *soardataset, dns_stub_t *stub) { dns_zone_log(zone, ISC_LOG_INFO, "refreshing stub: " "dns_db_addrdataset() failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } } @@ -14826,7 +14826,7 @@ ns_query(dns_zone_t *zone, dns_rdataset_t *soardataset, dns_stub_t *stub) { if (result != ISC_R_SUCCESS) { zone_debuglog(zone, me, 1, "unable to add opt record: %s", - dns_result_totext(result)); + isc_result_totext(result)); } } @@ -14886,7 +14886,7 @@ ns_query(dns_zone_t *zone, dns_rdataset_t *soardataset, dns_stub_t *stub) { timeout, 0, zone->task, stub_callback, cb_args, &zone->request); if (result != ISC_R_SUCCESS) { zone_debuglog(zone, me, 1, "dns_request_createvia() failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); goto cleanup; } dns_message_detach(&message); @@ -16237,7 +16237,7 @@ notify_done(isc_task_t *task, isc_event_t *event) { } else { notify_log(notify->zone, ISC_LOG_DEBUG(2), "notify to %s failed: %s", addrbuf, - dns_result_totext(result)); + isc_result_totext(result)); } /* @@ -16681,7 +16681,7 @@ failure: level = ISC_LOG_INFO; } dns_zone_log(zone, level, "receive_secure_serial: %s", - dns_result_totext(result)); + isc_result_totext(result)); } if (tuple != NULL) { dns_difftuple_free(&tuple); @@ -17205,7 +17205,7 @@ failure: } if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "receive_secure_db: %s", - dns_result_totext(result)); + isc_result_totext(result)); } while (!ISC_LIST_EMPTY(nsec3list)) { @@ -17307,7 +17307,7 @@ zone_replacedb(dns_zone_t *zone, dns_db_t *db, bool dump) { } else { dns_zone_log(zone, ISC_LOG_ERROR, "retrieving SOA and NS records failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); return (result); } @@ -17487,7 +17487,7 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) { REQUIRE(DNS_ZONE_VALID(zone)); dns_zone_logc(zone, DNS_LOGCATEGORY_XFER_IN, ISC_LOG_DEBUG(1), - "zone transfer finished: %s", dns_result_totext(result)); + "zone transfer finished: %s", isc_result_totext(result)); /* * Obtaining a lock on the zone->secure (see zone_send_secureserial) @@ -17647,7 +17647,7 @@ again: "transfer: could not set file " "modification time of '%s': %s", zone->masterfile, - dns_result_totext(result)); + isc_result_totext(result)); } } DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_NODELAY); @@ -18261,7 +18261,7 @@ forward_callback(isc_task_t *task, isc_event_t *event) { if (revent->result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_INFO, "could not forward dynamic update to %s: %s", - master, dns_result_totext(revent->result)); + master, isc_result_totext(revent->result)); goto next_master; } @@ -20061,7 +20061,7 @@ dns_zone_checknames(dns_zone_t *zone, const dns_name_t *name, dns_name_format(name, namebuf, sizeof(namebuf)); dns_rdatatype_format(rdata->type, typebuf, sizeof(typebuf)); dns_zone_log(zone, level, "%s/%s: %s", namebuf, typebuf, - dns_result_totext(DNS_R_BADOWNERNAME)); + isc_result_totext(DNS_R_BADOWNERNAME)); if (fail) { return (DNS_R_BADOWNERNAME); } @@ -20074,7 +20074,7 @@ dns_zone_checknames(dns_zone_t *zone, const dns_name_t *name, dns_name_format(&bad, namebuf2, sizeof(namebuf2)); dns_rdatatype_format(rdata->type, typebuf, sizeof(typebuf)); dns_zone_log(zone, level, "%s/%s: %s: %s ", namebuf, typebuf, - namebuf2, dns_result_totext(DNS_R_BADNAME)); + namebuf2, isc_result_totext(DNS_R_BADNAME)); if (fail) { return (DNS_R_BADNAME); } @@ -20468,7 +20468,7 @@ tickle_apex_rrset(dns_rdatatype_t rrtype, dns_zone_t *zone, dns_db_t *db, if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "sign_apex:del_sigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); return (result); } result = add_sigs(db, ver, &zone->origin, zone, rrtype, @@ -20478,7 +20478,7 @@ tickle_apex_rrset(dns_rdatatype_t rrtype, dns_zone_t *zone, dns_db_t *db, if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "sign_apex:add_sigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); return (result); } } @@ -20500,7 +20500,7 @@ sign_apex(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *ver, if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "sign_apex:dns__zone_findkeys -> %s", - dns_result_totext(result)); + isc_result_totext(result)); return (result); } @@ -20548,7 +20548,7 @@ sign_apex(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *ver, if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "sign_apex:dns__zone_updatesigs -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -21299,7 +21299,7 @@ checkds_send_toaddr(isc_task_t *task, isc_event_t *event) { dns_zone_log( checkds->zone, ISC_LOG_DEBUG(3), "checkds: dns_request_createvia() to %s failed: %s", - addrbuf, dns_result_totext(result)); + addrbuf, isc_result_totext(result)); } cleanup_key: @@ -21791,7 +21791,7 @@ zone_rekey(dns_zone_t *zone) { dnssec_log(zone, ISC_LOG_ERROR, "zone_signwithkey failed: " "%s", - dns_result_totext(result)); + isc_result_totext(result)); } /* Clear DNSSEC sign statistics. */ @@ -21830,7 +21830,7 @@ zone_rekey(dns_zone_t *zone) { dnssec_log(zone, ISC_LOG_ERROR, "zone_signwithkey failed: " "%s", - dns_result_totext(result)); + isc_result_totext(result)); } } } else if (newalg) { @@ -21853,7 +21853,7 @@ zone_rekey(dns_zone_t *zone) { dnssec_log(zone, ISC_LOG_ERROR, "zone_signwithkey failed: " "%s", - dns_result_totext(result)); + isc_result_totext(result)); } } } @@ -21895,7 +21895,7 @@ zone_rekey(dns_zone_t *zone) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "zone_addnsec3chain failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); } } @@ -22540,7 +22540,7 @@ keydone(isc_task_t *task, isc_event_t *event) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "keydone:dns_db_newversion -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -22817,7 +22817,7 @@ rss_post(dns_zone_t *zone, isc_event_t *event) { if (result != ISC_R_SUCCESS) { dnssec_log(zone, ISC_LOG_ERROR, "setnsec3param:dns_db_newversion -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } @@ -23052,7 +23052,7 @@ dns__zone_lookup_nsec3param(dns_zone_t *zone, dns_rdata_nsec3param_t *lookup, dns_zone_log(zone, ISC_LOG_ERROR, "dns__zone_lookup_nsec3param:" "dns_db_findnode -> %s", - dns_result_totext(result)); + isc_result_totext(result)); result = ISC_R_FAILURE; goto setparam; } @@ -23067,7 +23067,7 @@ dns__zone_lookup_nsec3param(dns_zone_t *zone, dns_rdata_nsec3param_t *lookup, dns_zone_log(zone, ISC_LOG_ERROR, "dns__zone_lookup_nsec3param:" "dns_db_findrdataset -> %s", - dns_result_totext(result)); + isc_result_totext(result)); } goto setparam; } @@ -23444,7 +23444,7 @@ setserial(isc_task_t *task, isc_event_t *event) { if (result != ISC_R_SUCCESS) { dns_zone_log(zone, ISC_LOG_ERROR, "setserial:dns_db_newversion -> %s", - dns_result_totext(result)); + isc_result_totext(result)); goto failure; } diff --git a/lib/dns/zoneverify.c b/lib/dns/zoneverify.c index b51c0b1371..9ac236132d 100644 --- a/lib/dns/zoneverify.c +++ b/lib/dns/zoneverify.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -2045,7 +2044,7 @@ dns_zoneverify_dnssec(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *ver, result = vresult; if (result != ISC_R_SUCCESS) { report("DNSSEC completeness test failed (%s).", - dns_result_totext(result)); + isc_result_totext(result)); goto done; } diff --git a/lib/dns/zt.c b/lib/dns/zt.c index da4f222ab6..0d235a21bb 100644 --- a/lib/dns/zt.c +++ b/lib/dns/zt.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -26,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/lib/isc/Makefile.am b/lib/isc/Makefile.am index 73a8245e34..521ed9e266 100644 --- a/lib/isc/Makefile.am +++ b/lib/isc/Makefile.am @@ -78,7 +78,6 @@ libisc_la_HEADERS = \ include/isc/region.h \ include/isc/resource.h \ include/isc/result.h \ - include/isc/resultclass.h \ include/isc/rwlock.h \ include/isc/safe.h \ include/isc/serial.h \ diff --git a/lib/isc/include/isc/app.h b/lib/isc/include/isc/app.h index 4d43fcffe2..fc58ff75a3 100644 --- a/lib/isc/include/isc/app.h +++ b/lib/isc/include/isc/app.h @@ -82,6 +82,7 @@ #include #include #include +#include /*** *** Types diff --git a/lib/isc/include/isc/commandline.h b/lib/isc/include/isc/commandline.h index 778cb7aa20..111160242f 100644 --- a/lib/isc/include/isc/commandline.h +++ b/lib/isc/include/isc/commandline.h @@ -18,6 +18,7 @@ #include #include +#include /*% Index into parent argv vector. */ extern int isc_commandline_index; diff --git a/lib/isc/include/isc/result.h b/lib/isc/include/isc/result.h index 21071c7dad..64249417c2 100644 --- a/lib/isc/include/isc/result.h +++ b/lib/isc/include/isc/result.h @@ -14,85 +14,261 @@ /*! \file isc/result.h */ +#include + #include -#include -#define ISC_R_SUCCESS 0 /*%< success */ -#define ISC_R_NOMEMORY 1 /*%< out of memory */ -#define ISC_R_TIMEDOUT 2 /*%< timed out */ -#define ISC_R_NOTHREADS 3 /*%< no available threads */ -#define ISC_R_ADDRNOTAVAIL 4 /*%< address not available */ -#define ISC_R_ADDRINUSE 5 /*%< address in use */ -#define ISC_R_NOPERM 6 /*%< permission denied */ -#define ISC_R_NOCONN 7 /*%< no pending connections */ -#define ISC_R_NETUNREACH 8 /*%< network unreachable */ -#define ISC_R_HOSTUNREACH 9 /*%< host unreachable */ -#define ISC_R_NETDOWN 10 /*%< network down */ -#define ISC_R_HOSTDOWN 11 /*%< host down */ -#define ISC_R_CONNREFUSED 12 /*%< connection refused */ -#define ISC_R_NORESOURCES 13 /*%< not enough free resources */ -#define ISC_R_EOF 14 /*%< end of file */ -#define ISC_R_BOUND 15 /*%< socket already bound */ -#define ISC_R_RELOAD 16 /*%< reload */ -#define ISC_R_SUSPEND ISC_R_RELOAD /*%< alias of 'reload' */ -#define ISC_R_LOCKBUSY 17 /*%< lock busy */ -#define ISC_R_EXISTS 18 /*%< already exists */ -#define ISC_R_NOSPACE 19 /*%< ran out of space */ -#define ISC_R_CANCELED 20 /*%< operation canceled */ -#define ISC_R_NOTBOUND 21 /*%< socket is not bound */ -#define ISC_R_SHUTTINGDOWN 22 /*%< shutting down */ -#define ISC_R_NOTFOUND 23 /*%< not found */ -#define ISC_R_UNEXPECTEDEND 24 /*%< unexpected end of input */ -#define ISC_R_FAILURE 25 /*%< generic failure */ -#define ISC_R_IOERROR 26 /*%< I/O error */ -#define ISC_R_NOTIMPLEMENTED 27 /*%< not implemented */ -#define ISC_R_UNBALANCED 28 /*%< unbalanced parentheses */ -#define ISC_R_NOMORE 29 /*%< no more */ -#define ISC_R_INVALIDFILE 30 /*%< invalid file */ -#define ISC_R_BADBASE64 31 /*%< bad base64 encoding */ -#define ISC_R_UNEXPECTEDTOKEN 32 /*%< unexpected token */ -#define ISC_R_QUOTA 33 /*%< quota reached */ -#define ISC_R_UNEXPECTED 34 /*%< unexpected error */ -#define ISC_R_ALREADYRUNNING 35 /*%< already running */ -#define ISC_R_IGNORE 36 /*%< ignore */ -#define ISC_R_MASKNONCONTIG 37 /*%< addr mask not contiguous */ -#define ISC_R_FILENOTFOUND 38 /*%< file not found */ -#define ISC_R_FILEEXISTS 39 /*%< file already exists */ -#define ISC_R_NOTCONNECTED 40 /*%< socket is not connected */ -#define ISC_R_RANGE 41 /*%< out of range */ -#define ISC_R_NOENTROPY 42 /*%< out of entropy */ -#define ISC_R_MULTICAST 43 /*%< invalid use of multicast */ -#define ISC_R_NOTFILE 44 /*%< not a file */ -#define ISC_R_NOTDIRECTORY 45 /*%< not a directory */ -#define ISC_R_EMPTY 46 /*%< queue is empty */ -#define ISC_R_FAMILYMISMATCH 47 /*%< address family mismatch */ -#define ISC_R_FAMILYNOSUPPORT 48 /*%< AF not supported */ -#define ISC_R_BADHEX 49 /*%< bad hex encoding */ -#define ISC_R_TOOMANYOPENFILES 50 /*%< too many open files */ -#define ISC_R_NOTBLOCKING 51 /*%< not blocking */ -#define ISC_R_UNBALANCEDQUOTES 52 /*%< unbalanced quotes */ -#define ISC_R_INPROGRESS 53 /*%< operation in progress */ -#define ISC_R_CONNECTIONRESET 54 /*%< connection reset */ -#define ISC_R_SOFTQUOTA 55 /*%< soft quota reached */ -#define ISC_R_BADNUMBER 56 /*%< not a valid number */ -#define ISC_R_DISABLED 57 /*%< disabled */ -#define ISC_R_MAXSIZE 58 /*%< max size */ -#define ISC_R_BADADDRESSFORM 59 /*%< invalid address format */ -#define ISC_R_BADBASE32 60 /*%< bad base32 encoding */ -#define ISC_R_UNSET 61 /*%< unset */ -#define ISC_R_MULTIPLE 62 /*%< multiple */ -#define ISC_R_WOULDBLOCK 63 /*%< would block */ -#define ISC_R_COMPLETE 64 /*%< complete */ -#define ISC_R_CRYPTOFAILURE 65 /*%< cryptography library failure */ -#define ISC_R_DISCQUOTA 66 /*%< disc quota */ -#define ISC_R_DISCFULL 67 /*%< disc full */ -#define ISC_R_DEFAULT 68 /*%< default */ -#define ISC_R_IPV4PREFIX 69 /*%< IPv4 prefix */ -#define ISC_R_TLSERROR 70 /*%< TLS error */ -#define ISC_R_HTTP2ALPNERROR 71 /*%< ALPN for HTTP/2 failed */ +typedef enum isc_result { + ISC_R_SUCCESS, /*%< success */ + ISC_R_NOMEMORY, /*%< out of memory */ + ISC_R_TIMEDOUT, /*%< timed out */ + ISC_R_NOTHREADS, /*%< no available threads */ + ISC_R_ADDRNOTAVAIL, /*%< address not available */ + ISC_R_ADDRINUSE, /*%< address in use */ + ISC_R_NOPERM, /*%< permission denied */ + ISC_R_NOCONN, /*%< no pending connections */ + ISC_R_NETUNREACH, /*%< network unreachable */ + ISC_R_HOSTUNREACH, /*%< host unreachable */ + ISC_R_NETDOWN, /*%< network down */ + ISC_R_HOSTDOWN, /*%< host down */ + ISC_R_CONNREFUSED, /*%< connection refused */ + ISC_R_NORESOURCES, /*%< not enough free resources */ + ISC_R_EOF, /*%< end of file */ + ISC_R_BOUND, /*%< socket already bound */ + ISC_R_RELOAD, /*%< reload */ + ISC_R_SUSPEND = ISC_R_RELOAD, /*%< alias of 'reload' */ + ISC_R_LOCKBUSY, /*%< lock busy */ + ISC_R_EXISTS, /*%< already exists */ + ISC_R_NOSPACE, /*%< ran out of space */ + ISC_R_CANCELED, /*%< operation canceled */ + ISC_R_NOTBOUND, /*%< socket is not bound */ + ISC_R_SHUTTINGDOWN, /*%< shutting down */ + ISC_R_NOTFOUND, /*%< not found */ + ISC_R_UNEXPECTEDEND, /*%< unexpected end of input */ + ISC_R_FAILURE, /*%< generic failure */ + ISC_R_IOERROR, /*%< I/O error */ + ISC_R_NOTIMPLEMENTED, /*%< not implemented */ + ISC_R_UNBALANCED, /*%< unbalanced parentheses */ + ISC_R_NOMORE, /*%< no more */ + ISC_R_INVALIDFILE, /*%< invalid file */ + ISC_R_BADBASE64, /*%< bad base64 encoding */ + ISC_R_UNEXPECTEDTOKEN, /*%< unexpected token */ + ISC_R_QUOTA, /*%< quota reached */ + ISC_R_UNEXPECTED, /*%< unexpected error */ + ISC_R_ALREADYRUNNING, /*%< already running */ + ISC_R_IGNORE, /*%< ignore */ + ISC_R_MASKNONCONTIG, /*%< addr mask not contiguous */ + ISC_R_FILENOTFOUND, /*%< file not found */ + ISC_R_FILEEXISTS, /*%< file already exists */ + ISC_R_NOTCONNECTED, /*%< socket is not connected */ + ISC_R_RANGE, /*%< out of range */ + ISC_R_NOENTROPY, /*%< out of entropy */ + ISC_R_MULTICAST, /*%< invalid use of multicast */ + ISC_R_NOTFILE, /*%< not a file */ + ISC_R_NOTDIRECTORY, /*%< not a directory */ + ISC_R_EMPTY, /*%< queue is empty */ + ISC_R_FAMILYMISMATCH, /*%< address family mismatch */ + ISC_R_FAMILYNOSUPPORT, /*%< AF not supported */ + ISC_R_BADHEX, /*%< bad hex encoding */ + ISC_R_TOOMANYOPENFILES, /*%< too many open files */ + ISC_R_NOTBLOCKING, /*%< not blocking */ + ISC_R_UNBALANCEDQUOTES, /*%< unbalanced quotes */ + ISC_R_INPROGRESS, /*%< operation in progress */ + ISC_R_CONNECTIONRESET, /*%< connection reset */ + ISC_R_SOFTQUOTA, /*%< soft quota reached */ + ISC_R_BADNUMBER, /*%< not a valid number */ + ISC_R_DISABLED, /*%< disabled */ + ISC_R_MAXSIZE, /*%< max size */ + ISC_R_BADADDRESSFORM, /*%< invalid address format */ + ISC_R_BADBASE32, /*%< bad base32 encoding */ + ISC_R_UNSET, /*%< unset */ + ISC_R_MULTIPLE, /*%< multiple */ + ISC_R_WOULDBLOCK, /*%< would block */ + ISC_R_COMPLETE, /*%< complete */ + ISC_R_CRYPTOFAILURE, /*%< cryptography library failure */ + ISC_R_DISCQUOTA, /*%< disc quota */ + ISC_R_DISCFULL, /*%< disc full */ + ISC_R_DEFAULT, /*%< default */ + ISC_R_IPV4PREFIX, /*%< IPv4 prefix */ + ISC_R_TLSERROR, /*%< TLS error */ + ISC_R_HTTP2ALPNERROR, /*%< ALPN for HTTP/2 failed */ -/*% Not a result code: the number of results. */ -#define ISC_R_NRESULTS 72 + DNS_R_LABELTOOLONG = 1 << 16, + DNS_R_BADESCAPE, + 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, + DNS_R_INCONSISTENTRR, + + DST_R_UNSUPPORTEDALG = 2 << 16, + DST_R_CRYPTOFAILURE, + /* compat */ + DST_R_OPENSSLFAILURE = DST_R_CRYPTOFAILURE, + DST_R_NOCRYPTO, + DST_R_NULLKEY, + DST_R_INVALIDPUBLICKEY, + DST_R_INVALIDPRIVATEKEY, + DST_R_WRITEERROR, + DST_R_INVALIDPARAM, + DST_R_SIGNFAILURE, + DST_R_VERIFYFAILURE, + DST_R_NOTPUBLICKEY, + DST_R_NOTPRIVATEKEY, + DST_R_KEYCANNOTCOMPUTESECRET, + DST_R_COMPUTESECRETFAILURE, + DST_R_NORANDOMNESS, + DST_R_BADKEYTYPE, + DST_R_NOENGINE, + DST_R_EXTERNALKEY, + + DNS_R_NOERROR = 3 << 16, + 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, + DNS_R_RCODE12, + DNS_R_RCODE13, + DNS_R_RCODE14, + DNS_R_RCODE15, + DNS_R_BADVERS, + + ISCCC_R_UNKNOWNVERSION = 5 << 16, + ISCCC_R_SYNTAX, + ISCCC_R_BADAUTH, + ISCCC_R_EXPIRED, + ISCCC_R_CLOCKSKEW, + ISCCC_R_DUPLICATE, + + ISC_R_NRESULTS = ISCCC_R_DUPLICATE + 1, /*% The number of results. */ + ISC_R_MAKE_ENUM_32BIT = INT32_MAX, +} isc_result_t; ISC_LANG_BEGINDECLS @@ -107,14 +283,6 @@ const char *isc_result_toid(isc_result_t); * "ISC_R_SUCCESS". */ -isc_result_t -isc_result_register(unsigned int base, unsigned int nresults, const char **text, - int set); - -isc_result_t -isc_result_registerids(unsigned int base, unsigned int nresults, - const char **ids, int set); - ISC_LANG_ENDDECLS #endif /* ISC_RESULT_H */ diff --git a/lib/isc/include/isc/resultclass.h b/lib/isc/include/isc/resultclass.h deleted file mode 100644 index 4953622e54..0000000000 --- a/lib/isc/include/isc/resultclass.h +++ /dev/null @@ -1,41 +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 ISC_RESULTCLASS_H -#define ISC_RESULTCLASS_H 1 - -/*! \file isc/resultclass.h - * \brief Registry of Predefined Result Type Classes - * - * A result class number is an unsigned 16 bit number. Each class may - * contain up to 65536 results. A result code is formed by adding the - * result number within the class to the class number multiplied by 65536. - * - * Classes < 1024 are reserved for ISC use. - * Result classes >= 1024 and <= 65535 are reserved for application use. - */ - -#define ISC_RESULTCLASS_FROMNUM(num) ((num) << 16) -#define ISC_RESULTCLASS_TONUM(rclass) ((rclass) >> 16) -#define ISC_RESULTCLASS_SIZE 65536 -#define ISC_RESULTCLASS_INCLASS(rclass, result) \ - ((rclass) == ((result)&0xFFFF0000)) - -#define ISC_RESULTCLASS_ISC ISC_RESULTCLASS_FROMNUM(0) -#define ISC_RESULTCLASS_DNS ISC_RESULTCLASS_FROMNUM(1) -#define ISC_RESULTCLASS_DST ISC_RESULTCLASS_FROMNUM(2) -#define ISC_RESULTCLASS_DNSRCODE ISC_RESULTCLASS_FROMNUM(3) -#define ISC_RESULTCLASS_OMAPI ISC_RESULTCLASS_FROMNUM(4) -#define ISC_RESULTCLASS_ISCCC ISC_RESULTCLASS_FROMNUM(5) -#define ISC_RESULTCLASS_DHCP ISC_RESULTCLASS_FROMNUM(6) -#define ISC_RESULTCLASS_PK11 ISC_RESULTCLASS_FROMNUM(7) - -#endif /* ISC_RESULTCLASS_H */ diff --git a/lib/isc/include/isc/types.h b/lib/isc/include/isc/types.h index 2890b56a3f..3c6f89ba55 100644 --- a/lib/isc/include/isc/types.h +++ b/lib/isc/include/isc/types.h @@ -13,6 +13,7 @@ #define ISC_TYPES_H 1 #include +#include /*! \file isc/types.h * \brief @@ -73,7 +74,6 @@ typedef struct isc_quota isc_quota_t; /*%< Quota */ typedef struct isc_ratelimiter isc_ratelimiter_t; /*%< Rate Limiter */ typedef struct isc_region isc_region_t; /*%< Region */ typedef uint64_t isc_resourcevalue_t; /*%< Resource Value */ -typedef unsigned int isc_result_t; /*%< Result */ typedef struct isc_rwlock isc_rwlock_t; /*%< Read Write Lock */ typedef struct isc_sockaddr isc_sockaddr_t; /*%< Socket Address */ typedef ISC_LIST(isc_sockaddr_t) isc_sockaddrlist_t; /*%< Socket Address List diff --git a/lib/isc/result.c b/lib/isc/result.c index 6a10dd1c2c..e525654efc 100644 --- a/lib/isc/result.c +++ b/lib/isc/result.c @@ -15,289 +15,513 @@ #include #include -#include -#include #include -typedef struct resulttable { - unsigned int base; - unsigned int last; - const char **text; - int set; - ISC_LINK(struct resulttable) link; -} resulttable; - -typedef ISC_LIST(resulttable) resulttable_list_t; - static const char *description[ISC_R_NRESULTS] = { - "success", /*%< 0 */ - "out of memory", /*%< 1 */ - "timed out", /*%< 2 */ - "no available threads", /*%< 3 */ - "address not available", /*%< 4 */ - "address in use", /*%< 5 */ - "permission denied", /*%< 6 */ - "no pending connections", /*%< 7 */ - "network unreachable", /*%< 8 */ - "host unreachable", /*%< 9 */ - "network down", /*%< 10 */ - "host down", /*%< 11 */ - "connection refused", /*%< 12 */ - "not enough free resources", /*%< 13 */ - "end of file", /*%< 14 */ - "socket already bound", /*%< 15 */ - "reload", /*%< 16 */ - "lock busy", /*%< 17 */ - "already exists", /*%< 18 */ - "ran out of space", /*%< 19 */ - "operation canceled", /*%< 20 */ - "socket is not bound", /*%< 21 */ - "shutting down", /*%< 22 */ - "not found", /*%< 23 */ - "unexpected end of input", /*%< 24 */ - "failure", /*%< 25 */ - "I/O error", /*%< 26 */ - "not implemented", /*%< 27 */ - "unbalanced parentheses", /*%< 28 */ - "no more", /*%< 29 */ - "invalid file", /*%< 30 */ - "bad base64 encoding", /*%< 31 */ - "unexpected token", /*%< 32 */ - "quota reached", /*%< 33 */ - "unexpected error", /*%< 34 */ - "already running", /*%< 35 */ - "ignore", /*%< 36 */ - "address mask not contiguous", /*%< 37 */ - "file not found", /*%< 38 */ - "file already exists", /*%< 39 */ - "socket is not connected", /*%< 40 */ - "out of range", /*%< 41 */ - "out of entropy", /*%< 42 */ - "invalid use of multicast address", /*%< 43 */ - "not a file", /*%< 44 */ - "not a directory", /*%< 45 */ - "queue is empty", /*%< 46 */ - "address family mismatch", /*%< 47 */ - "address family not supported", /*%< 48 */ - "bad hex encoding", /*%< 49 */ - "too many open files", /*%< 50 */ - "not blocking", /*%< 51 */ - "unbalanced quotes", /*%< 52 */ - "operation in progress", /*%< 53 */ - "connection reset", /*%< 54 */ - "soft quota reached", /*%< 55 */ - "not a valid number", /*%< 56 */ - "disabled", /*%< 57 */ - "max size", /*%< 58 */ - "invalid address format", /*%< 59 */ - "bad base32 encoding", /*%< 60 */ - "unset", /*%< 61 */ - "multiple", /*%< 62 */ - "would block", /*%< 63 */ - "complete", /*%< 64 */ - "crypto failure", /*%< 65 */ - "disc quota", /*%< 66 */ - "disc full", /*%< 67 */ - "default", /*%< 68 */ - "IPv4 prefix", /*%< 69 */ - "TLS error", /*%< 70 */ - "ALPN for HTTP/2 failed" /*%< 71 */ + [ISC_R_SUCCESS] = "success", + [ISC_R_NOMEMORY] = "out of memory", + [ISC_R_TIMEDOUT] = "timed out", + [ISC_R_NOTHREADS] = "no available threads", + [ISC_R_ADDRNOTAVAIL] = "address not available", + [ISC_R_ADDRINUSE] = "address in use", + [ISC_R_NOPERM] = "permission denied", + [ISC_R_NOCONN] = "no pending connections", + [ISC_R_NETUNREACH] = "network unreachable", + [ISC_R_HOSTUNREACH] = "host unreachable", + [ISC_R_NETDOWN] = "network down", + [ISC_R_HOSTDOWN] = "host down", + [ISC_R_CONNREFUSED] = "connection refused", + [ISC_R_NORESOURCES] = "not enough free resources", + [ISC_R_EOF] = "end of file", + [ISC_R_BOUND] = "socket already bound", + [ISC_R_RELOAD] = "reload", + [ISC_R_LOCKBUSY] = "lock busy", + [ISC_R_EXISTS] = "already exists", + [ISC_R_NOSPACE] = "ran out of space", + [ISC_R_CANCELED] = "operation canceled", + [ISC_R_NOTBOUND] = "socket is not bound", + [ISC_R_SHUTTINGDOWN] = "shutting down", + [ISC_R_NOTFOUND] = "not found", + [ISC_R_UNEXPECTEDEND] = "unexpected end of input", + [ISC_R_FAILURE] = "failure", + [ISC_R_IOERROR] = "I/O error", + [ISC_R_NOTIMPLEMENTED] = "not implemented", + [ISC_R_UNBALANCED] = "unbalanced parentheses", + [ISC_R_NOMORE] = "no more", + [ISC_R_INVALIDFILE] = "invalid file", + [ISC_R_BADBASE64] = "bad base64 encoding", + [ISC_R_UNEXPECTEDTOKEN] = "unexpected token", + [ISC_R_QUOTA] = "quota reached", + [ISC_R_UNEXPECTED] = "unexpected error", + [ISC_R_ALREADYRUNNING] = "already running", + [ISC_R_IGNORE] = "ignore", + [ISC_R_MASKNONCONTIG] = "address mask not contiguous", + [ISC_R_FILENOTFOUND] = "file not found", + [ISC_R_FILEEXISTS] = "file already exists", + [ISC_R_NOTCONNECTED] = "socket is not connected", + [ISC_R_RANGE] = "out of range", + [ISC_R_NOENTROPY] = "out of entropy", + [ISC_R_MULTICAST] = "invalid use of multicast address", + [ISC_R_NOTFILE] = "not a file", + [ISC_R_NOTDIRECTORY] = "not a directory", + [ISC_R_EMPTY] = "queue is empty", + [ISC_R_FAMILYMISMATCH] = "address family mismatch", + [ISC_R_FAMILYNOSUPPORT] = "address family not supported", + [ISC_R_BADHEX] = "bad hex encoding", + [ISC_R_TOOMANYOPENFILES] = "too many open files", + [ISC_R_NOTBLOCKING] = "not blocking", + [ISC_R_UNBALANCEDQUOTES] = "unbalanced quotes", + [ISC_R_INPROGRESS] = "operation in progress", + [ISC_R_CONNECTIONRESET] = "connection reset", + [ISC_R_SOFTQUOTA] = "soft quota reached", + [ISC_R_BADNUMBER] = "not a valid number", + [ISC_R_DISABLED] = "disabled", + [ISC_R_MAXSIZE] = "max size", + [ISC_R_BADADDRESSFORM] = "invalid address format", + [ISC_R_BADBASE32] = "bad base32 encoding", + [ISC_R_UNSET] = "unset", + [ISC_R_MULTIPLE] = "multiple", + [ISC_R_WOULDBLOCK] = "would block", + [ISC_R_COMPLETE] = "complete", + [ISC_R_CRYPTOFAILURE] = "crypto failure", + [ISC_R_DISCQUOTA] = "disc quota", + [ISC_R_DISCFULL] = "disc full", + [ISC_R_DEFAULT] = "default", + [ISC_R_IPV4PREFIX] = "IPv4 prefix", + [ISC_R_TLSERROR] = "TLS error", + [ISC_R_HTTP2ALPNERROR] = "ALPN for HTTP/2 failed", + + [DNS_R_LABELTOOLONG] = "label too long", + [DNS_R_BADESCAPE] = "bad escape", + [DNS_R_EMPTYLABEL] = "empty label", + [DNS_R_BADDOTTEDQUAD] = "bad dotted quad", + [DNS_R_INVALIDNS] = "invalid NS owner name (wildcard)", + [DNS_R_UNKNOWN] = "unknown class/type", + [DNS_R_BADLABELTYPE] = "bad label type", + [DNS_R_BADPOINTER] = "bad compression pointer", + [DNS_R_TOOMANYHOPS] = "too many hops", + [DNS_R_DISALLOWED] = "disallowed (by application policy)", + [DNS_R_EXTRATOKEN] = "extra input text", + [DNS_R_EXTRADATA] = "extra input data", + [DNS_R_TEXTTOOLONG] = "text too long", + [DNS_R_NOTZONETOP] = "not at top of zone", + [DNS_R_SYNTAX] = "syntax error", + [DNS_R_BADCKSUM] = "bad checksum", + [DNS_R_BADAAAA] = "bad IPv6 address", + [DNS_R_NOOWNER] = "no owner", + [DNS_R_NOTTL] = "no ttl", + [DNS_R_BADCLASS] = "bad class", + [DNS_R_NAMETOOLONG] = "name too long", + [DNS_R_PARTIALMATCH] = "partial match", + [DNS_R_NEWORIGIN] = "new origin", + [DNS_R_UNCHANGED] = "unchanged", + [DNS_R_BADTTL] = "bad ttl", + [DNS_R_NOREDATA] = "more data needed/to be rendered", + [DNS_R_CONTINUE] = "continue", + [DNS_R_DELEGATION] = "delegation", + [DNS_R_GLUE] = "glue", + [DNS_R_DNAME] = "dname", + [DNS_R_CNAME] = "cname", + [DNS_R_BADDB] = "bad database", + [DNS_R_ZONECUT] = "zonecut", + [DNS_R_BADZONE] = "bad zone", + [DNS_R_MOREDATA] = "more data", + [DNS_R_UPTODATE] = "up to date", + [DNS_R_TSIGVERIFYFAILURE] = "tsig verify failure", + [DNS_R_TSIGERRORSET] = "tsig indicates error", + [DNS_R_SIGINVALID] = "RRSIG failed to verify", + [DNS_R_SIGEXPIRED] = "RRSIG has expired", + [DNS_R_SIGFUTURE] = "RRSIG validity period has not begun", + [DNS_R_KEYUNAUTHORIZED] = "key is unauthorized to sign data", + [DNS_R_INVALIDTIME] = "invalid time", + [DNS_R_EXPECTEDTSIG] = "expected a TSIG or SIG(0)", + [DNS_R_UNEXPECTEDTSIG] = "did not expect a TSIG or SIG(0)", + [DNS_R_INVALIDTKEY] = "TKEY is unacceptable", + [DNS_R_HINT] = "hint", + [DNS_R_DROP] = "drop", + [DNS_R_NOTLOADED] = "zone not loaded", + [DNS_R_NCACHENXDOMAIN] = "ncache nxdomain", + [DNS_R_NCACHENXRRSET] = "ncache nxrrset", + [DNS_R_WAIT] = "wait", + [DNS_R_NOTVERIFIEDYET] = "not verified yet", + [DNS_R_NOIDENTITY] = "no identity", + [DNS_R_NOJOURNAL] = "no journal", + [DNS_R_ALIAS] = "alias", + [DNS_R_USETCP] = "use TCP", + [DNS_R_NOVALIDSIG] = "no valid RRSIG", + [DNS_R_NOVALIDNSEC] = "no valid NSEC", + [DNS_R_NOTINSECURE] = "insecurity proof failed", + [DNS_R_UNKNOWNSERVICE] = "unknown service", + [DNS_R_RECOVERABLE] = "recoverable error occurred", + [DNS_R_UNKNOWNOPT] = "unknown opt attribute record", + [DNS_R_UNEXPECTEDID] = "unexpected message id", + [DNS_R_SEENINCLUDE] = "seen include file", + [DNS_R_NOTEXACT] = "not exact", + [DNS_R_BLACKHOLED] = "address blackholed", + [DNS_R_BADALG] = "bad algorithm", + [DNS_R_METATYPE] = "invalid use of a meta type", + [DNS_R_CNAMEANDOTHER] = "CNAME and other data", + [DNS_R_SINGLETON] = "multiple RRs of singleton type", + [DNS_R_HINTNXRRSET] = "hint nxrrset", + [DNS_R_NOMASTERFILE] = "no master file configured", + [DNS_R_UNKNOWNPROTO] = "unknown protocol", + [DNS_R_CLOCKSKEW] = "clocks are unsynchronized", + [DNS_R_BADIXFR] = "IXFR failed", + [DNS_R_NOTAUTHORITATIVE] = "not authoritative", + [DNS_R_NOVALIDKEY] = "no valid KEY", + [DNS_R_OBSOLETE] = "obsolete", + [DNS_R_FROZEN] = "already frozen", + [DNS_R_UNKNOWNFLAG] = "unknown flag", + [DNS_R_EXPECTEDRESPONSE] = "expected a response", + [DNS_R_NOVALIDDS] = "no valid DS", + [DNS_R_NSISADDRESS] = "NS is an address", + [DNS_R_REMOTEFORMERR] = "received FORMERR", + [DNS_R_TRUNCATEDTCP] = "truncated TCP response", + [DNS_R_LAME] = "lame server detected", + [DNS_R_UNEXPECTEDRCODE] = "unexpected RCODE", + [DNS_R_UNEXPECTEDOPCODE] = "unexpected OPCODE", + [DNS_R_CHASEDSSERVERS] = "chase DS servers", + [DNS_R_EMPTYNAME] = "empty name", + [DNS_R_EMPTYWILD] = "empty wild", + [DNS_R_BADBITMAP] = "bad bitmap", + [DNS_R_FROMWILDCARD] = "from wildcard", + [DNS_R_BADOWNERNAME] = "bad owner name (check-names)", + [DNS_R_BADNAME] = "bad name (check-names)", + [DNS_R_DYNAMIC] = "dynamic zone", + [DNS_R_UNKNOWNCOMMAND] = "unknown command", + [DNS_R_MUSTBESECURE] = "must-be-secure", + [DNS_R_COVERINGNSEC] = "covering NSEC record returned", + [DNS_R_MXISADDRESS] = "MX is an address", + [DNS_R_DUPLICATE] = "duplicate query", + [DNS_R_INVALIDNSEC3] = "invalid NSEC3 owner name (wildcard)", + [DNS_R_NOTMASTER] = "not master", + [DNS_R_BROKENCHAIN] = "broken trust chain", + [DNS_R_EXPIRED] = "expired", + [DNS_R_NOTDYNAMIC] = "not dynamic", + [DNS_R_BADEUI] = "bad EUI", + [DNS_R_NTACOVERED] = "covered by negative trust anchor", + [DNS_R_BADCDS] = "bad CDS", + [DNS_R_BADCDNSKEY] = "bad CDNSKEY", + [DNS_R_OPTERR] = "malformed OPT option", + [DNS_R_BADDNSTAP] = "malformed DNSTAP data", + [DNS_R_BADTSIG] = "TSIG in wrong location", + [DNS_R_BADSIG0] = "SIG(0) in wrong location", + [DNS_R_TOOMANYRECORDS] = "too many records", + [DNS_R_VERIFYFAILURE] = "verify failure", + [DNS_R_ATZONETOP] = "at top of zone", + [DNS_R_NOKEYMATCH] = "no matching key found", + [DNS_R_TOOMANYKEYS] = "too many keys matching", + [DNS_R_KEYNOTACTIVE] = "key is not actively signing", + [DNS_R_NSEC3ITERRANGE] = "NSEC3 iterations out of range", + [DNS_R_NSEC3SALTRANGE] = "NSEC3 salt length too high", + [DNS_R_NSEC3BADALG] = "cannot use NSEC3 with key algorithm", + [DNS_R_NSEC3RESALT] = "NSEC3 resalt", + [DNS_R_INCONSISTENTRR] = "inconsistent resource record", + + [DST_R_UNSUPPORTEDALG] = "algorithm is unsupported", + [DST_R_CRYPTOFAILURE] = "crypto failure", + [DST_R_NOCRYPTO] = "built with no crypto support", + [DST_R_NULLKEY] = "illegal operation for a null key", + [DST_R_INVALIDPUBLICKEY] = "public key is invalid", + [DST_R_INVALIDPRIVATEKEY] = "private key is invalid", + [DST_R_WRITEERROR] = "error occurred writing key to disk", + [DST_R_INVALIDPARAM] = "invalid algorithm specific parameter", + [DST_R_SIGNFAILURE] = "sign failure", + [DST_R_VERIFYFAILURE] = "verify failure", + [DST_R_NOTPUBLICKEY] = "not a public key", + [DST_R_NOTPRIVATEKEY] = "not a private key", + [DST_R_KEYCANNOTCOMPUTESECRET] = "not a key that can compute a secret", + [DST_R_COMPUTESECRETFAILURE] = "failure computing a shared secret", + [DST_R_NORANDOMNESS] = "no randomness available", + [DST_R_BADKEYTYPE] = "bad key type", + [DST_R_NOENGINE] = "no engine", + [DST_R_EXTERNALKEY] = "illegal operation for an external key", + + [DNS_R_NOERROR] = "NOERROR", + [DNS_R_FORMERR] = "FORMERR", + [DNS_R_SERVFAIL] = "SERVFAIL", + [DNS_R_NXDOMAIN] = "NXDOMAIN", + [DNS_R_NOTIMP] = "NOTIMP", + [DNS_R_REFUSED] = "REFUSED", + [DNS_R_YXDOMAIN] = "YXDOMAIN", + [DNS_R_YXRRSET] = "YXRRSET", + [DNS_R_NXRRSET] = "NXRRSET", + [DNS_R_NOTAUTH] = "NOTAUTH", + [DNS_R_NOTZONE] = "NOTZONE", + [DNS_R_RCODE11] = "", + [DNS_R_RCODE12] = "", + [DNS_R_RCODE13] = "", + [DNS_R_RCODE14] = "", + [DNS_R_RCODE15] = "", + [DNS_R_BADVERS] = "BADVERS", + + [ISCCC_R_UNKNOWNVERSION] = "unknown version", + [ISCCC_R_SYNTAX] = "syntax error", + [ISCCC_R_BADAUTH] = "bad auth", + [ISCCC_R_EXPIRED] = "expired", + [ISCCC_R_CLOCKSKEW] = "clock skew", + [ISCCC_R_DUPLICATE] = "duplicate", }; -static const char *identifier[ISC_R_NRESULTS] = { "ISC_R_SUCCESS", - "ISC_R_NOMEMORY", - "ISC_R_TIMEDOUT", - "ISC_R_NOTHREADS", - "ISC_R_ADDRNOTAVAIL", - "ISC_R_ADDRINUSE", - "ISC_R_NOPERM", - "ISC_R_NOCONN", - "ISC_R_NETUNREACH", - "ISC_R_HOSTUNREACH", - "ISC_R_NETDOWN", - "ISC_R_HOSTDOWN", - "ISC_R_CONNREFUSED", - "ISC_R_NORESOURCES", - "ISC_R_EOF", - "ISC_R_BOUND", - "ISC_R_RELOAD", - "ISC_R_LOCKBUSY", - "ISC_R_EXISTS", - "ISC_R_NOSPACE", - "ISC_R_CANCELED", - "ISC_R_NOTBOUND", - "ISC_R_SHUTTINGDOWN", - "ISC_R_NOTFOUND", - "ISC_R_UNEXPECTEDEND", - "ISC_R_FAILURE", - "ISC_R_IOERROR", - "ISC_R_NOTIMPLEMENTED", - "ISC_R_UNBALANCED", - "ISC_R_NOMORE", - "ISC_R_INVALIDFILE", - "ISC_R_BADBASE64", - "ISC_R_UNEXPECTEDTOKEN", - "ISC_R_QUOTA", - "ISC_R_UNEXPECTED", - "ISC_R_ALREADYRUNNING", - "ISC_R_IGNORE", - "ISC_R_MASKNONCONTIG", - "ISC_R_FILENOTFOUND", - "ISC_R_FILEEXISTS", - "ISC_R_NOTCONNECTED", - "ISC_R_RANGE", - "ISC_R_NOENTROPY", - "ISC_R_MULTICAST", - "ISC_R_NOTFILE", - "ISC_R_NOTDIRECTORY", - "ISC_R_EMPTY", - "ISC_R_FAMILYMISMATCH", - "ISC_R_FAMILYNOSUPPORT", - "ISC_R_BADHEX", - "ISC_R_TOOMANYOPENFILES", - "ISC_R_NOTBLOCKING", - "ISC_R_UNBALANCEDQUOTES", - "ISC_R_INPROGRESS", - "ISC_R_CONNECTIONRESET", - "ISC_R_SOFTQUOTA", - "ISC_R_BADNUMBER", - "ISC_R_DISABLED", - "ISC_R_MAXSIZE", - "ISC_R_BADADDRESSFORM", - "ISC_R_BADBASE32", - "ISC_R_UNSET", - "ISC_R_MULTIPLE", - "ISC_R_WOULDBLOCK", - "ISC_R_COMPLETE", - "ISC_R_CRYPTOFAILURE", - "ISC_R_DISCQUOTA", - "ISC_R_DISCFULL", - "ISC_R_DEFAULT", - "ISC_R_IPV4PREFIX", - "ISC_R_TLSERROR", - "ISC_R_HTTP2ALPNERROR" }; +static const char *identifier[ISC_R_NRESULTS] = { + [ISC_R_SUCCESS] = "ISC_R_SUCCESS", + [ISC_R_NOMEMORY] = "ISC_R_NOMEMORY", + [ISC_R_TIMEDOUT] = "ISC_R_TIMEDOUT", + [ISC_R_NOTHREADS] = "ISC_R_NOTHREADS", + [ISC_R_ADDRNOTAVAIL] = "ISC_R_ADDRNOTAVAIL", + [ISC_R_ADDRINUSE] = "ISC_R_ADDRINUSE", + [ISC_R_NOPERM] = "ISC_R_NOPERM", + [ISC_R_NOCONN] = "ISC_R_NOCONN", + [ISC_R_NETUNREACH] = "ISC_R_NETUNREACH", + [ISC_R_HOSTUNREACH] = "ISC_R_HOSTUNREACH", + [ISC_R_NETDOWN] = "ISC_R_NETDOWN", + [ISC_R_HOSTDOWN] = "ISC_R_HOSTDOWN", + [ISC_R_CONNREFUSED] = "ISC_R_CONNREFUSED", + [ISC_R_NORESOURCES] = "ISC_R_NORESOURCES", + [ISC_R_EOF] = "ISC_R_EOF", + [ISC_R_BOUND] = "ISC_R_BOUND", + [ISC_R_RELOAD] = "ISC_R_RELOAD", + [ISC_R_LOCKBUSY] = "ISC_R_LOCKBUSY", + [ISC_R_EXISTS] = "ISC_R_EXISTS", + [ISC_R_NOSPACE] = "ISC_R_NOSPACE", + [ISC_R_CANCELED] = "ISC_R_CANCELED", + [ISC_R_NOTBOUND] = "ISC_R_NOTBOUND", + [ISC_R_SHUTTINGDOWN] = "ISC_R_SHUTTINGDOWN", + [ISC_R_NOTFOUND] = "ISC_R_NOTFOUND", + [ISC_R_UNEXPECTEDEND] = "ISC_R_UNEXPECTEDEND", + [ISC_R_FAILURE] = "ISC_R_FAILURE", + [ISC_R_IOERROR] = "ISC_R_IOERROR", + [ISC_R_NOTIMPLEMENTED] = "ISC_R_NOTIMPLEMENTED", + [ISC_R_UNBALANCED] = "ISC_R_UNBALANCED", + [ISC_R_NOMORE] = "ISC_R_NOMORE", + [ISC_R_INVALIDFILE] = "ISC_R_INVALIDFILE", + [ISC_R_BADBASE64] = "ISC_R_BADBASE64", + [ISC_R_UNEXPECTEDTOKEN] = "ISC_R_UNEXPECTEDTOKEN", + [ISC_R_QUOTA] = "ISC_R_QUOTA", + [ISC_R_UNEXPECTED] = "ISC_R_UNEXPECTED", + [ISC_R_ALREADYRUNNING] = "ISC_R_ALREADYRUNNING", + [ISC_R_IGNORE] = "ISC_R_IGNORE", + [ISC_R_MASKNONCONTIG] = "ISC_R_MASKNONCONTIG", + [ISC_R_FILENOTFOUND] = "ISC_R_FILENOTFOUND", + [ISC_R_FILEEXISTS] = "ISC_R_FILEEXISTS", + [ISC_R_NOTCONNECTED] = "ISC_R_NOTCONNECTED", + [ISC_R_RANGE] = "ISC_R_RANGE", + [ISC_R_NOENTROPY] = "ISC_R_NOENTROPY", + [ISC_R_MULTICAST] = "ISC_R_MULTICAST", + [ISC_R_NOTFILE] = "ISC_R_NOTFILE", + [ISC_R_NOTDIRECTORY] = "ISC_R_NOTDIRECTORY", + [ISC_R_EMPTY] = "ISC_R_EMPTY", + [ISC_R_FAMILYMISMATCH] = "ISC_R_FAMILYMISMATCH", + [ISC_R_FAMILYNOSUPPORT] = "ISC_R_FAMILYNOSUPPORT", + [ISC_R_BADHEX] = "ISC_R_BADHEX", + [ISC_R_TOOMANYOPENFILES] = "ISC_R_TOOMANYOPENFILES", + [ISC_R_NOTBLOCKING] = "ISC_R_NOTBLOCKING", + [ISC_R_UNBALANCEDQUOTES] = "ISC_R_UNBALANCEDQUOTES", + [ISC_R_INPROGRESS] = "ISC_R_INPROGRESS", + [ISC_R_CONNECTIONRESET] = "ISC_R_CONNECTIONRESET", + [ISC_R_SOFTQUOTA] = "ISC_R_SOFTQUOTA", + [ISC_R_BADNUMBER] = "ISC_R_BADNUMBER", + [ISC_R_DISABLED] = "ISC_R_DISABLED", + [ISC_R_MAXSIZE] = "ISC_R_MAXSIZE", + [ISC_R_BADADDRESSFORM] = "ISC_R_BADADDRESSFORM", + [ISC_R_BADBASE32] = "ISC_R_BADBASE32", + [ISC_R_UNSET] = "ISC_R_UNSET", + [ISC_R_MULTIPLE] = "ISC_R_MULTIPLE", + [ISC_R_WOULDBLOCK] = "ISC_R_WOULDBLOCK", + [ISC_R_COMPLETE] = "ISC_R_COMPLETE", + [ISC_R_CRYPTOFAILURE] = "ISC_R_CRYPTOFAILURE", + [ISC_R_DISCQUOTA] = "ISC_R_DISCQUOTA", + [ISC_R_DISCFULL] = "ISC_R_DISCFULL", + [ISC_R_DEFAULT] = "ISC_R_DEFAULT", + [ISC_R_IPV4PREFIX] = "ISC_R_IPV4PREFIX", + [ISC_R_TLSERROR] = "ISC_R_TLSERROR", + [ISC_R_HTTP2ALPNERROR] = "ISC_R_HTTP2ALPNERROR", + [DNS_R_LABELTOOLONG] = "DNS_R_LABELTOOLONG", + [DNS_R_BADESCAPE] = "DNS_R_BADESCAPE", + [DNS_R_EMPTYLABEL] = "DNS_R_EMPTYLABEL", + [DNS_R_BADDOTTEDQUAD] = "DNS_R_BADDOTTEDQUAD", + [DNS_R_INVALIDNS] = "DNS_R_INVALIDNS", + [DNS_R_UNKNOWN] = "DNS_R_UNKNOWN", + [DNS_R_BADLABELTYPE] = "DNS_R_BADLABELTYPE", + [DNS_R_BADPOINTER] = "DNS_R_BADPOINTER", + [DNS_R_TOOMANYHOPS] = "DNS_R_TOOMANYHOPS", + [DNS_R_DISALLOWED] = "DNS_R_DISALLOWED", + [DNS_R_EXTRATOKEN] = "DNS_R_EXTRATOKEN", + [DNS_R_EXTRADATA] = "DNS_R_EXTRADATA", + [DNS_R_TEXTTOOLONG] = "DNS_R_TEXTTOOLONG", + [DNS_R_NOTZONETOP] = "DNS_R_NOTZONETOP", + [DNS_R_SYNTAX] = "DNS_R_SYNTAX", + [DNS_R_BADCKSUM] = "DNS_R_BADCKSUM", + [DNS_R_BADAAAA] = "DNS_R_BADAAAA", + [DNS_R_NOOWNER] = "DNS_R_NOOWNER", + [DNS_R_NOTTL] = "DNS_R_NOTTL", + [DNS_R_BADCLASS] = "DNS_R_BADCLASS", + [DNS_R_NAMETOOLONG] = "DNS_R_NAMETOOLONG", + [DNS_R_PARTIALMATCH] = "DNS_R_PARTIALMATCH", + [DNS_R_NEWORIGIN] = "DNS_R_NEWORIGIN", + [DNS_R_UNCHANGED] = "DNS_R_UNCHANGED", + [DNS_R_BADTTL] = "DNS_R_BADTTL", + [DNS_R_NOREDATA] = "DNS_R_NOREDATA", + [DNS_R_CONTINUE] = "DNS_R_CONTINUE", + [DNS_R_DELEGATION] = "DNS_R_DELEGATION", + [DNS_R_GLUE] = "DNS_R_GLUE", + [DNS_R_DNAME] = "DNS_R_DNAME", + [DNS_R_CNAME] = "DNS_R_CNAME", + [DNS_R_BADDB] = "DNS_R_BADDB", + [DNS_R_ZONECUT] = "DNS_R_ZONECUT", + [DNS_R_BADZONE] = "DNS_R_BADZONE", + [DNS_R_MOREDATA] = "DNS_R_MOREDATA", + [DNS_R_UPTODATE] = "DNS_R_UPTODATE", + [DNS_R_TSIGVERIFYFAILURE] = "DNS_R_TSIGVERIFYFAILURE", + [DNS_R_TSIGERRORSET] = "DNS_R_TSIGERRORSET", + [DNS_R_SIGINVALID] = "DNS_R_SIGINVALID", + [DNS_R_SIGEXPIRED] = "DNS_R_SIGEXPIRED", + [DNS_R_SIGFUTURE] = "DNS_R_SIGFUTURE", + [DNS_R_KEYUNAUTHORIZED] = "DNS_R_KEYUNAUTHORIZED", + [DNS_R_INVALIDTIME] = "DNS_R_INVALIDTIME", + [DNS_R_EXPECTEDTSIG] = "DNS_R_EXPECTEDTSIG", + [DNS_R_UNEXPECTEDTSIG] = "DNS_R_UNEXPECTEDTSIG", + [DNS_R_INVALIDTKEY] = "DNS_R_INVALIDTKEY", + [DNS_R_HINT] = "DNS_R_HINT", + [DNS_R_DROP] = "DNS_R_DROP", + [DNS_R_NOTLOADED] = "DNS_R_NOTLOADED", + [DNS_R_NCACHENXDOMAIN] = "DNS_R_NCACHENXDOMAIN", + [DNS_R_NCACHENXRRSET] = "DNS_R_NCACHENXRRSET", + [DNS_R_WAIT] = "DNS_R_WAIT", + [DNS_R_NOTVERIFIEDYET] = "DNS_R_NOTVERIFIEDYET", + [DNS_R_NOIDENTITY] = "DNS_R_NOIDENTITY", + [DNS_R_NOJOURNAL] = "DNS_R_NOJOURNAL", + [DNS_R_ALIAS] = "DNS_R_ALIAS", + [DNS_R_USETCP] = "DNS_R_USETCP", + [DNS_R_NOVALIDSIG] = "DNS_R_NOVALIDSIG", + [DNS_R_NOVALIDNSEC] = "DNS_R_NOVALIDNSEC", + [DNS_R_NOTINSECURE] = "DNS_R_NOTINSECURE", + [DNS_R_UNKNOWNSERVICE] = "DNS_R_UNKNOWNSERVICE", + [DNS_R_RECOVERABLE] = "DNS_R_RECOVERABLE", + [DNS_R_UNKNOWNOPT] = "DNS_R_UNKNOWNOPT", + [DNS_R_UNEXPECTEDID] = "DNS_R_UNEXPECTEDID", + [DNS_R_SEENINCLUDE] = "DNS_R_SEENINCLUDE", + [DNS_R_NOTEXACT] = "DNS_R_NOTEXACT", + [DNS_R_BLACKHOLED] = "DNS_R_BLACKHOLED", + [DNS_R_BADALG] = "DNS_R_BADALG", + [DNS_R_METATYPE] = "DNS_R_METATYPE", + [DNS_R_CNAMEANDOTHER] = "DNS_R_CNAMEANDOTHER", + [DNS_R_SINGLETON] = "DNS_R_SINGLETON", + [DNS_R_HINTNXRRSET] = "DNS_R_HINTNXRRSET", + [DNS_R_NOMASTERFILE] = "DNS_R_NOMASTERFILE", + [DNS_R_UNKNOWNPROTO] = "DNS_R_UNKNOWNPROTO", + [DNS_R_CLOCKSKEW] = "DNS_R_CLOCKSKEW", + [DNS_R_BADIXFR] = "DNS_R_BADIXFR", + [DNS_R_NOTAUTHORITATIVE] = "DNS_R_NOTAUTHORITATIVE", + [DNS_R_NOVALIDKEY] = "DNS_R_NOVALIDKEY", + [DNS_R_OBSOLETE] = "DNS_R_OBSOLETE", + [DNS_R_FROZEN] = "DNS_R_FROZEN", + [DNS_R_UNKNOWNFLAG] = "DNS_R_UNKNOWNFLAG", + [DNS_R_EXPECTEDRESPONSE] = "DNS_R_EXPECTEDRESPONSE", + [DNS_R_NOVALIDDS] = "DNS_R_NOVALIDDS", + [DNS_R_NSISADDRESS] = "DNS_R_NSISADDRESS", + [DNS_R_REMOTEFORMERR] = "DNS_R_REMOTEFORMERR", + [DNS_R_TRUNCATEDTCP] = "DNS_R_TRUNCATEDTCP", + [DNS_R_LAME] = "DNS_R_LAME", + [DNS_R_UNEXPECTEDRCODE] = "DNS_R_UNEXPECTEDRCODE", + [DNS_R_UNEXPECTEDOPCODE] = "DNS_R_UNEXPECTEDOPCODE", + [DNS_R_CHASEDSSERVERS] = "DNS_R_CHASEDSSERVERS", + [DNS_R_EMPTYNAME] = "DNS_R_EMPTYNAME", + [DNS_R_EMPTYWILD] = "DNS_R_EMPTYWILD", + [DNS_R_BADBITMAP] = "DNS_R_BADBITMAP", + [DNS_R_FROMWILDCARD] = "DNS_R_FROMWILDCARD", + [DNS_R_BADOWNERNAME] = "DNS_R_BADOWNERNAME", + [DNS_R_BADNAME] = "DNS_R_BADNAME", + [DNS_R_DYNAMIC] = "DNS_R_DYNAMIC", + [DNS_R_UNKNOWNCOMMAND] = "DNS_R_UNKNOWNCOMMAND", + [DNS_R_MUSTBESECURE] = "DNS_R_MUSTBESECURE", + [DNS_R_COVERINGNSEC] = "DNS_R_COVERINGNSEC", + [DNS_R_MXISADDRESS] = "DNS_R_MXISADDRESS", + [DNS_R_DUPLICATE] = "DNS_R_DUPLICATE", + [DNS_R_INVALIDNSEC3] = "DNS_R_INVALIDNSEC3", + [DNS_R_NOTMASTER] = "DNS_R_NOTMASTER", + [DNS_R_BROKENCHAIN] = "DNS_R_BROKENCHAIN", + [DNS_R_EXPIRED] = "DNS_R_EXPIRED", + [DNS_R_NOTDYNAMIC] = "DNS_R_NOTDYNAMIC", + [DNS_R_BADEUI] = "DNS_R_BADEUI", + [DNS_R_NTACOVERED] = "DNS_R_NTACOVERED", + [DNS_R_BADCDS] = "DNS_R_BADCDS", + [DNS_R_BADCDNSKEY] = "DNS_R_BADCDNSKEY", + [DNS_R_OPTERR] = "DNS_R_OPTERR", + [DNS_R_BADDNSTAP] = "DNS_R_BADDNSTAP", + [DNS_R_BADTSIG] = "DNS_R_BADTSIG", + [DNS_R_BADSIG0] = "DNS_R_BADSIG0", + [DNS_R_TOOMANYRECORDS] = "DNS_R_TOOMANYRECORDS", + [DNS_R_VERIFYFAILURE] = "DNS_R_VERIFYFAILURE", + [DNS_R_ATZONETOP] = "DNS_R_ATZONETOP", + [DNS_R_NOKEYMATCH] = "DNS_R_NOKEYMATCH", + [DNS_R_TOOMANYKEYS] = "DNS_R_TOOMANYKEYS", + [DNS_R_KEYNOTACTIVE] = "DNS_R_KEYNOTACTIVE", + [DNS_R_NSEC3ITERRANGE] = "DNS_R_NSEC3ITERRANGE", + [DNS_R_NSEC3SALTRANGE] = "DNS_R_NSEC3SALTRANGE", + [DNS_R_NSEC3BADALG] = "DNS_R_NSEC3BADALG", + [DNS_R_NSEC3RESALT] = "DNS_R_NSEC3RESALT", + [DNS_R_INCONSISTENTRR] = "DNS_R_INCONSISTENTRR", -#define ISC_RESULT_RESULTSET 2 -#define ISC_RESULT_UNAVAILABLESET 3 + [DST_R_UNSUPPORTEDALG] = "DST_R_UNSUPPORTEDALG", + [DST_R_CRYPTOFAILURE] = "DST_R_CRYPTOFAILURE", + [DST_R_NOCRYPTO] = "DST_R_NOCRYPTO", + [DST_R_NULLKEY] = "DST_R_NULLKEY", + [DST_R_INVALIDPUBLICKEY] = "DST_R_INVALIDPUBLICKEY", + [DST_R_INVALIDPRIVATEKEY] = "DST_R_INVALIDPRIVATEKEY", + [DST_R_WRITEERROR] = "DST_R_WRITEERROR", + [DST_R_INVALIDPARAM] = "DST_R_INVALIDPARAM", + [DST_R_SIGNFAILURE] = "DST_R_SIGNFAILURE", + [DST_R_VERIFYFAILURE] = "DST_R_VERIFYFAILURE", + [DST_R_NOTPUBLICKEY] = "DST_R_NOTPUBLICKEY", + [DST_R_NOTPRIVATEKEY] = "DST_R_NOTPRIVATEKEY", + [DST_R_KEYCANNOTCOMPUTESECRET] = "DST_R_KEYCANNOTCOMPUTESECRET", + [DST_R_COMPUTESECRETFAILURE] = "DST_R_COMPUTESECRETFAILURE", + [DST_R_NORANDOMNESS] = "DST_R_NORANDOMNESS", + [DST_R_BADKEYTYPE] = "DST_R_BADKEYTYPE", + [DST_R_NOENGINE] = "DST_R_NOENGINE", + [DST_R_EXTERNALKEY] = "DST_R_EXTERNALKEY", -static isc_once_t once = ISC_ONCE_INIT; -static resulttable_list_t description_tables; -static resulttable_list_t identifier_tables; -static isc_rwlock_t lock; + [DNS_R_NOERROR] = "DNS_R_NOERROR", + [DNS_R_FORMERR] = "DNS_R_FORMERR", + [DNS_R_SERVFAIL] = "DNS_R_SERVFAIL", + [DNS_R_NXDOMAIN] = "DNS_R_NXDOMAIN", + [DNS_R_NOTIMP] = "DNS_R_NOTIMP", + [DNS_R_REFUSED] = "DNS_R_REFUSED", + [DNS_R_YXDOMAIN] = "DNS_R_YXDOMAIN", + [DNS_R_YXRRSET] = "DNS_R_YXRRSET", + [DNS_R_NXRRSET] = "DNS_R_NXRRSET", + [DNS_R_NOTAUTH] = "DNS_R_NOTAUTH", + [DNS_R_NOTZONE] = "DNS_R_NOTZONE", + [DNS_R_RCODE11] = "DNS_R_RCODE11", + [DNS_R_RCODE12] = "RNS_R_RCODE12", + [DNS_R_RCODE13] = "DNS_R_RCODE13", + [DNS_R_RCODE14] = "DNS_R_RCODE14", + [DNS_R_RCODE15] = "DNS_R_RCODE15", + [DNS_R_BADVERS] = "DNS_R_BADVERS", -static isc_result_t -register_table(resulttable_list_t *tables, unsigned int base, - unsigned int nresults, const char **text, int set) { - resulttable *table; + [ISCCC_R_UNKNOWNVERSION] = "ISCCC_R_UNKNOWNVERSION", + [ISCCC_R_SYNTAX] = "ISCCC_R_SYNTAX", + [ISCCC_R_BADAUTH] = "ISCCC_R_BADAUTH", + [ISCCC_R_EXPIRED] = "ISCCC_R_EXPIRED", + [ISCCC_R_CLOCKSKEW] = "ISCCC_R_CLOCKSKEW", + [ISCCC_R_DUPLICATE] = "ISCCC_R_DUPLICATE", +}; - REQUIRE(base % ISC_RESULTCLASS_SIZE == 0); - REQUIRE(nresults <= ISC_RESULTCLASS_SIZE); - REQUIRE(text != NULL); +STATIC_ASSERT((DNS_R_SERVFAIL - DNS_R_NOERROR == 2), + "DNS_R_NOERROR has wrong value"); - /* - * We use malloc() here because we we want to be able to use - * isc_result_totext() even if there is no memory context. - */ - table = malloc(sizeof(*table)); - if (table == NULL) { - return (ISC_R_NOMEMORY); - } - table->base = base; - table->last = base + nresults - 1; - table->text = text; - table->set = set; - ISC_LINK_INIT(table, link); +STATIC_ASSERT((DNS_R_BADVERS - DNS_R_NOERROR == 16), + "DNS_R_BADVERS has wrong value"); - RWLOCK(&lock, isc_rwlocktype_write); - - ISC_LIST_APPEND(*tables, table, link); - - RWUNLOCK(&lock, isc_rwlocktype_write); - - return (ISC_R_SUCCESS); -} - -static void -initialize_action(void) { - isc_result_t result; - - isc_rwlock_init(&lock, 0, 0); - ISC_LIST_INIT(description_tables); - ISC_LIST_INIT(identifier_tables); - - result = register_table(&description_tables, ISC_RESULTCLASS_ISC, - ISC_R_NRESULTS, description, - ISC_RESULT_RESULTSET); - if (result != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "register_table() failed: %u", result); - } - - result = register_table(&identifier_tables, ISC_RESULTCLASS_ISC, - ISC_R_NRESULTS, identifier, - ISC_RESULT_RESULTSET); - if (result != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "register_table() failed: %u", result); - } -} - -static void -initialize(void) { - RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); -} - -static const char * -isc_result_tomany_helper(resulttable_list_t *tables, isc_result_t result) { - resulttable *table; - const char *text; - int index; - - initialize(); - - RWLOCK(&lock, isc_rwlocktype_read); - - text = NULL; - for (table = ISC_LIST_HEAD(*tables); table != NULL; - table = ISC_LIST_NEXT(table, link)) - { - if (result >= table->base && result <= table->last) { - index = (int)(result - table->base); - text = table->text[index]; - break; - } - } - if (text == NULL) { - text = "(result code text not available)"; - } - - RWUNLOCK(&lock, isc_rwlocktype_read); - - return (text); -} +STATIC_ASSERT((ISC_R_NRESULTS < INT32_MAX), "result.h enum too big"); const char * isc_result_totext(isc_result_t result) { - return (isc_result_tomany_helper(&description_tables, result)); + return (description[result]); } const char * isc_result_toid(isc_result_t result) { - return (isc_result_tomany_helper(&identifier_tables, result)); -} - -isc_result_t -isc_result_register(unsigned int base, unsigned int nresults, const char **text, - int set) { - initialize(); - - return (register_table(&description_tables, base, nresults, text, set)); -} - -isc_result_t -isc_result_registerids(unsigned int base, unsigned int nresults, - const char **ids, int set) { - initialize(); - - return (register_table(&identifier_tables, base, nresults, ids, set)); + return (identifier[result]); } diff --git a/lib/isc/tests/result_test.c b/lib/isc/tests/result_test.c index 2977905c61..57545a0fa7 100644 --- a/lib/isc/tests/result_test.c +++ b/lib/isc/tests/result_test.c @@ -52,42 +52,11 @@ isc_result_totext_test(void **state) { assert_string_equal("failure", str); } -/* check tables are populated */ -static void -tables(void **state) { - const char *str; - isc_result_t result; - - UNUSED(state); - - for (result = 0; result < ISC_R_NRESULTS; result++) { - str = isc_result_toid(result); - assert_non_null(str); - assert_string_not_equal(str, "(result code text not " - "available)"); - - str = isc_result_totext(result); - assert_non_null(str); - assert_string_not_equal(str, "(result code text not " - "available)"); - fprintf(stderr, "%u < %u\n", result, (unsigned)ISC_R_NRESULTS); - } - - str = isc_result_toid(result); - assert_non_null(str); - assert_string_equal(str, "(result code text not available)"); - - str = isc_result_totext(result); - assert_non_null(str); - assert_string_equal(str, "(result code text not available)"); -} - int main(void) { const struct CMUnitTest tests[] = { cmocka_unit_test(isc_result_toid_test), cmocka_unit_test(isc_result_totext_test), - cmocka_unit_test(tables), }; return (cmocka_run_group_tests(tests, NULL, NULL)); diff --git a/lib/isccc/Makefile.am b/lib/isccc/Makefile.am index d5cc537ead..10a0ec1c98 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 @@ -37,7 +35,3 @@ libisccc_la_LIBADD = \ libisccc_la_LDFLAGS = \ $(AM_LDFLAGS) \ -release "$(PACKAGE_VERSION)" - -if HAVE_CMOCKA -SUBDIRS = tests -endif diff --git a/lib/isccc/alist.c b/lib/isccc/alist.c index e179b41e34..819bb1a35d 100644 --- a/lib/isccc/alist.c +++ b/lib/isccc/alist.c @@ -31,9 +31,9 @@ #include #include +#include #include -#include #include #include diff --git a/lib/isccc/base64.c b/lib/isccc/base64.c index 3633526d3b..07a912954f 100644 --- a/lib/isccc/base64.c +++ b/lib/isccc/base64.c @@ -31,7 +31,6 @@ #include #include -#include #include isc_result_t diff --git a/lib/isccc/cc.c b/lib/isccc/cc.c index 581682cfc9..33bf705aa2 100644 --- a/lib/isccc/cc.c +++ b/lib/isccc/cc.c @@ -35,12 +35,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/lib/isccc/include/isccc/result.h b/lib/isccc/include/isccc/result.h deleted file mode 100644 index 5346babefc..0000000000 --- a/lib/isccc/include/isccc/result.h +++ /dev/null @@ -1,65 +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. - */ - -#ifndef ISCCC_RESULT_H -#define ISCCC_RESULT_H 1 - -/*! \file isccc/result.h */ - -#include -#include -#include - -#include - -/*% Unknown Version */ -#define ISCCC_R_UNKNOWNVERSION (ISC_RESULTCLASS_ISCCC + 0) -/*% Syntax Error */ -#define ISCCC_R_SYNTAX (ISC_RESULTCLASS_ISCCC + 1) -/*% Bad Authorization */ -#define ISCCC_R_BADAUTH (ISC_RESULTCLASS_ISCCC + 2) -/*% Expired */ -#define ISCCC_R_EXPIRED (ISC_RESULTCLASS_ISCCC + 3) -/*% Clock Skew */ -#define ISCCC_R_CLOCKSKEW (ISC_RESULTCLASS_ISCCC + 4) -/*% Duplicate */ -#define ISCCC_R_DUPLICATE (ISC_RESULTCLASS_ISCCC + 5) - -#define ISCCC_R_NRESULTS 6 /*%< Number of results */ - -ISC_LANG_BEGINDECLS - -const char * -isccc_result_totext(isc_result_t result); -/*% - * Convert a isccc_result_t into a string message describing the result. - */ - -void -isccc_result_register(void); - -ISC_LANG_ENDDECLS - -#endif /* ISCCC_RESULT_H */ diff --git a/lib/isccc/result.c b/lib/isccc/result.c deleted file mode 100644 index 9285435209..0000000000 --- a/lib/isccc/result.c +++ /dev/null @@ -1,85 +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 -#include - -#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", -}; - -#define ISCCC_RESULT_RESULTSET 2 - -static isc_once_t once = ISC_ONCE_INIT; - -static void -initialize_action(void) { - isc_result_t result; - - result = isc_result_register(ISC_RESULTCLASS_ISCCC, ISCCC_R_NRESULTS, - text, ISCCC_RESULT_RESULTSET); - if (result != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_result_register() failed: %u", result); - } - - result = isc_result_registerids(ISC_RESULTCLASS_ISCCC, ISCCC_R_NRESULTS, - ids, ISCCC_RESULT_RESULTSET); - if (result != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, - "isc_result_registerids() failed: %u", result); - } -} - -static void -initialize(void) { - RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS); -} - -const char * -isccc_result_totext(isc_result_t result) { - initialize(); - - return (isc_result_totext(result)); -} - -void -isccc_result_register(void) { - initialize(); -} diff --git a/lib/isccc/symtab.c b/lib/isccc/symtab.c index e305748add..eabbe580cb 100644 --- a/lib/isccc/symtab.c +++ b/lib/isccc/symtab.c @@ -31,9 +31,9 @@ #include #include +#include #include -#include #include #include diff --git a/lib/isccc/tests/Makefile.am b/lib/isccc/tests/Makefile.am deleted file mode 100644 index 7cab5b72af..0000000000 --- a/lib/isccc/tests/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -include $(top_srcdir)/Makefile.top - -AM_CPPFLAGS += \ - $(LIBISC_CFLAGS) \ - $(LIBISCCC_CFLAGS) - -LDADD += \ - $(LIBISC_LIBS) \ - $(LIBISCCC_LIBS) - -check_PROGRAMS = \ - result_test - -include $(top_srcdir)/Makefile.tests diff --git a/lib/isccc/tests/result_test.c b/lib/isccc/tests/result_test.c deleted file mode 100644 index 341088a04b..0000000000 --- a/lib/isccc/tests/result_test.c +++ /dev/null @@ -1,82 +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. - */ - -#if HAVE_CMOCKA - -#include -#include -#include -#include -#include - -#define UNIT_TESTING -#include - -#include -#include - -#include - -/* - * Check tables are populated. - */ -static void -tables(void **state) { - const char *str; - isc_result_t result; - - UNUSED(state); - - isccc_result_register(); - - for (result = ISC_RESULTCLASS_ISCCC; - result < (ISC_RESULTCLASS_ISCCC + ISCCC_R_NRESULTS); result++) - { - str = isc_result_toid(result); - assert_non_null(str); - assert_string_not_equal(str, "(result code text not " - "available)"); - - str = isc_result_totext(result); - assert_non_null(str); - assert_string_not_equal(str, "(result code text not " - "available)"); - } - - str = isc_result_toid(result); - assert_non_null(str); - assert_string_equal(str, "(result code text not available)"); - - str = isc_result_totext(result); - assert_non_null(str); - assert_string_equal(str, "(result code text not available)"); -} - -int -main(void) { - const struct CMUnitTest tests[] = { - cmocka_unit_test(tables), - }; - - return (cmocka_run_group_tests(tests, NULL, NULL)); -} - -#else /* HAVE_CMOCKA */ - -#include - -int -main(void) { - printf("1..0 # Skipped: cmocka not available\n"); - return (SKIPPED_TEST_EXIT_CODE); -} - -#endif /* if HAVE_CMOCKA */ diff --git a/lib/isccfg/kaspconf.c b/lib/isccfg/kaspconf.c index 8a119fb612..95df080f31 100644 --- a/lib/isccfg/kaspconf.c +++ b/lib/isccfg/kaspconf.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -23,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c index 7bff17d184..ecf346a054 100644 --- a/lib/isccfg/namedconf.c +++ b/lib/isccfg/namedconf.c @@ -23,7 +23,6 @@ #include #include -#include #include #include diff --git a/lib/ns/client.c b/lib/ns/client.c index f06f9bda79..5bcb43df08 100644 --- a/lib/ns/client.c +++ b/lib/ns/client.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/ns/include/ns/interfacemgr.h b/lib/ns/include/ns/interfacemgr.h index ae552a9656..05fcfb30b1 100644 --- a/lib/ns/include/ns/interfacemgr.h +++ b/lib/ns/include/ns/interfacemgr.h @@ -45,9 +45,9 @@ #include #include #include +#include #include -#include #include #include diff --git a/lib/ns/include/ns/update.h b/lib/ns/include/ns/update.h index 6eeeaec9dd..a01567c0b4 100644 --- a/lib/ns/include/ns/update.h +++ b/lib/ns/include/ns/update.h @@ -25,7 +25,8 @@ *** Imports ***/ -#include +#include + #include /*** diff --git a/lib/ns/notify.c b/lib/ns/notify.c index 4360588a08..99550553dd 100644 --- a/lib/ns/notify.c +++ b/lib/ns/notify.c @@ -11,6 +11,7 @@ #include #include +#include #include #include diff --git a/lib/ns/query.c b/lib/ns/query.c index 4002433ebf..80395d1a77 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/ns/sortlist.c b/lib/ns/sortlist.c index 19eca7ad79..5647c8e6d9 100644 --- a/lib/ns/sortlist.c +++ b/lib/ns/sortlist.c @@ -12,11 +12,11 @@ /*! \file */ #include +#include #include #include #include -#include #include #include diff --git a/lib/ns/tests/nstest.c b/lib/ns/tests/nstest.c index abfabf853b..a1bbba73f4 100644 --- a/lib/ns/tests/nstest.c +++ b/lib/ns/tests/nstest.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -42,7 +43,6 @@ #include #include #include -#include #include #include @@ -324,8 +324,6 @@ ns_test_begin(FILE *logfile, bool start_managers) { CHECK(isc_log_usechannel(logconfig, "stderr", NULL, NULL)); } - dns_result_register(); - if (start_managers) { CHECK(create_managers()); } diff --git a/lib/ns/tests/nstest.h b/lib/ns/tests/nstest.h index 1721d79d27..a780945ec1 100644 --- a/lib/ns/tests/nstest.h +++ b/lib/ns/tests/nstest.h @@ -18,12 +18,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/lib/ns/update.c b/lib/ns/update.c index 5c7476b1a0..2594fdbe83 100644 --- a/lib/ns/update.c +++ b/lib/ns/update.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -117,6 +118,8 @@ case DNS_R_YXRRSET: \ case DNS_R_NXRRSET: \ _what = "unsuccessful"; \ + default: \ + break; \ } \ update_log(client, zone, LOGLEVEL_PROTOCOL, \ "update %s: %s (%s)", _what, msg, \ @@ -140,6 +143,8 @@ case DNS_R_YXRRSET: \ case DNS_R_NXRRSET: \ _what = "unsuccessful"; \ + default: \ + break; \ } \ if (isc_log_wouldlog(ns_lctx, LOGLEVEL_PROTOCOL)) { \ char _nbuf[DNS_NAME_FORMATSIZE]; \ @@ -167,6 +172,8 @@ case DNS_R_YXRRSET: \ case DNS_R_NXRRSET: \ _what = "unsuccessful"; \ + default: \ + break; \ } \ if (isc_log_wouldlog(ns_lctx, LOGLEVEL_PROTOCOL)) { \ char _nbuf[DNS_NAME_FORMATSIZE]; \ @@ -1805,13 +1812,13 @@ check_mx(ns_client_t *client, dns_zone_t *zone, dns_db_t *db, if (isaddress && (options & DNS_ZONEOPT_CHECKMXFAIL) != 0) { update_log(client, zone, ISC_LOG_ERROR, "%s/MX: '%s': %s", ownerbuf, namebuf, - dns_result_totext(DNS_R_MXISADDRESS)); + isc_result_totext(DNS_R_MXISADDRESS)); ok = false; } else if (isaddress) { update_log(client, zone, ISC_LOG_WARNING, "%s/MX: warning: '%s': %s", ownerbuf, namebuf, - dns_result_totext(DNS_R_MXISADDRESS)); + isc_result_totext(DNS_R_MXISADDRESS)); } /* @@ -2701,7 +2708,7 @@ update_action(isc_task_t *task, isc_event_t *event) { UNEXPECTED_ERROR(__FILE__, __LINE__, "temp entry creation failed: " "%s", - dns_result_totext(result)); + isc_result_totext(result)); FAIL(ISC_R_UNEXPECTED); } } else { @@ -3073,7 +3080,7 @@ update_action(isc_task_t *task, isc_event_t *event) { snprintf(rdstr, sizeof(rdstr), "[dns_" "rdata_totext failed: %s]", - dns_result_totext(result)); + isc_result_totext(result)); len = strlen(rdstr); } else { len = (int)isc_buffer_usedlength(&buf); @@ -3421,7 +3428,7 @@ update_action(isc_task_t *task, isc_event_t *event) { if (result != ISC_R_SUCCESS) { update_log(client, zone, ISC_LOG_ERROR, "dns_zone_signwithkey failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); } } @@ -3456,7 +3463,7 @@ update_action(isc_task_t *task, isc_event_t *event) { if (result != ISC_R_SUCCESS) { update_log(client, zone, ISC_LOG_ERROR, "dns_zone_addnsec3chain failed: %s", - dns_result_totext(result)); + isc_result_totext(result)); } } } else { diff --git a/lib/ns/xfrout.c b/lib/ns/xfrout.c index 9a9e44f1cf..952cd83a69 100644 --- a/lib/ns/xfrout.c +++ b/lib/ns/xfrout.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -29,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/util/check-includes.pl b/util/check-includes.pl index 2154d2f4e0..fe9d092654 100644 --- a/util/check-includes.pl +++ b/util/check-includes.pl @@ -89,12 +89,6 @@ for (<>) { unless $file =~ m%isc/eventclass.h%; } - if (/$nocomment.*ISC_RESULTCLASS_/m && - ! m%^#include %m) { - print "$file has ISC_RESULTCLASS_ without \n" - unless $file =~ m%isc/resultclass.h%; - } - if ($file !~ m%isc/magic\.h$%) { print "$file has ISC_MAGIC_VALID without \n" if /$nocomment.*ISC_MAGIC_VALID/m && ! m%^#include %m; diff --git a/util/copyrights b/util/copyrights index 60f11ebd65..68eb1b2d7b 100644 --- a/util/copyrights +++ b/util/copyrights @@ -1142,7 +1142,6 @@ ./lib/dns/dst_openssl.h C 2002,2004,2005,2007,2008,2009,2011,2012,2015,2016,2018,2019,2020,2021 ./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_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 @@ -1249,7 +1248,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 @@ -1498,7 +1496,6 @@ ./lib/dns/tests/rdataset_test.c C 2012,2016,2018,2019,2020,2021 ./lib/dns/tests/rdatasetstats_test.c C 2012,2015,2016,2018,2019,2020,2021 ./lib/dns/tests/resolver_test.c C 2018,2019,2020,2021 -./lib/dns/tests/result_test.c C 2018,2019,2020,2021 ./lib/dns/tests/rsa_test.c C 2016,2018,2019,2020,2021 ./lib/dns/tests/sigs_test.c C 2018,2019,2020,2021 ./lib/dns/tests/testdata/dbiterator/zone2.data X 2011,2018,2019 @@ -1688,7 +1685,6 @@ ./lib/isc/include/isc/region.h C 1998,1999,2000,2001,2002,2004,2005,2006,2007,2013,2016,2018,2019,2020,2021 ./lib/isc/include/isc/resource.h C 2000,2001,2004,2005,2006,2007,2008,2016,2018,2019,2020,2021 ./lib/isc/include/isc/result.h C 1998,1999,2000,2001,2003,2004,2005,2006,2007,2008,2009,2012,2014,2015,2016,2017,2018,2019,2020,2021 -./lib/isc/include/isc/resultclass.h C 1999,2000,2001,2004,2005,2006,2007,2009,2014,2016,2018,2019,2020,2021 ./lib/isc/include/isc/rwlock.h C 1998,1999,2000,2001,2003,2004,2005,2006,2007,2016,2017,2018,2019,2020,2021 ./lib/isc/include/isc/safe.h C 2013,2015,2016,2017,2018,2019,2020,2021 ./lib/isc/include/isc/serial.h C 1999,2000,2001,2004,2005,2006,2007,2009,2016,2018,2019,2020,2021 @@ -1832,16 +1828,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/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 ./lib/isccfg/aclconf.c C 1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 ./lib/isccfg/dnsconf.c C 2009,2016,2018,2019,2020,2021 ./lib/isccfg/include/isccfg/aclconf.h C 1999,2000,2001,2004,2005,2006,2007,2010,2011,2012,2013,2014,2016,2018,2019,2020,2021