]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #576: [FR] UB_* error codes in unbound.h
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 29 Nov 2021 15:10:45 +0000 (16:10 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 29 Nov 2021 15:10:45 +0000 (16:10 +0100)
doc/Changelog
libunbound/context.h
libunbound/unbound.h

index e1bbb6a7e6bdeb26fc8c0b8b9f56ac2bec3d1ac6..04c495e970c2923f9f075c5d8878cf426c116b97 100644 (file)
@@ -5,6 +5,7 @@
        - Fix #574: unbound-checkconf reports fatal error if interface names
          are used as value for interfaces:
        - Fix #574: Review fixes for it.
+       - Fix #576: [FR] UB_* error codes in unbound.h
 
 15 November 2021: Tom
        - Improve EDNS option handling, now also works for synthesised
index 78f8731e236ed4e9e301d17d3f364415cdab0ad0..c0c86fb526978e0f142cdd4bb9e367a98e5b859a 100644 (file)
@@ -176,35 +176,6 @@ struct ctx_query {
        struct ub_result* res;
 };
 
-/**
- * The error constants
- */
-enum ub_ctx_err {
-       /** no error */
-       UB_NOERROR = 0,
-       /** socket operation. Set to -1, so that if an error from _fd() is
-        * passed (-1) it gives a socket error. */
-       UB_SOCKET = -1,
-       /** alloc failure */
-       UB_NOMEM = -2,
-       /** syntax error */
-       UB_SYNTAX = -3,
-       /** DNS service failed */
-       UB_SERVFAIL = -4,
-       /** fork() failed */
-       UB_FORKFAIL = -5,
-       /** cfg change after finalize() */
-       UB_AFTERFINAL = -6,
-       /** initialization failed (bad settings) */
-       UB_INITFAIL = -7,
-       /** error in pipe communication with async bg worker */
-       UB_PIPE = -8,
-       /** error reading from file (resolv.conf) */
-       UB_READFILE = -9,
-       /** error async_id does not exist or result already been delivered */
-       UB_NOID = -10
-};
-
 /**
  * Command codes for libunbound pipe.
  *
index 2a12511bde3937957458ede2c1ecd53bc73cf537..ee8558759065d4fc8f723217281cde7d55a0cd03 100644 (file)
@@ -232,6 +232,35 @@ struct ub_result {
  */
 typedef void (*ub_callback_type)(void*, int, struct ub_result*);
 
+/**
+ * The error constants
+ */
+enum ub_ctx_err {
+       /** no error */
+       UB_NOERROR = 0,
+       /** socket operation. Set to -1, so that if an error from _fd() is
+        * passed (-1) it gives a socket error. */
+       UB_SOCKET = -1,
+       /** alloc failure */
+       UB_NOMEM = -2,
+       /** syntax error */
+       UB_SYNTAX = -3,
+       /** DNS service failed */
+       UB_SERVFAIL = -4,
+       /** fork() failed */
+       UB_FORKFAIL = -5,
+       /** cfg change after finalize() */
+       UB_AFTERFINAL = -6,
+       /** initialization failed (bad settings) */
+       UB_INITFAIL = -7,
+       /** error in pipe communication with async bg worker */
+       UB_PIPE = -8,
+       /** error reading from file (resolv.conf) */
+       UB_READFILE = -9,
+       /** error async_id does not exist or result already been delivered */
+       UB_NOID = -10
+};
+
 /**
  * Create a resolving and validation context.
  * The information from /etc/resolv.conf and /etc/hosts is not utilised by
@@ -563,6 +592,7 @@ void ub_resolve_free(struct ub_result* result);
 /** 
  * Convert error value to a human readable string.
  * @param err: error code from one of the libunbound functions.
+ *     The error codes are from the type enum ub_ctx_err.
  * @return pointer to constant text string, zero terminated.
  */
 const char* ub_strerror(int err);