]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lua: extended_error const table
authorTomas Krizek <tomas.krizek@nic.cz>
Mon, 22 Nov 2021 16:53:32 +0000 (17:53 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 21 Dec 2021 14:02:08 +0000 (15:02 +0100)
daemon/lua/kres.lua
lib/README.rst

index 3b00c2011ba8668567f7d79bb9ca6262743564c0..6a2c00e1aa3894836b4588f19d56239c3347b078 100644 (file)
@@ -203,6 +203,34 @@ local const_rank = {
        AUTH = 16,
        SECURE = 32
 }
+local const_extended_error = {
+       NONE = -1,
+       OTHER = 0,
+       DNSKEY_ALG = 1,
+       DS_DIGEST = 2,
+       STALE = 3,
+       FORGED = 4,
+       INDETERMINATE = 5,
+       BOGUS = 6,
+       SIG_EXPIRED = 7,
+       SIG_NOTYET = 8,
+       DNSKEY_MISS = 9,
+       RRSIG_MISS = 10,
+       DNSKEY_BIT = 11,
+       NSEC_MISS = 12,
+       CACHED_ERR = 13,
+       NOT_READY = 14,
+       BLOCKED = 15,
+       CENSORED = 16,
+       FILTERED = 17,
+       PROHIBITED = 18,
+       STALE_NXD = 19,
+       NOTAUTH = 20,
+       NOTSUP = 21,
+       NREACH_AUTH = 22,
+       NETWORK = 23,
+       INV_DATA = 24,
+}
 
 -- Constant tables
 local const_class_str = itable(const_class)
@@ -211,6 +239,7 @@ local const_rcode_str = itable(const_rcode)
 local const_opcode_str = itable(const_opcode)
 local const_section_str = itable(const_section)
 local const_rank_str = itable(const_rank)
+local const_extended_error_str = itable(const_extended_error)
 
 -- Metatype for RR types to allow anonymous types
 setmetatable(const_type, {
@@ -1026,6 +1055,7 @@ kres = {
        rcode = const_rcode,
        opcode = const_opcode,
        rank = const_rank,
+       extended_error = const_extended_error,
 
        -- Constants to strings
        tostring = {
@@ -1035,6 +1065,7 @@ kres = {
                rcode = const_rcode_str,
                opcode = const_opcode_str,
                rank = const_rank_str,
+               extended_eror = const_extended_error_str,
        },
 
        -- Create a struct kr_qflags from a single flag name or a list of names.
index 766634c768cec2cc144af9bd945a48dff3ef69a7..1c8cf7b22622b44406e599cfdaf8d9ad0534ef6a 100644 (file)
@@ -152,6 +152,7 @@ Elementary types and constants
 * DNS classes are in ``kres.class`` table, e.g. ``kres.class.IN`` for Internet class.
 * DNS types are in  ``kres.type`` table, e.g. ``kres.type.AAAA`` for AAAA type.
 * DNS rcodes types are in ``kres.rcode`` table, e.g. ``kres.rcode.NOERROR``.
+* Extended DNS error codes are in  ``kres.extended_error`` table, e.g. ``kres.extended_error.BLOCKED``.
 * Packet sections (QUESTION, ANSWER, AUTHORITY, ADDITIONAL) are in the ``kres.section`` table.
 
 Working with domain names