From: Tomas Krizek Date: Mon, 22 Nov 2021 16:53:32 +0000 (+0100) Subject: lua: extended_error const table X-Git-Tag: v5.5.0~26^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36382ea7fa0ea992fd26a0576b3d7f05a298aa77;p=thirdparty%2Fknot-resolver.git lua: extended_error const table --- diff --git a/daemon/lua/kres.lua b/daemon/lua/kres.lua index 3b00c2011..6a2c00e1a 100644 --- a/daemon/lua/kres.lua +++ b/daemon/lua/kres.lua @@ -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. diff --git a/lib/README.rst b/lib/README.rst index 766634c76..1c8cf7b22 100644 --- a/lib/README.rst +++ b/lib/README.rst @@ -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