From: Vladimír Čunát Date: Wed, 26 Apr 2017 09:39:23 +0000 (+0200) Subject: kr_qflags: don't use X-macros anymore X-Git-Tag: v1.4.0~20^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba779a34aaff9c025038d2a779e12a895c2abca9;p=thirdparty%2Fknot-resolver.git kr_qflags: don't use X-macros anymore We no longer need it and it's just confusing, e.g. the bit assignments were ignored now. --- diff --git a/lib/rplan.h b/lib/rplan.h index 633ae4875..af35bd203 100644 --- a/lib/rplan.h +++ b/lib/rplan.h @@ -24,47 +24,42 @@ #include "lib/zonecut.h" #include "lib/nsrep.h" -#define QUERY_FLAGS(X) \ - X(NO_MINIMIZE, 1 << 0) /**< Don't minimize QNAME. */ \ - X(NO_THROTTLE, 1 << 1) /**< No query/slow NS throttling. */ \ - X(NO_IPV6, 1 << 2) /**< Disable IPv6 */ \ - X(NO_IPV4, 1 << 3) /**< Disable IPv4 */ \ - X(TCP, 1 << 4) /**< Use TCP for this query. */ \ - X(RESOLVED, 1 << 5) /**< Query is resolved. */ \ - X(AWAIT_IPV4, 1 << 6) /**< Query is waiting for A address. */ \ - X(AWAIT_IPV6, 1 << 7) /**< Query is waiting for AAAA address. */ \ - X(AWAIT_CUT, 1 << 8) /**< Query is waiting for zone cut lookup */ \ - X(SAFEMODE, 1 << 9) /**< Don't use fancy stuff (EDNS, 0x20, ...) */ \ - X(CACHED, 1 << 10) /**< Query response is cached. */ \ - X(NO_CACHE, 1 << 11) /**< No cache for lookup; exception: finding NSs and subqueries. */ \ - X(EXPIRING, 1 << 12) /**< Query response is cached, but expiring. */ \ - X(ALLOW_LOCAL, 1 << 13) /**< Allow queries to local or private address ranges. */ \ - X(DNSSEC_WANT, 1 << 14) /**< Want DNSSEC secured answer; exception: +cd, \ - * i.e. knot_wire_set_cd(request->answer->wire). */ \ - X(DNSSEC_BOGUS, 1 << 15) /**< Query response is DNSSEC bogus. */ \ - X(DNSSEC_INSECURE, 1 << 16) /**< Query response is DNSSEC insecure. */ \ - X(STUB, 1 << 17) /**< Stub resolution, accept received answer as solved. */ \ - X(ALWAYS_CUT, 1 << 18) /**< Always recover zone cut (even if cached). */ \ - X(DNSSEC_WEXPAND, 1 << 19) /**< Query response has wildcard expansion. */ \ - X(PERMISSIVE, 1 << 20) /**< Permissive resolver mode. */ \ - X(STRICT, 1 << 21) /**< Strict resolver mode. */ \ - X(BADCOOKIE_AGAIN, 1 << 22) /**< Query again because bad cookie returned. */ \ - X(CNAME, 1 << 23) /**< Query response contains CNAME in answer section. */ \ - X(REORDER_RR, 1 << 24) /**< Reorder cached RRs. */ \ - X(TRACE, 1 << 25) /**< Log answer with kr_verbose_log(), unless -DNDEBUG. */ \ - X(NO_0X20, 1 << 26) /**< Disable query case randomization . */ \ - X(DNSSEC_NODS, 1 << 27) /**< DS non-existance is proven */ \ - X(DNSSEC_OPTOUT, 1 << 28) /**< Closest encloser proof has optout */ \ - X(NONAUTH, 1 << 29) /**< Non-authoritative in-bailiwick records are enough. - * TODO: utilize this also outside cache. */ \ - X(FORWARD, 1 << 30) /**< Forward all queries to upstream; validate answers */ \ - X(DNS64_MARK, 1u << 31) /**< Internal to ../modules/dns64/dns64.lua */ - /** Query flags */ struct kr_qflags { - #define X(flag, val) bool flag : 1; - QUERY_FLAGS(X) - #undef X + bool NO_MINIMIZE : 1; /**< Don't minimize QNAME. */ + bool NO_THROTTLE : 1; /**< No query/slow NS throttling. */ + bool NO_IPV6 : 1; /**< Disable IPv6 */ + bool NO_IPV4 : 1; /**< Disable IPv4 */ + bool TCP : 1; /**< Use TCP for this query. */ + bool RESOLVED : 1; /**< Query is resolved. */ + bool AWAIT_IPV4 : 1; /**< Query is waiting for A address. */ + bool AWAIT_IPV6 : 1; /**< Query is waiting for AAAA address. */ + bool AWAIT_CUT : 1; /**< Query is waiting for zone cut lookup */ + bool SAFEMODE : 1; /**< Don't use fancy stuff (EDNS, 0x20, ...) */ + bool CACHED : 1; /**< Query response is cached. */ + bool NO_CACHE : 1; /**< No cache for lookup; exception: finding NSs and subqueries. */ + bool EXPIRING : 1; /**< Query response is cached, but expiring. */ + bool ALLOW_LOCAL : 1; /**< Allow queries to local or private address ranges. */ + bool DNSSEC_WANT : 1; /**< Want DNSSEC secured answer; exception: +cd, + * i.e. knot_wire_set_cd(request->answer->wire). */ + bool DNSSEC_BOGUS : 1; /**< Query response is DNSSEC bogus. */ + bool DNSSEC_INSECURE : 1;/**< Query response is DNSSEC insecure. */ + bool STUB : 1; /**< Stub resolution, accept received answer as solved. */ + bool ALWAYS_CUT : 1; /**< Always recover zone cut (even if cached). */ + bool DNSSEC_WEXPAND : 1; /**< Query response has wildcard expansion. */ + bool PERMISSIVE : 1; /**< Permissive resolver mode. */ + bool STRICT : 1; /**< Strict resolver mode. */ + bool BADCOOKIE_AGAIN : 1;/**< Query again because bad cookie returned. */ + bool CNAME : 1; /**< Query response contains CNAME in answer section. */ + bool REORDER_RR : 1; /**< Reorder cached RRs. */ + bool TRACE : 1; /**< Log answer with kr_verbose_log(), unless -DNDEBUG. */ + bool NO_0X20 : 1; /**< Disable query case randomization . */ + bool DNSSEC_NODS : 1; /**< DS non-existance is proven */ + bool DNSSEC_OPTOUT : 1; /**< Closest encloser proof has optout */ + bool NONAUTH : 1; /**< Non-authoritative in-bailiwick records are enough. + * TODO: utilize this also outside cache. */ + bool FORWARD : 1; /**< Forward all queries to upstream; validate answers. */ + bool DNS64_MARK : 1; /**< Internal mark for dns64 module. */ }; /** Combine flags together. This means set union for simple flags. */