Compare commits

...
Author SHA1 Message Date
Diego Fronza 275d774a0d Add CHANGES entry 2021-03-31 14:45:47 +00:00
Evan HuntandDiego dos Santos Fronza 5242f358cc Update developer documentation
Also incidentally corrected an error in the doc, isc_result_t
had been written as dns_result_t in several places.
2021-03-31 14:45:47 +00:00
Diego Fronza dc300d3e48 Convert isc_result_t to an enum type
This commit updates isc_result_t to be an enum type, thus allowing
debugging sessions to promptly identify the string used to define the
error number, e.g. ISC_R_NOMEMORY, instead of a number like 37.

It does so by having error codes defined in template files located in
lib/<libname>/result_<lib>.h.in, those files are combined during the
build stage to generate the enum type, stored in
lib/isc/include/isc/result_ext.h source file.
2021-03-31 14:45:47 +00:00
Diego Fronza c2ff51150f Use correct result code on dns_rrl
The dns_rrl function's return type, dns_rrl_result_t, is an enumerated
type defined in file lib/dns/include/dns/rrl.h, before the result code
API update, the previous returning of ISC_R_SUCCESS within this function
was compatible with DNS_RRL_RESULT_OK, both had the same value of zero.

After the refactor of the result code API, this is no more true, these
result codes hold different values, besides, the correct result code to
use within this function is DNS_RRL_RESULT_OK and not ISC_R_SUCCESS.
2021-03-31 14:45:47 +00:00
Diego Fronza f4b387cb8e Update tests to use the new result codes API
This commit adjusts unity and system tests to use the new result code
interface.
2021-03-31 14:45:47 +00:00
Diego Fronza bfb38c16ec Result code API changes
- Result code descriptions and IDs (strings) are now defined in
	lib/isc/result_<class>.c.in source files. See lib/isc/result_*.c.in
	for examples.

- To create a new result class, check isc/resultclass.h and follow
	documentation in there.

- Error codes are now defined in the following fashion:

	ISC_RESULTCODE_<CLASS>(number), old style was
	ISC_RESULTCLASS_<CLASS> + number.

	Following is an example of the old style converted to the new one,
	file lib/dns/result_dst.h.in:

;; Old style
	#define DST_R_NOCRYPTO       (ISC_RESULTCLASS_DST + 2)

;; New Style
	#define DST_R_NOCRYPTO        ISC_RESULTCODE_DST(2)

- To use error codes, same as before:
	isc_result_t code = DST_R_NOCRYPTO;

	isr_result_t rc = some_call(..)
	if (rc == ISC_R_SUCCESS) ...

- isc_result_totext() does not lock anymore, since all result data from
	all classes are available at compile time.

All relevant source files were updated to use the new result API
interface.
2021-03-31 14:45:47 +00:00
Diego Fronza 9f922f77ea pull in result values from other libraries at compile time
This commit automatically generates two files during compile time,
which will be used by the new result API implementation.

lib/isc/result_ext.c: result of combining lib/*/result_*.c.in files.

lib/isc/include/isc/result_ext.h: result of combining
lib/*/result_*.h.in files.

result_ext.c will be included by lib/isc/result.c to have all relevant
symbols available during compile time, this substitutes the old method
of having each library calling <libname>_result_register() functions.

result_ext.h will be included by lib/isc/include/isc/result.h, so source
files can now include only <isc/result.h> to have all the ISC result
codes available.
2021-03-31 14:45:47 +00:00
Diego Fronza a88bb45b0a Adjust file structure for the new result API implementation
With the new result API, source files only need to include
<isc/result.h> to have isc_result_(totext|toid) functions available and
able to handle different library results, isc, isccc, dst and so on...

To allow for that, a new structure for defining result codes per library
was employed, it is implemented as follow:

- Suppose a new library called "foo" is being added to BIND.

- Two source files must be added to <BIND_ROOT>/lib/foo/:

	result_foo.h.in: The header file defines result codes that may be
		returned by functions within the library.

	result_foo.c.in: The source file define two string arrays, used for
		conversion between library result codes and their string
		representation, the array <libname>_result_descriptions define a
		comphreensive description of a given result code, while
		<libname>_result_ids is a 1:1 result code to string.

On top of this structure, during the build phase all
lib/*/result_<libname>.c.in files will be concatenated to a file named
lib/isc/result_ext.c, which will be included by lib/isc/result.c, so
all the symbols will be available during compile time, thus making the
use of locking to manage the table of result codes not necessary
anymore.

In the same fashion, during the build phase all
lib/*/result_<libname>.h.in files will be concatenated to a file named
lib/isc/include/isc/result_ext.h, which will be included by
lib/isc/include/isc/result.h, thus exporting all error codes of all
libraries in a unified way.

The code for automatically generating such files will be added in the
subsequent commit.

Note: result codes from lib/dns/include/dns/result.h were moved to a new
file: lib/dns/result_dns.h.in, the dns/result.h file was kept since it
defines an extra function 'dns_result_torcode' that is implemented in
lib/dns/result.c, similary, string tables with dns result codes were
moved from lib/dns/result.c to lib/dns/result_dns.c.in to follow the new
result code API structure.
2021-03-31 14:45:47 +00:00
Diego Fronza 75c39475cf Removal of library result registering code
The new result API won't require each library to register their result
codes, as result we can remove this code now.
2021-03-31 14:45:47 +00:00
Diego Fronza 22459f25a3 Removed all #include <(dst|isccc)/result.h> references
Use semantic patch from the previous commit, which also describes in
details why these includes are being removed.

The wrapping directives around #include <pk11/result.h> were manually
removed: #if USE_PKCS11 / #endif
2021-03-31 14:45:47 +00:00
Diego Fronza 70f5323818 Added semantic patch to remove (dst|isccc|pk11)/result.h includes
The internal implementation of isc_result API is being updated, before
the update each internal library had to register their error results
using a respective <lib>_result_register() call during runtime, these
operations required locking to manage an internal data structure.

In the same fashion, locking was required when calling
isc_result_totext and isc_result_toid functions.

To avoid locking, the table of error codes will now be statically
created during compile time, also the result API is now unified and
can be accessed through isc/result.h only header, with dns/result.h
being an exception, it should still be included separately as
dns_result_torcode() function depends on a type defined in the dns
library.
2021-03-31 14:45:47 +00:00
Diego Fronza 5b94d5b805 Removed all *_result_register() calls:
- dns_result_register()
- dst_result_register()
- isccc_result_register()
- pk11_result_register()

Use the semantic patch from the previous commit to remove all function
calls listed above.

This commit also removes the above listed functions from
lib/*/win32/lib*.def.in files.

It also manually removes the preprocessor directives surrounding
pk11_result_register():
- #if USE_PKCS11
	pk11_result_register();
- #endif /* if USE_PKCS11 */
2021-03-31 14:45:47 +00:00
Diego Fronza c933410231 Add semantic patch to remove <lib>_result_register calls
Added a semantic patch to remove the following calls:

- dns_result_register()
- dst_result_register()
- isccc_result_register()
- pk11_result_register()

Code in this branch will change error/result codes API to make them
static (defined at compile/link time), thus it won't be necessary to
dynamically register them with <class>_result_register() calls anymore.
2021-03-31 14:45:47 +00:00
107 changed files with 1141 additions and 1613 deletions
+3
View File
@@ -1,3 +1,6 @@
5609. [cleanup] Refactor the result-code API to be statically linked,
removing the need for locking. [GL #719]
5608. [bug] Dig now honors +retry=0 and +tries=1 when queries
are sent over TCP (+tcp) and the remote server closes
the connection prematurely. [GL #2490]
-2
View File
@@ -720,8 +720,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) {
-2
View File
@@ -529,8 +529,6 @@ main(int argc, char **argv) {
ISC_R_SUCCESS);
}
dns_result_register();
origin = argv[isc_commandline_index++];
if (isc_commandline_index == argc) {
-9
View File
@@ -34,10 +34,6 @@
#include <isc/time.h>
#include <isc/util.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include <dns/keyvalues.h>
#include <dns/name.h>
#include <dns/result.h>
@@ -101,11 +97,6 @@ main(int argc, char **argv) {
int len = 0;
int ch;
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
result = isc_file_progname(*argv, program, sizeof(program));
if (result != ISC_R_SUCCESS) {
memmove(program, "tsig-keygen", 11);
-1
View File
@@ -67,7 +67,6 @@
#include <dns/view.h>
#include <dst/dst.h>
#include <dst/result.h>
#include <isccfg/log.h>
#include <isccfg/namedconf.h>
-10
View File
@@ -76,7 +76,6 @@
#include <dns/tsig.h>
#include <dst/dst.h>
#include <dst/result.h>
#include <isccfg/namedconf.h>
@@ -86,10 +85,6 @@
#include "dighost.h"
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
dig_lookuplist_t lookup_list;
dig_serverlist_t server_list;
dig_searchlistlist_t search_list;
@@ -1329,11 +1324,6 @@ setup_libs(void) {
debug("setup_libs()");
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
result = isc_net_probeipv4();
if (result == ISC_R_SUCCESS) {
have_ipv4 = true;
-9
View File
@@ -54,10 +54,6 @@
#include <dst/dst.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include "dnssectool.h"
const char *program = "dnssec-cds";
@@ -1065,11 +1061,6 @@ main(int argc, char *argv[]) {
isc_mem_create(&mctx);
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
isc_commandline_errprint = false;
#define OPTIONS "a:c:Dd:f:i:ms:T:uv:V"
-9
View File
@@ -42,10 +42,6 @@
#include <dst/dst.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include "dnssectool.h"
const char *program = "dnssec-dsfromkey";
@@ -376,11 +372,6 @@ main(int argc, char **argv) {
isc_mem_create(&mctx);
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
isc_commandline_errprint = false;
#define OPTIONS "12Aa:Cc:d:Ff:K:l:sT:v:hV"
-9
View File
@@ -41,10 +41,6 @@
#include <dst/dst.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include "dnssectool.h"
const char *program = "dnssec-importkey";
@@ -316,11 +312,6 @@ main(int argc, char **argv) {
isc_mem_create(&mctx);
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
isc_commandline_errprint = false;
#define CMDLINE_FLAGS "D:f:hK:L:P:v:V"
-9
View File
@@ -38,10 +38,6 @@
#include <dst/dst.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include "dnssectool.h"
#define MAX_RSA 4096 /* should be long enough... */
@@ -170,11 +166,6 @@ main(int argc, char **argv) {
isc_mem_create(&mctx);
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
isc_commandline_errprint = false;
isc_stdtime_get(&now);
-9
View File
@@ -59,10 +59,6 @@
#include <isccfg/kaspconf.h>
#include <isccfg/namedconf.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include "dnssectool.h"
#define MAX_RSA 4096 /* should be long enough... */
@@ -881,11 +877,6 @@ main(int argc, char **argv) {
usage();
}
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
isc_commandline_errprint = false;
/*
-9
View File
@@ -31,10 +31,6 @@
#include <dst/dst.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include "dnssectool.h"
const char *program = "dnssec-revoke";
@@ -94,11 +90,6 @@ main(int argc, char **argv) {
isc_mem_create(&mctx);
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv, "E:fK:rRhv:V")) != -1) {
-9
View File
@@ -35,10 +35,6 @@
#include <dst/dst.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include "dnssectool.h"
const char *program = "dnssec-settime";
@@ -262,11 +258,6 @@ main(int argc, char **argv) {
setup_logging(mctx, &log);
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
isc_commandline_errprint = false;
isc_stdtime_get(&now);
+4 -12
View File
@@ -82,10 +82,6 @@
#include <dst/dst.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include "dnssectool.h"
const char *program = "dnssec-signzone";
@@ -455,10 +451,11 @@ expecttofindkey(dns_name_t *name) {
case DNS_R_CNAME:
case DNS_R_DNAME:
return (false);
default:
dns_name_format(name, namestr, sizeof(namestr));
fatal("failure looking for '%s DNSKEY' in database: %s",
namestr, isc_result_totext(result));
}
dns_name_format(name, namestr, sizeof(namestr));
fatal("failure looking for '%s DNSKEY' in database: %s", namestr,
isc_result_totext(result));
/* NOTREACHED */
return (false); /* removes a warning */
}
@@ -3354,11 +3351,6 @@ main(int argc, char *argv[]) {
isc_mem_create(&mctx);
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
-9
View File
@@ -61,10 +61,6 @@
#include <dst/dst.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include "dnssectool.h"
const char *program = "dnssec-verify";
@@ -225,11 +221,6 @@ main(int argc, char *argv[]) {
isc_mem_create(&mctx);
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
-1
View File
@@ -25,7 +25,6 @@
#include <isccc/alist.h>
#include <isccc/cc.h>
#include <isccc/result.h>
#include <named/control.h>
#include <named/globals.h>
-1
View File
@@ -38,7 +38,6 @@
#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/util.h>
-14
View File
@@ -49,13 +49,6 @@
#include <dns/result.h>
#include <dns/view.h>
#include <dst/result.h>
#include <isccc/result.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include <dlz/dlz_dlopen_driver.h>
#ifdef HAVE_GPERFTOOLS_PROFILER
@@ -1517,13 +1510,6 @@ main(int argc, char *argv[]) {
named_os_init(program_name);
dns_result_register();
dst_result_register();
isccc_result_register();
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
parse_command_line(argc, argv);
#ifdef ENABLE_AFL
+2 -1
View File
@@ -102,7 +102,6 @@
#include <dns/zt.h>
#include <dst/dst.h>
#include <dst/result.h>
#include <isccfg/grammar.h>
#include <isccfg/kaspconf.h>
@@ -12800,6 +12799,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:
msg = "Unexpected error.\n";
}
}
}
-2
View File
@@ -808,8 +808,6 @@ setup_system(void) {
ddebug("setup_system()");
dns_result_register();
isc_log_create(gmctx, &glctx, &logconfig);
isc_log_setcontext(glctx);
dns_log_init(glctx);
-3
View File
@@ -58,7 +58,6 @@
#include <isc/types.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
#ifdef WIN32
#define sleep(x) Sleep(x)
@@ -134,8 +133,6 @@ main(int argc, char *argv[]) {
search_template[0].ulValueLen = strlen(label);
}
pk11_result_register();
/* Initialize the CRYPTOKI library */
if (lib_name != NULL) {
pk11_set_lib_name(lib_name);
-3
View File
@@ -69,7 +69,6 @@
#include <pk11/constants.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
/* Define static key template values */
static CK_BBOOL truevalue = TRUE;
@@ -393,8 +392,6 @@ main(int argc, char *argv[]) {
private_template[PRIVATE_ID].ulValueLen = idlen;
}
pk11_result_register();
/* Initialize the CRYPTOKI library */
if (lib_name != NULL) {
pk11_set_lib_name(lib_name);
-3
View File
@@ -51,7 +51,6 @@
#include <isc/types.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
int
main(int argc, char *argv[]) {
@@ -132,8 +131,6 @@ main(int argc, char *argv[]) {
search_template[0].ulValueLen = strlen(label);
}
pk11_result_register();
/* Initialize the CRYPTOKI library */
if (lib_name != NULL) {
pk11_set_lib_name(lib_name);
-3
View File
@@ -27,7 +27,6 @@
#include <isc/types.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
int
main(int argc, char *argv[]) {
@@ -66,8 +65,6 @@ main(int argc, char *argv[]) {
isc_mem_create(&mctx);
pk11_result_register();
/* Initialize the CRYPTOKI library */
if (lib_name != NULL) {
pk11_set_lib_name(lib_name);
-3
View File
@@ -43,7 +43,6 @@
#include <isccc/base64.h>
#include <isccc/cc.h>
#include <isccc/ccmsg.h>
#include <isccc/result.h>
#include <isccc/sexpr.h>
#include <isccc/types.h>
#include <isccc/util.h>
@@ -1052,8 +1051,6 @@ main(int argc, char **argv) {
parse_config(rndc_mctx, log, keyname, &pctx, &config);
isccc_result_register();
isc_buffer_allocate(rndc_mctx, &databuf, 2048);
/*
-2
View File
@@ -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);
+1 -5
View File
@@ -43,8 +43,6 @@
#include <dns/types.h>
#include <dns/view.h>
#include <dst/result.h>
#define CHECK(str, x) \
{ \
if ((x) != ISC_R_SUCCESS) { \
@@ -94,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 = ISC_RESULTCODE_DNSRCODE(response->rcode);
fprintf(stderr, "I:response rcode: %s\n",
isc_result_totext(result));
exit(-1);
@@ -251,8 +249,6 @@ main(int argc, char *argv[]) {
have_src = true;
}
dns_result_register();
isc_sockaddr_any(&bind_any);
result = ISC_R_FAILURE;
-3
View File
@@ -39,7 +39,6 @@
#include <dns/secalg.h>
#include <dst/dst.h>
#include <dst/result.h>
dst_key_t *key;
dns_fixedname_t fname;
@@ -103,8 +102,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);
+1 -5
View File
@@ -39,8 +39,6 @@
#include <dns/tsig.h>
#include <dns/view.h>
#include <dst/result.h>
#define CHECK(str, x) \
{ \
if ((x) != ISC_R_SUCCESS) { \
@@ -95,7 +93,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 = ISC_RESULTCODE_DNSRCODE(response->rcode);
fprintf(stderr, "I:response rcode: %s\n",
isc_result_totext(result));
exit(-1);
@@ -222,8 +220,6 @@ main(int argc, char *argv[]) {
ownername_str = argv[4];
}
dns_result_register();
mctx = NULL;
isc_mem_debugging = ISC_MEM_DEBUGRECORD;
isc_mem_create(&mctx);
+1 -5
View File
@@ -38,8 +38,6 @@
#include <dns/tsig.h>
#include <dns/view.h>
#include <dst/result.h>
#define CHECK(str, x) \
{ \
if ((x) != ISC_R_SUCCESS) { \
@@ -86,7 +84,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 = ISC_RESULTCODE_DNSRCODE(response->rcode);
fprintf(stderr, "I:response rcode: %s\n",
isc_result_totext(result));
exit(-1);
@@ -166,8 +164,6 @@ main(int argc, char **argv) {
port = atoi(argv[2]);
keyname = argv[3];
dns_result_register();
mctx = NULL;
isc_mem_create(&mctx);
-2
View File
@@ -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");
-4
View File
@@ -50,8 +50,6 @@
#include <dns/types.h>
#include <dns/view.h>
#include <dst/result.h>
#include <bind9/getaddresses.h>
#define CHECK(str, x) \
@@ -2096,8 +2094,6 @@ main(int argc, char *argv[]) {
RUNCHECK(isc_app_start());
dns_result_register();
if (isc_net_probeipv4() == ISC_R_SUCCESS) {
have_ipv4 = true;
}
+17
View File
@@ -0,0 +1,17 @@
@@
@@
(
- #include <dst/result.h>
|
- #include "dst/result.h"
|
- #include <isccc/result.h>
|
- #include "isccc/result.h"
|
- #include <pk11/result.h>
|
- #include "pk11/result.h"
)
+14
View File
@@ -0,0 +1,14 @@
@@
@@
(
- dns_result_register();
|
- dst_result_register();
|
- isccc_result_register();
|
- pk11_result_register();
)
+9 -6
View File
@@ -395,16 +395,12 @@ or the end of file was reached, but BIND's version uses result codes:
Only functions which cannot fail (assuming the caller has provided valid
arguments) should return data directly instead of a result code. For
example, `dns_name_issubdomain()` returns an `bool`, because it
has no failure mode.
example, `dns_name_issubdomain()` returns a `bool`, because it has no
failure mode.
A result code can be converted to a human-readable error message by
calling `isc_result_totext(result)`.
Many result codes have been defined and can be found in the source tree
in header files called `result.h` (for example, the result codes defined
for the ISC library are in `lib/isc/include/isc/result.h`.
ISC library result codes (many of which are generically useful elsewhere)
begin with `ISC_R`: examples include `ISC_R_SUCCESS`, `ISC_R_FAILURE`,
`ISC_R_NOMEMORY`, etc.
@@ -413,6 +409,13 @@ DNS library result codes begin with `DNS_R`: `DNS_R_SERVFAIL`, `DNS_R_NXRRSET`,
etc). Other sets of result codes are defined for crypto functions (`DST_R`
and `PKCS_R`).
Many result codes have been defined and can be found in the source tree
in files called `result_<module>.h.in` and `result_<module>.c.in`.
For example, the DNS library result codes are defined in
`lib/dns/result_dns.c.in` and `lib/dns/result_dns.h.in`. At compile
time, these are concatenated into the files `lib/isc/result_ext.c`
and `lib/isc/include/isc/result_ext.h`.
For portability, ISC result codes are used instead of codes provided
by the operating system; for example, `ISC_R_NOMEMORY` instead of
`ENOMEM`. In some cases, but not all, POSIX-defined error codes can be
+25 -25
View File
@@ -125,7 +125,7 @@ applied to domain names in the rdata.
The functions to convert from text format has the following call formats and
is declared as follows for class-generic functions.
static dns_result_t
static isc_result_t
fromtext_typename(dns_rdataclass_t class, dns_rdatatype_t type,
isc_lex_t *lexer, dns_name_t *origin,
bool downcase, isc_buffer_t *target);
@@ -133,7 +133,7 @@ is declared as follows for class-generic functions.
Class specific functions contain the class name in addition to the
type name.
static dns_result_t
static isc_result_t
fromtext_classname_typename(dns_rdataclass_t class,
dns_rdatatype_t type,
isc_lex_t *lexer,
@@ -167,11 +167,11 @@ security area and must be paranoid about its input.
#### Converting from internal format to text format
static dns_result_t
static isc_result_t
totext_typename(dns_rdata_t *rdata, dns_name_t *origin,
isc_buffer_t *target);
static dns_result_t
static isc_result_t
totext_classname_typename(dns_rdata_t *rdata,
dns_name_t *origin, isc_buffer_t *target);
@@ -183,7 +183,7 @@ security area and must be paranoid about its input.
#### Converting from wire format to internal format
static dns_result_t
static isc_result_t
fromwire_typename(dns_rdataclass_t class,
dns_rdatatype_t type,
isc_buffer_t *source,
@@ -191,7 +191,7 @@ security area and must be paranoid about its input.
bool downcase,
isc_buffer_t *target);
static dns_result_t
static isc_result_t
fromwire_classname_typename(dns_rdataclass_t class,
dns_rdatatype_t type,
isc_buffer_t *source,
@@ -226,12 +226,12 @@ will return `DNS_R_EXTRADATA`.
#### Converting from internal format to wire format
static dns_result_t
static isc_result_t
towire_typename(dns_rdata_t *rdata,
dns_compress_t *cctx,
isc_buffer_t *target);
static dns_result_t
static isc_result_t
towire_classname_typename(dns_rdata_t *rdata,
dns_compress_t *cctx,
isc_buffer_t *target);
@@ -258,13 +258,13 @@ transfer the contents of the `rdata` to the target buffer.
#### Converting from a structure to internal format
static dns_result_t
static isc_result_t
fromstruct_typename(dns_rdataclass_t class,
dns_rdatatype_t type,
void *source,
isc_buffer_t *target);
static dns_result_t
static isc_result_t
fromstruct_classname_typename(dns_rdataclass_t class,
dns_rdatatype_t type,
void *source,
@@ -279,10 +279,10 @@ transfer the contents of the `rdata` to the target buffer.
#### Converting from internal format to a structure
static dns_result_t
static isc_result_t
tostruct_typename(dns_rdata_t *rdata, void *target);
static dns_result_t
static isc_result_t
tostruct_classname_typename(dns_rdata_t *rdata, void *target);
|Parameter|Description |
@@ -318,7 +318,7 @@ The following static support functions are available to use.
Returns the length of `name`.
static dns_result_t
static isc_result_t
txt_totext(isc_region_t *source, isc_buffer_t *target);
Extracts the octet-length-tagged text string at the start of
@@ -328,7 +328,7 @@ text string.
Returns `DNS_R_NOSPACE` or `DNS_R_SUCCESS`.
static dns_result_t
static isc_result_t
txt_fromtext(isc_textregion_t *source, isc_buffer_t *target);
Take the text region `source` and convert it to a length-tagged
@@ -336,7 +336,7 @@ text string, writing it to `target`.
Returns `DNS_R_NOSPACE`, `DNS_R_TEXTTOLONG` or `DNS_R_SUCCESS`.
static dns_result_t
static isc_result_t
txt_fromwire(isc_buffer_t *source, isc_buffer_t *target);
Read an octet-length-tagged text string from `source` and write it to `target`.
@@ -356,7 +356,7 @@ not equal to it. If so, make `target` refer to the prefix of `name` and return
Typical use:
static dns_result_t
static isc_result_t
totext_typename(dns_rdata_t *rdata, dns_name_t *origin,
isc_buffer_t * target)
{
@@ -372,7 +372,7 @@ Typical use:
return (dns_name_totext(&prefix, sub, target));
}
static dns_result_t
static isc_result_t
str_totext(char *source, isc_buffer_t *target);
Adds the `NULL`-terminated string `source`, up to but not including `NULL`,
@@ -392,14 +392,14 @@ empty otherwise `false`.
Make `buffer` refer to the memory in `region` and make it active.
static dns_result_t
static isc_result_t
uint32_tobuffer(uint32_t value, isc_buffer_t *target);
Write the 32 bit `value` in network order to `target`.
Returns `DNS_R_NOSPACE` and `DNS_R_SUCCESS`.
static dns_result_t
static isc_result_t
uint16_tobuffer(uint32_t value, isc_buffer_t *target);
Write them 16 bit `value` in network order to `target`.
@@ -420,7 +420,7 @@ Returns the 16 bit at the start of `region` in host byte order.
Requires `(region->length >= 2)`.
static dns_result_t
static isc_result_t
gettoken(isc_lex_t *lexer, isc_token_t *token,
isc_tokentype_t expect, bool eol);
@@ -432,7 +432,7 @@ isc_tokentype_string), or isc_tokentype_eol and isc_tokentype_eof if `eol` is
Returns `DNS_R_UNEXPECTED`, `DNS_R_UNEXPECTEDEND`, `DNS_R_UNEXPECTEDTOKEN` and
`DNS_R_SUCCESS`.
static dns_result_t
static isc_result_t
mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length);
Add the memory referred to by `base` to `target`.
@@ -454,7 +454,7 @@ Returns the hexadecimal value of `value`, or -1 if not a hexadecimal character.
Returns the decimal value of `value`, or -1 if not a decimal character.
static dns_result_t
static isc_result_t
base64_totext(isc_region_t *source, isc_buffer_t *target);
Convert the region referred to by `source` to Base64 encoded text and put it
@@ -462,7 +462,7 @@ into `target`.
Returns `DNS_R_NOSPACE` or `DNS_R_SUCCESS`.
static dns_result_t
static isc_result_t
base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length);
Read a series of tokens from `lexer` that containing base64 data until one of
@@ -474,7 +474,7 @@ token, `length` octets would have been exceeded.
Returns `DNS_R_BADBASE64`, `DNS_R_UNEXPECTED`, `DNS_R_UNEXPECTEDEND`,
`DNS_R_UNEXPECTEDTOKEN` and `DNS_R_SUCCESS`.
static dns_result_t
static isc_result_t
time_totext(unsigned long value, isc_buffer_t *target);`
Convert the date represented by `value` into YYYYMMDDHHMMSS format
@@ -482,7 +482,7 @@ taking into account the active epochs. This code is Y2K and Y2038 compliant.
Returns `DNS_R_NOSPACE` and `DNS_R_SUCCESS`.
static dns_result_t
static isc_result_t
time_tobuffer(char *source, isc_buffer_t *target);
Take the date in `source` and convert it to seconds since January 1, 1970
-1
View File
@@ -55,7 +55,6 @@
#include <dns/ssu.h>
#include <dst/dst.h>
#include <dst/result.h>
#include <isccfg/aclconf.h>
#include <isccfg/cfg.h>
+5 -3
View File
@@ -26,6 +26,10 @@ EXTRA_DIST = \
gen.c \
gen-unix.h \
gen-win32.h \
result_dns.h.in \
result_dns.c.in \
result_dst.h.in \
result_dst.c.in \
rdata/*
include/dns/enumtype.h: gen Makefile
@@ -147,8 +151,7 @@ libdns_la_HEADERS = \
dstdir = $(includedir)/dst
dst_HEADERS = \
include/dst/dst.h \
include/dst/gssapi.h \
include/dst/result.h
include/dst/gssapi.h
libdns_la_SOURCES = \
$(libdns_la_HEADERS) \
@@ -177,7 +180,6 @@ libdns_la_SOURCES = \
dst_parse.c \
dst_parse.h \
dst_pkcs11.h \
dst_result.c \
dyndb.c \
ecs.c \
fixedname.c \
+2
View File
@@ -3928,6 +3928,8 @@ dbfind_name(dns_adbname_t *adbname, isc_stdtime_t now, dns_rdatatype_t rdtype) {
adbname->fetch6_err = FIND_ERR_SUCCESS;
}
break;
default:
(void)0; /* Suppress -Werror=switch. */
}
if (dns_rdataset_isassociated(&rdataset)) {
-2
View File
@@ -41,8 +41,6 @@
#include <dns/stats.h>
#include <dns/tsig.h> /* for DNS_TSIG_FUDGE */
#include <dst/result.h>
LIBDNS_EXTERNAL_DATA isc_stats_t *dns_dnssec_stats;
#define is_response(msg) ((msg->flags & DNS_MESSAGEFLAG_QR) != 0)
-4
View File
@@ -58,8 +58,6 @@
#include <dns/ttl.h>
#include <dns/types.h>
#include <dst/result.h>
#include "dst_internal.h"
#define DST_AS_STR(t) ((t).value.as_textregion.base)
@@ -192,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]));
-1
View File
@@ -43,7 +43,6 @@
#include <dns/log.h>
#include <dns/time.h>
#include "dst/result.h"
#include "dst_internal.h"
#define DST_AS_STR(t) ((t).value.as_textregion.base)
-108
View File
@@ -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 <isc/once.h>
#include <isc/util.h>
#include <dst/result.h>
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 */
-1
View File
@@ -33,7 +33,6 @@
#include <isc/util.h>
#include <dst/gssapi.h>
#include <dst/result.h>
#include "dst_internal.h"
#include "dst_parse.h"
-1
View File
@@ -57,7 +57,6 @@
#include <dns/types.h>
#include <dst/gssapi.h>
#include <dst/result.h>
#include "dst_internal.h"
-2
View File
@@ -40,8 +40,6 @@
#include <pk11/site.h>
#include <dst/result.h>
#include "dst_internal.h"
#ifdef HAVE_FIPS_MODE
#include "dst_openssl.h" /* FIPS_mode() prototype */
+3 -170
View File
@@ -27,180 +27,13 @@
*/
#include <isc/result.h> /* Contractual promise. */
/*
* DNS library result codes
*/
#define DNS_R_LABELTOOLONG (ISC_RESULTCLASS_DNS + 0)
#define DNS_R_BADESCAPE (ISC_RESULTCLASS_DNS + 1)
/*
* Since we dropped the support of bitstring labels, deprecate the related
* result codes too.
*
#define DNS_R_BADBITSTRING (ISC_RESULTCLASS_DNS + 2)
#define DNS_R_BITSTRINGTOOLONG (ISC_RESULTCLASS_DNS + 3)
*/
#define DNS_R_EMPTYLABEL (ISC_RESULTCLASS_DNS + 4)
#define DNS_R_BADDOTTEDQUAD (ISC_RESULTCLASS_DNS + 5)
#define DNS_R_INVALIDNS (ISC_RESULTCLASS_DNS + 6)
#define DNS_R_UNKNOWN (ISC_RESULTCLASS_DNS + 7)
#define DNS_R_BADLABELTYPE (ISC_RESULTCLASS_DNS + 8)
#define DNS_R_BADPOINTER (ISC_RESULTCLASS_DNS + 9)
#define DNS_R_TOOMANYHOPS (ISC_RESULTCLASS_DNS + 10)
#define DNS_R_DISALLOWED (ISC_RESULTCLASS_DNS + 11)
#define DNS_R_EXTRATOKEN (ISC_RESULTCLASS_DNS + 12)
#define DNS_R_EXTRADATA (ISC_RESULTCLASS_DNS + 13)
#define DNS_R_TEXTTOOLONG (ISC_RESULTCLASS_DNS + 14)
#define DNS_R_NOTZONETOP (ISC_RESULTCLASS_DNS + 15)
#define DNS_R_SYNTAX (ISC_RESULTCLASS_DNS + 16)
#define DNS_R_BADCKSUM (ISC_RESULTCLASS_DNS + 17)
#define DNS_R_BADAAAA (ISC_RESULTCLASS_DNS + 18)
#define DNS_R_NOOWNER (ISC_RESULTCLASS_DNS + 19)
#define DNS_R_NOTTL (ISC_RESULTCLASS_DNS + 20)
#define DNS_R_BADCLASS (ISC_RESULTCLASS_DNS + 21)
#define DNS_R_NAMETOOLONG (ISC_RESULTCLASS_DNS + 22)
#define DNS_R_PARTIALMATCH (ISC_RESULTCLASS_DNS + 23)
#define DNS_R_NEWORIGIN (ISC_RESULTCLASS_DNS + 24)
#define DNS_R_UNCHANGED (ISC_RESULTCLASS_DNS + 25)
#define DNS_R_BADTTL (ISC_RESULTCLASS_DNS + 26)
#define DNS_R_NOREDATA (ISC_RESULTCLASS_DNS + 27)
#define DNS_R_CONTINUE (ISC_RESULTCLASS_DNS + 28)
#define DNS_R_DELEGATION (ISC_RESULTCLASS_DNS + 29)
#define DNS_R_GLUE (ISC_RESULTCLASS_DNS + 30)
#define DNS_R_DNAME (ISC_RESULTCLASS_DNS + 31)
#define DNS_R_CNAME (ISC_RESULTCLASS_DNS + 32)
#define DNS_R_BADDB (ISC_RESULTCLASS_DNS + 33)
#define DNS_R_ZONECUT (ISC_RESULTCLASS_DNS + 34)
#define DNS_R_BADZONE (ISC_RESULTCLASS_DNS + 35)
#define DNS_R_MOREDATA (ISC_RESULTCLASS_DNS + 36)
#define DNS_R_UPTODATE (ISC_RESULTCLASS_DNS + 37)
#define DNS_R_TSIGVERIFYFAILURE (ISC_RESULTCLASS_DNS + 38)
#define DNS_R_TSIGERRORSET (ISC_RESULTCLASS_DNS + 39)
#define DNS_R_SIGINVALID (ISC_RESULTCLASS_DNS + 40)
#define DNS_R_SIGEXPIRED (ISC_RESULTCLASS_DNS + 41)
#define DNS_R_SIGFUTURE (ISC_RESULTCLASS_DNS + 42)
#define DNS_R_KEYUNAUTHORIZED (ISC_RESULTCLASS_DNS + 43)
#define DNS_R_INVALIDTIME (ISC_RESULTCLASS_DNS + 44)
#define DNS_R_EXPECTEDTSIG (ISC_RESULTCLASS_DNS + 45)
#define DNS_R_UNEXPECTEDTSIG (ISC_RESULTCLASS_DNS + 46)
#define DNS_R_INVALIDTKEY (ISC_RESULTCLASS_DNS + 47)
#define DNS_R_HINT (ISC_RESULTCLASS_DNS + 48)
#define DNS_R_DROP (ISC_RESULTCLASS_DNS + 49)
#define DNS_R_NOTLOADED (ISC_RESULTCLASS_DNS + 50)
#define DNS_R_NCACHENXDOMAIN (ISC_RESULTCLASS_DNS + 51)
#define DNS_R_NCACHENXRRSET (ISC_RESULTCLASS_DNS + 52)
#define DNS_R_WAIT (ISC_RESULTCLASS_DNS + 53)
#define DNS_R_NOTVERIFIEDYET (ISC_RESULTCLASS_DNS + 54)
#define DNS_R_NOIDENTITY (ISC_RESULTCLASS_DNS + 55)
#define DNS_R_NOJOURNAL (ISC_RESULTCLASS_DNS + 56)
#define DNS_R_ALIAS (ISC_RESULTCLASS_DNS + 57)
#define DNS_R_USETCP (ISC_RESULTCLASS_DNS + 58)
#define DNS_R_NOVALIDSIG (ISC_RESULTCLASS_DNS + 59)
#define DNS_R_NOVALIDNSEC (ISC_RESULTCLASS_DNS + 60)
#define DNS_R_NOTINSECURE (ISC_RESULTCLASS_DNS + 61)
#define DNS_R_UNKNOWNSERVICE (ISC_RESULTCLASS_DNS + 62)
#define DNS_R_RECOVERABLE (ISC_RESULTCLASS_DNS + 63)
#define DNS_R_UNKNOWNOPT (ISC_RESULTCLASS_DNS + 64)
#define DNS_R_UNEXPECTEDID (ISC_RESULTCLASS_DNS + 65)
#define DNS_R_SEENINCLUDE (ISC_RESULTCLASS_DNS + 66)
#define DNS_R_NOTEXACT (ISC_RESULTCLASS_DNS + 67)
#define DNS_R_BLACKHOLED (ISC_RESULTCLASS_DNS + 68)
#define DNS_R_BADALG (ISC_RESULTCLASS_DNS + 69)
#define DNS_R_METATYPE (ISC_RESULTCLASS_DNS + 70)
#define DNS_R_CNAMEANDOTHER (ISC_RESULTCLASS_DNS + 71)
#define DNS_R_SINGLETON (ISC_RESULTCLASS_DNS + 72)
#define DNS_R_HINTNXRRSET (ISC_RESULTCLASS_DNS + 73)
#define DNS_R_NOMASTERFILE (ISC_RESULTCLASS_DNS + 74)
#define DNS_R_UNKNOWNPROTO (ISC_RESULTCLASS_DNS + 75)
#define DNS_R_CLOCKSKEW (ISC_RESULTCLASS_DNS + 76)
#define DNS_R_BADIXFR (ISC_RESULTCLASS_DNS + 77)
#define DNS_R_NOTAUTHORITATIVE (ISC_RESULTCLASS_DNS + 78)
#define DNS_R_NOVALIDKEY (ISC_RESULTCLASS_DNS + 79)
#define DNS_R_OBSOLETE (ISC_RESULTCLASS_DNS + 80)
#define DNS_R_FROZEN (ISC_RESULTCLASS_DNS + 81)
#define DNS_R_UNKNOWNFLAG (ISC_RESULTCLASS_DNS + 82)
#define DNS_R_EXPECTEDRESPONSE (ISC_RESULTCLASS_DNS + 83)
#define DNS_R_NOVALIDDS (ISC_RESULTCLASS_DNS + 84)
#define DNS_R_NSISADDRESS (ISC_RESULTCLASS_DNS + 85)
#define DNS_R_REMOTEFORMERR (ISC_RESULTCLASS_DNS + 86)
#define DNS_R_TRUNCATEDTCP (ISC_RESULTCLASS_DNS + 87)
#define DNS_R_LAME (ISC_RESULTCLASS_DNS + 88)
#define DNS_R_UNEXPECTEDRCODE (ISC_RESULTCLASS_DNS + 89)
#define DNS_R_UNEXPECTEDOPCODE (ISC_RESULTCLASS_DNS + 90)
#define DNS_R_CHASEDSSERVERS (ISC_RESULTCLASS_DNS + 91)
#define DNS_R_EMPTYNAME (ISC_RESULTCLASS_DNS + 92)
#define DNS_R_EMPTYWILD (ISC_RESULTCLASS_DNS + 93)
#define DNS_R_BADBITMAP (ISC_RESULTCLASS_DNS + 94)
#define DNS_R_FROMWILDCARD (ISC_RESULTCLASS_DNS + 95)
#define DNS_R_BADOWNERNAME (ISC_RESULTCLASS_DNS + 96)
#define DNS_R_BADNAME (ISC_RESULTCLASS_DNS + 97)
#define DNS_R_DYNAMIC (ISC_RESULTCLASS_DNS + 98)
#define DNS_R_UNKNOWNCOMMAND (ISC_RESULTCLASS_DNS + 99)
#define DNS_R_MUSTBESECURE (ISC_RESULTCLASS_DNS + 100)
#define DNS_R_COVERINGNSEC (ISC_RESULTCLASS_DNS + 101)
#define DNS_R_MXISADDRESS (ISC_RESULTCLASS_DNS + 102)
#define DNS_R_DUPLICATE (ISC_RESULTCLASS_DNS + 103)
#define DNS_R_INVALIDNSEC3 (ISC_RESULTCLASS_DNS + 104)
#define DNS_R_NOTMASTER (ISC_RESULTCLASS_DNS + 105)
#define DNS_R_BROKENCHAIN (ISC_RESULTCLASS_DNS + 106)
#define DNS_R_EXPIRED (ISC_RESULTCLASS_DNS + 107)
#define DNS_R_NOTDYNAMIC (ISC_RESULTCLASS_DNS + 108)
#define DNS_R_BADEUI (ISC_RESULTCLASS_DNS + 109)
#define DNS_R_NTACOVERED (ISC_RESULTCLASS_DNS + 110)
#define DNS_R_BADCDS (ISC_RESULTCLASS_DNS + 111)
#define DNS_R_BADCDNSKEY (ISC_RESULTCLASS_DNS + 112)
#define DNS_R_OPTERR (ISC_RESULTCLASS_DNS + 113)
#define DNS_R_BADDNSTAP (ISC_RESULTCLASS_DNS + 114)
#define DNS_R_BADTSIG (ISC_RESULTCLASS_DNS + 115)
#define DNS_R_BADSIG0 (ISC_RESULTCLASS_DNS + 116)
#define DNS_R_TOOMANYRECORDS (ISC_RESULTCLASS_DNS + 117)
#define DNS_R_VERIFYFAILURE (ISC_RESULTCLASS_DNS + 118)
#define DNS_R_ATZONETOP (ISC_RESULTCLASS_DNS + 119)
#define DNS_R_NOKEYMATCH (ISC_RESULTCLASS_DNS + 120)
#define DNS_R_TOOMANYKEYS (ISC_RESULTCLASS_DNS + 121)
#define DNS_R_KEYNOTACTIVE (ISC_RESULTCLASS_DNS + 122)
#define DNS_R_NSEC3ITERRANGE (ISC_RESULTCLASS_DNS + 123)
#define DNS_R_NSEC3SALTRANGE (ISC_RESULTCLASS_DNS + 124)
#define DNS_R_NSEC3BADALG (ISC_RESULTCLASS_DNS + 125)
#define DNS_R_NSEC3RESALT (ISC_RESULTCLASS_DNS + 126)
#define DNS_R_NRESULTS 127 /*%< Number of results */
/*
* DNS wire format rcodes.
*
* By making these their own class we can easily convert them into the
* wire-format rcode value simply by masking off the resultclass.
*/
#define DNS_R_NOERROR (ISC_RESULTCLASS_DNSRCODE + 0)
#define DNS_R_FORMERR (ISC_RESULTCLASS_DNSRCODE + 1)
#define DNS_R_SERVFAIL (ISC_RESULTCLASS_DNSRCODE + 2)
#define DNS_R_NXDOMAIN (ISC_RESULTCLASS_DNSRCODE + 3)
#define DNS_R_NOTIMP (ISC_RESULTCLASS_DNSRCODE + 4)
#define DNS_R_REFUSED (ISC_RESULTCLASS_DNSRCODE + 5)
#define DNS_R_YXDOMAIN (ISC_RESULTCLASS_DNSRCODE + 6)
#define DNS_R_YXRRSET (ISC_RESULTCLASS_DNSRCODE + 7)
#define DNS_R_NXRRSET (ISC_RESULTCLASS_DNSRCODE + 8)
#define DNS_R_NOTAUTH (ISC_RESULTCLASS_DNSRCODE + 9)
#define DNS_R_NOTZONE (ISC_RESULTCLASS_DNSRCODE + 10)
#define DNS_R_RCODE11 (ISC_RESULTCLASS_DNSRCODE + 11)
#define DNS_R_RCODE12 (ISC_RESULTCLASS_DNSRCODE + 12)
#define DNS_R_RCODE13 (ISC_RESULTCLASS_DNSRCODE + 13)
#define DNS_R_RCODE14 (ISC_RESULTCLASS_DNSRCODE + 14)
#define DNS_R_RCODE15 (ISC_RESULTCLASS_DNSRCODE + 15)
#define DNS_R_BADVERS (ISC_RESULTCLASS_DNSRCODE + 16)
#define DNS_R_NRCODERESULTS 17 /*%< Number of rcode results */
#define DNS_RESULT_ISRCODE(result) \
(ISC_RESULTCLASS_INCLASS(ISC_RESULTCLASS_DNSRCODE, (result)))
(ISC_RESULT_INCLASS(ISC_RESULTCLASS_DNSRCODE, (result)))
#define dns_result_totext isc_result_totext
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);
-65
View File
@@ -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 <isc/lang.h>
#include <isc/resultclass.h>
/*
* Nothing in this file truly depends on <isc/result.h>, 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 <isc/result.h> /* 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 */
-1
View File
@@ -31,7 +31,6 @@
#include <dns/result.h>
#include <dst/dst.h>
#include <dst/result.h>
#define RETERR(x) \
do { \
-1
View File
@@ -51,7 +51,6 @@ initialize(void) {
isc_refcount_init(&references, 0);
isc_mem_create(&dns_g_mctx);
dns_result_register();
result = dst_lib_init(dns_g_mctx, NULL);
if (result != ISC_R_SUCCESS) {
-2
View File
@@ -34,8 +34,6 @@
#include <dns/log.h>
#include <dst/result.h>
#include "dst_internal.h"
#include "dst_openssl.h"
-2
View File
@@ -38,8 +38,6 @@
#include <pk11/site.h>
#include <dst/result.h>
#include "dst_internal.h"
#include "dst_openssl.h"
#include "dst_parse.h"
-2
View File
@@ -28,8 +28,6 @@
#include <dns/keyvalues.h>
#include <dst/result.h>
#include "dst_internal.h"
#include "dst_openssl.h"
#include "dst_parse.h"
-2
View File
@@ -31,8 +31,6 @@
#include <dns/keyvalues.h>
#include <dst/result.h>
#include "dst_internal.h"
#include "dst_openssl.h"
#include "dst_parse.h"
-2
View File
@@ -26,8 +26,6 @@
#include <pk11/site.h>
#include <dst/result.h>
#include "dst_internal.h"
#include "dst_openssl.h"
#include "dst_parse.h"
-2
View File
@@ -25,8 +25,6 @@
#include <dns/keyvalues.h>
#include <dst/result.h>
#include "dst_internal.h"
#include "dst_parse.h"
#include "dst_pkcs11.h"
-2
View File
@@ -25,8 +25,6 @@
#include <dns/keyvalues.h>
#include <dst/result.h>
#include "dst_internal.h"
#include "dst_parse.h"
#include "dst_pkcs11.h"
-2
View File
@@ -22,8 +22,6 @@
#include <pk11/internal.h>
#include <pk11/site.h>
#include <dst/result.h>
#include "dst_internal.h"
#include "dst_parse.h"
#include "dst_pkcs11.h"
+2 -380
View File
@@ -11,387 +11,9 @@
/*! \file */
#include <isc/once.h>
#include <isc/util.h>
#include <dns/lib.h>
#include <dns/rcode.h>
#include <dns/result.h>
static const char *text[DNS_R_NRESULTS] = {
"label too long", /*%< 0 DNS_R_LABELTOOLONG */
"bad escape", /*%< 1 DNS_R_BADESCAPE */
/*!
* Note that DNS_R_BADBITSTRING and DNS_R_BITSTRINGTOOLONG are
* deprecated.
*/
"bad bitstring", /*%< 2 DNS_R_BADBITSTRING */
"bitstring too long", /*%< 3 DNS_R_BITSTRINGTOOLONG */
"empty label", /*%< 4 DNS_R_EMPTYLABEL */
"bad dotted quad", /*%< 5 DNS_R_BADDOTTEDQUAD */
"invalid NS owner name (wildcard)", /*%< 6 DNS_R_INVALIDNS */
"unknown class/type", /*%< 7 DNS_R_UNKNOWN */
"bad label type", /*%< 8 DNS_R_BADLABELTYPE */
"bad compression pointer", /*%< 9 DNS_R_BADPOINTER */
"too many hops", /*%< 10 DNS_R_TOOMANYHOPS */
"disallowed (by application policy)", /*%< 11 DNS_R_DISALLOWED */
"extra input text", /*%< 12 DNS_R_EXTRATOKEN */
"extra input data", /*%< 13 DNS_R_EXTRADATA */
"text too long", /*%< 14 DNS_R_TEXTTOOLONG */
"not at top of zone", /*%< 15 DNS_R_NOTZONETOP */
"syntax error", /*%< 16 DNS_R_SYNTAX */
"bad checksum", /*%< 17 DNS_R_BADCKSUM */
"bad IPv6 address", /*%< 18 DNS_R_BADAAAA */
"no owner", /*%< 19 DNS_R_NOOWNER */
"no ttl", /*%< 20 DNS_R_NOTTL */
"bad class", /*%< 21 DNS_R_BADCLASS */
"name too long", /*%< 22 DNS_R_NAMETOOLONG */
"partial match", /*%< 23 DNS_R_PARTIALMATCH */
"new origin", /*%< 24 DNS_R_NEWORIGIN */
"unchanged", /*%< 25 DNS_R_UNCHANGED */
"bad ttl", /*%< 26 DNS_R_BADTTL */
"more data needed/to be rendered", /*%< 27 DNS_R_NOREDATA */
"continue", /*%< 28 DNS_R_CONTINUE */
"delegation", /*%< 29 DNS_R_DELEGATION */
"glue", /*%< 30 DNS_R_GLUE */
"dname", /*%< 31 DNS_R_DNAME */
"cname", /*%< 32 DNS_R_CNAME */
"bad database", /*%< 33 DNS_R_BADDB */
"zonecut", /*%< 34 DNS_R_ZONECUT */
"bad zone", /*%< 35 DNS_R_BADZONE */
"more data", /*%< 36 DNS_R_MOREDATA */
"up to date", /*%< 37 DNS_R_UPTODATE */
"tsig verify failure", /*%< 38 DNS_R_TSIGVERIFYFAILURE */
"tsig indicates error", /*%< 39 DNS_R_TSIGERRORSET */
"RRSIG failed to verify", /*%< 40 DNS_R_SIGINVALID */
"RRSIG has expired", /*%< 41 DNS_R_SIGEXPIRED */
"RRSIG validity period has not begun", /*%< 42 DNS_R_SIGFUTURE */
"key is unauthorized to sign data", /*%< 43 DNS_R_KEYUNAUTHORIZED */
"invalid time", /*%< 44 DNS_R_INVALIDTIME */
"expected a TSIG or SIG(0)", /*%< 45 DNS_R_EXPECTEDTSIG */
"did not expect a TSIG or SIG(0)", /*%< 46 DNS_R_UNEXPECTEDTSIG */
"TKEY is unacceptable", /*%< 47 DNS_R_INVALIDTKEY */
"hint", /*%< 48 DNS_R_HINT */
"drop", /*%< 49 DNS_R_DROP */
"zone not loaded", /*%< 50 DNS_R_NOTLOADED */
"ncache nxdomain", /*%< 51 DNS_R_NCACHENXDOMAIN */
"ncache nxrrset", /*%< 52 DNS_R_NCACHENXRRSET */
"wait", /*%< 53 DNS_R_WAIT */
"not verified yet", /*%< 54 DNS_R_NOTVERIFIEDYET */
"no identity", /*%< 55 DNS_R_NOIDENTITY */
"no journal", /*%< 56 DNS_R_NOJOURNAL */
"alias", /*%< 57 DNS_R_ALIAS */
"use TCP", /*%< 58 DNS_R_USETCP */
"no valid RRSIG", /*%< 59 DNS_R_NOVALIDSIG */
"no valid NSEC", /*%< 60 DNS_R_NOVALIDNSEC */
"insecurity proof failed", /*%< 61 DNS_R_NOTINSECURE */
"unknown service", /*%< 62 DNS_R_UNKNOWNSERVICE */
"recoverable error occurred", /*%< 63 DNS_R_RECOVERABLE */
"unknown opt attribute record", /*%< 64 DNS_R_UNKNOWNOPT */
"unexpected message id", /*%< 65 DNS_R_UNEXPECTEDID */
"seen include file", /*%< 66 DNS_R_SEENINCLUDE */
"not exact", /*%< 67 DNS_R_NOTEXACT */
"address blackholed", /*%< 68 DNS_R_BLACKHOLED */
"bad algorithm", /*%< 69 DNS_R_BADALG */
"invalid use of a meta type", /*%< 70 DNS_R_METATYPE */
"CNAME and other data", /*%< 71 DNS_R_CNAMEANDOTHER */
"multiple RRs of singleton type", /*%< 72 DNS_R_SINGLETON */
"hint nxrrset", /*%< 73 DNS_R_HINTNXRRSET */
"no master file configured", /*%< 74 DNS_R_NOMASTERFILE */
"unknown protocol", /*%< 75 DNS_R_UNKNOWNPROTO */
"clocks are unsynchronized", /*%< 76 DNS_R_CLOCKSKEW */
"IXFR failed", /*%< 77 DNS_R_BADIXFR */
"not authoritative", /*%< 78 DNS_R_NOTAUTHORITATIVE */
"no valid KEY", /*%< 79 DNS_R_NOVALIDKEY */
"obsolete", /*%< 80 DNS_R_OBSOLETE */
"already frozen", /*%< 81 DNS_R_FROZEN */
"unknown flag", /*%< 82 DNS_R_UNKNOWNFLAG */
"expected a response", /*%< 83 DNS_R_EXPECTEDRESPONSE */
"no valid DS", /*%< 84 DNS_R_NOVALIDDS */
"NS is an address", /*%< 85 DNS_R_NSISADDRESS */
"received FORMERR", /*%< 86 DNS_R_REMOTEFORMERR */
"truncated TCP response", /*%< 87 DNS_R_TRUNCATEDTCP */
"lame server detected", /*%< 88 DNS_R_LAME */
"unexpected RCODE", /*%< 89 DNS_R_UNEXPECTEDRCODE */
"unexpected OPCODE", /*%< 90 DNS_R_UNEXPECTEDOPCODE */
"chase DS servers", /*%< 91 DNS_R_CHASEDSSERVERS */
"empty name", /*%< 92 DNS_R_EMPTYNAME */
"empty wild", /*%< 93 DNS_R_EMPTYWILD */
"bad bitmap", /*%< 94 DNS_R_BADBITMAP */
"from wildcard", /*%< 95 DNS_R_FROMWILDCARD */
"bad owner name (check-names)", /*%< 96 DNS_R_BADOWNERNAME */
"bad name (check-names)", /*%< 97 DNS_R_BADNAME */
"dynamic zone", /*%< 98 DNS_R_DYNAMIC */
"unknown command", /*%< 99 DNS_R_UNKNOWNCOMMAND */
"must-be-secure", /*%< 100 DNS_R_MUSTBESECURE */
"covering NSEC record returned", /*%< 101 DNS_R_COVERINGNSEC */
"MX is an address", /*%< 102 DNS_R_MXISADDRESS */
"duplicate query", /*%< 103 DNS_R_DUPLICATE */
"invalid NSEC3 owner name (wildcard)", /*%< 104 DNS_R_INVALIDNSEC3 */
"not master", /*%< 105 DNS_R_NOTMASTER */
"broken trust chain", /*%< 106 DNS_R_BROKENCHAIN */
"expired", /*%< 107 DNS_R_EXPIRED */
"not dynamic", /*%< 108 DNS_R_NOTDYNAMIC */
"bad EUI", /*%< 109 DNS_R_BADEUI */
"covered by negative trust anchor", /*%< 110 DNS_R_NTACOVERED */
"bad CDS", /*%< 111 DNS_R_BADCDS */
"bad CDNSKEY", /*%< 112 DNS_R_BADCDNSKEY */
"malformed OPT option", /*%< 113 DNS_R_OPTERR */
"malformed DNSTAP data", /*%< 114 DNS_R_BADDNSTAP */
"TSIG in wrong location", /*%< 115 DNS_R_BADTSIG */
"SIG(0) in wrong location", /*%< 116 DNS_R_BADSIG0 */
"too many records", /*%< 117 DNS_R_TOOMANYRECORDS */
"verify failure", /*%< 118 DNS_R_VERIFYFAILURE */
"at top of zone", /*%< 119 DNS_R_ATZONETOP */
"no matching key found", /*%< 120 DNS_R_NOKEYMATCH */
"too many keys matching", /*%< 121 DNS_R_TOOMANYKEYS */
"key is not actively signing", /*%< 122 DNS_R_KEYNOTACTIVE */
"NSEC3 iterations out of range", /*%< 123 DNS_R_NSEC3ITERRANGE */
"NSEC3 salt length too high", /*%< 124 DNS_R_NSEC3SALTRANGE */
"cannot use NSEC3 with key algorithm", /*%< 125 DNS_R_NSEC3BADALG */
"NSEC3 resalt", /*%< 126 DNS_R_NSEC3RESALT */
};
static const char *ids[DNS_R_NRESULTS] = {
"DNS_R_LABELTOOLONG",
"DNS_R_BADESCAPE",
/*!
* Note that DNS_R_BADBITSTRING and DNS_R_BITSTRINGTOOLONG are
* deprecated.
*/
"DNS_R_BADBITSTRING",
"DNS_R_BITSTRINGTOOLONG",
"DNS_R_EMPTYLABEL",
"DNS_R_BADDOTTEDQUAD",
"DNS_R_INVALIDNS",
"DNS_R_UNKNOWN",
"DNS_R_BADLABELTYPE",
"DNS_R_BADPOINTER",
"DNS_R_TOOMANYHOPS",
"DNS_R_DISALLOWED",
"DNS_R_EXTRATOKEN",
"DNS_R_EXTRADATA",
"DNS_R_TEXTTOOLONG",
"DNS_R_NOTZONETOP",
"DNS_R_SYNTAX",
"DNS_R_BADCKSUM",
"DNS_R_BADAAAA",
"DNS_R_NOOWNER",
"DNS_R_NOTTL",
"DNS_R_BADCLASS",
"DNS_R_NAMETOOLONG",
"DNS_R_PARTIALMATCH",
"DNS_R_NEWORIGIN",
"DNS_R_UNCHANGED",
"DNS_R_BADTTL",
"DNS_R_NOREDATA",
"DNS_R_CONTINUE",
"DNS_R_DELEGATION",
"DNS_R_GLUE",
"DNS_R_DNAME",
"DNS_R_CNAME",
"DNS_R_BADDB",
"DNS_R_ZONECUT",
"DNS_R_BADZONE",
"DNS_R_MOREDATA",
"DNS_R_UPTODATE",
"DNS_R_TSIGVERIFYFAILURE",
"DNS_R_TSIGERRORSET",
"DNS_R_SIGINVALID",
"DNS_R_SIGEXPIRED",
"DNS_R_SIGFUTURE",
"DNS_R_KEYUNAUTHORIZED",
"DNS_R_INVALIDTIME",
"DNS_R_EXPECTEDTSIG",
"DNS_R_UNEXPECTEDTSIG",
"DNS_R_INVALIDTKEY",
"DNS_R_HINT",
"DNS_R_DROP",
"DNS_R_NOTLOADED",
"DNS_R_NCACHENXDOMAIN",
"DNS_R_NCACHENXRRSET",
"DNS_R_WAIT",
"DNS_R_NOTVERIFIEDYET",
"DNS_R_NOIDENTITY",
"DNS_R_NOJOURNAL",
"DNS_R_ALIAS",
"DNS_R_USETCP",
"DNS_R_NOVALIDSIG",
"DNS_R_NOVALIDNSEC",
"DNS_R_NOTINSECURE",
"DNS_R_UNKNOWNSERVICE",
"DNS_R_RECOVERABLE",
"DNS_R_UNKNOWNOPT",
"DNS_R_UNEXPECTEDID",
"DNS_R_SEENINCLUDE",
"DNS_R_NOTEXACT",
"DNS_R_BLACKHOLED",
"DNS_R_BADALG",
"DNS_R_METATYPE",
"DNS_R_CNAMEANDOTHER",
"DNS_R_SINGLETON",
"DNS_R_HINTNXRRSET",
"DNS_R_NOMASTERFILE",
"DNS_R_UNKNOWNPROTO",
"DNS_R_CLOCKSKEW",
"DNS_R_BADIXFR",
"DNS_R_NOTAUTHORITATIVE",
"DNS_R_NOVALIDKEY",
"DNS_R_OBSOLETE",
"DNS_R_FROZEN",
"DNS_R_UNKNOWNFLAG",
"DNS_R_EXPECTEDRESPONSE",
"DNS_R_NOVALIDDS",
"DNS_R_NSISADDRESS",
"DNS_R_REMOTEFORMERR",
"DNS_R_TRUNCATEDTCP",
"DNS_R_LAME",
"DNS_R_UNEXPECTEDRCODE",
"DNS_R_UNEXPECTEDOPCODE",
"DNS_R_CHASEDSSERVERS",
"DNS_R_EMPTYNAME",
"DNS_R_EMPTYWILD",
"DNS_R_BADBITMAP",
"DNS_R_FROMWILDCARD",
"DNS_R_BADOWNERNAME",
"DNS_R_BADNAME",
"DNS_R_DYNAMIC",
"DNS_R_UNKNOWNCOMMAND",
"DNS_R_MUSTBESECURE",
"DNS_R_COVERINGNSEC",
"DNS_R_MXISADDRESS",
"DNS_R_DUPLICATE",
"DNS_R_INVALIDNSEC3",
"DNS_R_NOTMASTER",
"DNS_R_BROKENCHAIN",
"DNS_R_EXPIRED",
"DNS_R_NOTDYNAMIC",
"DNS_R_BADEUI",
"DNS_R_NTACOVERED",
"DNS_R_BADCDS",
"DNS_R_BADCDNSKEY",
"DNS_R_OPTERR",
"DNS_R_BADDNSTAP",
"DNS_R_BADTSIG",
"DNS_R_BADSIG0",
"DNS_R_TOOMANYRECORDS",
"DNS_R_VERIFYFAILURE",
"DNS_R_ATZONETOP",
"DNS_R_NOKEYMATCH",
"DNS_R_TOOMANYKEYS",
"DNS_R_KEYNOTACTIVE",
"DNS_R_NSEC3ITERRANGE",
"DNS_R_NSEC3SALTRANGE",
"DNS_R_NSEC3BADALG",
"DNS_R_NSEC3RESALT",
};
static const char *rcode_text[DNS_R_NRCODERESULTS] = {
"NOERROR", /*%< 0 DNS_R_NOERROR */
"FORMERR", /*%< 1 DNS_R_FORMERR */
"SERVFAIL", /*%< 2 DNS_R_SERVFAIL */
"NXDOMAIN", /*%< 3 DNS_R_NXDOMAIN */
"NOTIMP", /*%< 4 DNS_R_NOTIMP */
"REFUSED", /*%< 5 DNS_R_REFUSED */
"YXDOMAIN", /*%< 6 DNS_R_YXDOMAIN */
"YXRRSET", /*%< 7 DNS_R_YXRRSET */
"NXRRSET", /*%< 8 DNS_R_NXRRSET */
"NOTAUTH", /*%< 9 DNS_R_NOTAUTH */
"NOTZONE", /*%< 10 DNS_R_NOTZONE */
"<rcode 11>", /*%< 11 DNS_R_RCODE11 */
"<rcode 12>", /*%< 12 DNS_R_RCODE12 */
"<rcode 13>", /*%< 13 DNS_R_RCODE13 */
"<rcode 14>", /*%< 14 DNS_R_RCODE14 */
"<rcode 15>", /*%< 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();
}
dns_rcode_t
dns_result_torcode(isc_result_t result) {
dns_rcode_t rcode = dns_rcode_servfail;
@@ -401,7 +23,7 @@ dns_result_torcode(isc_result_t result) {
* Rcodes can't be bigger than 12 bits, which is why we
* AND with 0xFFF instead of 0xFFFF.
*/
return ((dns_rcode_t)((result)&0xFFF));
return ((dns_rcode_t)(ISC_RESULT_VALUE(result) & 0xFFF));
}
/*
+323
View File
@@ -0,0 +1,323 @@
static const char *dns_result_descriptions[DNS_R_NRESULTS] = {
"label too long", /*%< 0 DNS_R_LABELTOOLONG */
"bad escape", /*%< 1 DNS_R_BADESCAPE */
/*!
* Note that DNS_R_BADBITSTRING and DNS_R_BITSTRINGTOOLONG are
* deprecated.
*/
"bad bitstring", /*%< 2 DNS_R_BADBITSTRING */
"bitstring too long", /*%< 3 DNS_R_BITSTRINGTOOLONG */
"empty label", /*%< 4 DNS_R_EMPTYLABEL */
"bad dotted quad", /*%< 5 DNS_R_BADDOTTEDQUAD */
"invalid NS owner name (wildcard)", /*%< 6 DNS_R_INVALIDNS */
"unknown class/type", /*%< 7 DNS_R_UNKNOWN */
"bad label type", /*%< 8 DNS_R_BADLABELTYPE */
"bad compression pointer", /*%< 9 DNS_R_BADPOINTER */
"too many hops", /*%< 10 DNS_R_TOOMANYHOPS */
"disallowed (by application policy)", /*%< 11 DNS_R_DISALLOWED */
"extra input text", /*%< 12 DNS_R_EXTRATOKEN */
"extra input data", /*%< 13 DNS_R_EXTRADATA */
"text too long", /*%< 14 DNS_R_TEXTTOOLONG */
"not at top of zone", /*%< 15 DNS_R_NOTZONETOP */
"syntax error", /*%< 16 DNS_R_SYNTAX */
"bad checksum", /*%< 17 DNS_R_BADCKSUM */
"bad IPv6 address", /*%< 18 DNS_R_BADAAAA */
"no owner", /*%< 19 DNS_R_NOOWNER */
"no ttl", /*%< 20 DNS_R_NOTTL */
"bad class", /*%< 21 DNS_R_BADCLASS */
"name too long", /*%< 22 DNS_R_NAMETOOLONG */
"partial match", /*%< 23 DNS_R_PARTIALMATCH */
"new origin", /*%< 24 DNS_R_NEWORIGIN */
"unchanged", /*%< 25 DNS_R_UNCHANGED */
"bad ttl", /*%< 26 DNS_R_BADTTL */
"more data needed/to be rendered", /*%< 27 DNS_R_NOREDATA */
"continue", /*%< 28 DNS_R_CONTINUE */
"delegation", /*%< 29 DNS_R_DELEGATION */
"glue", /*%< 30 DNS_R_GLUE */
"dname", /*%< 31 DNS_R_DNAME */
"cname", /*%< 32 DNS_R_CNAME */
"bad database", /*%< 33 DNS_R_BADDB */
"zonecut", /*%< 34 DNS_R_ZONECUT */
"bad zone", /*%< 35 DNS_R_BADZONE */
"more data", /*%< 36 DNS_R_MOREDATA */
"up to date", /*%< 37 DNS_R_UPTODATE */
"tsig verify failure", /*%< 38 DNS_R_TSIGVERIFYFAILURE */
"tsig indicates error", /*%< 39 DNS_R_TSIGERRORSET */
"RRSIG failed to verify", /*%< 40 DNS_R_SIGINVALID */
"RRSIG has expired", /*%< 41 DNS_R_SIGEXPIRED */
"RRSIG validity period has not begun", /*%< 42 DNS_R_SIGFUTURE */
"key is unauthorized to sign data", /*%< 43 DNS_R_KEYUNAUTHORIZED */
"invalid time", /*%< 44 DNS_R_INVALIDTIME */
"expected a TSIG or SIG(0)", /*%< 45 DNS_R_EXPECTEDTSIG */
"did not expect a TSIG or SIG(0)", /*%< 46 DNS_R_UNEXPECTEDTSIG */
"TKEY is unacceptable", /*%< 47 DNS_R_INVALIDTKEY */
"hint", /*%< 48 DNS_R_HINT */
"drop", /*%< 49 DNS_R_DROP */
"zone not loaded", /*%< 50 DNS_R_NOTLOADED */
"ncache nxdomain", /*%< 51 DNS_R_NCACHENXDOMAIN */
"ncache nxrrset", /*%< 52 DNS_R_NCACHENXRRSET */
"wait", /*%< 53 DNS_R_WAIT */
"not verified yet", /*%< 54 DNS_R_NOTVERIFIEDYET */
"no identity", /*%< 55 DNS_R_NOIDENTITY */
"no journal", /*%< 56 DNS_R_NOJOURNAL */
"alias", /*%< 57 DNS_R_ALIAS */
"use TCP", /*%< 58 DNS_R_USETCP */
"no valid RRSIG", /*%< 59 DNS_R_NOVALIDSIG */
"no valid NSEC", /*%< 60 DNS_R_NOVALIDNSEC */
"insecurity proof failed", /*%< 61 DNS_R_NOTINSECURE */
"unknown service", /*%< 62 DNS_R_UNKNOWNSERVICE */
"recoverable error occurred", /*%< 63 DNS_R_RECOVERABLE */
"unknown opt attribute record", /*%< 64 DNS_R_UNKNOWNOPT */
"unexpected message id", /*%< 65 DNS_R_UNEXPECTEDID */
"seen include file", /*%< 66 DNS_R_SEENINCLUDE */
"not exact", /*%< 67 DNS_R_NOTEXACT */
"address blackholed", /*%< 68 DNS_R_BLACKHOLED */
"bad algorithm", /*%< 69 DNS_R_BADALG */
"invalid use of a meta type", /*%< 70 DNS_R_METATYPE */
"CNAME and other data", /*%< 71 DNS_R_CNAMEANDOTHER */
"multiple RRs of singleton type", /*%< 72 DNS_R_SINGLETON */
"hint nxrrset", /*%< 73 DNS_R_HINTNXRRSET */
"no master file configured", /*%< 74 DNS_R_NOMASTERFILE */
"unknown protocol", /*%< 75 DNS_R_UNKNOWNPROTO */
"clocks are unsynchronized", /*%< 76 DNS_R_CLOCKSKEW */
"IXFR failed", /*%< 77 DNS_R_BADIXFR */
"not authoritative", /*%< 78 DNS_R_NOTAUTHORITATIVE */
"no valid KEY", /*%< 79 DNS_R_NOVALIDKEY */
"obsolete", /*%< 80 DNS_R_OBSOLETE */
"already frozen", /*%< 81 DNS_R_FROZEN */
"unknown flag", /*%< 82 DNS_R_UNKNOWNFLAG */
"expected a response", /*%< 83 DNS_R_EXPECTEDRESPONSE */
"no valid DS", /*%< 84 DNS_R_NOVALIDDS */
"NS is an address", /*%< 85 DNS_R_NSISADDRESS */
"received FORMERR", /*%< 86 DNS_R_REMOTEFORMERR */
"truncated TCP response", /*%< 87 DNS_R_TRUNCATEDTCP */
"lame server detected", /*%< 88 DNS_R_LAME */
"unexpected RCODE", /*%< 89 DNS_R_UNEXPECTEDRCODE */
"unexpected OPCODE", /*%< 90 DNS_R_UNEXPECTEDOPCODE */
"chase DS servers", /*%< 91 DNS_R_CHASEDSSERVERS */
"empty name", /*%< 92 DNS_R_EMPTYNAME */
"empty wild", /*%< 93 DNS_R_EMPTYWILD */
"bad bitmap", /*%< 94 DNS_R_BADBITMAP */
"from wildcard", /*%< 95 DNS_R_FROMWILDCARD */
"bad owner name (check-names)", /*%< 96 DNS_R_BADOWNERNAME */
"bad name (check-names)", /*%< 97 DNS_R_BADNAME */
"dynamic zone", /*%< 98 DNS_R_DYNAMIC */
"unknown command", /*%< 99 DNS_R_UNKNOWNCOMMAND */
"must-be-secure", /*%< 100 DNS_R_MUSTBESECURE */
"covering NSEC record returned", /*%< 101 DNS_R_COVERINGNSEC */
"MX is an address", /*%< 102 DNS_R_MXISADDRESS */
"duplicate query", /*%< 103 DNS_R_DUPLICATE */
"invalid NSEC3 owner name (wildcard)", /*%< 104 DNS_R_INVALIDNSEC3 */
"not master", /*%< 105 DNS_R_NOTMASTER */
"broken trust chain", /*%< 106 DNS_R_BROKENCHAIN */
"expired", /*%< 107 DNS_R_EXPIRED */
"not dynamic", /*%< 108 DNS_R_NOTDYNAMIC */
"bad EUI", /*%< 109 DNS_R_BADEUI */
"covered by negative trust anchor", /*%< 110 DNS_R_NTACOVERED */
"bad CDS", /*%< 111 DNS_R_BADCDS */
"bad CDNSKEY", /*%< 112 DNS_R_BADCDNSKEY */
"malformed OPT option", /*%< 113 DNS_R_OPTERR */
"malformed DNSTAP data", /*%< 114 DNS_R_BADDNSTAP */
"TSIG in wrong location", /*%< 115 DNS_R_BADTSIG */
"SIG(0) in wrong location", /*%< 116 DNS_R_BADSIG0 */
"too many records", /*%< 117 DNS_R_TOOMANYRECORDS */
"verify failure", /*%< 118 DNS_R_VERIFYFAILURE */
"at top of zone", /*%< 119 DNS_R_ATZONETOP */
"no matching key found", /*%< 120 DNS_R_NOKEYMATCH */
"too many keys matching", /*%< 121 DNS_R_TOOMANYKEYS */
"key is not actively signing", /*%< 122 DNS_R_KEYNOTACTIVE */
"NSEC3 iterations out of range", /*%< 123 DNS_R_NSEC3ITERRANGE */
"NSEC3 salt length too high", /*%< 124 DNS_R_NSEC3SALTRANGE */
"cannot use NSEC3 with key algorithm", /*%< 125 DNS_R_NSEC3BADALG */
"NSEC3 resalt", /*%< 126 DNS_R_NSEC3RESALT */
};
static const char *dns_result_ids[DNS_R_NRESULTS] = {
"DNS_R_LABELTOOLONG",
"DNS_R_BADESCAPE",
/*!
* Note that DNS_R_BADBITSTRING and DNS_R_BITSTRINGTOOLONG are
* deprecated.
*/
"DNS_R_BADBITSTRING",
"DNS_R_BITSTRINGTOOLONG",
"DNS_R_EMPTYLABEL",
"DNS_R_BADDOTTEDQUAD",
"DNS_R_INVALIDNS",
"DNS_R_UNKNOWN",
"DNS_R_BADLABELTYPE",
"DNS_R_BADPOINTER",
"DNS_R_TOOMANYHOPS",
"DNS_R_DISALLOWED",
"DNS_R_EXTRATOKEN",
"DNS_R_EXTRADATA",
"DNS_R_TEXTTOOLONG",
"DNS_R_NOTZONETOP",
"DNS_R_SYNTAX",
"DNS_R_BADCKSUM",
"DNS_R_BADAAAA",
"DNS_R_NOOWNER",
"DNS_R_NOTTL",
"DNS_R_BADCLASS",
"DNS_R_NAMETOOLONG",
"DNS_R_PARTIALMATCH",
"DNS_R_NEWORIGIN",
"DNS_R_UNCHANGED",
"DNS_R_BADTTL",
"DNS_R_NOREDATA",
"DNS_R_CONTINUE",
"DNS_R_DELEGATION",
"DNS_R_GLUE",
"DNS_R_DNAME",
"DNS_R_CNAME",
"DNS_R_BADDB",
"DNS_R_ZONECUT",
"DNS_R_BADZONE",
"DNS_R_MOREDATA",
"DNS_R_UPTODATE",
"DNS_R_TSIGVERIFYFAILURE",
"DNS_R_TSIGERRORSET",
"DNS_R_SIGINVALID",
"DNS_R_SIGEXPIRED",
"DNS_R_SIGFUTURE",
"DNS_R_KEYUNAUTHORIZED",
"DNS_R_INVALIDTIME",
"DNS_R_EXPECTEDTSIG",
"DNS_R_UNEXPECTEDTSIG",
"DNS_R_INVALIDTKEY",
"DNS_R_HINT",
"DNS_R_DROP",
"DNS_R_NOTLOADED",
"DNS_R_NCACHENXDOMAIN",
"DNS_R_NCACHENXRRSET",
"DNS_R_WAIT",
"DNS_R_NOTVERIFIEDYET",
"DNS_R_NOIDENTITY",
"DNS_R_NOJOURNAL",
"DNS_R_ALIAS",
"DNS_R_USETCP",
"DNS_R_NOVALIDSIG",
"DNS_R_NOVALIDNSEC",
"DNS_R_NOTINSECURE",
"DNS_R_UNKNOWNSERVICE",
"DNS_R_RECOVERABLE",
"DNS_R_UNKNOWNOPT",
"DNS_R_UNEXPECTEDID",
"DNS_R_SEENINCLUDE",
"DNS_R_NOTEXACT",
"DNS_R_BLACKHOLED",
"DNS_R_BADALG",
"DNS_R_METATYPE",
"DNS_R_CNAMEANDOTHER",
"DNS_R_SINGLETON",
"DNS_R_HINTNXRRSET",
"DNS_R_NOMASTERFILE",
"DNS_R_UNKNOWNPROTO",
"DNS_R_CLOCKSKEW",
"DNS_R_BADIXFR",
"DNS_R_NOTAUTHORITATIVE",
"DNS_R_NOVALIDKEY",
"DNS_R_OBSOLETE",
"DNS_R_FROZEN",
"DNS_R_UNKNOWNFLAG",
"DNS_R_EXPECTEDRESPONSE",
"DNS_R_NOVALIDDS",
"DNS_R_NSISADDRESS",
"DNS_R_REMOTEFORMERR",
"DNS_R_TRUNCATEDTCP",
"DNS_R_LAME",
"DNS_R_UNEXPECTEDRCODE",
"DNS_R_UNEXPECTEDOPCODE",
"DNS_R_CHASEDSSERVERS",
"DNS_R_EMPTYNAME",
"DNS_R_EMPTYWILD",
"DNS_R_BADBITMAP",
"DNS_R_FROMWILDCARD",
"DNS_R_BADOWNERNAME",
"DNS_R_BADNAME",
"DNS_R_DYNAMIC",
"DNS_R_UNKNOWNCOMMAND",
"DNS_R_MUSTBESECURE",
"DNS_R_COVERINGNSEC",
"DNS_R_MXISADDRESS",
"DNS_R_DUPLICATE",
"DNS_R_INVALIDNSEC3",
"DNS_R_NOTMASTER",
"DNS_R_BROKENCHAIN",
"DNS_R_EXPIRED",
"DNS_R_NOTDYNAMIC",
"DNS_R_BADEUI",
"DNS_R_NTACOVERED",
"DNS_R_BADCDS",
"DNS_R_BADCDNSKEY",
"DNS_R_OPTERR",
"DNS_R_BADDNSTAP",
"DNS_R_BADTSIG",
"DNS_R_BADSIG0",
"DNS_R_TOOMANYRECORDS",
"DNS_R_VERIFYFAILURE",
"DNS_R_ATZONETOP",
"DNS_R_NOKEYMATCH",
"DNS_R_TOOMANYKEYS",
"DNS_R_KEYNOTACTIVE",
"DNS_R_NSEC3ITERRANGE",
"DNS_R_NSEC3SALTRANGE",
"DNS_R_NSEC3BADALG",
"DNS_R_NSEC3RESALT",
};
static const char *dns_rcode_descriptions[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 */
"<rcode 11>", /*%< 11 DNS_R_RCODE11 */
"<rcode 12>", /*%< 12 DNS_R_RCODE12 */
"<rcode 13>", /*%< 13 DNS_R_RCODE13 */
"<rcode 14>", /*%< 14 DNS_R_RCODE14 */
"<rcode 15>", /*%< 15 DNS_R_RCODE15 */
"BADVERS", /*%< 16 DNS_R_BADVERS */
};
static const char *dns_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",
};
+157
View File
@@ -0,0 +1,157 @@
/*
* DNS library result codes
*/
DNS_R_LABELTOOLONG = ISC_RESULTCODE_DNS(0),
DNS_R_BADESCAPE = ISC_RESULTCODE_DNS(1),
/* Note: 2 and 3 are deprecated. */
DNS_R_EMPTYLABEL = ISC_RESULTCODE_DNS(4),
DNS_R_BADDOTTEDQUAD = ISC_RESULTCODE_DNS(5),
DNS_R_INVALIDNS = ISC_RESULTCODE_DNS(6),
DNS_R_UNKNOWN = ISC_RESULTCODE_DNS(7),
DNS_R_BADLABELTYPE = ISC_RESULTCODE_DNS(8),
DNS_R_BADPOINTER = ISC_RESULTCODE_DNS(9),
DNS_R_TOOMANYHOPS = ISC_RESULTCODE_DNS(10),
DNS_R_DISALLOWED = ISC_RESULTCODE_DNS(11),
DNS_R_EXTRATOKEN = ISC_RESULTCODE_DNS(12),
DNS_R_EXTRADATA = ISC_RESULTCODE_DNS(13),
DNS_R_TEXTTOOLONG = ISC_RESULTCODE_DNS(14),
DNS_R_NOTZONETOP = ISC_RESULTCODE_DNS(15),
DNS_R_SYNTAX = ISC_RESULTCODE_DNS(16),
DNS_R_BADCKSUM = ISC_RESULTCODE_DNS(17),
DNS_R_BADAAAA = ISC_RESULTCODE_DNS(18),
DNS_R_NOOWNER = ISC_RESULTCODE_DNS(19),
DNS_R_NOTTL = ISC_RESULTCODE_DNS(20),
DNS_R_BADCLASS = ISC_RESULTCODE_DNS(21),
DNS_R_NAMETOOLONG = ISC_RESULTCODE_DNS(22),
DNS_R_PARTIALMATCH = ISC_RESULTCODE_DNS(23),
DNS_R_NEWORIGIN = ISC_RESULTCODE_DNS(24),
DNS_R_UNCHANGED = ISC_RESULTCODE_DNS(25),
DNS_R_BADTTL = ISC_RESULTCODE_DNS(26),
DNS_R_NOREDATA = ISC_RESULTCODE_DNS(27),
DNS_R_CONTINUE = ISC_RESULTCODE_DNS(28),
DNS_R_DELEGATION = ISC_RESULTCODE_DNS(29),
DNS_R_GLUE = ISC_RESULTCODE_DNS(30),
DNS_R_DNAME = ISC_RESULTCODE_DNS(31),
DNS_R_CNAME = ISC_RESULTCODE_DNS(32),
DNS_R_BADDB = ISC_RESULTCODE_DNS(33),
DNS_R_ZONECUT = ISC_RESULTCODE_DNS(34),
DNS_R_BADZONE = ISC_RESULTCODE_DNS(35),
DNS_R_MOREDATA = ISC_RESULTCODE_DNS(36),
DNS_R_UPTODATE = ISC_RESULTCODE_DNS(37),
DNS_R_TSIGVERIFYFAILURE = ISC_RESULTCODE_DNS(38),
DNS_R_TSIGERRORSET = ISC_RESULTCODE_DNS(39),
DNS_R_SIGINVALID = ISC_RESULTCODE_DNS(40),
DNS_R_SIGEXPIRED = ISC_RESULTCODE_DNS(41),
DNS_R_SIGFUTURE = ISC_RESULTCODE_DNS(42),
DNS_R_KEYUNAUTHORIZED = ISC_RESULTCODE_DNS(43),
DNS_R_INVALIDTIME = ISC_RESULTCODE_DNS(44),
DNS_R_EXPECTEDTSIG = ISC_RESULTCODE_DNS(45),
DNS_R_UNEXPECTEDTSIG = ISC_RESULTCODE_DNS(46),
DNS_R_INVALIDTKEY = ISC_RESULTCODE_DNS(47),
DNS_R_HINT = ISC_RESULTCODE_DNS(48),
DNS_R_DROP = ISC_RESULTCODE_DNS(49),
DNS_R_NOTLOADED = ISC_RESULTCODE_DNS(50),
DNS_R_NCACHENXDOMAIN = ISC_RESULTCODE_DNS(51),
DNS_R_NCACHENXRRSET = ISC_RESULTCODE_DNS(52),
DNS_R_WAIT = ISC_RESULTCODE_DNS(53),
DNS_R_NOTVERIFIEDYET = ISC_RESULTCODE_DNS(54),
DNS_R_NOIDENTITY = ISC_RESULTCODE_DNS(55),
DNS_R_NOJOURNAL = ISC_RESULTCODE_DNS(56),
DNS_R_ALIAS = ISC_RESULTCODE_DNS(57),
DNS_R_USETCP = ISC_RESULTCODE_DNS(58),
DNS_R_NOVALIDSIG = ISC_RESULTCODE_DNS(59),
DNS_R_NOVALIDNSEC = ISC_RESULTCODE_DNS(60),
DNS_R_NOTINSECURE = ISC_RESULTCODE_DNS(61),
DNS_R_UNKNOWNSERVICE = ISC_RESULTCODE_DNS(62),
DNS_R_RECOVERABLE = ISC_RESULTCODE_DNS(63),
DNS_R_UNKNOWNOPT = ISC_RESULTCODE_DNS(64),
DNS_R_UNEXPECTEDID = ISC_RESULTCODE_DNS(65),
DNS_R_SEENINCLUDE = ISC_RESULTCODE_DNS(66),
DNS_R_NOTEXACT = ISC_RESULTCODE_DNS(67),
DNS_R_BLACKHOLED = ISC_RESULTCODE_DNS(68),
DNS_R_BADALG = ISC_RESULTCODE_DNS(69),
DNS_R_METATYPE = ISC_RESULTCODE_DNS(70),
DNS_R_CNAMEANDOTHER = ISC_RESULTCODE_DNS(71),
DNS_R_SINGLETON = ISC_RESULTCODE_DNS(72),
DNS_R_HINTNXRRSET = ISC_RESULTCODE_DNS(73),
DNS_R_NOMASTERFILE = ISC_RESULTCODE_DNS(74),
DNS_R_UNKNOWNPROTO = ISC_RESULTCODE_DNS(75),
DNS_R_CLOCKSKEW = ISC_RESULTCODE_DNS(76),
DNS_R_BADIXFR = ISC_RESULTCODE_DNS(77),
DNS_R_NOTAUTHORITATIVE = ISC_RESULTCODE_DNS(78),
DNS_R_NOVALIDKEY = ISC_RESULTCODE_DNS(79),
DNS_R_OBSOLETE = ISC_RESULTCODE_DNS(80),
DNS_R_FROZEN = ISC_RESULTCODE_DNS(81),
DNS_R_UNKNOWNFLAG = ISC_RESULTCODE_DNS(82),
DNS_R_EXPECTEDRESPONSE = ISC_RESULTCODE_DNS(83),
DNS_R_NOVALIDDS = ISC_RESULTCODE_DNS(84),
DNS_R_NSISADDRESS = ISC_RESULTCODE_DNS(85),
DNS_R_REMOTEFORMERR = ISC_RESULTCODE_DNS(86),
DNS_R_TRUNCATEDTCP = ISC_RESULTCODE_DNS(87),
DNS_R_LAME = ISC_RESULTCODE_DNS(88),
DNS_R_UNEXPECTEDRCODE = ISC_RESULTCODE_DNS(89),
DNS_R_UNEXPECTEDOPCODE = ISC_RESULTCODE_DNS(90),
DNS_R_CHASEDSSERVERS = ISC_RESULTCODE_DNS(91),
DNS_R_EMPTYNAME = ISC_RESULTCODE_DNS(92),
DNS_R_EMPTYWILD = ISC_RESULTCODE_DNS(93),
DNS_R_BADBITMAP = ISC_RESULTCODE_DNS(94),
DNS_R_FROMWILDCARD = ISC_RESULTCODE_DNS(95),
DNS_R_BADOWNERNAME = ISC_RESULTCODE_DNS(96),
DNS_R_BADNAME = ISC_RESULTCODE_DNS(97),
DNS_R_DYNAMIC = ISC_RESULTCODE_DNS(98),
DNS_R_UNKNOWNCOMMAND = ISC_RESULTCODE_DNS(99),
DNS_R_MUSTBESECURE = ISC_RESULTCODE_DNS(100),
DNS_R_COVERINGNSEC = ISC_RESULTCODE_DNS(101),
DNS_R_MXISADDRESS = ISC_RESULTCODE_DNS(102),
DNS_R_DUPLICATE = ISC_RESULTCODE_DNS(103),
DNS_R_INVALIDNSEC3 = ISC_RESULTCODE_DNS(104),
DNS_R_NOTMASTER = ISC_RESULTCODE_DNS(105),
DNS_R_BROKENCHAIN = ISC_RESULTCODE_DNS(106),
DNS_R_EXPIRED = ISC_RESULTCODE_DNS(107),
DNS_R_NOTDYNAMIC = ISC_RESULTCODE_DNS(108),
DNS_R_BADEUI = ISC_RESULTCODE_DNS(109),
DNS_R_NTACOVERED = ISC_RESULTCODE_DNS(110),
DNS_R_BADCDS = ISC_RESULTCODE_DNS(111),
DNS_R_BADCDNSKEY = ISC_RESULTCODE_DNS(112),
DNS_R_OPTERR = ISC_RESULTCODE_DNS(113),
DNS_R_BADDNSTAP = ISC_RESULTCODE_DNS(114),
DNS_R_BADTSIG = ISC_RESULTCODE_DNS(115),
DNS_R_BADSIG0 = ISC_RESULTCODE_DNS(116),
DNS_R_TOOMANYRECORDS = ISC_RESULTCODE_DNS(117),
DNS_R_VERIFYFAILURE = ISC_RESULTCODE_DNS(118),
DNS_R_ATZONETOP = ISC_RESULTCODE_DNS(119),
DNS_R_NOKEYMATCH = ISC_RESULTCODE_DNS(120),
DNS_R_TOOMANYKEYS = ISC_RESULTCODE_DNS(121),
DNS_R_KEYNOTACTIVE = ISC_RESULTCODE_DNS(122),
DNS_R_NSEC3ITERRANGE = ISC_RESULTCODE_DNS(123),
DNS_R_NSEC3SALTRANGE = ISC_RESULTCODE_DNS(124),
DNS_R_NSEC3BADALG = ISC_RESULTCODE_DNS(125),
DNS_R_NSEC3RESALT = ISC_RESULTCODE_DNS(126),
#define DNS_R_NRESULTS 127 /*%< Number of results */
/*
* DNS wire format rcodes.
*
* By making these their own class we can easily convert them into the
* wire-format rcode value simply by masking off the resultclass.
*/
DNS_R_NOERROR = ISC_RESULTCODE_DNSRCODE(0),
DNS_R_FORMERR = ISC_RESULTCODE_DNSRCODE(1),
DNS_R_SERVFAIL = ISC_RESULTCODE_DNSRCODE(2),
DNS_R_NXDOMAIN = ISC_RESULTCODE_DNSRCODE(3),
DNS_R_NOTIMP = ISC_RESULTCODE_DNSRCODE(4),
DNS_R_REFUSED = ISC_RESULTCODE_DNSRCODE(5),
DNS_R_YXDOMAIN = ISC_RESULTCODE_DNSRCODE(6),
DNS_R_YXRRSET = ISC_RESULTCODE_DNSRCODE(7),
DNS_R_NXRRSET = ISC_RESULTCODE_DNSRCODE(8),
DNS_R_NOTAUTH = ISC_RESULTCODE_DNSRCODE(9),
DNS_R_NOTZONE = ISC_RESULTCODE_DNSRCODE(10),
DNS_R_RCODE11 = ISC_RESULTCODE_DNSRCODE(11),
DNS_R_RCODE12 = ISC_RESULTCODE_DNSRCODE(12),
DNS_R_RCODE13 = ISC_RESULTCODE_DNSRCODE(13),
DNS_R_RCODE14 = ISC_RESULTCODE_DNSRCODE(14),
DNS_R_RCODE15 = ISC_RESULTCODE_DNSRCODE(15),
DNS_R_BADVERS = ISC_RESULTCODE_DNSRCODE(16),
#define DNS_R_NRCODERESULTS 17 /*%< Number of rcode results */
+51
View File
@@ -0,0 +1,51 @@
static const char *dst_result_descriptions[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 *dst_result_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",
};
+27
View File
@@ -0,0 +1,27 @@
DST_R_UNSUPPORTEDALG = ISC_RESULTCODE_DST(0),
DST_R_CRYPTOFAILURE = ISC_RESULTCODE_DST(1),
/* compat */
DST_R_OPENSSLFAILURE = DST_R_CRYPTOFAILURE,
DST_R_NOCRYPTO = ISC_RESULTCODE_DST(2),
DST_R_NULLKEY = ISC_RESULTCODE_DST(3),
DST_R_INVALIDPUBLICKEY = ISC_RESULTCODE_DST(4),
DST_R_INVALIDPRIVATEKEY = ISC_RESULTCODE_DST(5),
/* 6 is unused */
DST_R_WRITEERROR = ISC_RESULTCODE_DST(7),
DST_R_INVALIDPARAM = ISC_RESULTCODE_DST(8),
/* 9 is unused */
/* 10 is unused */
DST_R_SIGNFAILURE = ISC_RESULTCODE_DST(11),
/* 12 is unused */
/* 13 is unused */
DST_R_VERIFYFAILURE = ISC_RESULTCODE_DST(14),
DST_R_NOTPUBLICKEY = ISC_RESULTCODE_DST(15),
DST_R_NOTPRIVATEKEY = ISC_RESULTCODE_DST(16),
DST_R_KEYCANNOTCOMPUTESECRET = ISC_RESULTCODE_DST(17),
DST_R_COMPUTESECRETFAILURE = ISC_RESULTCODE_DST(18),
DST_R_NORANDOMNESS = ISC_RESULTCODE_DST(19),
DST_R_BADKEYTYPE = ISC_RESULTCODE_DST(20),
DST_R_NOENGINE = ISC_RESULTCODE_DST(21),
DST_R_EXTERNALKEY = ISC_RESULTCODE_DST(22),
#define DST_R_NRESULTS 23 /* Number of results */
+1 -1
View File
@@ -1113,7 +1113,7 @@ dns_rrl(dns_view_t *view, const isc_sockaddr_t *client_addr, bool is_tcp,
}
}
UNLOCK(&rrl->lock);
return (ISC_R_SUCCESS);
return (DNS_RRL_RESULT_OK);
}
/*
-2
View File
@@ -29,8 +29,6 @@
#include <dns/name.h>
#include <dst/result.h>
#include "../dst_internal.h"
#include "dnstest.h"
-2
View File
@@ -168,8 +168,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());
}
-1
View File
@@ -29,7 +29,6 @@
#include <isc/util.h>
#include <dst/dst.h>
#include <dst/result.h>
#include "../dst_internal.h"
#include "dnstest.h"
+15 -14
View File
@@ -26,8 +26,6 @@
#include <dns/lib.h>
#include <dns/result.h>
#include <dst/result.h>
/*
* Check ids array is populated.
*/
@@ -35,15 +33,13 @@ static void
ids(void **state) {
const char *str;
isc_result_t result;
size_t i;
UNUSED(state);
dns_result_register();
dst_result_register();
for (i = 0; i < DNS_R_NRESULTS; i++) {
result = ISC_RESULTCODE_DNS(i);
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 "
@@ -55,6 +51,8 @@ ids(void **state) {
"available)");
}
result = ISC_RESULTCODE_DNS(i);
str = isc_result_toid(result);
assert_non_null(str);
assert_string_equal(str, "(result code text not available)");
@@ -63,9 +61,9 @@ ids(void **state) {
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++)
{
for (i = 0; i < DST_R_NRESULTS; i++) {
result = ISC_RESULTCODE_DST(i);
str = isc_result_toid(result);
assert_non_null(str);
assert_string_not_equal(str, "(result code text not "
@@ -77,6 +75,8 @@ ids(void **state) {
"available)");
}
result = ISC_RESULTCODE_DST(i);
str = isc_result_toid(result);
assert_non_null(str);
assert_string_equal(str, "(result code text not available)");
@@ -85,10 +85,9 @@ ids(void **state) {
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++)
{
for (i = 0; i < DNS_R_NRCODERESULTS; i++) {
result = ISC_RESULTCODE_DNSRCODE(i);
str = isc_result_toid(result);
assert_non_null(str);
assert_string_not_equal(str, "(result code text not "
@@ -100,6 +99,8 @@ ids(void **state) {
"available)");
}
result = ISC_RESULTCODE_DNSRCODE(i);
str = isc_result_toid(result);
assert_non_null(str);
assert_string_equal(str, "(result code text not available)");
+4 -4
View File
@@ -1241,7 +1241,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 (ISC_RESULTCODE_DNSRCODE(rmsg->rcode));
}
RETERR(find_tkey(rmsg, &tkeyname, &rtkeyrdata, DNS_SECTION_ANSWER));
RETERR(dns_rdata_tostruct(&rtkeyrdata, &rtkey, NULL));
@@ -1369,7 +1369,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 (ISC_RESULTCODE_DNSRCODE(rmsg->rcode));
}
RETERR(find_tkey(rmsg, &tkeyname, &rtkeyrdata, DNS_SECTION_ANSWER));
RETERR(dns_rdata_tostruct(&rtkeyrdata, &rtkey, NULL));
@@ -1442,7 +1442,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 (ISC_RESULTCODE_DNSRCODE(rmsg->rcode));
}
RETERR(find_tkey(rmsg, &tkeyname, &rtkeyrdata, DNS_SECTION_ANSWER));
@@ -1505,7 +1505,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 (ISC_RESULTCODE_DNSRCODE(rmsg->rcode));
}
RETERR(find_tkey(rmsg, &tkeyname, &rtkeyrdata, DNS_SECTION_ANSWER));
-2
View File
@@ -38,8 +38,6 @@
#include <dns/result.h>
#include <dns/tsig.h>
#include <dst/result.h>
#include "tsig_p.h"
#define TSIG_MAGIC ISC_MAGIC('T', 'S', 'I', 'G')
+6
View File
@@ -115,6 +115,8 @@
case DNS_R_YXRRSET: \
case DNS_R_NXRRSET: \
_what = "unsuccessful"; \
default: \
(void)0; /* Suppress -Werror=switch. */ \
} \
update_log(log, zone, LOGLEVEL_PROTOCOL, "update %s: %s (%s)", \
_what, msg, isc_result_totext(result)); \
@@ -132,6 +134,8 @@
case DNS_R_YXRRSET: \
case DNS_R_NXRRSET: \
_what = "unsuccessful"; \
default: \
(void)0; /* Suppress -Werror=switch. */ \
} \
if (isc_log_wouldlog(dns_lctx, LOGLEVEL_PROTOCOL)) { \
char _nbuf[DNS_NAME_FORMATSIZE]; \
@@ -154,6 +158,8 @@
case DNS_R_YXRRSET: \
case DNS_R_NXRRSET: \
_what = "unsuccessful"; \
default: \
(void)0; /* Suppress -Werror=switch. */ \
} \
if (isc_log_wouldlog(dns_lctx, LOGLEVEL_PROTOCOL)) { \
char _nbuf[DNS_NAME_FORMATSIZE]; \
-4
View File
@@ -960,9 +960,7 @@ dns_resolver_shutdown
dns_resolver_socketmgr
dns_resolver_taskmgr
dns_resolver_whenshutdown
dns_result_register
dns_result_torcode
dns_result_totext
dns_root_checkhints
dns_rootns_create
dns_rpz_add
@@ -1524,8 +1522,6 @@ dst_lib_destroy
dst_lib_init
dst_region_computeid
dst_region_computerid
dst_result_register
dst_result_totext
@IF NOLONGER
; Exported Data
-3
View File
@@ -278,9 +278,6 @@
<ClCompile Include="..\dst_parse.c">
<Filter>Dst Source Files</Filter>
</ClCompile>
<ClCompile Include="..\dst_result.c">
<Filter>Dst Source Files</Filter>
</ClCompile>
@IF GSSAPI
<ClCompile Include="..\gssapi_link.c">
<Filter>Dst Source Files</Filter>
-2
View File
@@ -138,7 +138,6 @@
<ClCompile Include="..\ds.c" />
<ClCompile Include="..\dst_api.c" />
<ClCompile Include="..\dst_parse.c" />
<ClCompile Include="..\dst_result.c" />
<ClCompile Include="..\dyndb.c" />
<ClCompile Include="..\ecs.c" />
<ClCompile Include="..\fixedname.c" />
@@ -332,7 +331,6 @@
<ClInclude Include="..\include\dns\zt.h" />
<ClInclude Include="..\include\dst\dst.h" />
<ClInclude Include="..\include\dst\gssapi.h" />
<ClInclude Include="..\include\dst\result.h" />
<ClInclude Include="..\rbtdb.h" />
<ClInclude Include="..\rdatalist_p.h" />
</ItemGroup>
+1 -1
View File
@@ -1256,7 +1256,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 = ISC_RESULTCODE_DNSRCODE(msg->rcode); /*XXX*/
} else if (result == ISC_R_SUCCESS &&
msg->opcode != dns_opcode_query) {
result = DNS_R_UNEXPECTEDOPCODE;
+18 -2
View File
@@ -2,6 +2,11 @@ include $(top_srcdir)/Makefile.top
lib_LTLIBRARIES = libisc.la
EXTRA_DIST = \
result_isc.h.in \
result_pk11.h.in \
result_pk11.c.in
libisc_ladir = $(includedir)/isc
libisc_la_HEADERS = \
include/isc/aes.h \
@@ -71,6 +76,7 @@ libisc_la_HEADERS = \
include/isc/region.h \
include/isc/resource.h \
include/isc/result.h \
include/isc/result_ext.h \
include/isc/resultclass.h \
include/isc/rwlock.h \
include/isc/safe.h \
@@ -113,7 +119,6 @@ pk11_HEADERS = \
include/pk11/constants.h \
include/pk11/internal.h \
include/pk11/pk11.h \
include/pk11/result.h \
include/pk11/site.h
pkcs11dir = $(includedir)/pkcs11
@@ -153,7 +158,6 @@ libisc_la_SOURCES = \
unix/time.c \
url.c \
pk11.c \
pk11_result.c \
aes.c \
app.c \
assertions.c \
@@ -227,6 +231,18 @@ libisc_la_SOURCES = \
task_p.h \
tls_p.h
BUILT_SOURCES = result_ext.c ${top_srcdir}/lib/isc/include/isc/result_ext.h
CLEANFILES = result_ext.c ${top_srcdir}/lib/isc/include/isc/result_ext.h
result_ext.c: ${top_srcdir}/lib/*/result_*.c.in
cat ${top_srcdir}/lib/*/result_*.c.in > result_ext.c
${top_srcdir}/lib/isc/include/isc/result_ext.h: ${top_srcdir}/lib/*/result_*.h.in
echo "enum isc_result {" > ${top_srcdir}/lib/isc/include/isc/result_ext.h
cat ${top_srcdir}/lib/*/result_*.h.in >> ${top_srcdir}/lib/isc/include/isc/result_ext.h
echo "ISC_R_DUMMY = ISC_RESULTCODE_ISC((uint32_t)-1) /* don't use this value. */" >> ${top_srcdir}/lib/isc/include/isc/result_ext.h
echo "};" >> ${top_srcdir}/lib/isc/include/isc/result_ext.h
libisc_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(LIBISC_CFLAGS) \
+6 -84
View File
@@ -15,84 +15,14 @@
/*! \file isc/result.h */
#include <isc/lang.h>
#include <isc/resultclass.h>
#include <isc/types.h>
#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_QUEUEFULL 46 /*%< queue is full */
#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 */
/*% Not a result code: the number of results. */
#define ISC_R_NRESULTS 72
/*
* This file is generated at compile time from the result_*.h files
* found in sibling library source directories.
*/
#include <isc/result_ext.h>
ISC_LANG_BEGINDECLS
@@ -107,14 +37,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 */
+66 -19
View File
@@ -12,30 +12,77 @@
#ifndef ISC_RESULTCLASS_H
#define ISC_RESULTCLASS_H 1
#include <stdint.h>
/*! \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.
* Error codes are organized (divided) into classes, we use an uint32_t number
* to store both the error class and the error code.
*
* Classes < 1024 are reserved for ISC use.
* Result classes >= 1024 and <= 65535 are reserved for application use.
* The lower bits are used to store the error number, the upper bits are used to
* store the error class.
*
* The class number is stored into the upper ISC_RESULTCLASS_BITS bits
* of the number (see macro), thus 2^ISC_RESULTCLASS_BITS classes are available.
*
* Each class may contain up to 2^(32 - ISC_RESULTCLASS_BITS) error codes.
*
* A result code is formed by applying a binary "or" between the error code
* and the result class shifted left ISC_RESULTCLASS_BITS.
* i.e.: full_rcode = rcode | (rclass << ISC_RESULTCLASS_BITS)
*
* Some macros are provided in this header file to make the task of creating
* result codes easier.
*/
#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))
/* Bits reserved for the error class. */
#define ISC_RESULTCLASS_BITS (uint32_t)16u
#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)
/* Mask used to extract the class bits within a number (using bitwise AND) */
#define ISC_RESULTCLASS_MASK (uint32_t)(~((1u << ISC_RESULTCLASS_BITS) - 1))
#endif /* ISC_RESULTCLASS_H */
/* Macro used to extract the class value given a isc_result_t input */
#define ISC_RESULT_CLASS(result) ((result) >> ISC_RESULTCLASS_BITS)
/* Macro used to extract the error value given a isc_result_t input */
#define ISC_RESULT_VALUE(result) ((result) & ~ISC_RESULTCLASS_MASK)
/* Check whether result is in the same class as rclass */
#define ISC_RESULT_INCLASS(rclass, result) \
((rclass) == ISC_RESULT_CLASS(result))
/*
* Following are macros that define result classes (or error classes) in the
* format ISC_RESULTCLASS_(CLASSNAME).
* Following each result class are macros intended to be used to create
* error codes for that class, in the format ISC_RESULTCODE_(CLASS_NAME).
*
* A library could have error codes defined like the example below:
* #define ISC_R_EOF ISC_RESULTCODE_ISC(14)
* Another library could use the same number (14) to define an error code
* without conflicting with another class, e.g:
* #define DNS_R_TEXTTOOLONG ISC_RESULTCODE_DNS(14)
* ISC_R_EOF == DNS_R_TEXTTOOLONG (false, not in the same class)
*/
#define MAKE_RCODE(rclass, rcode) (rcode | (rclass << ISC_RESULTCLASS_BITS))
#define ISC_RESULTCLASS_ISC 0
#define ISC_RESULTCODE_ISC(code) MAKE_RCODE(ISC_RESULTCLASS_ISC, code)
#define ISC_RESULTCLASS_DNS 1
#define ISC_RESULTCODE_DNS(code) MAKE_RCODE(ISC_RESULTCLASS_DNS, code)
#define ISC_RESULTCLASS_DST 2
#define ISC_RESULTCODE_DST(code) MAKE_RCODE(ISC_RESULTCLASS_DST, code)
#define ISC_RESULTCLASS_DNSRCODE 3
#define ISC_RESULTCODE_DNSRCODE(code) MAKE_RCODE(ISC_RESULTCLASS_DNSRCODE, code)
#define ISC_RESULTCLASS_OMAPI 4
#define ISC_RESULTCODE_OMAPI(code) MAKE_RCODE(ISC_RESULTCLASS_OMAPI, code)
#define ISC_RESULTCLASS_ISCCC 5
#define ISC_RESULTCODE_ISCCC(code) MAKE_RCODE(ISC_RESULTCLASS_ISCCC, code)
#define ISC_RESULTCLASS_DHCP 6
#define ISC_RESULTCODE_DHCP(code) MAKE_RCODE(ISC_RESULTCLASS_DHCP, code)
#define ISC_RESULTCLASS_PK11 7
#define ISC_RESULTCODE_PK11(code) MAKE_RCODE(ISC_RESULTCLASS_PK11, code)
#define ISC_RESULTCLASS_MAX 7
#endif /* ISC_RESULTCLASS_H */
+1
View File
@@ -56,6 +56,7 @@
#include <isc/eventclass.h>
#include <isc/lang.h>
#include <isc/region.h>
#include <isc/result.h>
#include <isc/sockaddr.h>
#include <isc/time.h>
#include <isc/types.h>
+1 -1
View File
@@ -74,7 +74,7 @@ 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 enum isc_result 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
-46
View File
@@ -1,46 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
#ifndef PK11_RESULT_H
#define PK11_RESULT_H 1
/*! \file pk11/result.h */
#include <isc/lang.h>
#include <isc/resultclass.h>
#include <isc/types.h>
/*
* Nothing in this file truly depends on <isc/result.h>, but the
* PK11 result codes are considered to be publicly derived from
* the ISC result codes, so including this file buys you the ISC_R_
* namespace too.
*/
#include <isc/result.h> /* Contractual promise. */
#define PK11_R_INITFAILED (ISC_RESULTCLASS_PK11 + 0)
#define PK11_R_NOPROVIDER (ISC_RESULTCLASS_PK11 + 1)
#define PK11_R_NORANDOMSERVICE (ISC_RESULTCLASS_PK11 + 2)
#define PK11_R_NODIGESTSERVICE (ISC_RESULTCLASS_PK11 + 3)
#define PK11_R_NOAESSERVICE (ISC_RESULTCLASS_PK11 + 4)
#define PK11_R_NRESULTS 5 /* Number of results */
ISC_LANG_BEGINDECLS
const char *pk11_result_totext(isc_result_t);
void
pk11_result_register(void);
ISC_LANG_ENDDECLS
#endif /* PK11_RESULT_H */
-1
View File
@@ -29,7 +29,6 @@
#include <pk11/internal.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
#include <pk11/site.h>
#include <pkcs11/pkcs11.h>
-71
View File
@@ -1,71 +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 <stddef.h>
#include <isc/once.h>
#include <isc/util.h>
#include <pk11/result.h>
static const char *text[PK11_R_NRESULTS] = {
"PKCS#11 initialization failed", /*%< 0 */
"no PKCS#11 provider", /*%< 1 */
"PKCS#11 no random service", /*%< 2 */
"PKCS#11 no digist service", /*%< 3 */
"PKCS#11 no AES service", /*%< 4 */
};
static const char *ids[PK11_R_NRESULTS] = {
"PK11_R_INITFAILED", "PK11_R_NOPROVIDER",
"PK11_R_NORANDOMSERVICE", "PK11_R_NODIGESTSERVICE",
"PK11_R_NOAESSERVICE",
};
#define PK11_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_PK11, PK11_R_NRESULTS,
text, PK11_RESULT_RESULTSET);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_result_register() failed: %u", result);
}
result = isc_result_registerids(ISC_RESULTCLASS_PK11, PK11_R_NRESULTS,
ids, PK11_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 *
pk11_result_totext(isc_result_t result) {
initialize();
return (isc_result_totext(result));
}
void
pk11_result_register(void) {
initialize();
}
+108 -194
View File
@@ -15,22 +15,16 @@
#include <stdlib.h>
#include <isc/lib.h>
#include <isc/once.h>
#include <isc/resultclass.h>
#include <isc/rwlock.h>
#include <isc/util.h>
typedef struct resulttable {
unsigned int base;
unsigned int last;
const char **text;
int set;
ISC_LINK(struct resulttable) link;
} resulttable;
/*
* This file is generated at compile time from the result_*.c files
* found in sibling library source directories:
*/
#include "result_ext.c"
typedef ISC_LIST(resulttable) resulttable_list_t;
static const char *description[ISC_R_NRESULTS] = {
static const char *isc_result_descriptions[ISC_R_NRESULTS] = {
"success", /*%< 0 */
"out of memory", /*%< 1 */
"timed out", /*%< 2 */
@@ -105,200 +99,120 @@ static const char *description[ISC_R_NRESULTS] = {
"ALPN for HTTP/2 failed" /*%< 71 */
};
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_QUEUEFULL",
"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 *isc_result_ids[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_QUEUEFULL",
"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" };
#define ISC_RESULT_RESULTSET 2
#define ISC_RESULT_UNAVAILABLESET 3
static struct {
size_t nresults; /*%< total number of result codes in this class */
const char **description_table; /*%< brief description of the result */
const char **id_table; /*%< result id, e.g. ISC_R_NOPERM */
} const result_classes[ISC_RESULTCLASS_MAX + 1] = {
[ISC_RESULTCLASS_ISC] = { ISC_R_NRESULTS, isc_result_descriptions,
isc_result_ids },
[ISC_RESULTCLASS_DNS] = { DNS_R_NRESULTS, dns_result_descriptions,
dns_result_ids },
[ISC_RESULTCLASS_DST] = { DST_R_NRESULTS, dst_result_descriptions,
dst_result_ids },
[ISC_RESULTCLASS_DNSRCODE] = { DNS_R_NRCODERESULTS,
dns_rcode_descriptions, dns_rcode_ids },
[ISC_RESULTCLASS_ISCCC] = { ISCCC_R_NRESULTS, isccc_result_descriptions,
isccc_result_ids },
[ISC_RESULTCLASS_PK11] = { PK11_R_NRESULTS, pk11_result_descriptions,
pk11_result_ids }
};
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;
static inline const char *
isc_result_from_table(isc_result_t result, bool description) {
uint32_t rclass = ISC_RESULT_CLASS(result);
uint32_t rindex = ISC_RESULT_VALUE(result);
static isc_result_t
register_table(resulttable_list_t *tables, unsigned int base,
unsigned int nresults, const char **text, int set) {
resulttable *table;
REQUIRE(rclass <= ISC_RESULTCLASS_MAX);
REQUIRE(base % ISC_RESULTCLASS_SIZE == 0);
REQUIRE(nresults <= ISC_RESULTCLASS_SIZE);
REQUIRE(text != NULL);
/*
* 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);
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);
if (rindex < result_classes[rclass].nresults) {
return (description ? result_classes[rclass]
.description_table[rindex]
: result_classes[rclass].id_table[rindex]);
}
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);
return ("(result code text not available)");
}
const char *
isc_result_totext(isc_result_t result) {
return (isc_result_tomany_helper(&description_tables, result));
return (isc_result_from_table(result, true));
}
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 (isc_result_from_table(result, false));
}
+90
View File
@@ -0,0 +1,90 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file result_isc.h.in */
ISC_R_SUCCESS = ISC_RESULTCODE_ISC(0), /*%< success */
ISC_R_NOMEMORY = ISC_RESULTCODE_ISC(1), /*%< out of memory */
ISC_R_TIMEDOUT = ISC_RESULTCODE_ISC(2), /*%< timed out */
ISC_R_NOTHREADS = ISC_RESULTCODE_ISC(3), /*%< no available threads */
ISC_R_ADDRNOTAVAIL = ISC_RESULTCODE_ISC(4), /*%< address not available */
ISC_R_ADDRINUSE = ISC_RESULTCODE_ISC(5), /*%< address in use */
ISC_R_NOPERM = ISC_RESULTCODE_ISC(6), /*%< permission denied */
ISC_R_NOCONN = ISC_RESULTCODE_ISC(7), /*%< no pending connections */
ISC_R_NETUNREACH = ISC_RESULTCODE_ISC(8), /*%< network unreachable */
ISC_R_HOSTUNREACH = ISC_RESULTCODE_ISC(9), /*%< host unreachable */
ISC_R_NETDOWN = ISC_RESULTCODE_ISC(10), /*%< network down */
ISC_R_HOSTDOWN = ISC_RESULTCODE_ISC(11), /*%< host down */
ISC_R_CONNREFUSED = ISC_RESULTCODE_ISC(12), /*%< connection refused */
ISC_R_NORESOURCES = ISC_RESULTCODE_ISC(13), /*%< not enough free resources */
ISC_R_EOF = ISC_RESULTCODE_ISC(14), /*%< end of file */
ISC_R_BOUND = ISC_RESULTCODE_ISC(15), /*%< socket already bound */
ISC_R_RELOAD = ISC_RESULTCODE_ISC(16), /*%< reload */
ISC_R_SUSPEND = ISC_R_RELOAD, /*%< alias of 'reload' */
ISC_R_LOCKBUSY = ISC_RESULTCODE_ISC(17), /*%< lock busy */
ISC_R_EXISTS = ISC_RESULTCODE_ISC(18), /*%< already exists */
ISC_R_NOSPACE = ISC_RESULTCODE_ISC(19), /*%< ran out of space */
ISC_R_CANCELED = ISC_RESULTCODE_ISC(20), /*%< operation canceled */
ISC_R_NOTBOUND = ISC_RESULTCODE_ISC(21), /*%< socket is not bound */
ISC_R_SHUTTINGDOWN = ISC_RESULTCODE_ISC(22), /*%< shutting down */
ISC_R_NOTFOUND = ISC_RESULTCODE_ISC(23), /*%< not found */
ISC_R_UNEXPECTEDEND = ISC_RESULTCODE_ISC(24), /*%< unexpected end of input */
ISC_R_FAILURE = ISC_RESULTCODE_ISC(25), /*%< generic failure */
ISC_R_IOERROR = ISC_RESULTCODE_ISC(26), /*%< I/O error */
ISC_R_NOTIMPLEMENTED = ISC_RESULTCODE_ISC(27), /*%< not implemented */
ISC_R_UNBALANCED = ISC_RESULTCODE_ISC(28), /*%< unbalanced parentheses */
ISC_R_NOMORE = ISC_RESULTCODE_ISC(29), /*%< no more */
ISC_R_INVALIDFILE = ISC_RESULTCODE_ISC(30), /*%< invalid file */
ISC_R_BADBASE64 = ISC_RESULTCODE_ISC(31), /*%< bad base64 encoding */
ISC_R_UNEXPECTEDTOKEN = ISC_RESULTCODE_ISC(32), /*%< unexpected token */
ISC_R_QUOTA = ISC_RESULTCODE_ISC(33), /*%< quota reached */
ISC_R_UNEXPECTED = ISC_RESULTCODE_ISC(34), /*%< unexpected error */
ISC_R_ALREADYRUNNING = ISC_RESULTCODE_ISC(35), /*%< already running */
ISC_R_IGNORE = ISC_RESULTCODE_ISC(36), /*%< ignore */
ISC_R_MASKNONCONTIG = ISC_RESULTCODE_ISC(37), /*%< addr mask not contiguous */
ISC_R_FILENOTFOUND = ISC_RESULTCODE_ISC(38), /*%< file not found */
ISC_R_FILEEXISTS = ISC_RESULTCODE_ISC(39), /*%< file already exists */
ISC_R_NOTCONNECTED = ISC_RESULTCODE_ISC(40), /*%< socket is not connected */
ISC_R_RANGE = ISC_RESULTCODE_ISC(41), /*%< out of range */
ISC_R_NOENTROPY = ISC_RESULTCODE_ISC(42), /*%< out of entropy */
ISC_R_MULTICAST = ISC_RESULTCODE_ISC(43), /*%< invalid use of multicast */
ISC_R_NOTFILE = ISC_RESULTCODE_ISC(44), /*%< not a file */
ISC_R_NOTDIRECTORY = ISC_RESULTCODE_ISC(45), /*%< not a directory */
ISC_R_QUEUEFULL = ISC_RESULTCODE_ISC(46), /*%< queue is full */
ISC_R_FAMILYMISMATCH = ISC_RESULTCODE_ISC(47), /*%< address family mismatch */
ISC_R_FAMILYNOSUPPORT = ISC_RESULTCODE_ISC(48), /*%< AF not supported */
ISC_R_BADHEX = ISC_RESULTCODE_ISC(49), /*%< bad hex encoding */
ISC_R_TOOMANYOPENFILES = ISC_RESULTCODE_ISC(50), /*%< too many open files */
ISC_R_NOTBLOCKING = ISC_RESULTCODE_ISC(51), /*%< not blocking */
ISC_R_UNBALANCEDQUOTES = ISC_RESULTCODE_ISC(52), /*%< unbalanced quotes */
ISC_R_INPROGRESS = ISC_RESULTCODE_ISC(53), /*%< operation in progress */
ISC_R_CONNECTIONRESET = ISC_RESULTCODE_ISC(54), /*%< connection reset */
ISC_R_SOFTQUOTA = ISC_RESULTCODE_ISC(55), /*%< soft quota reached */
ISC_R_BADNUMBER = ISC_RESULTCODE_ISC(56), /*%< not a valid number */
ISC_R_DISABLED = ISC_RESULTCODE_ISC(57), /*%< disabled */
ISC_R_MAXSIZE = ISC_RESULTCODE_ISC(58), /*%< max size */
ISC_R_BADADDRESSFORM = ISC_RESULTCODE_ISC(59), /*%< invalid address format */
ISC_R_BADBASE32 = ISC_RESULTCODE_ISC(60), /*%< bad base32 encoding */
ISC_R_UNSET = ISC_RESULTCODE_ISC(61), /*%< unset */
ISC_R_MULTIPLE = ISC_RESULTCODE_ISC(62), /*%< multiple */
ISC_R_WOULDBLOCK = ISC_RESULTCODE_ISC(63), /*%< would block */
ISC_R_COMPLETE = ISC_RESULTCODE_ISC(64), /*%< complete */
ISC_R_CRYPTOFAILURE = ISC_RESULTCODE_ISC(65), /*%< cryptography library failure */
ISC_R_DISCQUOTA = ISC_RESULTCODE_ISC(66), /*%< disc quota */
ISC_R_DISCFULL = ISC_RESULTCODE_ISC(67), /*%< disc full */
ISC_R_DEFAULT = ISC_RESULTCODE_ISC(68), /*%< default */
ISC_R_IPV4PREFIX = ISC_RESULTCODE_ISC(69), /*%< IPv4 prefix */
ISC_R_TLSERROR = ISC_RESULTCODE_ISC(70), /*%< TLS error */
ISC_R_HTTP2ALPNERROR = ISC_RESULTCODE_ISC(71), /*%< ALPN for HTTP/2 failed */
/*% Not a result code: the number of results. */
#define ISC_R_NRESULTS 72
+24
View File
@@ -0,0 +1,24 @@
/*
* 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.
*/
static const char *pk11_result_descriptions[PK11_R_NRESULTS] = {
"PKCS#11 initialization failed", /*%< 0 */
"no PKCS#11 provider", /*%< 1 */
"PKCS#11 no random service", /*%< 2 */
"PKCS#11 no digist service", /*%< 3 */
"PKCS#11 no AES service", /*%< 4 */
};
static const char *pk11_result_ids[PK11_R_NRESULTS] = {
"PK11_R_INITFAILED", "PK11_R_NOPROVIDER",
"PK11_R_NORANDOMSERVICE", "PK11_R_NODIGESTSERVICE",
"PK11_R_NOAESSERVICE",
};
+21
View File
@@ -0,0 +1,21 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file result_pk11.h.in */
PK11_R_INITFAILED = ISC_RESULTCODE_PK11(0),
PK11_R_NOPROVIDER = ISC_RESULTCODE_PK11(1),
PK11_R_NORANDOMSERVICE = ISC_RESULTCODE_PK11(2),
PK11_R_NODIGESTSERVICE = ISC_RESULTCODE_PK11(3),
PK11_R_NOAESSERVICE = ISC_RESULTCODE_PK11(4),
#define PK11_R_NRESULTS 5 /* Number of results */
+10 -7
View File
@@ -23,8 +23,6 @@
#include <isc/result.h>
#include <isc/util.h>
#include <pk11/result.h>
/* convert result to identifier string */
static void
isc_result_toid_test(void **state) {
@@ -58,12 +56,13 @@ static void
tables(void **state) {
const char *str;
isc_result_t result;
size_t i;
UNUSED(state);
pk11_result_register();
for (i = 0; i < ISC_R_NRESULTS; i++) {
result = ISC_RESULTCODE_ISC(i);
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 "
@@ -75,6 +74,8 @@ tables(void **state) {
"available)");
}
result = ISC_RESULTCODE_ISC(i);
str = isc_result_toid(result);
assert_non_null(str);
assert_string_equal(str, "(result code text not available)");
@@ -83,9 +84,9 @@ tables(void **state) {
assert_non_null(str);
assert_string_equal(str, "(result code text not available)");
for (result = ISC_RESULTCLASS_PK11;
result < (ISC_RESULTCLASS_PK11 + PK11_R_NRESULTS); result++)
{
for (i = 0; i < PK11_R_NRESULTS; i++) {
result = ISC_RESULTCODE_PK11(i);
str = isc_result_toid(result);
assert_non_null(str);
assert_string_not_equal(str, "(result code text not "
@@ -97,6 +98,8 @@ tables(void **state) {
"available)");
}
result = ISC_RESULTCODE_PK11(i);
str = isc_result_toid(result);
assert_non_null(str);
assert_string_equal(str, "(result code text not available)");
-3
View File
@@ -545,8 +545,6 @@ isc_region_compare
isc_resource_getcurlimit
isc_resource_getlimit
isc_resource_setlimit
isc_result_register
isc_result_registerids
isc_result_toid
isc_result_totext
isc_rwlock_destroy
@@ -744,7 +742,6 @@ pk11_mem_get
pk11_mem_put
pk11_numbits
pk11_parse_uri
pk11_result_register
pk11_result_totext
pk11_return_session
pk11_set_lib_name
+3 -3
View File
@@ -203,6 +203,9 @@
<ClInclude Include="..\include\isc\result.h">
<Filter>Library Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\isc\result_ext.h">
<Filter>Library Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\isc\resultclass.h">
<Filter>Library Header Files</Filter>
</ClInclude>
@@ -633,9 +636,6 @@
<ClCompile Include="..\pk11.c">
<Filter>Library Source Files</Filter>
</ClCompile>
<ClCompile Include="..\pk11_result.c">
<Filter>Library Source Files</Filter>
</ClCompile>
@END PKCS11
</ItemGroup>
</Project>
+1 -1
View File
@@ -324,6 +324,7 @@ copy InstallFiles ..\Build\Release\
<ClInclude Include="..\include\isc\region.h" />
<ClInclude Include="..\include\isc\resource.h" />
<ClInclude Include="..\include\isc\result.h" />
<ClInclude Include="..\include\isc\result_ext.h" />
<ClInclude Include="..\include\isc\resultclass.h" />
<ClInclude Include="..\include\isc\rwlock.h" />
<ClInclude Include="..\include\isc\safe.h" />
@@ -457,7 +458,6 @@ copy InstallFiles ..\Build\Release\
<ClCompile Include="..\utf8.c" />
@IF PKCS11
<ClCompile Include="..\pk11.c" />
<ClCompile Include="..\pk11_result.c" />
@END PKCS11
<ClCompile Include="condition.c" />
<ClCompile Include="dir.c" />
+4 -2
View File
@@ -2,6 +2,10 @@ include $(top_srcdir)/Makefile.top
lib_LTLIBRARIES = libisccc.la
EXTRA_DIST = \
result_isccc.h.in \
result_isccc.c.in
libisccc_ladir = $(includedir)/isccc
libisccc_la_HEADERS = \
include/isccc/alist.h \
@@ -9,7 +13,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 +25,6 @@ libisccc_la_SOURCES = \
base64.c \
cc.c \
ccmsg.c \
result.c \
sexpr.c \
symtab.c
-1
View File
@@ -33,7 +33,6 @@
#include <isc/print.h>
#include <isccc/alist.h>
#include <isccc/result.h>
#include <isccc/sexpr.h>
#include <isccc/util.h>
-1
View File
@@ -31,7 +31,6 @@
#include <isc/result.h>
#include <isccc/base64.h>
#include <isccc/result.h>
#include <isccc/util.h>
isc_result_t
-1
View File
@@ -42,7 +42,6 @@
#include <isccc/alist.h>
#include <isccc/base64.h>
#include <isccc/cc.h>
#include <isccc/result.h>
#include <isccc/sexpr.h>
#include <isccc/symtab.h>
#include <isccc/symtype.h>
-65
View File
@@ -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 <isc/lang.h>
#include <isc/result.h>
#include <isc/resultclass.h>
#include <isccc/types.h>
/*% 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 */
-85
View File
@@ -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 <isc/once.h>
#include <isc/util.h>
#include <isccc/result.h>
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();
}
+26
View File
@@ -0,0 +1,26 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file */
static const char *isccc_result_descriptions[ISCCC_R_NRESULTS] = {
"unknown version", /* 1 */
"syntax error", /* 2 */
"bad auth", /* 3 */
"expired", /* 4 */
"clock skew", /* 5 */
"duplicate" /* 6 */
};
static const char *isccc_result_ids[ISCCC_R_NRESULTS] = {
"ISCCC_R_UNKNOWNVERSION", "ISCCC_R_SYNTAX", "ISCCC_R_BADAUTH",
"ISCCC_R_EXPIRED", "ISCCC_R_CLOCKSKEW", "ISCCC_R_DUPLICATE",
};
+28
View File
@@ -0,0 +1,28 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file result_isccc.h.in */
/*% Unknown Version */
ISCCC_R_UNKNOWNVERSION = ISC_RESULTCODE_ISCCC(0),
/*% Syntax Error */
ISCCC_R_SYNTAX = ISC_RESULTCODE_ISCCC(1),
/*% Bad Authorization */
ISCCC_R_BADAUTH = ISC_RESULTCODE_ISCCC(2),
/*% Expired */
ISCCC_R_EXPIRED = ISC_RESULTCODE_ISCCC(3),
/*% Clock Skew */
ISCCC_R_CLOCKSKEW = ISC_RESULTCODE_ISCCC(4),
/*% Duplicate */
ISCCC_R_DUPLICATE = ISC_RESULTCODE_ISCCC(5),
#define ISCCC_R_NRESULTS 6 /*%< Number of results */
-1
View File
@@ -33,7 +33,6 @@
#include <isc/magic.h>
#include <isc/string.h>
#include <isccc/result.h>
#include <isccc/symtab.h>
#include <isccc/util.h>

Some files were not shown because too many files have changed in this diff Show More