diff options
Diffstat (limited to 'external/unbound/util')
51 files changed, 11778 insertions, 4990 deletions
diff --git a/external/unbound/util/alloc.c b/external/unbound/util/alloc.c index 05d2fa362..2c6e1a23f 100644 --- a/external/unbound/util/alloc.c +++ b/external/unbound/util/alloc.c @@ -52,7 +52,7 @@ /** setup new special type */ static void -alloc_setup_special(alloc_special_t* t) +alloc_setup_special(alloc_special_type* t) { memset(t, 0, sizeof(*t)); lock_rw_init(&t->entry.lock); @@ -64,12 +64,13 @@ alloc_setup_special(alloc_special_t* t) * @param alloc: the structure to fill up. */ static void -prealloc(struct alloc_cache* alloc) +prealloc_setup(struct alloc_cache* alloc) { - alloc_special_t* p; + alloc_special_type* p; int i; for(i=0; i<ALLOC_SPECIAL_MAX; i++) { - if(!(p = (alloc_special_t*)malloc(sizeof(alloc_special_t)))) { + if(!(p = (alloc_special_type*)malloc( + sizeof(alloc_special_type)))) { log_err("prealloc: out of memory"); return; } @@ -128,7 +129,7 @@ alloc_init(struct alloc_cache* alloc, struct alloc_cache* super, void alloc_clear(struct alloc_cache* alloc) { - alloc_special_t* p, *np; + alloc_special_type* p, *np; struct regional* r, *nr; if(!alloc) return; @@ -187,10 +188,10 @@ alloc_get_id(struct alloc_cache* alloc) return id; } -alloc_special_t* +alloc_special_type* alloc_special_obtain(struct alloc_cache* alloc) { - alloc_special_t* p; + alloc_special_type* p; log_assert(alloc); /* see if in local cache */ if(alloc->quar) { @@ -216,8 +217,8 @@ alloc_special_obtain(struct alloc_cache* alloc) } } /* allocate new */ - prealloc(alloc); - if(!(p = (alloc_special_t*)malloc(sizeof(alloc_special_t)))) { + prealloc_setup(alloc); + if(!(p = (alloc_special_type*)malloc(sizeof(alloc_special_type)))) { log_err("alloc_special_obtain: out of memory"); return NULL; } @@ -228,10 +229,10 @@ alloc_special_obtain(struct alloc_cache* alloc) /** push mem and some more items to the super */ static void -pushintosuper(struct alloc_cache* alloc, alloc_special_t* mem) +pushintosuper(struct alloc_cache* alloc, alloc_special_type* mem) { int i; - alloc_special_t *p = alloc->quar; + alloc_special_type *p = alloc->quar; log_assert(p); log_assert(alloc && alloc->super && alloc->num_quar >= ALLOC_SPECIAL_MAX); @@ -253,7 +254,7 @@ pushintosuper(struct alloc_cache* alloc, alloc_special_t* mem) } void -alloc_special_release(struct alloc_cache* alloc, alloc_special_t* mem) +alloc_special_release(struct alloc_cache* alloc, alloc_special_type* mem) { log_assert(alloc); if(!mem) @@ -286,12 +287,12 @@ alloc_stats(struct alloc_cache* alloc) size_t alloc_get_mem(struct alloc_cache* alloc) { - alloc_special_t* p; + alloc_special_type* p; size_t s = sizeof(*alloc); if(!alloc->super) { lock_quick_lock(&alloc->lock); /* superalloc needs locking */ } - s += sizeof(alloc_special_t) * alloc->num_quar; + s += sizeof(alloc_special_type) * alloc->num_quar; for(p = alloc->quar; p; p = alloc_special_next(p)) { s += lock_get_mem(&p->entry.lock); } diff --git a/external/unbound/util/alloc.h b/external/unbound/util/alloc.h index 43fc30f98..9839a4550 100644 --- a/external/unbound/util/alloc.h +++ b/external/unbound/util/alloc.h @@ -53,11 +53,11 @@ struct ub_packed_rrset_key; struct regional; /** The special type, packed rrset. Not allowed to be used for other memory */ -typedef struct ub_packed_rrset_key alloc_special_t; +typedef struct ub_packed_rrset_key alloc_special_type; /** clean the special type. Pass pointer. */ #define alloc_special_clean(x) (x)->id = 0; /** access next pointer. (in available spot). Pass pointer. */ -#define alloc_special_next(x) ((alloc_special_t*)((x)->entry.overflow_next)) +#define alloc_special_next(x) ((alloc_special_type*)((x)->entry.overflow_next)) /** set next pointer. (in available spot). Pass pointers. */ #define alloc_set_special_next(x, y) \ ((x)->entry.overflow_next) = (struct lruhash_entry*)(y); @@ -71,11 +71,11 @@ typedef struct ub_packed_rrset_key alloc_special_t; */ struct alloc_cache { /** lock, only used for the super. */ - lock_quick_t lock; + lock_quick_type lock; /** global allocator above this one. NULL for none (malloc/free) */ struct alloc_cache* super; /** singly linked lists of special type. These are free for use. */ - alloc_special_t* quar; + alloc_special_type* quar; /** number of items in quarantine. */ size_t num_quar; /** thread number for id creation */ @@ -116,20 +116,20 @@ void alloc_init(struct alloc_cache* alloc, struct alloc_cache* super, void alloc_clear(struct alloc_cache* alloc); /** - * Get a new special_t element. + * Get a new special_type element. * @param alloc: where to alloc it. * @return: memory block. Will not return NULL (instead fatal_exit). * The block is zeroed. */ -alloc_special_t* alloc_special_obtain(struct alloc_cache* alloc); +alloc_special_type* alloc_special_obtain(struct alloc_cache* alloc); /** - * Return special_t back to pool. + * Return special_type back to pool. * The block is cleaned up (zeroed) which also invalidates the ID inside. * @param alloc: where to alloc it. * @param mem: block to free. */ -void alloc_special_release(struct alloc_cache* alloc, alloc_special_t* mem); +void alloc_special_release(struct alloc_cache* alloc, alloc_special_type* mem); /** * Set ID number of special type to a fresh new ID number. diff --git a/external/unbound/util/as112.c b/external/unbound/util/as112.c new file mode 100644 index 000000000..6ee694046 --- /dev/null +++ b/external/unbound/util/as112.c @@ -0,0 +1,143 @@ +/* + * util/as112.c - list of local zones. + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * + * This file provides a list of lan zones. + */ + +#include "util/as112.h" + +static const char* as112_zone_array[] = { + "10.in-addr.arpa.", + "16.172.in-addr.arpa.", + "17.172.in-addr.arpa.", + "18.172.in-addr.arpa.", + "19.172.in-addr.arpa.", + "20.172.in-addr.arpa.", + "21.172.in-addr.arpa.", + "22.172.in-addr.arpa.", + "23.172.in-addr.arpa.", + "24.172.in-addr.arpa.", + "25.172.in-addr.arpa.", + "26.172.in-addr.arpa.", + "27.172.in-addr.arpa.", + "28.172.in-addr.arpa.", + "29.172.in-addr.arpa.", + "30.172.in-addr.arpa.", + "31.172.in-addr.arpa.", + "168.192.in-addr.arpa.", + "0.in-addr.arpa.", + "64.100.in-addr.arpa.", + "65.100.in-addr.arpa.", + "66.100.in-addr.arpa.", + "67.100.in-addr.arpa.", + "68.100.in-addr.arpa.", + "69.100.in-addr.arpa.", + "70.100.in-addr.arpa.", + "71.100.in-addr.arpa.", + "72.100.in-addr.arpa.", + "73.100.in-addr.arpa.", + "74.100.in-addr.arpa.", + "75.100.in-addr.arpa.", + "76.100.in-addr.arpa.", + "77.100.in-addr.arpa.", + "78.100.in-addr.arpa.", + "79.100.in-addr.arpa.", + "80.100.in-addr.arpa.", + "81.100.in-addr.arpa.", + "82.100.in-addr.arpa.", + "83.100.in-addr.arpa.", + "84.100.in-addr.arpa.", + "85.100.in-addr.arpa.", + "86.100.in-addr.arpa.", + "87.100.in-addr.arpa.", + "88.100.in-addr.arpa.", + "89.100.in-addr.arpa.", + "90.100.in-addr.arpa.", + "91.100.in-addr.arpa.", + "92.100.in-addr.arpa.", + "93.100.in-addr.arpa.", + "94.100.in-addr.arpa.", + "95.100.in-addr.arpa.", + "96.100.in-addr.arpa.", + "97.100.in-addr.arpa.", + "98.100.in-addr.arpa.", + "99.100.in-addr.arpa.", + "100.100.in-addr.arpa.", + "101.100.in-addr.arpa.", + "102.100.in-addr.arpa.", + "103.100.in-addr.arpa.", + "104.100.in-addr.arpa.", + "105.100.in-addr.arpa.", + "106.100.in-addr.arpa.", + "107.100.in-addr.arpa.", + "108.100.in-addr.arpa.", + "109.100.in-addr.arpa.", + "110.100.in-addr.arpa.", + "111.100.in-addr.arpa.", + "112.100.in-addr.arpa.", + "113.100.in-addr.arpa.", + "114.100.in-addr.arpa.", + "115.100.in-addr.arpa.", + "116.100.in-addr.arpa.", + "117.100.in-addr.arpa.", + "118.100.in-addr.arpa.", + "119.100.in-addr.arpa.", + "120.100.in-addr.arpa.", + "121.100.in-addr.arpa.", + "122.100.in-addr.arpa.", + "123.100.in-addr.arpa.", + "124.100.in-addr.arpa.", + "125.100.in-addr.arpa.", + "126.100.in-addr.arpa.", + "127.100.in-addr.arpa.", + "254.169.in-addr.arpa.", + "2.0.192.in-addr.arpa.", + "100.51.198.in-addr.arpa.", + "113.0.203.in-addr.arpa.", + "255.255.255.255.in-addr.arpa.", + "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.", + "d.f.ip6.arpa.", + "8.e.f.ip6.arpa.", + "9.e.f.ip6.arpa.", + "a.e.f.ip6.arpa.", + "b.e.f.ip6.arpa.", + "8.b.d.0.1.0.0.2.ip6.arpa.", + 0 +}; + +const char** as112_zones = as112_zone_array; diff --git a/external/unbound/util/as112.h b/external/unbound/util/as112.h new file mode 100644 index 000000000..7d0329e82 --- /dev/null +++ b/external/unbound/util/as112.h @@ -0,0 +1,57 @@ +/* + * util/as112.c - list of local zones. + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * + * This file provides a list of lan zones + */ + +#ifndef UTIL_AS112_H +#define UTIL_AS112_H + +/** + * Array of text-format domain names of the AS112 zones. + * The array ends with NULL. "AS112" is a service on the internet that + * that this array is named after. The names in this list (or some of them) + * are null-routed by this service to avoid load on central servers caused by + * mistaken lookups for local content on the global internet. + * + * This is the list of names that unbound should not normally be sending + * on towards the internet, because they are local-use. + */ +extern const char** as112_zones; + +#endif diff --git a/external/unbound/util/config_file.c b/external/unbound/util/config_file.c index cc7d99086..af176929d 100644 --- a/external/unbound/util/config_file.c +++ b/external/unbound/util/config_file.c @@ -62,6 +62,9 @@ #ifdef HAVE_GLOB_H # include <glob.h> #endif +#ifdef CLIENT_SUBNET +#include "edns-subnet/edns-subnet.h" +#endif #ifdef HAVE_PWD_H #include <pwd.h> #endif @@ -98,13 +101,17 @@ config_create(void) cfg->do_udp = 1; cfg->do_tcp = 1; cfg->tcp_upstream = 0; + cfg->tcp_mss = 0; + cfg->outgoing_tcp_mss = 0; cfg->ssl_service_key = NULL; cfg->ssl_service_pem = NULL; cfg->ssl_port = 853; cfg->ssl_upstream = 0; cfg->use_syslog = 1; + cfg->log_identity = NULL; /* changed later with argv[0] */ cfg->log_time_ascii = 0; cfg->log_queries = 0; + cfg->log_replies = 0; #ifndef USE_WINSOCK # ifdef USE_MINI_EVENT /* select max 1024 sockets */ @@ -155,18 +162,28 @@ config_create(void) cfg->donotqueryaddrs = NULL; cfg->donotquery_localhost = 1; cfg->root_hints = NULL; + cfg->use_systemd = 0; cfg->do_daemonize = 1; cfg->if_automatic = 0; cfg->so_rcvbuf = 0; cfg->so_sndbuf = 0; cfg->so_reuseport = 0; cfg->ip_transparent = 0; + cfg->ip_freebind = 0; cfg->num_ifs = 0; cfg->ifs = NULL; cfg->num_out_ifs = 0; cfg->out_ifs = NULL; cfg->stubs = NULL; cfg->forwards = NULL; +#ifdef CLIENT_SUBNET + cfg->client_subnet = NULL; + cfg->client_subnet_opcode = LDNS_EDNS_CLIENT_SUBNET; + cfg->client_subnet_always_forward = 0; + cfg->max_client_subnet_ipv4 = 24; + cfg->max_client_subnet_ipv6 = 56; +#endif + cfg->views = NULL; cfg->acls = NULL; cfg->harden_short_bufsize = 0; cfg->harden_large_queries = 0; @@ -182,6 +199,7 @@ config_create(void) cfg->unwanted_threshold = 0; cfg->hide_identity = 0; cfg->hide_version = 0; + cfg->hide_trustanchor = 0; cfg->identity = NULL; cfg->version = NULL; cfg->auto_trust_anchor_file_list = NULL; @@ -199,6 +217,7 @@ config_create(void) cfg->val_log_squelch = 0; cfg->val_permissive_mode = 0; cfg->ignore_cd = 0; + cfg->serve_expired = 0; cfg->add_holddown = 30*24*3600; cfg->del_holddown = 30*24*3600; cfg->keep_missing = 366*24*3600; /* one year plus a little leeway */ @@ -209,7 +228,9 @@ config_create(void) cfg->local_zones = NULL; cfg->local_zones_nodefault = NULL; cfg->local_data = NULL; + cfg->local_zone_overrides = NULL; cfg->unblock_lan_zones = 0; + cfg->insecure_lan_zones = 0; cfg->python_script = NULL; cfg->remote_control_enable = 0; cfg->control_ifs = NULL; @@ -227,20 +248,37 @@ config_create(void) if(!(cfg->control_cert_file = strdup(RUN_DIR"/unbound_control.pem"))) goto error_exit; +#ifdef CLIENT_SUBNET + if(!(cfg->module_conf = strdup("subnetcache validator iterator"))) goto error_exit; +#else if(!(cfg->module_conf = strdup("validator iterator"))) goto error_exit; +#endif if(!(cfg->val_nsec3_key_iterations = strdup("1024 150 2048 500 4096 2500"))) goto error_exit; #if defined(DNSTAP_SOCKET_PATH) if(!(cfg->dnstap_socket_path = strdup(DNSTAP_SOCKET_PATH))) goto error_exit; #endif + cfg->disable_dnssec_lame_check = 0; + cfg->ip_ratelimit = 0; cfg->ratelimit = 0; + cfg->ip_ratelimit_slabs = 4; cfg->ratelimit_slabs = 4; + cfg->ip_ratelimit_size = 4*1024*1024; cfg->ratelimit_size = 4*1024*1024; cfg->ratelimit_for_domain = NULL; cfg->ratelimit_below_domain = NULL; + cfg->ip_ratelimit_factor = 10; cfg->ratelimit_factor = 10; cfg->qname_minimisation = 0; + cfg->qname_minimisation_strict = 0; + cfg->shm_enable = 0; + cfg->shm_key = 11777; + cfg->dnscrypt = 0; + cfg->dnscrypt_port = 0; + cfg->dnscrypt_provider = NULL; + cfg->dnscrypt_provider_cert = NULL; + cfg->dnscrypt_secret_key = NULL; return cfg; error_exit: config_delete(cfg); @@ -361,18 +399,24 @@ int config_set_option(struct config_file* cfg, const char* opt, log_set_time_asc(cfg->log_time_ascii); } else S_SIZET_NONZERO("max-udp-size:", max_udp_size) else S_YNO("use-syslog:", use_syslog) + else S_STR("log-identity:", log_identity) else S_YNO("extended-statistics:", stat_extended) else S_YNO("statistics-cumulative:", stat_cumulative) + else S_YNO("shm-enable:", shm_enable) + else S_NUMBER_OR_ZERO("shm-key:", shm_key) else S_YNO("do-ip4:", do_ip4) else S_YNO("do-ip6:", do_ip6) else S_YNO("do-udp:", do_udp) else S_YNO("do-tcp:", do_tcp) else S_YNO("tcp-upstream:", tcp_upstream) + else S_NUMBER_NONZERO("tcp-mss:", tcp_mss) + else S_NUMBER_NONZERO("outgoing-tcp-mss:", outgoing_tcp_mss) else S_YNO("ssl-upstream:", ssl_upstream) else S_STR("ssl-service-key:", ssl_service_key) else S_STR("ssl-service-pem:", ssl_service_pem) else S_NUMBER_NONZERO("ssl-port:", ssl_port) else S_YNO("interface-automatic:", if_automatic) + else S_YNO("use-systemd:", use_systemd) else S_YNO("do-daemonize:", do_daemonize) else S_NUMBER_NONZERO("port:", port) else S_NUMBER_NONZERO("outgoing-range:", outgoing_num_ports) @@ -388,6 +432,7 @@ int config_set_option(struct config_file* cfg, const char* opt, else S_MEMSIZE("so-sndbuf:", so_sndbuf) else S_YNO("so-reuseport:", so_reuseport) else S_YNO("ip-transparent:", ip_transparent) + else S_YNO("ip-freebind:", ip_freebind) else S_MEMSIZE("rrset-cache-size:", rrset_cache_size) else S_POW2("rrset-cache-slabs:", rrset_cache_slabs) else S_YNO("prefetch:", prefetch) @@ -412,6 +457,7 @@ int config_set_option(struct config_file* cfg, const char* opt, else S_STR("pidfile:", pidfile) else S_YNO("hide-identity:", hide_identity) else S_YNO("hide-version:", hide_version) + else S_YNO("hide-trustanchor:", hide_trustanchor) else S_STR("identity:", identity) else S_STR("version:", version) else S_STRLIST("root-hints:", root_hints) @@ -442,8 +488,10 @@ int config_set_option(struct config_file* cfg, const char* opt, else S_NUMBER_OR_ZERO("val-log-level:", val_log_level) else S_YNO("val-log-squelch:", val_log_squelch) else S_YNO("log-queries:", log_queries) + else S_YNO("log-replies:", log_replies) else S_YNO("val-permissive-mode:", val_permissive_mode) else S_YNO("ignore-cd-flag:", ignore_cd) + else S_YNO("serve-expired:", serve_expired) else S_STR("val-nsec3-keysize-iterations:", val_nsec3_key_iterations) else S_UNSIGNED_OR_ZERO("add-holddown:", add_holddown) else S_UNSIGNED_OR_ZERO("del-holddown:", del_holddown) @@ -458,6 +506,7 @@ int config_set_option(struct config_file* cfg, const char* opt, else S_YNO("rrset-roundrobin:", rrset_roundrobin) else S_STRLIST("local-data:", local_data) else S_YNO("unblock-lan-zones:", unblock_lan_zones) + else S_YNO("insecure-lan-zones:", insecure_lan_zones) else S_YNO("control-enable:", remote_control_enable) else S_STRLIST("control-interface:", control_ifs) else S_NUMBER_NONZERO("control-port:", control_port) @@ -467,17 +516,34 @@ int config_set_option(struct config_file* cfg, const char* opt, else S_STR("control-cert-file:", control_cert_file) else S_STR("module-config:", module_conf) else S_STR("python-script:", python_script) + else S_YNO("disable-dnssec-lame-check:", disable_dnssec_lame_check) +#ifdef CLIENT_SUBNET + /* Can't set max subnet prefix here, since that value is used when + * generating the address tree. */ + /* No client-subnet-always-forward here, module registration depends on + * this option. */ +#endif + else if(strcmp(opt, "ip-ratelimit:") == 0) { + IS_NUMBER_OR_ZERO; cfg->ip_ratelimit = atoi(val); + infra_ip_ratelimit=cfg->ip_ratelimit; + } else if(strcmp(opt, "ratelimit:") == 0) { IS_NUMBER_OR_ZERO; cfg->ratelimit = atoi(val); infra_dp_ratelimit=cfg->ratelimit; } + else S_MEMSIZE("ip-ratelimit-size:", ip_ratelimit_size) else S_MEMSIZE("ratelimit-size:", ratelimit_size) + else S_POW2("ip-ratelimit-slabs:", ip_ratelimit_slabs) else S_POW2("ratelimit-slabs:", ratelimit_slabs) + else S_NUMBER_OR_ZERO("ip-ratelimit-factor:", ip_ratelimit_factor) else S_NUMBER_OR_ZERO("ratelimit-factor:", ratelimit_factor) else S_YNO("qname-minimisation:", qname_minimisation) + else S_YNO("qname-minimisation-strict:", qname_minimisation_strict) + else if(strcmp(opt, "define-tag:") ==0) { + return config_add_tag(cfg, val); /* val_sig_skew_min and max are copied into val_env during init, * so this does not update val_env with set_option */ - else if(strcmp(opt, "val-sig-skew-min:") == 0) + } else if(strcmp(opt, "val-sig-skew-min:") == 0) { IS_NUMBER_OR_ZERO; cfg->val_sig_skew_min = (int32_t)atoi(val); } else if(strcmp(opt, "val-sig-skew-max:") == 0) { IS_NUMBER_OR_ZERO; cfg->val_sig_skew_max = (int32_t)atoi(val); } @@ -496,9 +562,13 @@ int config_set_option(struct config_file* cfg, const char* opt, /* unknown or unsupported (from the set_option interface): * interface, outgoing-interface, access-control, * stub-zone, name, stub-addr, stub-host, stub-prime - * forward-first, stub-first, - * forward-zone, name, forward-addr, forward-host, - * ratelimit-for-domain, ratelimit-below-domain */ + * forward-first, stub-first, forward-ssl-upstream, + * stub-ssl-upstream, forward-zone, + * name, forward-addr, forward-host, + * ratelimit-for-domain, ratelimit-below-domain, + * local-zone-tag, access-control-view + * send-client-subnet client-subnet-always-forward + * max-client-subnet-ipv4 max-client-subnet-ipv6 */ return 0; } return 1; @@ -622,9 +692,31 @@ config_collate_cat(struct config_strlist* list) /** compare and print list option */ #define O_LS2(opt, name, lst) if(strcmp(opt, name)==0) { \ struct config_str2list* p = cfg->lst; \ - for(p = cfg->lst; p; p = p->next) \ - snprintf(buf, len, "%s %s\n", p->str, p->str2); \ + for(p = cfg->lst; p; p = p->next) { \ + snprintf(buf, len, "%s %s", p->str, p->str2); \ + func(buf, arg); \ + } \ + } +/** compare and print list option */ +#define O_LS3(opt, name, lst) if(strcmp(opt, name)==0) { \ + struct config_str3list* p = cfg->lst; \ + for(p = cfg->lst; p; p = p->next) { \ + snprintf(buf, len, "%s %s %s", p->str, p->str2, p->str3); \ func(buf, arg); \ + } \ + } +/** compare and print taglist option */ +#define O_LTG(opt, name, lst) if(strcmp(opt, name)==0) { \ + char* tmpstr = NULL; \ + struct config_strbytelist *p = cfg->lst; \ + for(p = cfg->lst; p; p = p->next) {\ + tmpstr = config_taglist2str(cfg, p->str2, p->str2len); \ + if(tmpstr) {\ + snprintf(buf, len, "%s %s", p->str, tmpstr); \ + func(buf, arg); \ + free(tmpstr); \ + } \ + } \ } int @@ -638,7 +730,10 @@ config_get_option(struct config_file* cfg, const char* opt, else O_DEC(opt, "statistics-interval", stat_interval) else O_YNO(opt, "statistics-cumulative", stat_cumulative) else O_YNO(opt, "extended-statistics", stat_extended) + else O_YNO(opt, "shm-enable", shm_enable) + else O_DEC(opt, "shm-key", shm_key) else O_YNO(opt, "use-syslog", use_syslog) + else O_STR(opt, "log-identity", log_identity) else O_YNO(opt, "log-time-ascii", log_time_ascii) else O_DEC(opt, "num-threads", num_threads) else O_IFC(opt, "interface", num_ifs, ifs) @@ -658,6 +753,7 @@ config_get_option(struct config_file* cfg, const char* opt, else O_MEM(opt, "so-sndbuf", so_sndbuf) else O_YNO(opt, "so-reuseport", so_reuseport) else O_YNO(opt, "ip-transparent", ip_transparent) + else O_YNO(opt, "ip-freebind", ip_freebind) else O_MEM(opt, "rrset-cache-size", rrset_cache_size) else O_DEC(opt, "rrset-cache-slabs", rrset_cache_slabs) else O_YNO(opt, "prefetch-key", prefetch_key) @@ -675,19 +771,24 @@ config_get_option(struct config_file* cfg, const char* opt, else O_YNO(opt, "do-udp", do_udp) else O_YNO(opt, "do-tcp", do_tcp) else O_YNO(opt, "tcp-upstream", tcp_upstream) + else O_DEC(opt, "tcp-mss", tcp_mss) + else O_DEC(opt, "outgoing-tcp-mss", outgoing_tcp_mss) else O_YNO(opt, "ssl-upstream", ssl_upstream) else O_STR(opt, "ssl-service-key", ssl_service_key) else O_STR(opt, "ssl-service-pem", ssl_service_pem) else O_DEC(opt, "ssl-port", ssl_port) + else O_YNO(opt, "use-systemd", use_systemd) else O_YNO(opt, "do-daemonize", do_daemonize) else O_STR(opt, "chroot", chrootdir) else O_STR(opt, "username", username) else O_STR(opt, "directory", directory) else O_STR(opt, "logfile", logfile) else O_YNO(opt, "log-queries", log_queries) + else O_YNO(opt, "log-replies", log_replies) else O_STR(opt, "pidfile", pidfile) else O_YNO(opt, "hide-identity", hide_identity) else O_YNO(opt, "hide-version", hide_version) + else O_YNO(opt, "hide-trustanchor", hide_trustanchor) else O_STR(opt, "identity", identity) else O_STR(opt, "version", version) else O_STR(opt, "target-fetch-policy", target_fetch_policy) @@ -709,6 +810,7 @@ config_get_option(struct config_file* cfg, const char* opt, else O_DEC(opt, "val-log-level", val_log_level) else O_YNO(opt, "val-permissive-mode", val_permissive_mode) else O_YNO(opt, "ignore-cd-flag", ignore_cd) + else O_YNO(opt, "serve-expired", serve_expired) else O_STR(opt, "val-nsec3-keysize-iterations",val_nsec3_key_iterations) else O_UNS(opt, "add-holddown", add_holddown) else O_UNS(opt, "del-holddown", del_holddown) @@ -738,18 +840,40 @@ config_get_option(struct config_file* cfg, const char* opt, else O_UNS(opt, "val-override-date", val_date_override) else O_YNO(opt, "minimal-responses", minimal_responses) else O_YNO(opt, "rrset-roundrobin", rrset_roundrobin) +#ifdef CLIENT_SUBNET + else O_LST(opt, "send-client-subnet", client_subnet) + else O_DEC(opt, "max-client-subnet-ipv4", max_client_subnet_ipv4) + else O_DEC(opt, "max-client-subnet-ipv6", max_client_subnet_ipv6) + else O_YNO(opt, "client-subnet-always-forward:", + client_subnet_always_forward) +#endif else O_YNO(opt, "unblock-lan-zones", unblock_lan_zones) + else O_YNO(opt, "insecure-lan-zones", insecure_lan_zones) else O_DEC(opt, "max-udp-size", max_udp_size) else O_STR(opt, "python-script", python_script) + else O_YNO(opt, "disable-dnssec-lame-check", disable_dnssec_lame_check) + else O_DEC(opt, "ip-ratelimit", ip_ratelimit) else O_DEC(opt, "ratelimit", ratelimit) + else O_MEM(opt, "ip-ratelimit-size", ip_ratelimit_size) else O_MEM(opt, "ratelimit-size", ratelimit_size) + else O_DEC(opt, "ip-ratelimit-slabs", ip_ratelimit_slabs) else O_DEC(opt, "ratelimit-slabs", ratelimit_slabs) else O_LS2(opt, "ratelimit-for-domain", ratelimit_for_domain) else O_LS2(opt, "ratelimit-below-domain", ratelimit_below_domain) + else O_DEC(opt, "ip-ratelimit-factor", ip_ratelimit_factor) else O_DEC(opt, "ratelimit-factor", ratelimit_factor) else O_DEC(opt, "val-sig-skew-min", val_sig_skew_min) else O_DEC(opt, "val-sig-skew-max", val_sig_skew_max) else O_YNO(opt, "qname-minimisation", qname_minimisation) + else O_YNO(opt, "qname-minimisation-strict", qname_minimisation_strict) + else O_IFC(opt, "define-tag", num_tags, tagname) + else O_LTG(opt, "local-zone-tag", local_zone_tags) + else O_LTG(opt, "access-control-tag", acl_tags) + else O_LTG(opt, "response-ip-tag", respip_tags) + else O_LS3(opt, "local-zone-override", local_zone_overrides) + else O_LS3(opt, "access-control-tag-action", acl_tag_actions) + else O_LS3(opt, "access-control-tag-data", acl_tag_datas) + else O_LS2(opt, "access-control-view", acl_view) /* not here: * outgoing-permit, outgoing-avoid - have list of ports * local-zone - zones and nodefault variables @@ -854,6 +978,8 @@ config_read(struct config_file* cfg, const char* filename, const char* chroot) ub_c_parse(); fclose(in); + if(!cfg->dnscrypt) cfg->dnscrypt_port = 0; + if(cfg_parser->errors != 0) { fprintf(stderr, "read %s failed: %d errors in configuration file\n", fname, cfg_parser->errors); @@ -864,6 +990,18 @@ config_read(struct config_file* cfg, const char* filename, const char* chroot) return 1; } +struct config_stub* cfg_stub_find(struct config_stub*** pp, const char* nm) +{ + struct config_stub* p = *(*pp); + while(p) { + if(strcmp(p->name, nm) == 0) + return p; + (*pp) = &p->next; + p = p->next; + } + return NULL; +} + void config_delstrlist(struct config_strlist* p) { @@ -890,14 +1028,82 @@ config_deldblstrlist(struct config_str2list* p) } void +config_deltrplstrlist(struct config_str3list* p) +{ + struct config_str3list *np; + while(p) { + np = p->next; + free(p->str); + free(p->str2); + free(p->str3); + free(p); + p = np; + } +} + +void +config_delstub(struct config_stub* p) +{ + if(!p) return; + free(p->name); + config_delstrlist(p->hosts); + config_delstrlist(p->addrs); + free(p); +} + +void config_delstubs(struct config_stub* p) { struct config_stub* np; while(p) { np = p->next; - free(p->name); - config_delstrlist(p->hosts); - config_delstrlist(p->addrs); + config_delstub(p); + p = np; + } +} + +void +config_delview(struct config_view* p) +{ + if(!p) return; + free(p->name); + config_deldblstrlist(p->local_zones); + config_delstrlist(p->local_zones_nodefault); + config_delstrlist(p->local_data); + free(p); +} + +void +config_delviews(struct config_view* p) +{ + struct config_view* np; + while(p) { + np = p->next; + config_delview(p); + p = np; + } +} +/** delete string array */ +static void +config_del_strarray(char** array, int num) +{ + int i; + if(!array) + return; + for(i=0; i<num; i++) { + free(array[i]); + } + free(array); +} + +void +config_del_strbytelist(struct config_strbytelist* p) +{ + struct config_strbytelist* np; + while(p) { + np = p->next; + free(p->str); + free(p->str2); free(p); p = np; } @@ -915,22 +1121,17 @@ config_delete(struct config_file* cfg) free(cfg->target_fetch_policy); free(cfg->ssl_service_key); free(cfg->ssl_service_pem); - if(cfg->ifs) { - int i; - for(i=0; i<cfg->num_ifs; i++) - free(cfg->ifs[i]); - free(cfg->ifs); - } - if(cfg->out_ifs) { - int i; - for(i=0; i<cfg->num_out_ifs; i++) - free(cfg->out_ifs[i]); - free(cfg->out_ifs); - } + free(cfg->log_identity); + config_del_strarray(cfg->ifs, cfg->num_ifs); + config_del_strarray(cfg->out_ifs, cfg->num_out_ifs); config_delstubs(cfg->stubs); config_delstubs(cfg->forwards); + config_delviews(cfg->views); config_delstrlist(cfg->donotqueryaddrs); config_delstrlist(cfg->root_hints); +#ifdef CLIENT_SUBNET + config_delstrlist(cfg->client_subnet); +#endif free(cfg->identity); free(cfg->version); free(cfg->module_conf); @@ -950,6 +1151,13 @@ config_delete(struct config_file* cfg) config_deldblstrlist(cfg->local_zones); config_delstrlist(cfg->local_zones_nodefault); config_delstrlist(cfg->local_data); + config_deltrplstrlist(cfg->local_zone_overrides); + config_del_strarray(cfg->tagname, cfg->num_tags); + config_del_strbytelist(cfg->local_zone_tags); + config_del_strbytelist(cfg->acl_tags); + config_del_strbytelist(cfg->respip_tags); + config_deltrplstrlist(cfg->acl_tag_actions); + config_deltrplstrlist(cfg->acl_tag_datas); config_delstrlist(cfg->control_ifs); free(cfg->server_key_file); free(cfg->server_cert_file); @@ -1108,6 +1316,23 @@ int cfg_strlist_append(struct config_strlist_head* list, char* item) } int +cfg_region_strlist_insert(struct regional* region, + struct config_strlist** head, char* item) +{ + struct config_strlist *s; + if(!item || !head) + return 0; + s = (struct config_strlist*)regional_alloc_zero(region, + sizeof(struct config_strlist)); + if(!s) + return 0; + s->str = item; + s->next = *head; + *head = s; + return 1; +} + +int cfg_strlist_insert(struct config_strlist** head, char* item) { struct config_strlist *s; @@ -1138,6 +1363,42 @@ cfg_str2list_insert(struct config_str2list** head, char* item, char* i2) return 1; } +int +cfg_str3list_insert(struct config_str3list** head, char* item, char* i2, + char* i3) +{ + struct config_str3list *s; + if(!item || !i2 || !i3 || !head) + return 0; + s = (struct config_str3list*)calloc(1, sizeof(struct config_str3list)); + if(!s) + return 0; + s->str = item; + s->str2 = i2; + s->str3 = i3; + s->next = *head; + *head = s; + return 1; +} + +int +cfg_strbytelist_insert(struct config_strbytelist** head, char* item, + uint8_t* i2, size_t i2len) +{ + struct config_strbytelist* s; + if(!item || !i2 || !head) + return 0; + s = (struct config_strbytelist*)calloc(1, sizeof(*s)); + if(!s) + return 0; + s->str = item; + s->str2 = i2; + s->str2len = i2len; + s->next = *head; + *head = s; + return 1; +} + time_t cfg_convert_timeval(const char* str) { @@ -1242,6 +1503,123 @@ cfg_parse_memsize(const char* str, size_t* res) return 1; } +int +find_tag_id(struct config_file* cfg, const char* tag) +{ + int i; + for(i=0; i<cfg->num_tags; i++) { + if(strcmp(cfg->tagname[i], tag) == 0) + return i; + } + return -1; +} + +int +config_add_tag(struct config_file* cfg, const char* tag) +{ + char** newarray; + char* newtag; + if(find_tag_id(cfg, tag) != -1) + return 1; /* nothing to do */ + newarray = (char**)malloc(sizeof(char*)*(cfg->num_tags+1)); + if(!newarray) + return 0; + newtag = strdup(tag); + if(!newtag) { + free(newarray); + return 0; + } + if(cfg->tagname) { + memcpy(newarray, cfg->tagname, sizeof(char*)*cfg->num_tags); + free(cfg->tagname); + } + newarray[cfg->num_tags++] = newtag; + cfg->tagname = newarray; + return 1; +} + +/** set a bit in a bit array */ +static void +cfg_set_bit(uint8_t* bitlist, size_t len, int id) +{ + int pos = id/8; + log_assert((size_t)pos < len); + (void)len; + bitlist[pos] |= 1<<(id%8); +} + +uint8_t* config_parse_taglist(struct config_file* cfg, char* str, + size_t* listlen) +{ + uint8_t* taglist = NULL; + size_t len = 0; + char* p, *s; + + /* allocate */ + if(cfg->num_tags == 0) { + log_err("parse taglist, but no tags defined"); + return 0; + } + len = (size_t)(cfg->num_tags+7)/8; + taglist = calloc(1, len); + if(!taglist) { + log_err("out of memory"); + return 0; + } + + /* parse */ + s = str; + while((p=strsep(&s, " \t\n")) != NULL) { + if(*p) { + int id = find_tag_id(cfg, p); + /* set this bit in the bitlist */ + if(id == -1) { + log_err("unknown tag: %s", p); + free(taglist); + return 0; + } + cfg_set_bit(taglist, len, id); + } + } + + *listlen = len; + return taglist; +} + +char* config_taglist2str(struct config_file* cfg, uint8_t* taglist, + size_t taglen) +{ + char buf[10240]; + size_t i, j, len = 0; + buf[0] = 0; + for(i=0; i<taglen; i++) { + if(taglist[i] == 0) + continue; + for(j=0; j<8; j++) { + if((taglist[i] & (1<<j)) != 0) { + size_t id = i*8 + j; + snprintf(buf+len, sizeof(buf)-len, "%s%s", + (len==0?"":" "), cfg->tagname[id]); + len += strlen(buf+len); + } + } + } + return strdup(buf); +} + +int taglist_intersect(uint8_t* list1, size_t list1len, uint8_t* list2, + size_t list2len) +{ + size_t i; + if(!list1 || !list2) + return 0; + for(i=0; i<list1len && i<list2len; i++) { + if((list1[i] & list2[i]) != 0) + return 1; + } + return 0; +} + void config_apply(struct config_file* config) { diff --git a/external/unbound/util/config_file.h b/external/unbound/util/config_file.h index 8fa163ed7..79b094894 100644 --- a/external/unbound/util/config_file.h +++ b/external/unbound/util/config_file.h @@ -42,11 +42,15 @@ #ifndef UTIL_CONFIG_FILE_H #define UTIL_CONFIG_FILE_H struct config_stub; +struct config_view; struct config_strlist; struct config_str2list; +struct config_str3list; +struct config_strbytelist; struct module_qstate; struct sock_list; struct ub_packed_rrset_key; +struct regional; /** * The configuration options. @@ -72,12 +76,18 @@ struct config_file { int do_ip4; /** do ip6 query support. */ int do_ip6; + /** prefer ip6 upstream queries. */ + int prefer_ip6; /** do udp query support. */ int do_udp; /** do tcp query support. */ int do_tcp; /** tcp upstream queries (no UDP upstream queries) */ int tcp_upstream; + /** maximum segment size of tcp socket which queries are answered */ + int tcp_mss; + /** maximum segment size of tcp socket for outgoing queries */ + int outgoing_tcp_mss; /** private key file for dnstcp-ssl service (enabled if not NULL) */ char* ssl_service_key; @@ -138,6 +148,8 @@ struct config_file { int so_reuseport; /** IP_TRANSPARENT socket option requested on port 53 sockets */ int ip_transparent; + /** IP_FREEBIND socket option request on port 53 sockets */ + int ip_freebind; /** number of interfaces to open. If 0 default all interfaces. */ int num_ifs; @@ -156,8 +168,22 @@ struct config_file { struct config_stub* stubs; /** the forward zone definitions, linked list */ struct config_stub* forwards; + /** the views definitions, linked list */ + struct config_view* views; /** list of donotquery addresses, linked list */ struct config_strlist* donotqueryaddrs; +#ifdef CLIENT_SUBNET + /** list of servers we send edns-client-subnet option to and + * accept option from, linked list */ + struct config_strlist* client_subnet; + /** opcode assigned by IANA for edns0-client-subnet option */ + uint16_t client_subnet_opcode; + /** Do not check whitelist if incoming query contains an ECS record */ + int client_subnet_always_forward; + /** Subnet length we are willing to give up privacy for */ + uint8_t max_client_subnet_ipv4; + uint8_t max_client_subnet_ipv6; +#endif /** list of access control entries, linked list */ struct config_str2list* acls; /** use default localhost donotqueryaddr entries */ @@ -215,11 +241,17 @@ struct config_file { int log_time_ascii; /** log queries with one line per query */ int log_queries; + /** log replies with one line per reply */ + int log_replies; + /** log identity to report */ + char* log_identity; /** do not report identity (id.server, hostname.bind) */ int hide_identity; /** do not report version (version.server, version.bind) */ int hide_version; + /** do not report trustanchor (trustanchor.unbound) */ + int hide_trustanchor; /** identity, hostname is returned if "". */ char* identity; /** version, package version returned if "". */ @@ -261,6 +293,8 @@ struct config_file { int val_permissive_mode; /** ignore the CD flag in incoming queries and refuse them bogus data */ int ignore_cd; + /** serve expired entries and prefetch them */ + int serve_expired; /** nsec3 maximum iterations per key size, string */ char* val_nsec3_key_iterations; /** autotrust add holddown time, in seconds */ @@ -285,8 +319,32 @@ struct config_file { struct config_strlist* local_zones_nodefault; /** local data RRs configured */ struct config_strlist* local_data; - /** unblock lan zones (reverse lookups for 10/8 and so on) */ + /** local zone override types per netblock */ + struct config_str3list* local_zone_overrides; + /** unblock lan zones (reverse lookups for AS112 zones) */ int unblock_lan_zones; + /** insecure lan zones (don't validate AS112 zones) */ + int insecure_lan_zones; + /** list of zonename, tagbitlist */ + struct config_strbytelist* local_zone_tags; + /** list of aclname, tagbitlist */ + struct config_strbytelist* acl_tags; + /** list of aclname, tagname, localzonetype */ + struct config_str3list* acl_tag_actions; + /** list of aclname, tagname, redirectdata */ + struct config_str3list* acl_tag_datas; + /** list of aclname, view*/ + struct config_str2list* acl_view; + /** list of IP-netblock, tagbitlist */ + struct config_strbytelist* respip_tags; + /** list of response-driven access control entries, linked list */ + struct config_str2list* respip_actions; + /** RRs configured for response-driven access controls */ + struct config_str2list* respip_data; + /** tag list, array with tagname[i] is malloced string */ + char** tagname; + /** number of items in the taglist */ + int num_tags; /** remote control section. enable toggle. */ int remote_control_enable; @@ -308,6 +366,9 @@ struct config_file { /** Python script file */ char* python_script; + /** Use systemd socket activation. */ + int use_systemd; + /** daemonize, i.e. fork into the background. */ int do_daemonize; @@ -352,7 +413,19 @@ struct config_file { /** true to log dnstap FORWARDER_RESPONSE message events */ int dnstap_log_forwarder_response_messages; - /** ratelimit 0 is off, otherwise qps (unless overridden) */ + /** true to disable DNSSEC lameness check in iterator */ + int disable_dnssec_lame_check; + + /** ratelimit for ip addresses. 0 is off, otherwise qps (unless overridden) */ + int ip_ratelimit; + /** number of slabs for ip_ratelimit cache */ + size_t ip_ratelimit_slabs; + /** memory size in bytes for ip_ratelimit cache */ + size_t ip_ratelimit_size; + /** ip_ratelimit factor, 0 blocks all, 10 allows 1/10 of traffic */ + int ip_ratelimit_factor; + + /** ratelimit for domains. 0 is off, otherwise qps (unless overridden) */ int ratelimit; /** number of slabs for ratelimit cache */ size_t ratelimit_slabs; @@ -366,6 +439,25 @@ struct config_file { int ratelimit_factor; /** minimise outgoing QNAME and hide original QTYPE if possible */ int qname_minimisation; + /** minimise QNAME in strict mode, minimise according to RFC. + * Do not apply fallback */ + int qname_minimisation_strict; + /** SHM data - true if shm is enabled */ + int shm_enable; + /** SHM data - key for the shm */ + int shm_key; + + /** DNSCrypt */ + /** true to enable dnscrypt */ + int dnscrypt; + /** port on which to provide dnscrypt service */ + int dnscrypt_port; + /** provider name 2.dnscrypt-cert.example.com */ + char* dnscrypt_provider; + /** dnscrypt secret keys 1.key */ + struct config_strlist* dnscrypt_secret_key; + /** dnscrypt provider certs 1.cert */ + struct config_strlist* dnscrypt_provider_cert; }; /** from cfg username, after daemonise setup performed */ @@ -391,6 +483,31 @@ struct config_stub { int isprime; /** if forward-first is set (failover to without if fails) */ int isfirst; + /** use SSL for queries to this stub */ + int ssl_upstream; +}; + +/** + * View config options + */ +struct config_view { + /** next in list */ + struct config_view* next; + /** view name */ + char* name; + /** local zones */ + struct config_str2list* local_zones; + /** local data RRs */ + struct config_strlist* local_data; + /** local zones nodefault list */ + struct config_strlist* local_zones_nodefault; + /** Fallback to global local_zones when there is no match in the view + * view specific tree. 1 for yes, 0 for no */ + int isfirst; + /** predefined actions for particular IP address responses */ + struct config_str2list* respip_actions; + /** data complementing the 'redirect' response IP actions */ + struct config_str2list* respip_data; }; /** @@ -415,6 +532,34 @@ struct config_str2list { char* str2; }; +/** + * List of three strings for config options + */ +struct config_str3list { + /** next item in list */ + struct config_str3list* next; + /** first string */ + char* str; + /** second string */ + char* str2; + /** third string */ + char* str3; +}; + + +/** + * List of string, bytestring for config options + */ +struct config_strbytelist { + /** next item in list */ + struct config_strbytelist* next; + /** first string */ + char* str; + /** second bytestring */ + uint8_t* str2; + size_t str2len; +}; + /** List head for strlist processing, used for append operation. */ struct config_strlist_head { /** first in list of text items */ @@ -544,6 +689,10 @@ int cfg_strlist_append(struct config_strlist_head* list, char* item); */ int cfg_strlist_insert(struct config_strlist** head, char* item); +/** insert with region for allocation. */ +int cfg_region_strlist_insert(struct regional* region, + struct config_strlist** head, char* item); + /** * Insert string into str2list. * @param head: pointer to str2list head variable. @@ -554,6 +703,39 @@ int cfg_strlist_insert(struct config_strlist** head, char* item); int cfg_str2list_insert(struct config_str2list** head, char* item, char* i2); /** + * Insert string into str3list. + * @param head: pointer to str3list head variable. + * @param item: new item. malloced by caller. If NULL the insertion fails. + * @param i2: 2nd string, malloced by caller. If NULL the insertion fails. + * @param i3: 3rd string, malloced by caller. If NULL the insertion fails. + * @return: true on success. + */ +int cfg_str3list_insert(struct config_str3list** head, char* item, char* i2, + char* i3); + +/** + * Insert string into strbytelist. + * @param head: pointer to strbytelist head variable. + * @param item: new item. malloced by caller. If NULL the insertion fails. + * @param i2: 2nd string, malloced by caller. If NULL the insertion fails. + * @param i2len: length of the i2 bytestring. + * @return: true on success. + */ +int cfg_strbytelist_insert(struct config_strbytelist** head, char* item, + uint8_t* i2, size_t i2len); + +/** + * Find stub in config list, also returns prevptr (for deletion). + * @param pp: call routine with pointer to a pointer to the start of the list, + * if the stub is found, on exit, the value contains a pointer to the + * next pointer that points to the found element (or to the list start + * pointer if it is the first element). + * @param nm: name of stub to find. + * @return: pointer to config_stub if found, or NULL if not found. + */ +struct config_stub* cfg_stub_find(struct config_stub*** pp, const char* nm); + +/** * Delete items in config string list. * @param list: list. */ @@ -566,12 +748,39 @@ void config_delstrlist(struct config_strlist* list); void config_deldblstrlist(struct config_str2list* list); /** + * Delete items in config triple string list. + * @param list: list. + */ +void config_deltrplstrlist(struct config_str3list* list); + +/** delete stringbytelist */ +void config_del_strbytelist(struct config_strbytelist* list); + +/** + * Delete a stub item + * @param p: stub item + */ +void config_delstub(struct config_stub* p); + +/** * Delete items in config stub list. * @param list: list. */ void config_delstubs(struct config_stub* list); /** + * Delete a view item + * @param p: view item + */ +void config_delview(struct config_view* p); + +/** + * Delete items in config view list. + * @param list: list. + */ +void config_delviews(struct config_view* list); + +/** * Convert 14digit to time value * @param str: string of 14 digits * @return time value or 0 for error. @@ -602,6 +811,54 @@ int cfg_count_numbers(const char* str); int cfg_parse_memsize(const char* str, size_t* res); /** + * Add a tag name to the config. It is added at the end with a new ID value. + * @param cfg: the config structure. + * @param tag: string (which is copied) with the name. + * @return: false on alloc failure. + */ +int config_add_tag(struct config_file* cfg, const char* tag); + +/** + * Find tag ID in the tag list. + * @param cfg: the config structure. + * @param tag: string with tag name to search for. + * @return: 0..(num_tags-1) with tag ID, or -1 if tagname is not found. + */ +int find_tag_id(struct config_file* cfg, const char* tag); + +/** + * parse taglist from string into bytestring with bitlist. + * @param cfg: the config structure (with tagnames) + * @param str: the string to parse. Parse puts 0 bytes in string. + * @param listlen: returns length of in bytes. + * @return malloced bytes with a bitlist of the tags. or NULL on parse error + * or malloc failure. + */ +uint8_t* config_parse_taglist(struct config_file* cfg, char* str, + size_t* listlen); + +/** + * convert tag bitlist to a malloced string with tag names. For debug output. + * @param cfg: the config structure (with tagnames) + * @param taglist: the tag bitlist. + * @param len: length of the tag bitlist. + * @return malloced string or NULL. + */ +char* config_taglist2str(struct config_file* cfg, uint8_t* taglist, + size_t len); + +/** + * see if two taglists intersect (have tags in common). + * @param list1: first tag bitlist. + * @param list1len: length in bytes of first list. + * @param list2: second tag bitlist. + * @param list2len: length in bytes of second list. + * @return true if there are tags in common, 0 if not. + */ +int taglist_intersect(uint8_t* list1, size_t list1len, uint8_t* list2, + size_t list2len); + +/** * Parse local-zone directive into two strings and register it in the config. * @param cfg: to put it in. * @param val: argument strings to local-zone, "example.com nodefault". @@ -746,4 +1003,7 @@ char* w_lookup_reg_str(const char* key, const char* name); void w_config_adjust_directory(struct config_file* cfg); #endif /* UB_ON_WINDOWS */ +/** debug option for unit tests. */ +extern int fake_dsa, fake_sha1; + #endif /* UTIL_CONFIG_FILE_H */ diff --git a/external/unbound/util/configlexer.c b/external/unbound/util/configlexer.c index a9fe54121..0043165c2 100644 --- a/external/unbound/util/configlexer.c +++ b/external/unbound/util/configlexer.c @@ -9,8 +9,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -143,7 +143,15 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -169,13 +177,14 @@ extern FILE *yyin, *yyout; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ + yy_size_t yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ @@ -345,11 +354,17 @@ extern int yylineno; int yylineno = 1; extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the @@ -363,8 +378,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 176 -#define YY_END_OF_BUFFER 177 +#define YY_NUM_RULES 221 +#define YY_END_OF_BUFFER 222 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -372,220 +387,264 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[1771] = +static yyconst flex_int16_t yy_accept[2165] = { 0, - 1, 1, 158, 158, 162, 162, 166, 166, 170, 170, - 1, 1, 177, 174, 1, 156, 156, 175, 2, 175, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 158, 159, 159, 160, 175, 162, 163, 163, 164, 175, - 169, 166, 167, 167, 168, 175, 170, 171, 171, 172, - 175, 173, 157, 2, 161, 175, 173, 174, 0, 1, - 2, 2, 2, 2, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 158, 0, 162, 0, - 169, 0, 166, 170, 0, 173, 0, 2, 2, 173, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - - 174, 173, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 173, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 71, 174, 174, 174, 174, 174, 174, 7, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 173, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 173, 174, 174, 174, 174, 174, - 31, 174, 174, 174, 174, 174, 174, 174, 174, 137, - 174, 13, 14, 174, 16, 15, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 130, 174, 174, 174, 174, - 174, 174, 174, 3, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 173, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 165, 174, 174, 174, 174, 174, 174, 174, 174, 174, - - 174, 174, 174, 174, 174, 34, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 35, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 86, 165, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - - 174, 85, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 69, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 21, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 32, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 33, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 23, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 150, 174, 174, 174, - 174, 174, 174, 27, 174, 28, 174, 174, 174, 72, - 174, 73, 174, 70, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 6, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 88, 174, 174, 174, - - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 24, - 174, 174, 174, 174, 174, 114, 113, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 36, 174, 174, 174, 174, 174, 174, 174, 174, - 75, 74, 174, 174, 174, 174, 174, 174, 174, 110, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - - 174, 54, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 58, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 112, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 5, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 106, 174, 174, 174, 174, 174, - - 174, 174, 174, 174, 123, 174, 107, 174, 135, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 22, - 174, 174, 174, 174, 77, 174, 78, 76, 174, 174, - 174, 174, 174, 174, 174, 84, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 108, 174, 174, - 174, 174, 134, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 68, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 29, 174, 174, 18, 174, 174, 174, 17, 174, 93, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - - 174, 174, 174, 174, 43, 45, 174, 174, 174, 174, - 174, 174, 174, 174, 138, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 79, 174, - 174, 174, 174, 174, 174, 83, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 87, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 129, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 97, 174, - 101, 174, 174, 174, 174, 82, 174, 174, 64, 174, - - 121, 174, 174, 174, 174, 136, 174, 174, 174, 174, - 174, 174, 174, 143, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 100, 174, 174, 174, 174, - 174, 46, 47, 174, 30, 53, 102, 174, 115, 111, - 174, 174, 39, 174, 104, 174, 174, 174, 174, 174, - 8, 174, 174, 67, 174, 174, 174, 174, 152, 174, - 120, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 89, 142, - 174, 174, 174, 174, 174, 174, 174, 174, 131, 174, - - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 103, 174, 38, 40, 174, 174, 174, - 174, 174, 174, 66, 174, 174, 174, 174, 151, 174, - 174, 174, 174, 125, 19, 20, 174, 174, 174, 174, - 174, 174, 174, 63, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 127, 124, 174, 174, 174, 174, - 174, 174, 174, 174, 37, 174, 174, 174, 174, 174, - 174, 174, 12, 174, 174, 174, 174, 174, 174, 174, - 174, 11, 174, 174, 174, 174, 174, 155, 174, 41, - 174, 133, 126, 174, 174, 174, 174, 174, 174, 174, - - 174, 174, 174, 174, 96, 95, 174, 174, 128, 122, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 48, 174, - 132, 174, 174, 174, 174, 174, 174, 174, 174, 42, - 174, 174, 174, 90, 92, 116, 174, 174, 174, 94, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 139, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 25, 174, 174, 174, 4, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 141, 174, 174, 119, 174, - - 174, 174, 174, 174, 174, 174, 51, 174, 26, 174, - 10, 174, 174, 174, 174, 174, 117, 55, 174, 174, - 174, 99, 174, 174, 174, 174, 174, 174, 174, 140, - 80, 174, 174, 174, 174, 57, 61, 56, 174, 49, - 174, 9, 174, 174, 153, 174, 174, 98, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 62, 60, - 174, 50, 174, 109, 174, 118, 174, 174, 91, 44, - 174, 174, 174, 174, 174, 174, 81, 59, 52, 154, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 65, 174, 174, 174, - - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 105, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 146, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 144, 174, - 147, 148, 174, 174, 174, 174, 174, 145, 149, 0 + 1, 1, 203, 203, 207, 207, 211, 211, 215, 215, + 1, 1, 222, 219, 1, 201, 201, 220, 2, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 220, + 203, 204, 204, 205, 220, 207, 208, 208, 209, 220, + 214, 211, 212, 212, 213, 220, 215, 216, 216, 217, + 220, 218, 202, 2, 206, 218, 220, 219, 0, 1, + 2, 2, 2, 2, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 203, 0, 207, 0, 214, 0, 211, 215, 0, 218, + 0, 2, 2, 218, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 218, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + + 218, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 77, 219, 219, 219, + 219, 219, 219, 8, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + + 219, 219, 219, 219, 88, 218, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 218, + 219, 219, 219, 219, 219, 37, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 168, 219, + 14, 15, 219, 18, 17, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 154, 219, 219, 219, 219, 219, + + 219, 219, 219, 219, 219, 3, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 218, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 210, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + + 219, 219, 219, 219, 40, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 41, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 143, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 20, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 102, 219, 210, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 195, 219, 219, 219, 219, 219, 219, 219, 219, + + 219, 219, 219, 118, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 101, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 75, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 25, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 38, 219, 219, 219, 219, 219, 219, 219, + + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 39, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 119, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 28, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 183, 219, 219, 219, + + 219, 219, 219, 219, 219, 219, 219, 32, 219, 33, + 219, 219, 219, 78, 219, 79, 219, 219, 76, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 7, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 161, 219, 219, 219, 219, 104, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 29, 219, 219, 219, + + 219, 219, 219, 219, 135, 219, 134, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 16, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 42, 219, 219, + 219, 219, 219, 219, 142, 219, 219, 219, 219, 81, + 80, 219, 219, 219, 219, 219, 219, 219, 219, 129, + 219, 219, 219, 219, 219, 219, 219, 219, 89, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 60, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 64, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 36, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 132, + 133, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 6, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 193, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 26, 219, 219, 219, 219, 219, 219, 219, 219, 125, + + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 147, 219, 126, 219, 219, 159, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 27, 219, 219, 219, 219, 84, 219, 85, 219, 83, + 219, 219, 219, 219, 219, 219, 219, 219, 99, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 182, 219, 219, 127, 219, 219, 219, 219, 219, 130, + 219, 219, 158, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 74, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + + 219, 219, 219, 219, 219, 34, 219, 219, 22, 219, + 219, 219, 219, 19, 219, 109, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 49, 51, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 197, 219, 219, 169, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 86, 219, 219, 219, 219, 219, 219, 219, 98, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 103, 219, 219, 219, 219, 219, 219, 219, + + 219, 219, 219, 219, 219, 219, 153, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 117, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 113, 219, 120, 219, 219, 219, + 219, 219, 92, 219, 219, 70, 219, 219, 219, 145, + 219, 219, 219, 219, 219, 160, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 174, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 116, 219, 219, 219, 219, 219, 52, 53, 219, 219, + 219, 219, 219, 35, 59, 121, 219, 136, 219, 162, + + 131, 219, 219, 219, 45, 219, 123, 219, 219, 219, + 219, 219, 9, 219, 219, 219, 73, 219, 219, 219, + 219, 187, 219, 144, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 105, 196, 219, 219, 173, 219, 219, 219, 219, 219, + 219, 219, 219, 155, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 122, 219, 219, 219, 44, 46, + + 219, 219, 219, 219, 219, 219, 219, 72, 219, 219, + 219, 219, 185, 219, 192, 219, 219, 219, 219, 219, + 149, 23, 24, 219, 219, 219, 219, 219, 219, 219, + 219, 69, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 151, 148, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 43, + 219, 219, 219, 219, 219, 219, 219, 219, 100, 13, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 12, 219, 219, 21, 219, 219, + 219, 191, 219, 194, 47, 219, 157, 219, 150, 219, + + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 112, 111, 219, 219, 219, 219, 219, 219, 152, + 146, 219, 219, 198, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 54, 219, 219, 219, 186, 219, + 219, 219, 156, 219, 219, 219, 219, 219, 219, 219, + 219, 48, 219, 219, 219, 82, 219, 106, 108, 137, + 219, 219, 219, 110, 219, 219, 163, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 170, 219, 219, 219, 219, 219, 219, 219, 219, + + 219, 219, 219, 219, 219, 138, 219, 219, 184, 219, + 219, 219, 30, 219, 219, 219, 219, 4, 219, 219, + 93, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 166, 219, 219, 219, 219, 219, 219, 199, 219, 219, + 219, 219, 219, 172, 219, 219, 141, 219, 219, 219, + 219, 219, 219, 219, 219, 57, 219, 31, 190, 167, + 219, 219, 11, 219, 219, 219, 219, 219, 219, 139, + 61, 219, 219, 219, 115, 219, 219, 219, 219, 219, + 95, 219, 219, 219, 219, 219, 219, 219, 171, 90, + 219, 87, 219, 219, 219, 63, 67, 62, 219, 55, + + 219, 219, 10, 219, 219, 219, 188, 219, 219, 114, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 68, 66, 219, 56, 219, + 219, 219, 128, 219, 219, 140, 219, 219, 219, 219, + 107, 50, 219, 219, 200, 219, 219, 219, 219, 219, + 219, 91, 65, 96, 97, 58, 219, 189, 219, 219, + 219, 165, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 71, 219, 164, 219, 181, 219, 219, + 219, 219, 219, 219, 5, 219, 219, 219, 219, 219, + + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 94, 219, 219, 219, 219, 219, 219, 124, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 177, 219, + 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 175, 219, 178, 179, 219, 219, 219, 219, + 219, 176, 180, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 5, 6, 1, 1, 1, 7, 1, - 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, - 9, 10, 1, 11, 1, 1, 1, 12, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 13, 1, 1, 1, 1, 14, 15, 16, 17, - - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 8, 1, 1, 1, 9, 1, + 10, 11, 1, 12, 1, 1, 1, 13, 1, 1, + 1, 1, 1, 1, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 1, 40, 1, 1, 1, 1, 41, 42, 43, 44, + + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -602,1200 +661,1889 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[40] = +static yyconst YY_CHAR yy_meta[67] = { 0, 1, 2, 3, 4, 5, 1, 6, 1, 1, 1, - 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[1785] = +static yyconst flex_uint16_t yy_base[2179] = { 0, - 0, 0, 37, 40, 44, 51, 63, 75, 56, 68, - 87, 108, 2403, 1986, 50, 3503, 3503, 3503, 129, 94, - 70, 104, 130, 90, 92, 115, 127, 95, 84, 111, - 137, 148, 50, 170, 122, 150, 157, 160, 140, 166, - 1934, 3503, 3503, 3503, 70, 1883, 3503, 3503, 3503, 42, - 1800, 1768, 3503, 3503, 3503, 192, 1510, 3503, 3503, 3503, - 141, 849, 3503, 198, 3503, 202, 197, 811, 210, 120, - 0, 223, 0, 0, 103, 203, 180, 205, 164, 206, - 213, 210, 125, 216, 224, 218, 226, 227, 229, 230, - 231, 238, 248, 244, 240, 250, 253, 233, 249, 258, - - 264, 261, 265, 266, 267, 270, 269, 276, 277, 278, - 173, 280, 283, 284, 285, 289, 295, 281, 291, 297, - 301, 302, 303, 306, 308, 309, 668, 250, 392, 319, - 382, 327, 363, 322, 333, 243, 339, 343, 0, 336, - 340, 346, 314, 342, 338, 344, 347, 353, 351, 360, - 363, 384, 364, 349, 366, 49, 358, 369, 372, 370, - 375, 373, 376, 377, 379, 380, 394, 400, 407, 408, - 406, 395, 414, 412, 423, 424, 420, 421, 422, 410, - 425, 411, 429, 426, 435, 432, 436, 438, 441, 442, - 449, 445, 446, 450, 458, 451, 452, 454, 467, 471, - - 472, 468, 459, 469, 481, 479, 487, 473, 475, 486, - 483, 489, 495, 500, 498, 501, 490, 503, 504, 505, - 510, 516, 512, 513, 515, 522, 521, 524, 523, 525, - 527, 529, 530, 531, 533, 537, 536, 540, 543, 546, - 535, 548, 550, 551, 558, 564, 559, 565, 566, 568, - 570, 573, 571, 574, 581, 582, 583, 590, 584, 587, - 588, 595, 596, 597, 605, 602, 598, 601, 599, 608, - 610, 611, 630, 616, 618, 620, 624, 623, 628, 639, - 635, 636, 637, 640, 659, 647, 650, 662, 653, 660, - 673, 661, 663, 666, 672, 674, 680, 675, 677, 678, - - 683, 685, 694, 688, 701, 689, 699, 704, 702, 706, - 708, 715, 711, 712, 713, 714, 716, 722, 720, 723, - 3503, 728, 726, 730, 731, 733, 734, 3503, 735, 736, - 737, 744, 743, 745, 749, 759, 742, 748, 758, 761, - 762, 763, 764, 766, 786, 769, 767, 776, 772, 773, - 790, 626, 795, 782, 788, 784, 798, 801, 803, 804, - 805, 806, 774, 814, 807, 810, 816, 818, 831, 815, - 820, 822, 833, 834, 835, 841, 839, 843, 845, 855, - 847, 857, 858, 838, 860, 862, 868, 867, 864, 861, - 875, 872, 873, 876, 882, 874, 880, 890, 886, 893, - - 897, 898, 878, 899, 889, 900, 907, 908, 906, 910, - 911, 915, 917, 924, 920, 918, 922, 935, 926, 928, - 937, 929, 940, 947, 948, 936, 949, 944, 945, 952, - 953, 956, 957, 954, 959, 961, 970, 964, 967, 974, - 975, 979, 972, 980, 981, 982, 985, 991, 987, 995, - 993, 996, 997, 1001, 1002, 1005, 1009, 1004, 1017, 1010, - 3503, 1021, 1020, 1022, 1012, 1023, 1014, 1027, 1053, 3503, - 1028, 3503, 3503, 1029, 3503, 3503, 1033, 1035, 1036, 1044, - 1076, 1045, 1037, 1038, 1048, 1057, 1047, 1059, 1049, 1066, - 1068, 1069, 1070, 1061, 1073, 1079, 1084, 1082, 1086, 1091, - - 1099, 1105, 1106, 1090, 1102, 1103, 1107, 1109, 1112, 1113, - 1110, 1119, 1114, 1121, 1123, 3503, 1124, 1125, 1128, 1126, - 1135, 1130, 1138, 3503, 1132, 1139, 1137, 1143, 1146, 1147, - 1148, 1150, 1151, 1152, 1155, 1156, 1159, 1160, 1161, 1177, - 1178, 1162, 1174, 1176, 1179, 1181, 1182, 1190, 1186, 1187, - 1191, 1197, 1194, 1196, 1199, 1200, 1203, 1201, 1206, 1208, - 1209, 1231, 1212, 1210, 1213, 1211, 1218, 1219, 1221, 1224, - 1217, 1239, 1241, 1237, 1227, 1243, 1249, 1250, 1258, 1253, - 1256, 1260, 1263, 1267, 1271, 1262, 1269, 1272, 1278, 1281, - 3503, 1287, 1286, 1273, 1280, 1290, 1279, 1288, 1294, 1296, - - 1297, 1299, 1300, 1301, 1311, 3503, 1305, 1307, 1308, 1312, - 1313, 1316, 1320, 1326, 1333, 1309, 3503, 1335, 1336, 1338, - 1331, 1332, 1339, 1342, 1343, 1344, 1348, 1350, 1351, 1347, - 1358, 1360, 1361, 1349, 1366, 1356, 1368, 1371, 1372, 1373, - 1375, 1376, 1379, 1377, 1381, 1389, 1395, 1383, 1397, 1386, - 1392, 1399, 1404, 1401, 1403, 1402, 1407, 3503, 158, 1408, - 1409, 1410, 1418, 1420, 1423, 1426, 1425, 1427, 1429, 1433, - 1416, 1436, 1437, 1443, 1440, 1438, 1445, 1446, 1449, 1450, - 1452, 1414, 1453, 1455, 1462, 1459, 1463, 1460, 1469, 1461, - 1472, 1474, 1475, 1476, 1477, 1480, 1481, 1484, 1483, 1485, - - 1486, 3503, 1497, 1493, 1494, 1491, 1503, 1514, 1500, 1515, - 1504, 1512, 1523, 1524, 1522, 1526, 1528, 1530, 1532, 1506, - 1533, 1540, 1541, 1538, 1542, 1544, 1547, 1534, 3503, 1550, - 1549, 1552, 1556, 1568, 1555, 1557, 1566, 1559, 1561, 1571, - 1578, 1572, 1581, 3503, 1582, 1583, 1575, 1590, 1584, 1592, - 1593, 1600, 1586, 1597, 1595, 1605, 1607, 1601, 1609, 1611, - 3503, 1617, 1621, 1620, 1627, 1614, 1613, 1624, 1629, 1626, - 1630, 1636, 1634, 1637, 1633, 1638, 1639, 1641, 1642, 1644, - 1647, 1643, 1650, 3503, 1664, 1649, 1660, 1669, 1651, 1675, - 1672, 1673, 1674, 1677, 1678, 1680, 1679, 1681, 1682, 1687, - - 1683, 1690, 1691, 1692, 1689, 1694, 1688, 1709, 1698, 1710, - 1700, 1711, 1712, 1713, 1725, 1726, 1722, 3503, 1728, 1724, - 1729, 1730, 1731, 1737, 1739, 1735, 1740, 1741, 1743, 1745, - 1752, 1746, 1749, 1753, 1755, 1756, 1748, 1758, 1760, 1763, - 1766, 1776, 1764, 1778, 1779, 1782, 3503, 1783, 1786, 1789, - 1791, 1790, 1798, 3503, 1781, 3503, 1797, 1804, 1811, 3503, - 1808, 3503, 1813, 3503, 1814, 1815, 1809, 1796, 1818, 1820, - 1819, 1823, 1826, 1827, 1829, 1830, 1831, 1833, 1837, 3503, - 1836, 1839, 1843, 1840, 1838, 1847, 1848, 1849, 1859, 1850, - 1865, 1856, 1868, 1864, 1871, 1866, 3503, 1862, 1873, 1875, - - 1877, 1882, 1884, 1889, 1881, 1891, 1880, 1892, 1898, 1901, - 1899, 1903, 1904, 1906, 1912, 1908, 1909, 1916, 1913, 1910, - 1919, 1920, 1921, 1925, 1923, 1932, 1926, 1929, 1930, 3503, - 1933, 1941, 1943, 1945, 1942, 3503, 3503, 1948, 1952, 1959, - 1944, 1953, 1961, 1963, 1965, 1971, 1968, 1969, 1970, 1973, - 1976, 1981, 1977, 1978, 1984, 1979, 1988, 1982, 1998, 1992, - 1994, 3503, 2005, 2003, 2011, 2008, 2007, 2015, 2009, 2016, - 3503, 3503, 2018, 2017, 2020, 2023, 2029, 2028, 2031, 3503, - 2032, 2033, 2034, 2035, 2036, 2045, 2043, 2046, 2048, 2050, - 2051, 2053, 2055, 2056, 2062, 2059, 2060, 2063, 2073, 2074, - - 2080, 3503, 2076, 2082, 2083, 2084, 2087, 2086, 2088, 2092, - 2090, 2091, 2093, 2101, 2107, 2094, 2104, 2105, 2110, 2106, - 2114, 2117, 2118, 2124, 2127, 3503, 2133, 2120, 2134, 2121, - 2132, 2135, 2142, 2139, 2140, 2141, 2143, 2145, 2144, 2148, - 2149, 2154, 2150, 3503, 2157, 2168, 2156, 2162, 2164, 2172, - 2176, 2174, 2178, 3503, 2179, 2185, 2181, 2182, 2188, 2187, - 2190, 2193, 2191, 2196, 2192, 2203, 2199, 2197, 2207, 2205, - 2209, 2210, 2212, 2213, 2227, 2219, 2232, 2216, 2224, 2234, - 2240, 2246, 2247, 2233, 2236, 2249, 2243, 2250, 2251, 2252, - 2258, 2256, 2262, 2260, 3503, 2261, 2265, 2268, 2270, 2271, - - 2273, 2275, 2276, 2274, 3503, 2281, 3503, 2284, 3503, 2285, - 2288, 2289, 2290, 2292, 2293, 2294, 2295, 2306, 2302, 3503, - 2303, 2305, 2308, 2311, 3503, 2314, 3503, 3503, 2307, 2318, - 2324, 2321, 2325, 2068, 2328, 3503, 2214, 2329, 2330, 2333, - 2334, 2335, 2336, 2339, 2337, 2340, 2341, 3503, 2345, 2344, - 2353, 2354, 3503, 2343, 2359, 2356, 2362, 2364, 2365, 2368, - 2369, 2372, 2379, 2375, 2376, 3503, 2377, 2381, 2386, 2388, - 2378, 2383, 2399, 2397, 2398, 2401, 2405, 2404, 2407, 2408, - 3503, 2410, 2418, 3503, 2409, 2391, 2412, 3503, 2419, 3503, - 2421, 2424, 2426, 2429, 2431, 2432, 2434, 2435, 2436, 2437, - - 2443, 2445, 2447, 2446, 3503, 3503, 2449, 2450, 2453, 2457, - 2460, 2461, 2462, 2464, 3503, 2465, 2468, 2469, 2470, 2471, - 2475, 2478, 2481, 2482, 2474, 2483, 2477, 2487, 3503, 2484, - 2491, 2495, 2496, 2497, 2498, 3503, 2500, 2501, 2505, 2502, - 2508, 2510, 2513, 2523, 2520, 2525, 2527, 2529, 2530, 2532, - 2535, 2536, 3503, 2537, 2539, 2540, 2544, 2545, 2541, 2548, - 2552, 2557, 2546, 2550, 2565, 3503, 2554, 2558, 2560, 2562, - 2571, 2567, 2573, 2576, 2577, 2579, 2580, 2582, 2583, 2584, - 2585, 2589, 2590, 2591, 2595, 2593, 2601, 2599, 3503, 2598, - 3503, 2610, 2611, 2614, 2615, 3503, 2613, 2617, 3503, 2620, - - 3503, 2622, 2629, 2621, 2631, 3503, 2636, 2623, 2638, 2633, - 2640, 2627, 2642, 3503, 2644, 2647, 2652, 2653, 2649, 2656, - 2655, 2657, 2660, 2666, 2662, 3503, 2663, 2667, 2676, 2673, - 2678, 3503, 3503, 2674, 3503, 3503, 3503, 2683, 3503, 3503, - 2684, 2686, 3503, 2688, 3503, 2695, 2691, 2693, 2694, 2696, - 3503, 2698, 2700, 3503, 2697, 2707, 2703, 2704, 3503, 2712, - 3503, 2708, 2715, 2714, 2718, 2725, 2727, 2730, 2720, 2722, - 2731, 2733, 2734, 2736, 2735, 2738, 2739, 2742, 2744, 2747, - 2749, 2751, 2752, 2750, 2753, 2754, 2757, 2762, 3503, 3503, - 2763, 2766, 2767, 2771, 2769, 2774, 2775, 2776, 3503, 2780, - - 2781, 2785, 2782, 2786, 2787, 2795, 2788, 2799, 2801, 2800, - 2802, 2803, 2806, 3503, 2808, 3503, 3503, 2809, 2810, 2815, - 2816, 2812, 2819, 3503, 2820, 2821, 2833, 2824, 3503, 2839, - 2828, 2841, 2843, 3503, 3503, 3503, 2844, 2834, 2846, 2848, - 2849, 2850, 2851, 3503, 2852, 2857, 2858, 2860, 2865, 2871, - 2866, 2868, 2877, 2879, 3503, 3503, 2885, 2882, 2883, 2872, - 2874, 2884, 2890, 2887, 3503, 2891, 2893, 2896, 2897, 2898, - 2900, 2903, 3503, 2902, 2904, 2908, 2914, 2910, 2916, 2917, - 2918, 3503, 2920, 2922, 2926, 2928, 2931, 3503, 2932, 3503, - 2937, 3503, 3503, 2934, 2938, 2940, 2945, 2948, 2950, 2941, - - 2951, 2957, 2956, 2958, 3503, 3503, 2960, 2968, 3503, 3503, - 2953, 2964, 2961, 2967, 2972, 2974, 2975, 2976, 2977, 2980, - 2982, 2985, 2988, 2978, 2989, 2990, 2991, 2992, 3503, 2997, - 3503, 2995, 3003, 3004, 3005, 3006, 3010, 3007, 3016, 3503, - 3017, 3018, 3019, 3503, 3503, 3503, 3022, 3023, 3028, 3503, - 3029, 3031, 3032, 3033, 3036, 3035, 3043, 3039, 3046, 3503, - 3042, 3047, 3049, 3051, 3050, 3056, 3057, 3058, 3060, 3063, - 3068, 3069, 3071, 3073, 3503, 3075, 3077, 3079, 3503, 3080, - 3082, 3083, 3085, 3087, 3090, 3091, 3092, 3094, 3095, 3098, - 3099, 3100, 3106, 3108, 3111, 3503, 3114, 3115, 3503, 3116, - - 3117, 3122, 3124, 3129, 3133, 3130, 3503, 3137, 3503, 3138, - 3503, 3141, 3142, 3143, 3145, 3146, 3503, 3503, 3147, 3149, - 3153, 3503, 3154, 3150, 3157, 3160, 3161, 3163, 3164, 3503, - 3503, 3165, 3167, 3171, 3168, 3503, 3503, 3503, 3174, 3503, - 3177, 3503, 3183, 3180, 3503, 3187, 3188, 3503, 3189, 3191, - 3193, 3195, 3196, 3197, 3199, 3200, 3198, 3202, 3503, 3503, - 3209, 3503, 3213, 3503, 3215, 3503, 3210, 3223, 3503, 3503, - 3221, 3219, 3225, 3226, 3228, 3227, 3503, 3503, 3503, 3503, - 3231, 3229, 3234, 3232, 3236, 3237, 3238, 3240, 3242, 3239, - 3252, 3256, 3244, 3250, 3264, 3258, 3503, 3260, 3262, 3271, - - 3273, 3270, 3267, 3274, 3276, 3277, 3278, 3279, 3282, 3283, - 3289, 3285, 3286, 3295, 3297, 3298, 3299, 3310, 3307, 3308, - 3309, 3311, 3317, 3313, 3314, 3503, 3316, 3319, 3320, 3322, - 3323, 3326, 3325, 3333, 3336, 3340, 3341, 3342, 3347, 3343, - 3349, 3351, 3352, 3353, 3503, 3354, 3355, 3358, 3362, 3363, - 3365, 3366, 3367, 3374, 3369, 3379, 3383, 3380, 3503, 3386, - 3503, 3503, 3388, 3371, 3375, 3396, 3398, 3503, 3503, 3503, - 3411, 3418, 3425, 3432, 3439, 94, 3446, 3453, 3460, 3467, - 3474, 3481, 3488, 3495 + 0, 0, 64, 67, 70, 72, 78, 84, 89, 92, + 131, 137, 473, 390, 96, 6214, 6214, 6214, 109, 111, + 142, 180, 86, 133, 138, 172, 50, 151, 91, 181, + 197, 124, 241, 187, 225, 289, 233, 228, 253, 307, + 385, 6214, 6214, 6214, 95, 362, 6214, 6214, 6214, 102, + 331, 364, 6214, 6214, 6214, 311, 317, 6214, 6214, 6214, + 116, 245, 6214, 321, 6214, 265, 328, 221, 334, 160, + 0, 338, 0, 0, 141, 206, 184, 330, 322, 255, + 323, 335, 324, 222, 268, 350, 325, 334, 344, 357, + 358, 352, 367, 364, 389, 160, 361, 388, 394, 214, + + 373, 400, 391, 383, 399, 416, 410, 414, 407, 421, + 437, 424, 448, 425, 434, 178, 431, 464, 441, 460, + 458, 462, 461, 468, 263, 490, 488, 487, 476, 491, + 212, 171, 170, 241, 164, 533, 146, 85, 284, 77, + 539, 543, 0, 509, 511, 534, 526, 536, 523, 530, + 546, 527, 539, 554, 553, 559, 557, 580, 624, 561, + 571, 572, 586, 569, 589, 597, 581, 579, 619, 585, + 609, 610, 646, 612, 627, 570, 622, 661, 630, 626, + 642, 653, 670, 673, 681, 671, 669, 677, 665, 680, + 662, 679, 688, 690, 703, 700, 699, 715, 717, 702, + + 704, 714, 708, 729, 723, 727, 728, 738, 741, 735, + 763, 742, 764, 744, 758, 755, 765, 745, 772, 769, + 760, 784, 761, 789, 778, 782, 792, 810, 813, 578, + 797, 816, 819, 802, 806, 823, 824, 822, 832, 838, + 837, 834, 849, 841, 836, 839, 846, 847, 868, 872, + 853, 866, 859, 881, 873, 876, 883, 886, 878, 902, + 897, 904, 899, 909, 938, 359, 924, 915, 928, 936, + 944, 901, 951, 949, 942, 955, 946, 917, 959, 966, + 961, 971, 970, 984, 987, 977, 994, 996, 999, 998, + 1007, 980, 997, 1017, 1026, 1019, 1071, 1021, 1032, 1043, + + 1030, 1035, 1034, 1044, 1040, 1042, 1055, 1057, 1078, 1084, + 1079, 1100, 1076, 1095, 1101, 1102, 1099, 1092, 1104, 1134, + 1098, 1114, 1121, 1125, 1136, 1140, 1143, 1128, 1142, 1159, + 1149, 1145, 1171, 1151, 1164, 1161, 1174, 1186, 1187, 1173, + 1183, 1189, 1039, 1195, 1202, 1199, 1191, 1200, 1206, 1213, + 1216, 1220, 1230, 1229, 1214, 1236, 6214, 1243, 1227, 1238, + 1240, 1233, 1247, 6214, 1261, 1257, 1255, 1209, 1263, 1273, + 1271, 1260, 1288, 1286, 1296, 1280, 1292, 1295, 1282, 1298, + 1305, 1306, 1310, 1308, 1354, 1316, 1312, 1318, 1345, 1339, + 1329, 1265, 1332, 1347, 1337, 1356, 1363, 1366, 1364, 1383, + + 1387, 1375, 1377, 1393, 6214, 1397, 1376, 1404, 1283, 1395, + 1390, 979, 1411, 1406, 1414, 1415, 1426, 1417, 1425, 1431, + 1420, 1421, 1451, 1442, 1440, 1449, 1465, 1450, 1462, 1470, + 1447, 1466, 1453, 1467, 1469, 1484, 1477, 1483, 1480, 1486, + 1488, 1482, 1476, 1513, 1500, 1504, 1502, 1514, 1517, 1509, + 1529, 1526, 1527, 1533, 1534, 1546, 1542, 1550, 1560, 1561, + 1552, 1555, 1547, 1566, 1573, 1577, 1578, 1557, 1582, 1586, + 1584, 1603, 1588, 1601, 1617, 1595, 1607, 1619, 1602, 1615, + 1622, 1614, 1627, 1636, 1637, 1618, 1648, 1639, 1653, 1642, + 1644, 1649, 1652, 1657, 1647, 1663, 1673, 1667, 1666, 1697, + + 1677, 1679, 1700, 1699, 1704, 1702, 1693, 1692, 1708, 1705, + 1717, 1726, 1732, 1735, 1723, 1736, 1738, 1731, 1742, 1749, + 1752, 1753, 1725, 1774, 1762, 6214, 1758, 1761, 1766, 1787, + 1778, 1776, 1792, 1788, 1779, 1782, 1800, 1843, 6214, 1784, + 6214, 6214, 1795, 6214, 6214, 1822, 1802, 1826, 1815, 1832, + 1805, 1892, 1836, 1819, 1827, 1839, 1847, 1844, 1849, 1860, + 1858, 1879, 1876, 1875, 1885, 1895, 1874, 1906, 1889, 1908, + 1907, 1913, 1903, 1929, 1921, 1920, 1923, 1944, 1941, 1842, + 1934, 1948, 1947, 1949, 1950, 1942, 1959, 1955, 1969, 1963, + 1956, 1971, 1954, 1974, 6214, 1985, 1986, 1996, 1992, 1989, + + 2001, 1990, 1991, 1980, 2022, 6214, 2007, 2008, 2016, 2034, + 2017, 2020, 2019, 2028, 2036, 2046, 2024, 2035, 2044, 2047, + 2043, 2052, 2056, 2062, 2064, 2081, 2092, 2084, 2071, 2083, + 2089, 2072, 2096, 2101, 2099, 2086, 2087, 2106, 2098, 2107, + 2114, 2112, 2120, 2133, 2117, 2116, 2124, 2122, 2125, 2171, + 2156, 2144, 2139, 2143, 2173, 2163, 2167, 2175, 2158, 2179, + 2184, 2181, 2207, 2186, 2183, 2200, 2203, 2219, 2231, 2228, + 75, 2258, 2223, 2224, 2226, 2230, 2244, 2233, 2246, 2247, + 2249, 2251, 2236, 2271, 6214, 2252, 2279, 2273, 2267, 2288, + 2285, 2286, 2287, 2294, 2283, 2307, 2301, 2313, 2302, 2310, + + 2311, 2326, 2327, 2306, 6214, 2325, 2323, 2328, 2329, 2343, + 2352, 2354, 2351, 2340, 2366, 2361, 6214, 2349, 2377, 2379, + 2382, 2375, 2370, 2376, 2369, 2378, 2392, 2373, 2403, 2397, + 2406, 2409, 2415, 6214, 2393, 2407, 2422, 2429, 2430, 2419, + 2440, 2426, 2432, 2425, 2434, 2436, 2453, 2455, 6214, 2450, + 2459, 2454, 2457, 2478, 2480, 2461, 2474, 2483, 2471, 2477, + 2481, 291, 2482, 2485, 2492, 2472, 6214, 2495, 68, 2488, + 2498, 2496, 2531, 2533, 2525, 2532, 2537, 2521, 2522, 2539, + 2538, 2527, 2540, 2541, 2551, 2545, 2561, 2558, 2571, 2559, + 2589, 6214, 2554, 2582, 2583, 2585, 2588, 2566, 2586, 2596, + + 2573, 2602, 2606, 6214, 2620, 2623, 2615, 2616, 2611, 2621, + 2632, 2628, 2618, 2635, 2626, 2643, 2645, 2641, 2653, 2665, + 6214, 2651, 2655, 2667, 2657, 2676, 2678, 2691, 2666, 2683, + 2682, 2688, 2686, 2698, 2684, 2705, 2709, 2710, 2715, 2716, + 2722, 2708, 2718, 2724, 2717, 2712, 2743, 2745, 2747, 2749, + 2772, 2766, 153, 2751, 6214, 2756, 2758, 2750, 2755, 2771, + 2770, 2787, 2782, 2794, 2789, 2791, 2795, 2806, 2785, 2815, + 2807, 2811, 2825, 6214, 2832, 2822, 2817, 2839, 2821, 2840, + 2838, 2829, 2845, 2837, 2853, 2847, 2856, 2859, 2851, 2865, + 2866, 2862, 6214, 2881, 2884, 2885, 2886, 2882, 2876, 2883, + + 2897, 2879, 2887, 2878, 2909, 2905, 2896, 2903, 2906, 2911, + 2926, 2917, 2914, 2913, 2930, 2945, 2928, 2943, 6214, 2940, + 2965, 2941, 2953, 2949, 2956, 2964, 2977, 2967, 2978, 2980, + 2976, 2966, 2973, 2991, 2990, 2992, 2993, 6214, 2998, 2997, + 2970, 3011, 3007, 3012, 3016, 3014, 3025, 3028, 3039, 3029, + 3036, 3048, 3038, 3040, 3043, 3054, 3056, 3066, 3067, 3076, + 6214, 3069, 3074, 3070, 3071, 3080, 3073, 3063, 3113, 3115, + 3072, 3098, 3099, 3101, 3107, 3095, 3104, 3105, 3129, 3108, + 3114, 3124, 3130, 3125, 3132, 3131, 3135, 3134, 3155, 3165, + 3163, 3170, 3156, 3162, 3159, 3185, 6214, 3158, 3184, 3175, + + 3176, 3189, 3186, 3192, 3195, 3182, 3207, 6214, 3199, 6214, + 3216, 3222, 3229, 6214, 3225, 6214, 3228, 3214, 6214, 3232, + 3237, 3224, 3220, 3226, 3231, 3246, 3254, 3256, 3248, 3269, + 3249, 3263, 3273, 3259, 3275, 6214, 3279, 3264, 3285, 3283, + 3287, 3288, 3293, 3294, 3311, 3297, 3320, 3318, 3298, 3307, + 3333, 6214, 3315, 3331, 3332, 3330, 6214, 3328, 3338, 3340, + 3319, 3346, 3345, 3350, 3349, 3368, 3358, 3365, 3372, 3375, + 3357, 3384, 3388, 3389, 3373, 3385, 3383, 3398, 3400, 3399, + 3396, 3401, 3420, 3416, 3411, 3414, 3415, 3410, 3422, 3427, + 3431, 3445, 3430, 3432, 3441, 3443, 6214, 3453, 3440, 3468, + + 3454, 3458, 3466, 3467, 6214, 3484, 6214, 3449, 3486, 3488, + 3487, 3470, 3493, 3491, 3494, 3500, 3497, 3513, 3517, 3508, + 3512, 3510, 3511, 3514, 3526, 3531, 6214, 3520, 3530, 3550, + 3536, 3553, 3549, 3559, 3555, 3565, 3566, 6214, 3570, 3572, + 3573, 3579, 3576, 3582, 6214, 3575, 3578, 3585, 3604, 6214, + 6214, 3577, 3600, 3601, 3602, 3597, 3623, 3603, 3615, 6214, + 3621, 3612, 3622, 3631, 3639, 3640, 3628, 3629, 6214, 3642, + 3638, 3647, 3655, 3656, 3658, 3654, 3660, 3659, 3663, 3674, + 3671, 3651, 3688, 3676, 6214, 3689, 3684, 3696, 3687, 3703, + 3686, 3690, 3704, 3719, 3700, 3698, 3713, 3729, 3726, 3718, + + 3727, 3741, 3749, 3731, 3740, 3723, 3747, 3737, 3760, 3745, + 3763, 3767, 3778, 3774, 6214, 3783, 3762, 3786, 3770, 3779, + 3785, 3787, 3796, 3805, 3800, 3801, 3804, 3806, 6214, 3808, + 3802, 3809, 3811, 3813, 3833, 3822, 3828, 3836, 3825, 6214, + 6214, 3832, 3835, 3854, 3843, 3860, 3862, 3846, 3864, 3848, + 3863, 6214, 3873, 3881, 3866, 3875, 3885, 3889, 3888, 3890, + 3887, 3877, 3884, 3898, 3904, 3900, 3893, 3920, 3911, 3924, + 6214, 3913, 3914, 3916, 3938, 3927, 3930, 3936, 3956, 3949, + 3931, 3947, 3948, 3955, 3964, 3978, 3975, 3954, 3965, 3989, + 6214, 3973, 3982, 3981, 3962, 3995, 3974, 4002, 3991, 6214, + + 4007, 3997, 4006, 4011, 3999, 4020, 4015, 4012, 4022, 4018, + 6214, 4026, 6214, 4029, 4023, 6214, 4024, 4040, 4041, 4034, + 4055, 4057, 4044, 4056, 4048, 4050, 4068, 4071, 4078, 4067, + 6214, 4073, 4062, 4077, 4079, 6214, 4090, 6214, 4093, 6214, + 4087, 4083, 4116, 4101, 4120, 4117, 4122, 4115, 6214, 4124, + 4105, 4126, 4128, 4112, 4129, 4145, 4147, 4108, 4148, 4160, + 6214, 4142, 4150, 6214, 4168, 4138, 4153, 4176, 4175, 6214, + 4169, 4183, 6214, 4174, 4191, 4187, 4189, 4190, 4199, 4202, + 4193, 4203, 4227, 4219, 4212, 4220, 6214, 4214, 4218, 4235, + 4236, 4229, 4222, 4241, 4238, 4246, 4245, 4252, 4260, 4265, + + 4256, 4255, 4266, 4269, 4279, 6214, 4262, 4281, 6214, 4282, + 4270, 4280, 4283, 6214, 4294, 6214, 4296, 4297, 4289, 4306, + 4311, 4310, 4320, 4309, 4326, 4327, 4318, 4340, 4335, 4324, + 6214, 6214, 4334, 4348, 4341, 4352, 4355, 4353, 4342, 4369, + 4361, 4372, 4368, 6214, 4370, 4358, 6214, 4359, 4376, 4371, + 4387, 4386, 4388, 4393, 4389, 4400, 4392, 4405, 4396, 4398, + 6214, 4411, 4401, 4415, 4416, 4419, 4414, 4427, 6214, 4432, + 4445, 4449, 4437, 4441, 4443, 4457, 4460, 4461, 4454, 4465, + 4462, 4482, 4471, 4473, 4480, 4474, 4486, 4477, 4497, 4499, + 4488, 4484, 6214, 4501, 4508, 4498, 4510, 4496, 4513, 4509, + + 4515, 4527, 4526, 4523, 4528, 4532, 6214, 4529, 4525, 4536, + 4530, 4560, 4543, 4564, 4546, 4561, 4553, 4570, 4558, 4575, + 6214, 4557, 4576, 4565, 4573, 4578, 4596, 4602, 4594, 4603, + 4605, 4597, 4588, 4606, 6214, 4598, 6214, 4613, 4615, 4624, + 4626, 4628, 6214, 4629, 4637, 6214, 4640, 4604, 4645, 6214, + 4655, 4654, 4641, 4651, 4660, 6214, 4665, 4664, 4671, 4670, + 4662, 4673, 4668, 4679, 4675, 4682, 6214, 4695, 4701, 4705, + 4703, 4691, 4692, 4700, 4709, 4696, 4710, 4722, 4718, 4707, + 6214, 4717, 4741, 4734, 4739, 4748, 6214, 6214, 4740, 4752, + 4755, 4730, 4761, 6214, 6214, 6214, 4759, 6214, 4745, 6214, + + 6214, 4760, 4764, 4770, 6214, 4771, 6214, 4781, 4777, 4768, + 4772, 4788, 6214, 4782, 4790, 4800, 6214, 4797, 4808, 4789, + 4795, 6214, 4812, 6214, 4813, 4818, 4820, 4817, 4809, 4816, + 4821, 4831, 4832, 4838, 4837, 4824, 4853, 4843, 4844, 4848, + 4857, 4841, 4863, 4858, 4846, 4859, 4864, 4868, 4882, 4873, + 4884, 4880, 4875, 4885, 4900, 4905, 4909, 4878, 4913, 4915, + 6214, 6214, 4899, 4907, 6214, 4901, 4904, 4911, 4919, 4920, + 4930, 4934, 4953, 6214, 4951, 4946, 4940, 4956, 4944, 4947, + 4957, 4960, 4943, 4964, 4968, 4974, 4970, 4978, 4977, 4967, + 4980, 4986, 5003, 5007, 6214, 4989, 4990, 4992, 6214, 6214, + + 4994, 5015, 5012, 5013, 5004, 5024, 5025, 6214, 5017, 5039, + 5026, 5033, 6214, 5047, 6214, 5048, 5031, 5054, 5052, 5061, + 6214, 6214, 6214, 5062, 5042, 5055, 5056, 5066, 5067, 5059, + 5077, 6214, 5081, 5075, 5082, 5086, 5076, 5097, 5093, 5105, + 5111, 5112, 5114, 5103, 5116, 5119, 6214, 6214, 5108, 5131, + 5120, 5127, 5129, 5135, 5141, 5134, 5128, 5146, 5145, 6214, + 5156, 5148, 5147, 5158, 5155, 5160, 5178, 5161, 6214, 6214, + 5162, 5173, 5175, 5190, 5176, 5192, 5184, 5204, 5188, 5205, + 5139, 5210, 5206, 5208, 6214, 5203, 5211, 6214, 5219, 5202, + 5227, 6214, 5217, 6214, 6214, 5225, 6214, 5228, 6214, 5229, + + 5246, 5253, 5254, 5258, 5259, 5260, 5243, 5250, 5267, 5263, + 5262, 6214, 6214, 5272, 5255, 5265, 5270, 5275, 5279, 6214, + 6214, 5290, 5293, 6214, 5276, 5291, 5299, 5289, 5292, 5297, + 5313, 5302, 5306, 5318, 5324, 5329, 5331, 5326, 5338, 5327, + 5323, 5335, 5340, 5341, 6214, 5346, 5352, 5345, 6214, 5366, + 5370, 5368, 6214, 5362, 5378, 5379, 5372, 5369, 5391, 5385, + 5392, 6214, 5394, 5400, 5402, 6214, 5388, 6214, 6214, 6214, + 5411, 5419, 5408, 6214, 5418, 5429, 6214, 5422, 5415, 5412, + 5407, 5443, 5436, 5447, 5437, 5434, 5449, 5440, 5467, 5441, + 5465, 6214, 5450, 5456, 5472, 5460, 5474, 5475, 5464, 5470, + + 5482, 5481, 5477, 5488, 5487, 6214, 5495, 5510, 6214, 5512, + 5502, 5514, 6214, 5520, 5501, 5500, 5505, 6214, 5525, 5517, + 6214, 5513, 5534, 5536, 5530, 5542, 5539, 5538, 5540, 5555, + 6214, 5548, 5544, 5547, 5568, 5569, 5561, 6214, 5573, 5558, + 5585, 5575, 5584, 6214, 5589, 5571, 6214, 5594, 5596, 5583, + 5598, 5607, 5608, 5609, 5610, 6214, 5613, 6214, 6214, 6214, + 5600, 5617, 6214, 5614, 5612, 5611, 5620, 5632, 5628, 6214, + 6214, 5635, 5646, 5645, 6214, 5634, 5637, 5647, 5636, 5659, + 6214, 5658, 5649, 5653, 5651, 5670, 5662, 5663, 6214, 6214, + 5679, 6214, 5682, 5691, 5696, 6214, 6214, 6214, 5701, 6214, + + 5704, 5703, 6214, 5705, 5690, 5697, 6214, 5712, 5698, 6214, + 5702, 5710, 5715, 5721, 5722, 5718, 5731, 5741, 5725, 5729, + 5730, 5748, 5749, 5740, 5755, 6214, 6214, 5761, 6214, 5762, + 5764, 5765, 6214, 5757, 5769, 6214, 5758, 5771, 5768, 5773, + 6214, 6214, 5776, 5784, 6214, 5779, 5788, 5785, 5782, 5786, + 5789, 6214, 6214, 6214, 6214, 6214, 5815, 6214, 5803, 5799, + 5806, 6214, 5800, 5797, 5809, 5821, 5825, 5828, 5812, 5826, + 5831, 5838, 5845, 5856, 5858, 5857, 5855, 5861, 5848, 5847, + 5868, 5863, 5869, 6214, 5864, 6214, 5874, 6214, 5875, 5881, + 5885, 5883, 5886, 5884, 6214, 5891, 5910, 5888, 5896, 5904, + + 5901, 5911, 5922, 5906, 5929, 5934, 5937, 5940, 5941, 5931, + 5944, 5948, 6214, 5952, 5936, 5938, 5956, 5947, 5963, 6214, + 5965, 5961, 5962, 5972, 5977, 5982, 5975, 5990, 5995, 5993, + 5999, 5992, 6000, 6003, 6008, 5997, 6023, 6012, 6214, 6024, + 6027, 6017, 6021, 6033, 6022, 6026, 6046, 6052, 6050, 6062, + 6064, 6058, 6214, 6061, 6214, 6214, 6070, 6059, 6063, 6069, + 6071, 6214, 6214, 6214, 6122, 6129, 6136, 6143, 6150, 100, + 6157, 6164, 6171, 6178, 6185, 6192, 6199, 6206 } ; -static yyconst flex_int16_t yy_def[1785] = +static yyconst flex_int16_t yy_def[2179] = { 0, - 1770, 1, 1771, 1771, 1772, 1772, 1773, 1773, 1774, 1774, - 1775, 1775, 1770, 1776, 1770, 1770, 1770, 1770, 1777, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1778, 1770, 1770, 1770, 1778, 1779, 1770, 1770, 1770, 1779, - 1780, 1770, 1770, 1770, 1770, 1780, 1781, 1770, 1770, 1770, - 1781, 1782, 1770, 1783, 1770, 1782, 1782, 1776, 1776, 1770, - 1784, 1777, 1784, 1777, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1778, 1778, 1779, 1779, - 1780, 1780, 1770, 1781, 1781, 1782, 1782, 1783, 1783, 1782, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - - 1776, 1782, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1782, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1782, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1782, 1776, 1776, 1776, 1776, 1776, - 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, - 1776, 1770, 1770, 1776, 1770, 1770, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1782, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - - 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1782, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - - 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, - 1776, 1776, 1776, 1770, 1776, 1770, 1776, 1776, 1776, 1770, - 1776, 1770, 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, - - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, - 1776, 1776, 1776, 1776, 1776, 1770, 1770, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1770, 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - - 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, - - 1776, 1776, 1776, 1776, 1770, 1776, 1770, 1776, 1770, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, - 1776, 1776, 1776, 1776, 1770, 1776, 1770, 1770, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, - 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1770, 1776, 1776, 1770, 1776, 1776, 1776, 1770, 1776, 1770, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - - 1776, 1776, 1776, 1776, 1770, 1770, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, - 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, - 1770, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1770, 1776, - - 1770, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, - 1776, 1770, 1770, 1776, 1770, 1770, 1770, 1776, 1770, 1770, - 1776, 1776, 1770, 1776, 1770, 1776, 1776, 1776, 1776, 1776, - 1770, 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1770, 1776, - 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1770, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, - - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1770, 1776, 1770, 1770, 1776, 1776, 1776, - 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1770, 1776, - 1776, 1776, 1776, 1770, 1770, 1770, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1770, 1770, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1770, - 1776, 1770, 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - - 1776, 1776, 1776, 1776, 1770, 1770, 1776, 1776, 1770, 1770, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, - 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, - 1776, 1776, 1776, 1770, 1770, 1770, 1776, 1776, 1776, 1770, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1770, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1770, 1776, - - 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1770, 1776, - 1770, 1776, 1776, 1776, 1776, 1776, 1770, 1770, 1776, 1776, - 1776, 1770, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, - 1770, 1776, 1776, 1776, 1776, 1770, 1770, 1770, 1776, 1770, - 1776, 1770, 1776, 1776, 1770, 1776, 1776, 1770, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1770, - 1776, 1770, 1776, 1770, 1776, 1770, 1776, 1776, 1770, 1770, - 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1770, 1770, 1770, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, - - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1770, 1776, 1776, 1776, 1776, 1776, - 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1776, 1770, 1776, - 1770, 1770, 1776, 1776, 1776, 1776, 1776, 1770, 1770, 0, - 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, - 1770, 1770, 1770, 1770 + 2164, 1, 2165, 2165, 2166, 2166, 2167, 2167, 2168, 2168, + 2169, 2169, 2164, 2170, 2164, 2164, 2164, 2164, 2171, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2172, 2164, 2164, 2164, 2172, 2173, 2164, 2164, 2164, 2173, + 2174, 2164, 2164, 2164, 2164, 2174, 2175, 2164, 2164, 2164, + 2175, 2176, 2164, 2177, 2164, 2176, 2176, 2170, 2170, 2164, + 2178, 2171, 2178, 2171, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2172, 2172, 2173, 2173, 2174, 2174, 2164, 2175, 2175, 2176, + 2176, 2177, 2177, 2176, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2176, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + + 2176, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, + 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2164, 2176, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2176, + 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, + 2164, 2164, 2170, 2164, 2164, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2176, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2176, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + + 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2164, + 2170, 2170, 2170, 2164, 2170, 2164, 2170, 2170, 2164, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2164, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2164, 2170, 2164, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, + 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2164, + 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, + 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, + + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2164, 2170, 2164, 2170, 2170, 2164, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2164, 2170, 2170, 2170, 2170, 2164, 2170, 2164, 2170, 2164, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2164, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2164, + 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2164, 2170, + 2170, 2170, 2170, 2164, 2170, 2164, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2164, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2164, 2170, 2170, 2164, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2164, 2170, 2164, 2170, 2170, 2170, + 2170, 2170, 2164, 2170, 2170, 2164, 2170, 2170, 2170, 2164, + 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2164, 2170, 2170, 2170, 2170, 2170, 2164, 2164, 2170, 2170, + 2170, 2170, 2170, 2164, 2164, 2164, 2170, 2164, 2170, 2164, + + 2164, 2170, 2170, 2170, 2164, 2170, 2164, 2170, 2170, 2170, + 2170, 2170, 2164, 2170, 2170, 2170, 2164, 2170, 2170, 2170, + 2170, 2164, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2164, 2164, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2164, 2164, + + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, + 2170, 2170, 2164, 2170, 2164, 2170, 2170, 2170, 2170, 2170, + 2164, 2164, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2164, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2164, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2164, 2170, 2170, + 2170, 2164, 2170, 2164, 2164, 2170, 2164, 2170, 2164, 2170, + + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2164, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2164, + 2164, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2164, 2170, + 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2164, 2170, 2170, 2170, 2164, 2170, 2164, 2164, 2164, + 2170, 2170, 2170, 2164, 2170, 2170, 2164, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2164, 2170, + 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2164, 2170, 2170, + 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2170, + 2170, 2170, 2170, 2164, 2170, 2170, 2164, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2164, 2170, 2164, 2164, 2164, + 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2164, + 2164, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, + 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2164, + 2170, 2164, 2170, 2170, 2170, 2164, 2164, 2164, 2170, 2164, + + 2170, 2170, 2164, 2170, 2170, 2170, 2164, 2170, 2170, 2164, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2164, 2164, 2170, 2164, 2170, + 2170, 2170, 2164, 2170, 2170, 2164, 2170, 2170, 2170, 2170, + 2164, 2164, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, + 2170, 2164, 2164, 2164, 2164, 2164, 2170, 2164, 2170, 2170, + 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2164, 2170, 2164, 2170, 2164, 2170, 2170, + 2170, 2170, 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, + + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2164, 2170, 2170, 2170, 2170, 2170, 2170, 2164, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2164, 2170, + 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, 2170, + 2170, 2170, 2164, 2170, 2164, 2164, 2170, 2170, 2170, 2170, + 2170, 2164, 2164, 0, 2164, 2164, 2164, 2164, 2164, 2164, + 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164 } ; -static yyconst flex_int16_t yy_nxt[3543] = +static yyconst flex_uint16_t yy_nxt[6281] = { 0, 14, 15, 16, 17, 18, 19, 18, 14, 14, 14, - 14, 18, 20, 21, 14, 22, 23, 24, 25, 14, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 14, 14, 14, 14, 42, - 43, 44, 42, 43, 44, 129, 47, 48, 129, 45, - 49, 70, 45, 47, 48, 71, 50, 49, 58, 59, - 60, 69, 69, 50, 52, 53, 54, 55, 61, 18, - 58, 59, 60, 127, 127, 56, 52, 53, 54, 55, - 61, 18, 69, 105, 224, 75, 76, 56, 15, 16, - 17, 63, 64, 65, 68, 68, 69, 68, 68, 66, - - 68, 96, 69, 77, 69, 68, 86, 69, 67, 15, - 16, 17, 63, 64, 65, 69, 69, 78, 141, 88, - 66, 70, 95, 69, 79, 71, 87, 69, 89, 67, - 73, 80, 73, 73, 69, 73, 90, 69, 97, 69, - 73, 74, 69, 91, 134, 134, 92, 81, 111, 69, - 98, 82, 69, 93, 83, 94, 84, 85, 99, 150, - 69, 102, 69, 112, 100, 103, 123, 113, 101, 69, - 137, 124, 69, 120, 116, 121, 69, 114, 69, 125, - 115, 104, 69, 126, 117, 69, 184, 106, 118, 119, - 122, 107, 69, 131, 146, 131, 131, 108, 131, 73, - - 109, 73, 73, 136, 73, 136, 136, 110, 136, 137, - 139, 68, 143, 68, 68, 69, 68, 69, 69, 142, - 144, 68, 69, 140, 73, 69, 73, 73, 69, 73, - 69, 152, 147, 145, 73, 74, 69, 148, 69, 69, - 149, 69, 69, 69, 154, 69, 158, 151, 159, 153, - 69, 164, 69, 127, 127, 137, 69, 156, 155, 157, - 69, 69, 69, 161, 160, 69, 162, 166, 168, 170, - 69, 165, 169, 69, 172, 171, 69, 69, 69, 69, - 163, 69, 69, 173, 175, 179, 174, 167, 69, 69, - 69, 176, 69, 69, 181, 69, 69, 69, 182, 177, - - 178, 69, 190, 69, 192, 191, 180, 69, 186, 69, - 183, 187, 185, 69, 69, 69, 188, 197, 69, 189, - 69, 69, 129, 199, 193, 129, 69, 194, 131, 195, - 131, 131, 200, 131, 135, 196, 134, 134, 198, 201, - 136, 205, 136, 136, 73, 136, 73, 73, 137, 73, - 69, 202, 69, 204, 69, 139, 69, 203, 69, 69, - 210, 69, 206, 69, 133, 69, 211, 213, 212, 207, - 69, 208, 69, 214, 225, 69, 69, 221, 69, 209, - 222, 69, 69, 223, 69, 69, 226, 69, 69, 69, - 233, 69, 69, 232, 132, 215, 69, 228, 227, 229, - - 216, 237, 230, 231, 130, 217, 69, 69, 236, 234, - 218, 235, 69, 238, 239, 241, 219, 220, 69, 69, - 69, 244, 69, 69, 69, 240, 69, 242, 243, 245, - 246, 247, 69, 69, 69, 69, 69, 69, 69, 248, - 250, 69, 251, 252, 69, 253, 249, 69, 69, 254, - 69, 255, 256, 69, 69, 259, 263, 69, 69, 257, - 265, 69, 69, 69, 69, 267, 69, 270, 258, 266, - 69, 69, 261, 262, 271, 260, 269, 264, 273, 69, - 137, 69, 268, 69, 69, 69, 274, 69, 279, 278, - 277, 69, 276, 69, 281, 69, 280, 272, 69, 69, - - 282, 69, 69, 275, 286, 283, 284, 69, 287, 288, - 69, 289, 69, 69, 290, 69, 69, 69, 291, 293, - 285, 294, 69, 296, 69, 69, 298, 69, 69, 300, - 292, 295, 299, 69, 69, 69, 69, 69, 297, 69, - 305, 69, 69, 69, 310, 69, 307, 69, 69, 69, - 304, 311, 69, 301, 302, 69, 303, 309, 69, 306, - 69, 308, 69, 69, 312, 319, 320, 315, 316, 321, - 69, 69, 313, 317, 318, 314, 69, 69, 69, 322, - 69, 328, 69, 69, 330, 69, 69, 326, 323, 327, - 329, 324, 325, 69, 69, 69, 69, 335, 332, 69, - - 69, 331, 69, 338, 337, 339, 333, 69, 69, 69, - 69, 69, 345, 69, 69, 334, 336, 69, 344, 346, - 69, 340, 69, 69, 341, 351, 349, 342, 69, 343, - 69, 347, 137, 348, 350, 69, 69, 353, 69, 362, - 69, 352, 69, 361, 354, 355, 367, 69, 69, 69, - 365, 69, 69, 363, 356, 364, 357, 358, 359, 69, - 366, 360, 69, 444, 370, 69, 372, 371, 369, 375, - 368, 69, 69, 69, 69, 69, 374, 377, 69, 373, - 128, 376, 378, 379, 69, 69, 69, 69, 384, 69, - 69, 381, 69, 380, 382, 69, 385, 69, 383, 388, - - 69, 69, 391, 387, 390, 386, 69, 395, 394, 393, - 392, 69, 389, 69, 69, 396, 69, 397, 69, 398, - 69, 400, 401, 69, 69, 69, 69, 69, 69, 406, - 405, 399, 69, 403, 69, 69, 409, 404, 69, 407, - 69, 410, 69, 69, 402, 69, 69, 69, 69, 69, - 412, 419, 413, 408, 69, 69, 69, 69, 415, 411, - 69, 69, 421, 418, 420, 414, 423, 416, 417, 422, - 69, 69, 424, 69, 69, 69, 69, 427, 69, 69, - 429, 69, 425, 439, 69, 69, 137, 441, 69, 428, - 455, 426, 430, 440, 69, 438, 69, 431, 69, 432, - - 69, 437, 69, 443, 433, 442, 434, 69, 445, 446, - 69, 448, 447, 69, 435, 69, 69, 69, 69, 69, - 451, 456, 69, 69, 436, 452, 69, 69, 69, 449, - 69, 457, 69, 454, 69, 450, 453, 464, 460, 462, - 458, 459, 461, 69, 463, 69, 69, 69, 469, 466, - 69, 69, 470, 69, 472, 69, 473, 69, 475, 69, - 465, 137, 474, 467, 471, 477, 468, 69, 476, 69, - 69, 478, 69, 69, 69, 481, 69, 479, 480, 69, - 69, 483, 485, 482, 69, 69, 69, 69, 69, 486, - 69, 488, 69, 484, 69, 491, 489, 494, 69, 487, - - 490, 69, 69, 500, 492, 69, 493, 495, 496, 69, - 69, 69, 69, 497, 504, 499, 501, 502, 69, 69, - 69, 506, 69, 69, 503, 507, 505, 69, 508, 69, - 69, 511, 69, 513, 69, 498, 69, 512, 69, 514, - 69, 69, 515, 510, 519, 509, 516, 69, 69, 69, - 520, 517, 69, 518, 523, 521, 69, 69, 524, 69, - 69, 69, 525, 527, 69, 69, 69, 526, 69, 69, - 522, 69, 532, 69, 528, 529, 69, 537, 533, 69, - 539, 534, 69, 530, 69, 531, 69, 69, 536, 535, - 540, 69, 69, 69, 69, 538, 542, 69, 541, 69, - - 543, 546, 547, 69, 549, 69, 545, 69, 69, 69, - 548, 544, 550, 69, 137, 552, 69, 69, 553, 555, - 556, 69, 69, 551, 69, 557, 69, 554, 562, 69, - 559, 561, 69, 69, 69, 69, 563, 558, 560, 69, - 69, 69, 565, 566, 567, 69, 564, 69, 69, 69, - 69, 579, 578, 577, 576, 574, 69, 69, 575, 69, - 69, 69, 587, 590, 568, 69, 592, 588, 591, 69, - 569, 69, 593, 69, 570, 589, 594, 571, 69, 595, - 69, 69, 69, 596, 572, 69, 597, 573, 69, 580, - 581, 69, 582, 599, 69, 583, 69, 602, 69, 601, - - 584, 598, 69, 69, 600, 609, 585, 586, 605, 603, - 606, 69, 607, 608, 69, 69, 604, 69, 69, 69, - 610, 69, 69, 611, 69, 69, 69, 612, 619, 614, - 617, 69, 615, 69, 618, 69, 69, 69, 69, 613, - 69, 616, 69, 623, 69, 621, 622, 69, 625, 69, - 69, 69, 624, 627, 620, 69, 630, 626, 69, 69, - 69, 628, 69, 69, 69, 629, 636, 69, 69, 635, - 631, 69, 69, 69, 69, 632, 639, 641, 646, 634, - 633, 637, 640, 638, 644, 645, 69, 643, 69, 69, - 69, 69, 642, 69, 69, 651, 649, 652, 69, 69, - - 648, 653, 69, 69, 656, 647, 69, 658, 69, 69, - 659, 137, 69, 69, 650, 69, 655, 654, 69, 661, - 69, 69, 69, 69, 69, 69, 657, 660, 672, 69, - 69, 69, 662, 69, 664, 676, 69, 673, 675, 69, - 679, 665, 663, 69, 680, 677, 666, 678, 667, 69, - 674, 69, 668, 69, 669, 69, 681, 688, 683, 670, - 685, 69, 69, 684, 671, 69, 682, 687, 69, 686, - 69, 689, 69, 694, 69, 69, 690, 693, 691, 69, - 697, 69, 699, 69, 69, 69, 695, 696, 698, 702, - 69, 69, 69, 69, 704, 700, 692, 703, 69, 69, - - 69, 705, 69, 701, 706, 707, 69, 708, 69, 69, - 709, 69, 69, 69, 713, 711, 710, 69, 717, 69, - 69, 69, 716, 69, 69, 69, 715, 712, 69, 721, - 722, 714, 69, 723, 727, 720, 718, 719, 69, 725, - 726, 724, 728, 69, 69, 69, 729, 69, 69, 730, - 69, 69, 731, 732, 69, 69, 69, 733, 737, 69, - 69, 69, 69, 69, 734, 739, 735, 740, 69, 741, - 69, 744, 69, 69, 736, 742, 743, 738, 69, 746, - 69, 747, 745, 69, 69, 69, 748, 69, 69, 69, - 752, 69, 753, 69, 755, 69, 758, 751, 69, 749, - - 756, 69, 759, 750, 69, 757, 754, 69, 761, 69, - 760, 69, 765, 69, 69, 69, 69, 762, 763, 69, - 69, 69, 69, 764, 767, 773, 69, 774, 69, 792, - 69, 766, 69, 768, 770, 69, 771, 69, 69, 69, - 775, 69, 772, 776, 769, 69, 779, 781, 69, 69, - 69, 777, 69, 778, 784, 69, 786, 69, 69, 788, - 780, 69, 69, 782, 69, 69, 789, 69, 783, 790, - 785, 69, 69, 69, 69, 69, 794, 787, 791, 795, - 797, 69, 800, 793, 69, 799, 69, 69, 69, 69, - 796, 798, 69, 69, 803, 69, 69, 69, 69, 801, - - 804, 802, 808, 69, 812, 69, 69, 811, 805, 69, - 809, 807, 69, 806, 814, 69, 69, 810, 69, 813, - 816, 817, 135, 815, 69, 818, 69, 69, 820, 821, - 823, 819, 830, 822, 69, 69, 69, 824, 69, 825, - 69, 827, 69, 826, 69, 69, 69, 832, 833, 829, - 69, 828, 69, 69, 69, 834, 69, 841, 835, 69, - 840, 69, 69, 831, 69, 836, 842, 69, 69, 69, - 837, 69, 838, 69, 839, 846, 843, 845, 69, 847, - 69, 848, 844, 69, 69, 851, 850, 69, 849, 854, - 69, 852, 856, 69, 69, 69, 69, 857, 69, 855, - - 858, 860, 69, 862, 69, 69, 859, 69, 853, 69, - 863, 864, 69, 69, 866, 867, 861, 69, 865, 69, - 869, 69, 868, 69, 873, 69, 69, 871, 874, 69, - 872, 870, 69, 69, 876, 877, 69, 875, 69, 69, - 880, 69, 69, 883, 878, 69, 69, 879, 69, 69, - 69, 69, 889, 69, 69, 69, 69, 887, 881, 69, - 884, 69, 69, 69, 893, 882, 885, 895, 888, 886, - 898, 896, 69, 890, 892, 897, 69, 901, 894, 891, - 899, 69, 902, 900, 69, 69, 69, 69, 903, 69, - 69, 69, 69, 69, 69, 69, 904, 908, 911, 69, - - 69, 69, 69, 69, 69, 905, 69, 919, 907, 909, - 69, 918, 69, 910, 913, 906, 914, 912, 915, 916, - 917, 69, 69, 69, 69, 69, 920, 923, 921, 924, - 926, 922, 927, 928, 69, 929, 69, 69, 69, 930, - 69, 69, 69, 69, 935, 925, 932, 69, 936, 69, - 937, 69, 69, 69, 931, 69, 933, 69, 69, 943, - 69, 69, 934, 942, 69, 69, 938, 69, 69, 133, - 69, 939, 69, 951, 941, 69, 69, 944, 69, 940, - 945, 949, 948, 953, 946, 950, 947, 952, 69, 955, - 69, 69, 954, 69, 69, 69, 958, 962, 69, 956, - - 959, 69, 69, 69, 957, 966, 963, 964, 69, 69, - 69, 967, 132, 960, 968, 961, 69, 969, 970, 971, - 69, 69, 965, 69, 972, 69, 69, 69, 974, 973, - 69, 69, 69, 976, 980, 69, 975, 978, 69, 69, - 982, 69, 69, 69, 977, 69, 979, 985, 69, 69, - 69, 69, 69, 984, 987, 69, 990, 991, 981, 69, - 69, 69, 69, 983, 986, 989, 988, 997, 69, 994, - 992, 69, 998, 996, 69, 1000, 69, 69, 69, 993, - 69, 995, 1002, 69, 1003, 69, 1005, 69, 999, 69, - 1001, 1011, 69, 69, 69, 130, 69, 1008, 1004, 1006, - - 1009, 69, 1013, 69, 69, 1017, 1012, 1016, 1014, 1007, - 69, 69, 1010, 69, 1018, 69, 69, 1015, 69, 1023, - 69, 69, 69, 1022, 69, 69, 1025, 1026, 69, 1019, - 1027, 69, 69, 69, 1020, 69, 1021, 69, 69, 1034, - 1028, 69, 69, 1024, 69, 69, 128, 1031, 1033, 1032, - 1038, 1029, 1030, 69, 69, 69, 69, 69, 1035, 1044, - 69, 1036, 1040, 1037, 69, 69, 1041, 1045, 1039, 1042, - 1043, 69, 1047, 69, 1048, 69, 1046, 69, 1053, 1054, - 69, 69, 69, 69, 1050, 69, 1052, 1051, 69, 69, - 69, 69, 1049, 69, 69, 1056, 69, 1062, 69, 1065, - - 69, 1055, 1058, 1057, 69, 1059, 69, 1063, 1061, 1064, - 69, 1066, 1071, 1068, 1060, 69, 1069, 69, 1073, 69, - 69, 69, 1076, 69, 1070, 1067, 1074, 69, 69, 69, - 69, 1078, 69, 1072, 1077, 69, 1084, 1079, 1080, 1075, - 69, 69, 1081, 69, 69, 69, 69, 69, 69, 1088, - 1082, 1089, 1090, 1091, 1083, 69, 1085, 69, 69, 1095, - 69, 1086, 69, 69, 1087, 69, 1092, 69, 69, 1101, - 1097, 69, 69, 1094, 69, 69, 1096, 1098, 1093, 1099, - 69, 1104, 1235, 1102, 1105, 69, 69, 1100, 69, 1106, - 1103, 1107, 69, 1109, 69, 69, 69, 1108, 69, 69, - - 69, 1111, 69, 69, 69, 69, 69, 1110, 1112, 1115, - 1113, 1116, 1120, 69, 1121, 1114, 69, 69, 69, 69, - 1119, 1125, 69, 1118, 1117, 1127, 69, 1122, 1128, 69, - 69, 1130, 69, 69, 1129, 1123, 69, 1124, 1126, 69, - 1132, 1134, 1131, 1136, 69, 69, 69, 69, 1137, 1138, - 1133, 69, 69, 69, 69, 69, 69, 69, 1135, 1148, - 69, 69, 69, 1139, 1140, 1141, 69, 1150, 69, 69, - 1142, 1146, 1143, 1144, 69, 1145, 69, 1147, 1152, 1153, - 69, 1155, 1151, 1154, 69, 1156, 69, 1149, 69, 1158, - 69, 69, 1162, 69, 69, 1165, 1161, 69, 1166, 69, - - 69, 1164, 69, 69, 69, 69, 1160, 1167, 69, 69, - 1157, 69, 1159, 1163, 1168, 69, 1171, 69, 1172, 69, - 1175, 69, 69, 1169, 69, 69, 69, 1170, 69, 1173, - 1179, 69, 1176, 1237, 1180, 1174, 69, 1178, 1181, 69, - 1177, 1187, 1182, 1184, 69, 69, 69, 1183, 69, 1185, - 1186, 1188, 69, 1189, 1191, 69, 1194, 1190, 69, 69, - 1193, 69, 69, 69, 69, 1199, 1196, 1195, 69, 1201, - 69, 1192, 69, 69, 69, 1197, 1203, 69, 1204, 1205, - 69, 1206, 69, 69, 1202, 69, 69, 69, 69, 1198, - 1200, 1208, 1209, 69, 1210, 1211, 69, 69, 1212, 1215, - - 69, 69, 69, 1207, 69, 69, 69, 69, 1213, 1214, - 1220, 1217, 1221, 1222, 69, 69, 1224, 69, 69, 69, - 69, 1216, 1218, 69, 1219, 1229, 69, 1225, 1223, 1227, - 69, 1232, 1228, 69, 1230, 1226, 69, 69, 1234, 1236, - 69, 69, 69, 1239, 1231, 69, 69, 69, 69, 69, - 1233, 69, 69, 69, 1240, 69, 69, 69, 1249, 1242, - 1243, 1238, 1248, 1244, 1245, 69, 69, 1241, 69, 1252, - 1253, 69, 1246, 1247, 69, 1251, 69, 69, 1256, 1255, - 69, 69, 1257, 1250, 69, 1258, 1261, 69, 69, 69, - 69, 69, 1262, 69, 1254, 69, 1263, 1266, 69, 1259, - - 69, 1267, 1770, 69, 1260, 1268, 1270, 1265, 1264, 69, - 69, 69, 1272, 69, 1271, 1269, 69, 69, 1276, 69, - 69, 69, 69, 1282, 69, 1273, 1274, 1279, 1277, 1275, - 69, 69, 1278, 69, 1281, 1280, 69, 1284, 69, 1285, - 1283, 69, 1289, 69, 69, 1291, 69, 69, 69, 69, - 1288, 1286, 1293, 1290, 1294, 69, 1296, 69, 69, 69, - 1299, 69, 69, 1287, 1301, 69, 1292, 1297, 1295, 69, - 1302, 1300, 69, 69, 69, 1306, 69, 69, 1298, 1305, - 69, 69, 69, 69, 1303, 1308, 69, 69, 1311, 69, - 69, 1304, 1314, 69, 69, 69, 69, 1310, 1315, 69, - - 1317, 1316, 1307, 69, 1309, 1312, 1313, 69, 69, 69, - 69, 1326, 69, 69, 69, 1318, 1327, 69, 1319, 1320, - 69, 1324, 69, 1331, 1332, 69, 1322, 1321, 1329, 1323, - 1328, 1325, 69, 1330, 1333, 69, 1335, 69, 1336, 69, - 1337, 69, 69, 1339, 69, 1334, 1340, 69, 69, 69, - 1343, 69, 69, 69, 1342, 1345, 69, 69, 69, 1347, - 69, 1338, 69, 1348, 69, 1349, 69, 1341, 1351, 69, - 69, 1344, 69, 1352, 69, 1346, 1354, 69, 1358, 69, - 1350, 1353, 1359, 69, 1361, 69, 1355, 1357, 69, 69, - 1363, 69, 69, 1356, 69, 69, 69, 69, 1360, 1366, - - 1364, 69, 69, 69, 1365, 69, 1370, 69, 1375, 1368, - 69, 69, 1372, 69, 1362, 1376, 1373, 1371, 1369, 1374, - 1367, 1380, 69, 69, 1379, 69, 69, 69, 1381, 69, - 1377, 1378, 69, 69, 69, 69, 1382, 1386, 1384, 69, - 1383, 69, 1389, 69, 1385, 69, 1387, 1390, 69, 1391, - 69, 1392, 69, 1388, 69, 1396, 69, 1393, 1395, 69, - 1397, 69, 1398, 1399, 69, 69, 1394, 69, 69, 69, - 1400, 1403, 69, 1406, 69, 69, 1770, 1405, 69, 69, - 1407, 1401, 1402, 1410, 1409, 69, 69, 1413, 69, 1404, - 69, 1408, 1412, 1411, 1414, 69, 69, 1416, 69, 1417, - - 69, 1415, 1418, 69, 1419, 69, 69, 69, 69, 69, - 69, 1424, 69, 1422, 1426, 69, 69, 1770, 1425, 69, - 69, 1420, 1423, 1429, 69, 1430, 69, 69, 1421, 1431, - 69, 1428, 69, 1427, 69, 1433, 1434, 69, 1435, 69, - 1432, 1436, 69, 69, 1437, 69, 69, 69, 69, 1444, - 69, 69, 1438, 1442, 69, 1439, 69, 1440, 1441, 69, - 1445, 69, 69, 69, 69, 69, 69, 1443, 1455, 69, - 1453, 1454, 1448, 1456, 69, 69, 1447, 1450, 69, 69, - 1446, 69, 1451, 69, 1452, 1449, 69, 69, 69, 1464, - 1461, 1465, 69, 69, 69, 1457, 1458, 69, 69, 69, - - 69, 1459, 1466, 1460, 1467, 1463, 1462, 69, 1474, 1468, - 1473, 69, 69, 69, 69, 69, 1469, 1470, 69, 1472, - 69, 69, 69, 1471, 69, 1481, 1482, 69, 69, 1476, - 1475, 69, 69, 69, 1477, 1485, 69, 1487, 1478, 1479, - 69, 1480, 1484, 1483, 1488, 69, 69, 1486, 1770, 1489, - 1490, 69, 1492, 69, 1493, 69, 69, 1494, 69, 1491, - 69, 69, 69, 69, 69, 1497, 1498, 1496, 1495, 69, - 69, 1500, 69, 1507, 1502, 1503, 1505, 69, 69, 1501, - 69, 1499, 1506, 69, 69, 1508, 69, 1504, 1509, 69, - 1510, 69, 1511, 1514, 69, 69, 69, 69, 1512, 69, - - 1513, 1515, 69, 69, 1516, 69, 1519, 1517, 69, 69, - 69, 1518, 69, 1524, 69, 69, 69, 1770, 1522, 1523, - 69, 1521, 69, 1520, 1525, 1529, 69, 1531, 69, 69, - 69, 1530, 69, 1526, 69, 1533, 1527, 1532, 69, 1528, - 69, 1534, 1536, 69, 69, 1539, 69, 1535, 1540, 69, - 69, 1542, 69, 69, 1537, 1543, 1544, 69, 1538, 1545, - 69, 1546, 69, 69, 1549, 69, 1541, 1550, 69, 69, - 69, 1547, 69, 69, 1551, 1553, 69, 1548, 1552, 69, - 69, 1556, 1554, 1555, 69, 1560, 69, 69, 69, 69, - 69, 1557, 69, 1564, 69, 1565, 1562, 69, 1559, 1558, - - 69, 69, 69, 69, 69, 1567, 1561, 69, 1563, 69, - 1568, 1570, 1573, 1566, 1575, 69, 69, 69, 69, 69, - 1576, 1579, 69, 1571, 1572, 1574, 1577, 1569, 69, 69, - 69, 69, 1580, 1578, 69, 69, 1586, 1581, 1582, 1585, - 69, 69, 1583, 69, 69, 69, 1588, 69, 69, 1587, - 1594, 69, 1589, 1592, 69, 69, 1584, 1596, 69, 69, - 1599, 69, 69, 69, 1590, 1593, 1591, 1600, 69, 69, - 69, 1601, 69, 1597, 1598, 69, 1595, 1605, 1604, 1607, - 69, 69, 1609, 69, 1602, 69, 1611, 69, 1603, 69, - 1610, 69, 69, 1614, 69, 69, 1617, 69, 1618, 69, - - 1608, 1606, 69, 69, 69, 1622, 69, 69, 1615, 1612, - 69, 69, 69, 1627, 1613, 1620, 1625, 1616, 69, 1623, - 69, 1619, 1630, 69, 1621, 1631, 69, 69, 69, 69, - 1624, 1626, 1770, 1633, 69, 1636, 69, 1628, 1629, 1635, - 1637, 69, 69, 1634, 1638, 69, 1632, 1639, 1640, 69, - 69, 1641, 1642, 69, 69, 69, 1645, 69, 69, 69, - 1648, 69, 69, 1646, 1644, 69, 69, 1647, 1643, 69, - 1649, 1650, 69, 69, 1651, 69, 69, 69, 1659, 69, - 69, 1657, 1660, 69, 1661, 1662, 69, 1652, 1653, 69, - 1654, 1655, 69, 1663, 1664, 69, 1656, 1658, 1666, 69, - - 69, 69, 1669, 69, 1670, 69, 1665, 69, 69, 69, - 69, 69, 69, 1677, 69, 1667, 1674, 1675, 1770, 1668, - 1678, 69, 69, 1672, 1679, 69, 1680, 69, 1683, 1676, - 1673, 69, 1671, 69, 1681, 69, 1682, 69, 69, 69, - 69, 69, 1685, 69, 69, 1684, 69, 1689, 69, 69, - 69, 69, 69, 1697, 69, 1688, 69, 1686, 1687, 1691, - 1698, 1690, 69, 1692, 69, 1694, 1693, 1696, 69, 1699, - 69, 1703, 69, 1700, 69, 1695, 69, 1702, 1707, 69, - 1708, 1701, 69, 69, 1704, 69, 69, 1705, 69, 69, - 69, 69, 1710, 1706, 69, 69, 1709, 69, 69, 1720, - - 1717, 69, 1712, 1714, 1715, 1711, 1718, 69, 1713, 69, - 69, 69, 1721, 1716, 1722, 1723, 1719, 1725, 1726, 69, - 69, 69, 69, 69, 1730, 69, 69, 1727, 69, 69, - 1724, 69, 69, 1733, 69, 69, 1737, 69, 69, 1732, - 1728, 1770, 1729, 1738, 1731, 69, 1740, 1736, 69, 1741, - 1734, 1735, 69, 69, 69, 69, 1739, 1742, 1745, 69, - 1743, 69, 1746, 69, 69, 69, 69, 69, 1747, 1749, - 69, 1751, 1752, 1744, 69, 69, 1755, 69, 69, 69, - 1758, 69, 1748, 69, 1750, 1759, 69, 69, 1760, 1753, - 1761, 69, 69, 1754, 1762, 69, 1756, 1757, 69, 1763, - - 69, 1770, 1766, 1764, 1770, 1765, 1767, 1768, 69, 1769, - 69, 41, 41, 41, 41, 41, 41, 41, 46, 46, - 46, 46, 46, 46, 46, 51, 51, 51, 51, 51, - 51, 51, 57, 57, 57, 57, 57, 57, 57, 62, - 62, 62, 62, 62, 62, 62, 72, 72, 1770, 72, - 72, 72, 72, 127, 127, 1770, 1770, 1770, 127, 127, - 129, 129, 1770, 1770, 129, 1770, 129, 131, 1770, 1770, - 1770, 1770, 1770, 131, 134, 134, 1770, 1770, 1770, 134, - 134, 136, 1770, 1770, 1770, 1770, 1770, 136, 138, 138, - 1770, 138, 138, 138, 138, 73, 73, 1770, 73, 73, - - 73, 73, 13, 1770, 1770, 1770, 1770, 1770, 1770, 1770, - 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, - 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, - 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, - 1770, 1770 + 14, 14, 18, 20, 14, 21, 22, 23, 24, 14, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 14, 14, 14, 14, 40, + 20, 14, 21, 22, 23, 24, 14, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 14, 14, 14, 14, 42, 43, 44, 42, + 43, 44, 47, 48, 47, 48, 49, 97, 49, 52, + 53, 54, 55, 805, 18, 52, 53, 54, 55, 69, + 18, 58, 59, 60, 58, 59, 60, 70, 131, 131, + + 68, 71, 87, 45, 97, 133, 45, 141, 133, 50, + 73, 50, 73, 73, 69, 73, 141, 56, 99, 138, + 138, 73, 88, 56, 139, 69, 75, 76, 61, 87, + 69, 61, 15, 16, 17, 63, 64, 65, 15, 16, + 17, 63, 64, 65, 77, 99, 89, 137, 74, 88, + 69, 91, 66, 75, 76, 78, 145, 107, 66, 92, + 90, 70, 79, 69, 990, 71, 80, 173, 98, 81, + 67, 77, 69, 89, 131, 131, 67, 69, 91, 66, + 69, 69, 78, 145, 107, 66, 92, 90, 93, 79, + 69, 94, 69, 80, 100, 98, 81, 82, 95, 69, + + 96, 83, 101, 136, 84, 197, 85, 86, 102, 134, + 104, 69, 103, 113, 105, 93, 147, 69, 94, 69, + 69, 100, 146, 69, 82, 95, 69, 96, 83, 101, + 106, 84, 197, 85, 86, 102, 69, 104, 114, 103, + 113, 105, 115, 147, 133, 69, 123, 133, 124, 146, + 179, 132, 116, 69, 126, 117, 157, 106, 108, 127, + 69, 69, 109, 125, 69, 114, 128, 69, 110, 115, + 129, 111, 69, 123, 130, 124, 151, 179, 112, 116, + 69, 126, 117, 157, 141, 108, 127, 138, 138, 109, + 125, 144, 69, 128, 69, 110, 208, 129, 111, 158, + + 897, 130, 69, 151, 141, 112, 118, 69, 68, 119, + 68, 68, 135, 68, 135, 135, 120, 135, 144, 68, + 121, 122, 73, 208, 73, 73, 158, 73, 69, 140, + 69, 140, 140, 118, 140, 68, 119, 68, 68, 73, + 68, 73, 73, 120, 73, 148, 68, 121, 122, 152, + 73, 161, 150, 153, 155, 156, 139, 159, 149, 154, + 143, 69, 69, 69, 69, 137, 162, 163, 166, 69, + 136, 357, 148, 69, 69, 160, 152, 74, 161, 150, + 153, 155, 156, 69, 167, 149, 154, 164, 165, 69, + 168, 69, 174, 162, 163, 166, 69, 69, 69, 180, + + 69, 134, 160, 69, 169, 175, 69, 170, 183, 177, + 182, 167, 69, 178, 164, 165, 181, 168, 184, 174, + 171, 172, 69, 188, 132, 176, 180, 69, 69, 69, + 69, 169, 175, 69, 170, 183, 177, 182, 69, 69, + 178, 185, 186, 181, 187, 184, 69, 171, 172, 69, + 188, 189, 176, 69, 190, 69, 192, 194, 191, 195, + 69, 193, 198, 69, 69, 196, 201, 202, 185, 186, + 69, 187, 2164, 69, 2164, 204, 69, 2164, 189, 2164, + 69, 190, 203, 192, 194, 191, 195, 69, 193, 198, + 199, 206, 196, 201, 200, 205, 207, 69, 2164, 69, + + 69, 69, 204, 69, 209, 211, 213, 69, 214, 203, + 2164, 212, 2164, 2164, 2164, 69, 2164, 199, 206, 2164, + 2164, 200, 205, 207, 215, 210, 69, 69, 216, 69, + 69, 209, 211, 213, 135, 214, 135, 135, 212, 135, + 140, 217, 140, 140, 73, 140, 73, 73, 141, 73, + 69, 215, 210, 218, 220, 216, 219, 221, 2164, 223, + 224, 225, 69, 222, 229, 69, 69, 226, 2164, 69, + 227, 2164, 228, 69, 238, 69, 2164, 258, 69, 2164, + 218, 220, 143, 219, 221, 69, 223, 224, 316, 240, + 222, 230, 69, 69, 226, 231, 69, 227, 69, 228, + + 69, 238, 239, 241, 242, 243, 246, 245, 69, 69, + 69, 69, 232, 2164, 244, 249, 240, 69, 69, 69, + 69, 2164, 231, 2164, 69, 69, 250, 251, 69, 239, + 241, 242, 243, 246, 245, 259, 69, 262, 2164, 232, + 233, 244, 249, 247, 256, 234, 248, 263, 69, 69, + 235, 69, 2164, 250, 251, 257, 236, 237, 69, 252, + 265, 69, 259, 69, 253, 69, 69, 233, 260, 69, + 247, 256, 234, 248, 263, 264, 254, 235, 255, 261, + 267, 69, 257, 236, 237, 69, 252, 266, 268, 2164, + 269, 253, 69, 2164, 270, 271, 274, 272, 273, 275, + + 69, 69, 264, 254, 69, 255, 261, 277, 69, 69, + 69, 284, 69, 276, 266, 287, 69, 269, 69, 69, + 69, 270, 271, 274, 272, 273, 275, 69, 279, 69, + 278, 280, 281, 282, 277, 291, 283, 289, 69, 69, + 276, 69, 69, 69, 285, 286, 290, 69, 294, 297, + 2164, 2164, 304, 69, 69, 279, 69, 278, 280, 281, + 282, 288, 69, 283, 289, 293, 69, 69, 69, 292, + 295, 285, 286, 290, 69, 294, 306, 69, 298, 300, + 69, 69, 301, 69, 69, 303, 302, 307, 288, 305, + 2164, 309, 293, 296, 69, 299, 292, 141, 311, 69, + + 69, 2164, 69, 69, 69, 298, 300, 313, 69, 301, + 308, 69, 303, 302, 307, 310, 305, 69, 309, 312, + 296, 69, 299, 69, 314, 311, 315, 317, 69, 318, + 320, 69, 319, 321, 313, 2164, 69, 308, 322, 325, + 323, 69, 310, 324, 327, 69, 312, 328, 330, 69, + 2164, 314, 69, 315, 317, 69, 318, 320, 69, 319, + 321, 69, 69, 69, 326, 322, 329, 323, 331, 332, + 324, 69, 334, 69, 328, 69, 69, 69, 69, 333, + 69, 335, 338, 337, 2164, 69, 69, 336, 69, 339, + 343, 326, 69, 329, 340, 331, 332, 2164, 69, 334, + + 342, 344, 345, 341, 2164, 69, 333, 69, 335, 338, + 337, 69, 69, 364, 336, 69, 339, 69, 350, 351, + 69, 340, 69, 346, 353, 69, 2164, 342, 344, 345, + 341, 347, 348, 354, 349, 2164, 69, 352, 69, 358, + 69, 69, 2164, 69, 359, 350, 351, 360, 69, 370, + 346, 353, 355, 356, 69, 361, 69, 362, 347, 348, + 354, 349, 366, 69, 352, 363, 358, 69, 365, 367, + 369, 359, 368, 372, 360, 69, 370, 69, 374, 355, + 356, 69, 361, 69, 362, 69, 371, 375, 69, 366, + 69, 526, 363, 373, 69, 365, 367, 369, 69, 368, + + 69, 376, 378, 380, 379, 69, 385, 377, 2164, 69, + 69, 2164, 389, 371, 375, 386, 69, 384, 69, 69, + 373, 2164, 381, 69, 390, 382, 69, 383, 376, 378, + 380, 379, 387, 69, 377, 69, 69, 69, 69, 389, + 388, 392, 386, 391, 384, 394, 69, 410, 402, 381, + 404, 390, 382, 403, 383, 405, 69, 393, 69, 387, + 69, 408, 2164, 406, 452, 69, 407, 388, 392, 141, + 391, 69, 394, 69, 69, 402, 409, 411, 69, 69, + 403, 69, 69, 69, 393, 395, 396, 412, 408, 413, + 406, 452, 2164, 407, 69, 397, 69, 398, 399, 400, + + 2164, 415, 401, 409, 411, 414, 416, 417, 418, 421, + 69, 2164, 395, 396, 412, 69, 413, 69, 69, 419, + 423, 424, 397, 69, 398, 399, 400, 420, 415, 401, + 427, 69, 414, 416, 69, 418, 422, 69, 69, 69, + 69, 69, 428, 69, 425, 426, 419, 423, 424, 429, + 431, 430, 2164, 69, 420, 2164, 432, 427, 435, 433, + 69, 2164, 441, 422, 69, 2164, 2164, 69, 436, 428, + 440, 444, 443, 69, 434, 69, 429, 431, 430, 69, + 437, 69, 69, 432, 69, 435, 433, 442, 69, 441, + 69, 438, 446, 439, 445, 436, 450, 440, 69, 443, + + 69, 434, 447, 69, 448, 449, 451, 437, 453, 454, + 69, 2164, 69, 69, 442, 455, 476, 457, 438, 446, + 439, 445, 69, 450, 456, 69, 69, 458, 69, 447, + 69, 448, 449, 451, 69, 453, 461, 459, 69, 69, + 460, 69, 455, 462, 457, 69, 463, 464, 69, 465, + 2164, 456, 69, 69, 458, 69, 466, 2164, 468, 69, + 467, 469, 2164, 461, 459, 470, 69, 460, 69, 69, + 462, 471, 69, 463, 464, 69, 465, 69, 507, 69, + 480, 475, 69, 466, 477, 468, 69, 467, 469, 474, + 478, 472, 470, 473, 69, 481, 69, 479, 471, 69, + + 69, 482, 69, 483, 69, 507, 485, 480, 475, 486, + 69, 477, 69, 523, 489, 488, 474, 478, 472, 69, + 473, 69, 69, 491, 479, 69, 484, 69, 482, 487, + 2164, 69, 490, 485, 69, 69, 486, 69, 492, 493, + 523, 489, 488, 501, 69, 69, 502, 69, 500, 69, + 491, 69, 503, 484, 505, 69, 487, 69, 2164, 490, + 509, 506, 504, 2164, 510, 492, 493, 494, 69, 508, + 501, 69, 495, 502, 496, 500, 69, 2164, 69, 2164, + 511, 505, 497, 521, 69, 498, 69, 509, 506, 504, + 512, 510, 499, 69, 494, 69, 508, 513, 514, 495, + + 515, 496, 69, 69, 518, 69, 517, 511, 516, 497, + 525, 519, 498, 520, 69, 69, 69, 512, 527, 499, + 524, 529, 69, 2164, 513, 514, 69, 515, 522, 69, + 528, 518, 69, 517, 69, 516, 141, 525, 519, 530, + 520, 531, 533, 69, 532, 69, 534, 524, 535, 537, + 69, 536, 541, 69, 69, 522, 69, 528, 538, 69, + 69, 542, 544, 539, 69, 69, 530, 540, 531, 533, + 69, 532, 543, 534, 545, 535, 537, 546, 536, 69, + 547, 69, 2164, 548, 549, 551, 69, 550, 69, 69, + 69, 552, 69, 553, 540, 557, 2164, 555, 2164, 558, + + 2164, 69, 559, 2164, 69, 69, 69, 547, 69, 69, + 548, 549, 551, 554, 550, 69, 69, 564, 556, 69, + 553, 69, 69, 69, 555, 69, 558, 69, 560, 559, + 563, 566, 565, 561, 567, 568, 569, 562, 2164, 69, + 554, 69, 571, 69, 564, 556, 2164, 570, 69, 572, + 2164, 574, 69, 69, 582, 560, 69, 563, 566, 565, + 561, 567, 568, 575, 562, 69, 69, 2164, 69, 571, + 576, 573, 69, 69, 570, 577, 572, 578, 574, 581, + 580, 69, 579, 2164, 583, 69, 69, 587, 584, 69, + 575, 69, 585, 589, 69, 586, 69, 576, 573, 69, + + 69, 590, 577, 592, 578, 69, 581, 580, 588, 579, + 591, 583, 69, 2164, 587, 584, 69, 69, 593, 585, + 596, 69, 586, 69, 594, 69, 598, 69, 590, 595, + 592, 2164, 597, 599, 69, 588, 600, 601, 603, 2164, + 69, 69, 69, 605, 604, 593, 69, 596, 606, 2164, + 607, 2164, 602, 69, 69, 608, 69, 69, 69, 597, + 599, 69, 609, 600, 601, 603, 69, 611, 617, 2164, + 610, 604, 612, 616, 613, 69, 69, 607, 69, 602, + 614, 69, 608, 69, 615, 2164, 69, 69, 69, 609, + 618, 69, 69, 621, 611, 617, 69, 610, 620, 612, + + 616, 613, 69, 619, 622, 69, 69, 614, 623, 2164, + 624, 615, 69, 625, 2164, 626, 69, 618, 69, 628, + 621, 629, 2164, 630, 632, 620, 2164, 627, 2164, 2164, + 619, 69, 69, 631, 633, 623, 69, 624, 69, 69, + 625, 69, 626, 69, 69, 634, 628, 69, 629, 635, + 630, 632, 636, 637, 627, 638, 69, 640, 645, 639, + 631, 633, 69, 641, 69, 69, 642, 643, 650, 644, + 69, 69, 634, 2164, 69, 69, 635, 69, 2164, 636, + 637, 69, 638, 648, 640, 645, 639, 646, 141, 649, + 641, 69, 69, 642, 643, 647, 644, 69, 651, 655, + + 69, 69, 653, 652, 2164, 69, 654, 2164, 656, 657, + 648, 665, 672, 69, 646, 69, 649, 69, 69, 658, + 668, 69, 647, 69, 666, 651, 69, 69, 670, 653, + 652, 69, 659, 654, 69, 656, 657, 2164, 665, 69, + 2164, 69, 669, 667, 69, 671, 658, 668, 2164, 707, + 2164, 666, 681, 680, 69, 670, 685, 682, 69, 659, + 660, 69, 684, 2164, 661, 69, 69, 662, 686, 669, + 667, 69, 671, 687, 663, 69, 683, 664, 69, 681, + 680, 69, 69, 69, 682, 688, 69, 660, 69, 684, + 691, 661, 689, 690, 662, 686, 2164, 69, 694, 69, + + 687, 663, 692, 683, 664, 673, 674, 2164, 675, 693, + 2164, 676, 688, 69, 69, 69, 677, 691, 69, 689, + 690, 696, 678, 679, 69, 694, 699, 698, 69, 692, + 700, 69, 673, 674, 69, 675, 693, 695, 676, 697, + 704, 708, 69, 677, 703, 69, 69, 69, 696, 678, + 679, 702, 69, 699, 698, 701, 705, 700, 706, 69, + 69, 720, 69, 709, 695, 710, 697, 704, 69, 711, + 712, 703, 713, 69, 715, 717, 714, 718, 702, 2164, + 69, 69, 701, 69, 2164, 706, 69, 69, 69, 69, + 709, 719, 710, 69, 69, 69, 711, 712, 69, 713, + + 716, 715, 69, 714, 718, 721, 722, 723, 69, 725, + 69, 724, 729, 69, 727, 726, 730, 728, 719, 69, + 734, 733, 2164, 2164, 69, 69, 2164, 716, 69, 69, + 69, 69, 721, 722, 723, 69, 725, 731, 724, 729, + 69, 727, 726, 730, 728, 732, 69, 69, 733, 735, + 737, 736, 738, 739, 743, 69, 69, 741, 69, 69, + 740, 69, 742, 69, 731, 745, 744, 69, 749, 747, + 748, 746, 732, 69, 69, 69, 735, 737, 736, 738, + 739, 743, 69, 69, 741, 69, 69, 740, 752, 742, + 751, 69, 745, 744, 750, 69, 747, 748, 746, 753, + + 754, 69, 755, 69, 2164, 759, 758, 756, 761, 760, + 69, 69, 764, 765, 762, 757, 763, 751, 2164, 767, + 69, 750, 69, 69, 769, 69, 69, 754, 69, 755, + 766, 69, 759, 758, 756, 69, 760, 69, 69, 764, + 69, 762, 757, 763, 768, 69, 69, 770, 772, 771, + 774, 141, 773, 69, 775, 69, 69, 766, 776, 69, + 784, 69, 2164, 69, 69, 791, 785, 2164, 2164, 783, + 792, 768, 69, 2164, 770, 772, 771, 774, 69, 773, + 786, 775, 69, 69, 789, 776, 777, 784, 778, 787, + 788, 2164, 779, 785, 780, 69, 783, 69, 2164, 781, + + 794, 790, 69, 798, 782, 793, 69, 786, 795, 799, + 69, 789, 69, 777, 69, 778, 787, 788, 69, 779, + 69, 780, 69, 69, 796, 69, 781, 794, 790, 801, + 798, 782, 793, 800, 797, 795, 799, 802, 803, 69, + 804, 812, 69, 2164, 2164, 2164, 69, 811, 821, 2164, + 816, 796, 813, 2164, 814, 2164, 801, 815, 69, 823, + 800, 797, 69, 69, 802, 69, 817, 69, 812, 69, + 69, 806, 69, 818, 811, 69, 807, 816, 808, 813, + 819, 814, 820, 69, 815, 69, 69, 822, 69, 809, + 69, 69, 826, 817, 824, 827, 810, 69, 806, 2164, + + 818, 2164, 828, 807, 825, 808, 69, 819, 830, 820, + 69, 832, 69, 841, 822, 831, 809, 829, 69, 826, + 2164, 824, 69, 810, 69, 69, 69, 69, 833, 828, + 835, 825, 834, 69, 836, 830, 837, 2164, 832, 2164, + 69, 69, 831, 838, 829, 69, 69, 839, 840, 69, + 69, 842, 69, 850, 843, 833, 845, 835, 844, 834, + 846, 836, 69, 837, 69, 69, 69, 69, 69, 847, + 838, 848, 849, 851, 839, 840, 862, 853, 842, 69, + 850, 843, 69, 845, 854, 844, 852, 846, 69, 855, + 69, 69, 856, 69, 2164, 857, 847, 858, 848, 849, + + 69, 859, 860, 861, 853, 69, 865, 864, 69, 69, + 863, 871, 69, 852, 69, 69, 69, 69, 69, 856, + 866, 69, 857, 868, 858, 867, 869, 2164, 859, 860, + 861, 69, 69, 865, 864, 872, 69, 863, 871, 870, + 873, 874, 69, 882, 2164, 69, 69, 866, 69, 876, + 868, 875, 867, 869, 69, 877, 878, 880, 69, 881, + 2164, 69, 872, 879, 69, 69, 870, 873, 69, 69, + 883, 69, 884, 69, 886, 69, 876, 887, 875, 69, + 885, 888, 877, 878, 880, 889, 881, 890, 891, 69, + 879, 892, 69, 69, 69, 893, 69, 883, 69, 884, + + 69, 886, 894, 895, 887, 896, 899, 885, 888, 901, + 69, 69, 898, 69, 903, 891, 69, 69, 892, 69, + 69, 69, 69, 900, 69, 904, 902, 69, 905, 894, + 895, 69, 896, 899, 69, 69, 901, 69, 906, 898, + 907, 903, 908, 2164, 2164, 2164, 909, 911, 912, 2164, + 900, 2164, 904, 902, 910, 905, 913, 919, 915, 916, + 69, 69, 2164, 2164, 69, 914, 69, 927, 917, 908, + 69, 69, 69, 909, 911, 912, 69, 69, 69, 69, + 69, 910, 918, 913, 69, 915, 916, 920, 921, 922, + 69, 923, 914, 69, 927, 917, 932, 69, 69, 928, + + 69, 2164, 929, 931, 935, 69, 924, 933, 2164, 918, + 69, 930, 69, 934, 920, 921, 922, 925, 923, 936, + 926, 69, 69, 932, 69, 69, 928, 69, 69, 929, + 931, 935, 938, 924, 933, 69, 940, 937, 930, 939, + 934, 69, 942, 941, 925, 69, 936, 926, 943, 946, + 69, 944, 945, 2164, 69, 69, 948, 69, 954, 69, + 69, 949, 69, 940, 937, 69, 939, 69, 947, 942, + 941, 69, 950, 951, 69, 943, 946, 2164, 944, 945, + 69, 955, 69, 948, 69, 952, 953, 956, 949, 957, + 69, 968, 69, 958, 69, 947, 69, 962, 960, 950, + + 951, 965, 959, 961, 69, 69, 69, 964, 955, 963, + 2164, 966, 952, 953, 956, 69, 957, 69, 969, 967, + 958, 69, 69, 69, 962, 69, 970, 69, 965, 959, + 69, 971, 972, 973, 964, 974, 963, 69, 966, 976, + 975, 977, 979, 978, 69, 969, 967, 69, 69, 69, + 980, 69, 981, 970, 69, 69, 69, 69, 971, 972, + 973, 69, 974, 69, 982, 983, 976, 975, 977, 979, + 978, 2164, 992, 2164, 991, 2164, 995, 2164, 996, 989, + 994, 2164, 69, 997, 69, 993, 69, 2164, 69, 69, + 69, 982, 983, 984, 69, 69, 998, 69, 985, 992, + + 986, 991, 987, 995, 988, 69, 989, 994, 999, 69, + 69, 69, 993, 1000, 1001, 1002, 1004, 1003, 2164, 1008, + 984, 69, 1006, 998, 69, 985, 69, 986, 69, 987, + 69, 988, 1007, 69, 69, 999, 1005, 1010, 1009, 1012, + 1000, 1001, 1002, 1004, 1003, 69, 69, 1011, 1013, 1006, + 69, 1014, 1016, 1015, 69, 1017, 69, 1019, 2164, 1007, + 69, 69, 1018, 1005, 69, 1009, 1012, 1022, 69, 1020, + 1021, 69, 1024, 1023, 1011, 1013, 69, 69, 69, 69, + 1015, 1025, 1017, 1026, 69, 1027, 69, 1028, 1029, 1018, + 69, 1030, 69, 1032, 1022, 69, 1020, 1021, 69, 1024, + + 1023, 69, 1031, 1033, 69, 69, 1035, 1034, 1025, 1036, + 1026, 1037, 1027, 1039, 1028, 69, 1040, 69, 69, 1038, + 69, 69, 69, 69, 69, 69, 69, 1044, 1043, 1031, + 1033, 1041, 1045, 1035, 1034, 69, 69, 1042, 1037, 1047, + 1039, 1046, 69, 1050, 69, 69, 1038, 1051, 69, 1048, + 69, 1049, 69, 69, 1044, 1043, 69, 1052, 1041, 1045, + 1054, 2164, 1058, 1053, 1042, 69, 1047, 69, 1046, 69, + 1050, 1055, 1056, 1059, 1051, 1060, 1048, 1057, 1049, 69, + 69, 1063, 69, 1061, 69, 1066, 1062, 1054, 69, 1058, + 1053, 1064, 69, 1065, 2164, 69, 1067, 1069, 1055, 1068, + + 1059, 1077, 1060, 69, 69, 69, 69, 1072, 1063, 69, + 1061, 1070, 69, 1062, 1075, 69, 69, 69, 1064, 69, + 1065, 1071, 1073, 1067, 1069, 1074, 1068, 1076, 1077, 69, + 69, 69, 69, 1079, 1072, 1078, 69, 69, 1070, 1080, + 2164, 1075, 1083, 1081, 2164, 1082, 69, 1084, 1071, 1073, + 69, 69, 1074, 69, 1076, 69, 1085, 1087, 1090, 1086, + 1079, 1088, 1078, 1093, 69, 1089, 1080, 69, 69, 1083, + 1081, 1092, 1082, 1094, 1084, 69, 1091, 69, 69, 69, + 1095, 1097, 69, 1085, 1087, 1090, 1086, 69, 1088, 1096, + 1098, 1099, 1089, 69, 1103, 69, 2164, 1101, 1092, 1102, + + 2164, 1100, 69, 1091, 1108, 69, 69, 1095, 69, 69, + 69, 69, 69, 69, 1112, 69, 1096, 1098, 1099, 69, + 1104, 1103, 1106, 1115, 1101, 1105, 1102, 1107, 1100, 1109, + 1110, 1108, 1111, 1113, 69, 1114, 1116, 69, 69, 1117, + 69, 2164, 2164, 69, 69, 1118, 69, 69, 1124, 1125, + 1115, 1121, 69, 69, 69, 1119, 1109, 1110, 1123, 1111, + 1113, 1120, 1114, 69, 69, 1122, 1117, 2164, 69, 69, + 69, 69, 1118, 69, 69, 1124, 1125, 1127, 1121, 1126, + 1128, 1130, 1119, 1131, 1132, 1123, 1129, 1138, 1120, 1144, + 1136, 2164, 1122, 1139, 69, 69, 2164, 69, 69, 1133, + + 2164, 69, 69, 1134, 69, 1140, 1126, 1128, 1130, 69, + 1131, 1132, 1137, 1129, 69, 69, 1135, 1136, 1141, 1145, + 1139, 69, 1142, 69, 69, 69, 1133, 1143, 69, 1146, + 1134, 69, 1140, 1147, 69, 1148, 1149, 1150, 69, 1137, + 1151, 2164, 1152, 1135, 2164, 1141, 69, 1153, 1158, 1142, + 1154, 1155, 1157, 69, 1143, 69, 1146, 1156, 2164, 69, + 1147, 69, 1148, 69, 69, 69, 1160, 69, 69, 1152, + 69, 69, 1161, 1159, 1153, 1158, 69, 1154, 1155, 1157, + 1162, 2164, 1163, 1164, 1156, 69, 1165, 69, 69, 1166, + 1167, 1169, 1168, 69, 1170, 69, 1172, 2164, 69, 1161, + + 1159, 2164, 69, 69, 1173, 1181, 2164, 1162, 69, 1163, + 1164, 1171, 69, 1165, 69, 1176, 1166, 1167, 69, 1168, + 1174, 1170, 69, 1172, 69, 1175, 69, 69, 1177, 1178, + 2164, 1173, 69, 69, 1179, 1180, 69, 69, 1171, 1182, + 1183, 1184, 1176, 1185, 2164, 2164, 69, 1174, 1187, 1191, + 69, 1189, 1175, 1190, 69, 1177, 1178, 69, 69, 69, + 1193, 1179, 1180, 1186, 1188, 1199, 1182, 69, 1184, 69, + 69, 69, 69, 1192, 1194, 1187, 1191, 69, 1189, 69, + 1190, 1195, 1200, 1196, 69, 69, 1197, 1193, 69, 69, + 1186, 1188, 1202, 1201, 1203, 1205, 69, 69, 1198, 1204, + + 1192, 1194, 1206, 1207, 69, 1210, 1212, 69, 1195, 1200, + 1196, 69, 69, 1197, 69, 1209, 1208, 1211, 1214, 1202, + 1201, 1203, 69, 69, 69, 1198, 1204, 69, 69, 1206, + 1207, 1213, 1215, 1216, 2164, 69, 1220, 69, 69, 69, + 69, 1217, 1209, 1208, 1211, 1214, 1218, 1219, 1221, 69, + 69, 1222, 1224, 69, 69, 69, 1223, 2164, 1213, 69, + 1216, 69, 1225, 1220, 1226, 1229, 69, 1227, 1217, 69, + 69, 69, 1230, 1218, 1219, 1221, 1228, 1233, 1222, 69, + 69, 1232, 69, 1223, 69, 1231, 1239, 1234, 69, 1225, + 1235, 1226, 69, 69, 1227, 1236, 2164, 69, 1240, 1230, + + 1241, 1243, 1242, 1228, 1233, 69, 69, 69, 1232, 69, + 1244, 1237, 1231, 1239, 1234, 1246, 1238, 1235, 1248, 1245, + 1252, 1249, 1236, 69, 1251, 69, 69, 69, 1243, 1242, + 69, 1247, 69, 69, 1250, 1254, 69, 1244, 1237, 69, + 1256, 1255, 1246, 1238, 1253, 1248, 1245, 69, 1249, 69, + 69, 69, 69, 69, 1257, 1258, 69, 1259, 1247, 69, + 1260, 1250, 1254, 1261, 1262, 69, 1264, 1256, 1255, 69, + 69, 1253, 1265, 1270, 1263, 69, 1267, 1272, 1271, 1268, + 1274, 1257, 1258, 1276, 1259, 1279, 1266, 1260, 69, 69, + 1261, 1262, 69, 1264, 69, 1269, 1275, 2164, 69, 1265, + + 1277, 1263, 1273, 1267, 69, 69, 1268, 1278, 1283, 69, + 1280, 69, 69, 1266, 69, 69, 69, 69, 69, 1281, + 1284, 69, 1269, 1275, 69, 1282, 1285, 1277, 1287, 1273, + 1288, 1289, 1286, 1291, 1278, 1283, 69, 1280, 1293, 69, + 69, 69, 69, 69, 1292, 1290, 1281, 1284, 1294, 1297, + 1300, 69, 1282, 1285, 69, 1287, 1295, 1296, 1289, 1286, + 69, 69, 69, 1311, 1298, 1293, 1307, 69, 69, 1299, + 69, 1292, 1290, 1301, 1302, 1294, 1297, 69, 69, 69, + 1303, 69, 1304, 1295, 1296, 1305, 69, 1308, 1313, 1310, + 69, 1298, 1306, 69, 69, 69, 1299, 69, 69, 69, + + 1301, 1302, 69, 1312, 1309, 1315, 1314, 1303, 1316, 1304, + 69, 1317, 1305, 69, 1308, 69, 1310, 1318, 1319, 1306, + 2164, 1323, 1324, 69, 1320, 69, 69, 69, 69, 69, + 1312, 1309, 1315, 1314, 1321, 69, 1322, 69, 1317, 69, + 1325, 2164, 69, 69, 1318, 1319, 1326, 1327, 1323, 1324, + 1329, 1320, 69, 1331, 1330, 1335, 1332, 69, 69, 1336, + 1328, 1321, 69, 1322, 1333, 69, 69, 1325, 69, 1337, + 69, 1334, 1338, 1326, 1327, 1340, 69, 1329, 1339, 69, + 69, 1330, 1335, 1341, 69, 1342, 69, 1328, 69, 1343, + 1344, 1333, 1345, 1346, 1348, 2164, 1337, 1349, 1334, 69, + + 1350, 69, 69, 1351, 2164, 1339, 69, 1347, 2164, 69, + 1341, 1358, 2164, 69, 2164, 1360, 1343, 69, 69, 1345, + 1361, 1348, 69, 1364, 69, 69, 69, 1350, 1362, 1352, + 1353, 1354, 1356, 1357, 1347, 69, 1355, 1370, 1359, 69, + 69, 69, 1363, 69, 69, 69, 1366, 69, 69, 1369, + 69, 1365, 69, 1371, 1367, 1362, 1352, 1353, 1354, 1356, + 1357, 69, 1368, 1355, 69, 1359, 1373, 69, 1372, 1363, + 1374, 69, 69, 1366, 69, 69, 1369, 1378, 1365, 1375, + 1371, 1367, 69, 1376, 1377, 69, 1379, 69, 1382, 1368, + 1381, 1380, 1385, 69, 1384, 1372, 1386, 1374, 1383, 69, + + 1387, 69, 69, 69, 1378, 69, 1375, 1388, 1389, 1390, + 1376, 1377, 69, 1379, 69, 1391, 69, 1381, 1380, 1393, + 69, 1384, 1392, 69, 69, 1383, 69, 69, 69, 69, + 1394, 1395, 69, 1396, 1388, 1389, 1390, 69, 1397, 69, + 1398, 1401, 1391, 69, 1400, 1404, 1393, 1402, 1406, 1392, + 69, 1405, 69, 69, 1403, 69, 1399, 1394, 1395, 69, + 1396, 1409, 1413, 69, 1410, 1397, 69, 1398, 1401, 69, + 69, 1400, 1404, 1411, 1402, 69, 1414, 69, 1405, 1407, + 1412, 1403, 1417, 1399, 1408, 1415, 69, 69, 69, 1419, + 1416, 1410, 1418, 69, 69, 69, 1420, 1421, 1422, 1424, + + 1411, 69, 1425, 69, 69, 1423, 1407, 1412, 1426, 1427, + 1430, 1408, 69, 69, 69, 1428, 1419, 69, 1431, 1418, + 69, 69, 1429, 1432, 1421, 1422, 1424, 1434, 69, 1436, + 69, 1433, 1423, 1435, 69, 1426, 69, 1430, 69, 1438, + 1437, 69, 1428, 1439, 1440, 69, 69, 1441, 1442, 1429, + 69, 69, 2164, 1444, 69, 1445, 1436, 69, 1433, 69, + 1435, 69, 69, 69, 1443, 69, 1438, 1437, 69, 1447, + 1439, 1440, 1446, 69, 1441, 1442, 1448, 1449, 1450, 69, + 69, 1451, 1445, 69, 1452, 1454, 1456, 69, 1453, 69, + 2164, 1443, 1458, 1455, 69, 69, 69, 1457, 1459, 1446, + + 1460, 69, 1461, 1448, 1449, 1450, 69, 69, 1451, 1464, + 69, 1452, 69, 1456, 1463, 1453, 69, 69, 69, 1458, + 1455, 1462, 69, 1465, 1457, 1459, 69, 1460, 2164, 69, + 1466, 1468, 69, 1467, 1469, 1470, 1464, 1472, 2164, 1473, + 69, 1463, 2164, 1471, 69, 1475, 1479, 69, 1462, 1474, + 2164, 69, 1486, 1476, 69, 69, 69, 1466, 1468, 69, + 1467, 69, 1470, 69, 1472, 69, 1473, 69, 69, 1477, + 1471, 1478, 1475, 1479, 1483, 1480, 1474, 69, 1481, 1486, + 1476, 69, 1484, 1487, 69, 1485, 69, 69, 2164, 69, + 1490, 1482, 69, 1488, 1489, 2164, 1477, 1491, 1478, 69, + + 1492, 1483, 1480, 1493, 1496, 1481, 1495, 69, 69, 1484, + 1487, 2164, 1485, 69, 69, 69, 1497, 1490, 1482, 1498, + 1488, 1489, 69, 1499, 1491, 1494, 69, 1492, 69, 69, + 69, 1496, 69, 1495, 1501, 1500, 1502, 1503, 69, 2164, + 1504, 69, 69, 1497, 1506, 1505, 1498, 1507, 1511, 1508, + 1499, 69, 1494, 69, 1510, 1512, 1509, 69, 69, 69, + 1513, 69, 1500, 1502, 1503, 1515, 69, 1504, 69, 1514, + 1519, 1506, 1505, 1516, 69, 69, 1508, 69, 1521, 1524, + 69, 1510, 1512, 1509, 69, 69, 1517, 1513, 1520, 1518, + 1522, 69, 1515, 2164, 69, 69, 1514, 1519, 1525, 69, + + 1516, 69, 1527, 1523, 69, 69, 1524, 1526, 69, 69, + 1528, 1529, 1530, 1517, 1531, 1520, 1518, 1522, 69, 69, + 69, 69, 69, 1535, 1532, 1525, 1533, 1534, 69, 1527, + 1523, 1536, 1537, 69, 1526, 69, 69, 1528, 1529, 1530, + 1538, 1531, 1539, 1541, 1540, 69, 1546, 1542, 69, 69, + 69, 1532, 1543, 1533, 1534, 1544, 1545, 69, 1536, 69, + 2164, 1547, 1549, 69, 1550, 69, 69, 1538, 1551, 1539, + 1541, 1540, 1553, 69, 69, 1548, 1554, 1552, 1555, 69, + 69, 69, 1544, 1545, 1556, 1557, 1558, 69, 1547, 1549, + 1559, 69, 69, 1561, 69, 1551, 1560, 69, 69, 1553, + + 69, 1567, 1548, 1564, 1552, 1555, 1562, 69, 69, 69, + 69, 69, 1557, 1558, 1563, 69, 1568, 1559, 1565, 1569, + 1561, 1566, 1570, 1560, 2164, 69, 69, 69, 69, 1572, + 1564, 69, 69, 1562, 1571, 69, 1574, 69, 1578, 69, + 69, 1563, 1573, 1568, 69, 1565, 1569, 1576, 1566, 1570, + 69, 1575, 1577, 69, 69, 69, 1572, 1581, 69, 1580, + 1579, 1571, 1583, 1574, 1582, 1578, 69, 1584, 1585, 1573, + 1586, 69, 1587, 1588, 1576, 1591, 69, 2164, 1575, 1577, + 69, 1589, 69, 1594, 69, 1595, 1580, 1579, 69, 1583, + 1590, 1582, 1596, 69, 1584, 1585, 69, 1586, 1598, 69, + + 69, 69, 1591, 1592, 69, 1597, 1593, 1599, 1589, 1600, + 69, 1601, 69, 69, 1602, 1603, 69, 1590, 1604, 69, + 1605, 69, 1607, 69, 1610, 69, 1608, 69, 1611, 1606, + 1592, 1609, 1597, 1593, 1599, 69, 69, 69, 69, 1613, + 69, 1602, 1603, 1612, 1617, 1604, 1621, 69, 69, 69, + 1615, 1610, 69, 1608, 69, 1611, 1606, 1614, 1609, 1616, + 1619, 1618, 69, 1620, 69, 69, 69, 69, 69, 69, + 1612, 69, 1622, 1621, 1623, 69, 1624, 1615, 1625, 1629, + 1626, 1631, 69, 1628, 1614, 69, 1616, 1619, 1618, 1630, + 1620, 1627, 69, 1632, 2164, 1642, 69, 69, 1634, 69, + + 69, 1623, 1633, 69, 69, 1625, 1629, 1626, 1631, 69, + 1628, 1635, 69, 1636, 69, 69, 1630, 69, 1627, 1637, + 1632, 1638, 1643, 1641, 1639, 1634, 1640, 69, 1646, 1633, + 1644, 1647, 1655, 69, 1645, 69, 69, 69, 1635, 1648, + 1636, 69, 69, 69, 69, 69, 1637, 1649, 1638, 1643, + 1641, 1639, 69, 1640, 69, 1646, 1652, 1644, 1653, 1655, + 1650, 1645, 1651, 69, 1654, 69, 1648, 69, 69, 1656, + 1657, 1658, 1661, 1659, 1649, 1660, 69, 1662, 1664, 69, + 69, 1663, 1665, 1652, 69, 1653, 1667, 1650, 1666, 1651, + 69, 1654, 1668, 69, 69, 1671, 1656, 1657, 1658, 69, + + 1659, 69, 1660, 69, 69, 1669, 1670, 69, 1663, 69, + 69, 1672, 69, 1667, 69, 1666, 1673, 1674, 69, 1668, + 1675, 69, 1671, 1676, 1677, 1679, 1678, 1681, 1680, 1682, + 69, 69, 1669, 1670, 69, 69, 1683, 1684, 1672, 69, + 69, 1687, 69, 1673, 69, 1685, 69, 1675, 69, 69, + 1676, 1677, 1679, 1678, 1681, 1680, 69, 69, 1686, 1688, + 2164, 69, 1689, 1683, 1684, 1691, 1690, 2164, 1693, 69, + 1692, 1695, 1685, 69, 1694, 1696, 2164, 1697, 69, 69, + 69, 1698, 1699, 1700, 69, 1686, 1688, 69, 1701, 1689, + 1702, 69, 1691, 1690, 69, 1693, 1703, 1692, 69, 69, + + 69, 1694, 1696, 69, 1697, 1705, 1704, 69, 1698, 69, + 69, 69, 1708, 1706, 1707, 1710, 69, 1702, 1709, 1711, + 69, 69, 1712, 1703, 1713, 2164, 1714, 69, 69, 69, + 1715, 1717, 1705, 1704, 69, 1718, 69, 1716, 1720, 69, + 1706, 1707, 1719, 1721, 1722, 1709, 1711, 69, 69, 1712, + 1723, 69, 69, 1714, 1725, 69, 69, 69, 1717, 69, + 69, 1724, 1718, 69, 1716, 1720, 1726, 1727, 1728, 1719, + 69, 69, 1729, 1731, 1730, 1732, 69, 69, 2164, 1733, + 69, 1725, 69, 69, 1734, 69, 1739, 69, 1724, 1736, + 1747, 1735, 69, 1726, 1727, 1728, 69, 69, 69, 1729, + + 1731, 1730, 69, 69, 1737, 1740, 1733, 69, 1738, 1742, + 1741, 1734, 69, 1739, 69, 1744, 1736, 69, 1735, 69, + 1743, 69, 1745, 69, 69, 1748, 1746, 2164, 1749, 1750, + 1751, 1737, 1740, 1752, 1753, 1738, 1742, 1741, 69, 69, + 69, 1756, 1744, 69, 69, 1754, 69, 1743, 69, 1745, + 69, 1755, 69, 1746, 69, 1749, 1750, 1751, 69, 69, + 1752, 1753, 1757, 1760, 1758, 2164, 1759, 1761, 1756, 69, + 1762, 1764, 1754, 69, 1768, 1763, 1769, 1765, 1755, 69, + 1770, 1771, 69, 69, 1775, 69, 69, 1766, 1767, 1757, + 69, 1758, 69, 1759, 1761, 69, 69, 1762, 1764, 69, + + 1772, 1768, 1763, 69, 1765, 1773, 69, 69, 1774, 69, + 1780, 1775, 1776, 69, 1766, 1767, 69, 69, 1777, 69, + 1778, 1779, 1781, 1782, 1785, 69, 1783, 1772, 69, 69, + 1784, 69, 1773, 69, 1787, 1774, 1788, 1780, 1792, 1776, + 1786, 1789, 69, 69, 1790, 1777, 69, 1778, 1779, 1781, + 1782, 69, 69, 1783, 69, 1791, 69, 1784, 1793, 1794, + 1795, 1787, 1796, 69, 69, 69, 1797, 1786, 1789, 1798, + 69, 1790, 69, 1799, 2164, 1800, 1801, 1803, 69, 2164, + 1802, 69, 1791, 1804, 1805, 1793, 69, 69, 1812, 1796, + 1806, 69, 1809, 69, 69, 69, 1798, 1807, 69, 1810, + + 69, 69, 1800, 1801, 1803, 69, 69, 1802, 1808, 1813, + 1804, 1805, 1814, 1811, 69, 69, 69, 1806, 1816, 1809, + 69, 69, 1815, 2164, 1807, 69, 1810, 1818, 1820, 1817, + 1819, 1821, 69, 1822, 1826, 1808, 69, 1825, 1823, 1814, + 1811, 2164, 69, 1824, 69, 1827, 1852, 69, 1831, 1815, + 69, 69, 1828, 69, 1818, 69, 1817, 1819, 69, 69, + 1822, 1830, 1829, 1832, 1825, 1835, 69, 69, 69, 1833, + 69, 1834, 1827, 69, 69, 1831, 1838, 1836, 69, 1828, + 69, 1839, 1841, 1837, 69, 69, 69, 69, 1830, 1829, + 1832, 1840, 1835, 1842, 69, 69, 1833, 69, 1834, 69, + + 69, 69, 1845, 1838, 1836, 1843, 1844, 1846, 1839, 1841, + 1837, 1848, 69, 1847, 69, 69, 1849, 69, 1840, 1850, + 1842, 1851, 1853, 69, 1856, 1855, 1854, 69, 1859, 69, + 1861, 69, 1843, 1844, 1846, 1858, 1857, 1862, 1848, 2164, + 1847, 69, 69, 69, 69, 69, 1850, 69, 1851, 69, + 69, 1856, 1855, 1854, 1860, 1859, 69, 1861, 69, 1865, + 1863, 1864, 1858, 1857, 69, 1866, 69, 69, 69, 1867, + 1868, 1869, 1870, 1871, 1873, 1874, 1872, 1880, 1875, 1876, + 2164, 1860, 69, 1879, 1877, 69, 1865, 1863, 1864, 69, + 1878, 2164, 69, 69, 69, 1882, 1867, 69, 69, 69, + + 1871, 69, 69, 1872, 69, 1875, 69, 1883, 1884, 69, + 1879, 69, 1881, 1885, 69, 69, 1888, 1878, 69, 1889, + 1886, 1887, 1882, 1891, 1890, 1892, 1894, 2164, 69, 69, + 69, 69, 69, 1893, 1883, 1884, 69, 1896, 69, 1881, + 1885, 69, 1897, 1888, 1898, 69, 1889, 1886, 1887, 1895, + 1891, 1890, 69, 1894, 1899, 1900, 1903, 69, 1906, 1901, + 1893, 1902, 69, 69, 1896, 69, 69, 1907, 69, 1897, + 69, 1898, 1904, 1905, 69, 1908, 1895, 69, 1909, 69, + 69, 1899, 1900, 1903, 69, 69, 1901, 1910, 1902, 1911, + 1913, 69, 1912, 1915, 1907, 1914, 1916, 2164, 1917, 1904, + + 1905, 69, 1908, 1918, 2164, 69, 1921, 69, 69, 69, + 1919, 69, 2164, 1920, 1910, 2164, 1911, 69, 69, 1912, + 1915, 1922, 1914, 1916, 69, 1924, 1923, 69, 1925, 1927, + 69, 69, 1926, 69, 1931, 1928, 1932, 1919, 1934, 69, + 1920, 69, 1929, 1936, 1933, 1930, 69, 69, 1922, 1938, + 69, 69, 1924, 1923, 69, 1925, 1927, 69, 69, 1926, + 1935, 69, 1928, 1932, 1937, 1934, 1940, 1939, 69, 1929, + 1941, 1933, 1930, 69, 1942, 69, 69, 1944, 1943, 69, + 69, 1945, 69, 1946, 1947, 1948, 69, 1935, 69, 69, + 1949, 1937, 1951, 1940, 1939, 69, 1950, 1941, 1954, 69, + + 1956, 1952, 1953, 69, 69, 1943, 69, 1958, 1945, 69, + 1946, 69, 1948, 69, 69, 1955, 69, 1949, 1957, 1951, + 69, 69, 1959, 1950, 1960, 1954, 69, 69, 1952, 1953, + 1961, 1962, 1963, 1964, 69, 1965, 1966, 2164, 1967, 69, + 69, 69, 1955, 1968, 69, 1957, 1970, 1969, 1971, 69, + 1975, 69, 69, 69, 1980, 1976, 69, 1961, 1962, 69, + 1964, 1972, 1965, 1966, 69, 1967, 1973, 2164, 1977, 69, + 1968, 1974, 1978, 69, 1969, 69, 1979, 69, 69, 69, + 1981, 69, 1976, 69, 1982, 2164, 69, 69, 1972, 1985, + 1984, 1983, 1986, 1973, 69, 1977, 1989, 69, 1974, 1978, + + 69, 1990, 1991, 1979, 1987, 1988, 1992, 69, 69, 1994, + 69, 1982, 69, 1993, 69, 1995, 1985, 1984, 1983, 1996, + 1997, 1998, 69, 69, 69, 2000, 2003, 1999, 69, 1991, + 2002, 1987, 1988, 69, 2001, 69, 1994, 69, 2004, 69, + 1993, 2006, 1995, 2005, 2007, 2008, 69, 69, 69, 69, + 69, 69, 69, 69, 1999, 2009, 69, 2002, 2010, 69, + 2015, 2001, 2011, 2164, 2014, 2004, 2012, 69, 2006, 2013, + 2005, 69, 2008, 69, 69, 69, 69, 2016, 2017, 2020, + 2024, 2018, 2009, 2019, 69, 69, 69, 2015, 69, 2011, + 69, 2014, 69, 2012, 2026, 2023, 2013, 69, 69, 2021, + + 2022, 69, 69, 2027, 2016, 2017, 2020, 2024, 2018, 69, + 2019, 2025, 2028, 2029, 2030, 2031, 2164, 2033, 69, 2032, + 2034, 69, 2023, 2035, 2036, 2037, 2021, 2022, 2040, 69, + 69, 2039, 2038, 2041, 2042, 69, 69, 69, 2025, 2028, + 69, 69, 69, 69, 69, 2043, 2032, 2034, 2044, 69, + 2035, 69, 2037, 2045, 69, 2040, 2047, 69, 2039, 2038, + 69, 69, 2046, 2048, 69, 2049, 2050, 2052, 69, 69, + 69, 2051, 2043, 2053, 2054, 2044, 2055, 2056, 2057, 69, + 69, 2058, 2059, 2047, 2060, 2062, 2065, 69, 69, 2046, + 2048, 2164, 2049, 2050, 69, 2061, 69, 69, 2051, 2064, + + 69, 69, 2067, 69, 69, 2057, 2063, 69, 69, 2059, + 69, 2060, 69, 2068, 2066, 69, 2069, 2070, 69, 2072, + 2076, 69, 2061, 69, 69, 69, 2064, 69, 69, 2067, + 2071, 2073, 2074, 2063, 2077, 2075, 69, 2164, 69, 69, + 2068, 2066, 69, 2069, 2070, 69, 2072, 2076, 69, 2081, + 2084, 69, 2078, 2082, 69, 2079, 2080, 2071, 2073, 2074, + 69, 2077, 2075, 2083, 69, 69, 2085, 69, 2086, 2088, + 69, 2087, 2089, 2164, 2092, 2093, 2081, 69, 2090, 2078, + 2082, 2095, 2079, 2080, 69, 2091, 69, 69, 2099, 2094, + 2083, 2096, 2100, 2085, 69, 69, 69, 69, 2087, 2089, + + 69, 2092, 69, 69, 2097, 2090, 2098, 69, 69, 2101, + 2164, 2102, 2091, 69, 69, 2103, 2094, 2104, 2096, 2106, + 69, 2107, 69, 69, 69, 69, 2105, 69, 2110, 2108, + 69, 2097, 2109, 2098, 2164, 69, 2101, 2112, 2102, 2111, + 69, 2113, 2103, 69, 2104, 69, 2106, 2114, 2107, 69, + 69, 2119, 2164, 2105, 2115, 2110, 2108, 2116, 2117, 2109, + 2120, 69, 2118, 2124, 2112, 2164, 2111, 2122, 69, 2123, + 69, 2121, 2164, 69, 2114, 69, 69, 69, 2125, 69, + 69, 2115, 2127, 69, 2116, 2117, 69, 69, 2126, 2118, + 2131, 69, 2128, 2129, 2122, 69, 2123, 2130, 2121, 2132, + + 69, 69, 69, 2134, 69, 2125, 2133, 2164, 2135, 2127, + 2136, 69, 2139, 2164, 69, 2126, 69, 2131, 2137, 2128, + 2129, 69, 2140, 2138, 2130, 2164, 2132, 2141, 2142, 69, + 2134, 69, 69, 2133, 69, 2135, 69, 2136, 69, 69, + 2143, 2145, 69, 2144, 2146, 2137, 2149, 69, 2147, 2140, + 2138, 69, 2148, 2150, 2141, 2142, 69, 2151, 2164, 2152, + 69, 69, 69, 69, 2153, 69, 69, 2143, 2145, 2154, + 2144, 2146, 69, 2149, 2155, 2147, 2156, 2157, 2158, 2148, + 2150, 2162, 2164, 2163, 2151, 69, 2152, 2159, 2164, 69, + 2160, 69, 2164, 2164, 2161, 2164, 2154, 69, 69, 2164, + + 69, 69, 69, 69, 2157, 2158, 2164, 2164, 69, 69, + 69, 2164, 2164, 2164, 2159, 2164, 2164, 2160, 2164, 2164, + 2164, 2161, 41, 41, 41, 41, 41, 41, 41, 46, + 46, 46, 46, 46, 46, 46, 51, 51, 51, 51, + 51, 51, 51, 57, 57, 57, 57, 57, 57, 57, + 62, 62, 62, 62, 62, 62, 62, 72, 72, 2164, + 72, 72, 72, 72, 131, 131, 2164, 2164, 2164, 131, + 131, 133, 133, 2164, 2164, 133, 2164, 133, 135, 2164, + 2164, 2164, 2164, 2164, 135, 138, 138, 2164, 2164, 2164, + 138, 138, 140, 2164, 2164, 2164, 2164, 2164, 140, 142, + + 142, 2164, 142, 142, 142, 142, 73, 73, 2164, 73, + 73, 73, 73, 13, 2164, 2164, 2164, 2164, 2164, 2164, + 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, + 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, + 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, + 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, + 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, + 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164 } ; -static yyconst flex_int16_t yy_chk[3543] = +static yyconst flex_int16_t yy_chk[6281] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 3, 3, 4, 4, 4, 50, 5, 5, 50, 3, - 5, 15, 4, 6, 6, 15, 5, 6, 9, 9, - 9, 156, 33, 6, 7, 7, 7, 7, 9, 7, - 10, 10, 10, 45, 45, 7, 8, 8, 8, 8, - 10, 8, 21, 33, 156, 21, 21, 8, 11, 11, - 11, 11, 11, 11, 1776, 20, 29, 20, 20, 11, - - 20, 29, 24, 21, 25, 20, 24, 28, 11, 12, - 12, 12, 12, 12, 12, 75, 22, 22, 75, 25, - 12, 70, 28, 30, 22, 70, 24, 26, 26, 12, - 19, 22, 19, 19, 35, 19, 26, 83, 30, 27, - 19, 19, 23, 27, 61, 61, 27, 23, 35, 31, - 31, 23, 39, 27, 23, 27, 23, 23, 31, 83, - 32, 32, 36, 36, 31, 32, 39, 36, 31, 37, - 659, 39, 38, 38, 37, 38, 79, 36, 40, 40, - 36, 32, 34, 40, 37, 111, 111, 34, 37, 37, - 38, 34, 77, 56, 79, 56, 56, 34, 56, 64, - - 34, 64, 64, 66, 64, 66, 66, 34, 66, 67, - 64, 69, 77, 69, 69, 76, 69, 78, 80, 76, - 78, 69, 82, 67, 72, 81, 72, 72, 84, 72, - 86, 85, 80, 78, 72, 72, 85, 81, 87, 88, - 82, 89, 90, 91, 86, 98, 90, 84, 91, 85, - 92, 94, 95, 128, 128, 136, 94, 88, 87, 89, - 93, 99, 96, 93, 92, 97, 93, 96, 97, 98, - 100, 95, 97, 102, 100, 99, 101, 103, 104, 105, - 93, 107, 106, 101, 103, 107, 102, 96, 108, 109, - 110, 104, 112, 118, 109, 113, 114, 115, 109, 105, - - 106, 116, 117, 119, 119, 118, 108, 117, 113, 120, - 110, 114, 112, 121, 122, 123, 115, 123, 124, 116, - 125, 126, 130, 124, 119, 130, 143, 120, 132, 121, - 132, 132, 125, 132, 134, 122, 135, 135, 123, 126, - 137, 143, 137, 137, 138, 137, 138, 138, 140, 138, - 145, 140, 141, 142, 144, 138, 146, 141, 142, 147, - 148, 154, 144, 149, 133, 148, 148, 150, 149, 145, - 157, 146, 150, 151, 157, 151, 153, 153, 155, 147, - 154, 158, 160, 155, 159, 162, 158, 161, 163, 164, - 164, 165, 166, 163, 131, 151, 152, 160, 159, 161, - - 152, 167, 161, 162, 129, 152, 167, 172, 166, 164, - 152, 165, 168, 168, 169, 170, 152, 152, 171, 169, - 170, 173, 180, 182, 174, 169, 173, 171, 172, 174, - 175, 176, 177, 178, 179, 175, 176, 181, 184, 177, - 179, 183, 180, 181, 186, 182, 178, 185, 187, 183, - 188, 184, 185, 189, 190, 188, 191, 192, 193, 186, - 193, 191, 194, 196, 197, 195, 198, 198, 187, 194, - 195, 203, 190, 190, 199, 189, 197, 192, 200, 199, - 202, 204, 196, 200, 201, 208, 201, 209, 205, 204, - 203, 206, 202, 205, 207, 211, 206, 199, 210, 207, - - 208, 212, 217, 201, 212, 209, 210, 213, 213, 214, - 215, 215, 214, 216, 216, 218, 219, 220, 217, 219, - 211, 220, 221, 222, 223, 224, 224, 225, 222, 226, - 218, 221, 225, 227, 226, 229, 228, 230, 223, 231, - 231, 232, 233, 234, 236, 235, 233, 241, 237, 236, - 230, 237, 238, 227, 228, 239, 229, 235, 240, 232, - 242, 234, 243, 244, 238, 244, 244, 240, 241, 245, - 245, 247, 239, 242, 243, 239, 246, 248, 249, 246, - 250, 251, 251, 253, 253, 252, 254, 249, 247, 250, - 252, 247, 248, 255, 256, 257, 259, 258, 255, 260, - - 261, 254, 258, 261, 260, 261, 256, 262, 263, 264, - 267, 269, 265, 268, 266, 257, 259, 265, 264, 266, - 270, 262, 271, 272, 263, 271, 269, 263, 274, 263, - 275, 267, 276, 268, 270, 278, 277, 272, 352, 275, - 279, 271, 273, 274, 273, 273, 280, 281, 282, 283, - 278, 280, 284, 276, 273, 277, 273, 273, 273, 286, - 279, 273, 287, 352, 283, 289, 285, 284, 282, 288, - 281, 285, 290, 292, 288, 293, 287, 290, 294, 286, - 127, 289, 291, 291, 295, 291, 296, 298, 296, 299, - 300, 293, 297, 292, 294, 301, 297, 302, 295, 300, - - 304, 306, 302, 299, 301, 298, 303, 306, 305, 304, - 303, 307, 300, 305, 309, 307, 308, 308, 310, 309, - 311, 311, 312, 313, 314, 315, 316, 312, 317, 317, - 316, 310, 319, 314, 318, 320, 320, 315, 323, 318, - 322, 322, 324, 325, 313, 326, 327, 329, 330, 331, - 324, 332, 325, 319, 337, 333, 332, 334, 327, 323, - 338, 335, 334, 331, 333, 326, 336, 329, 330, 335, - 339, 336, 337, 340, 341, 342, 343, 340, 344, 347, - 342, 346, 338, 348, 349, 350, 363, 349, 348, 341, - 363, 339, 343, 348, 354, 347, 356, 344, 345, 345, - - 355, 346, 351, 351, 345, 350, 345, 353, 353, 354, - 357, 356, 355, 358, 345, 359, 360, 361, 362, 365, - 359, 364, 366, 68, 345, 360, 364, 370, 367, 357, - 368, 365, 371, 362, 372, 358, 361, 372, 368, 370, - 366, 367, 369, 369, 371, 373, 374, 375, 376, 374, - 384, 377, 376, 376, 378, 378, 379, 379, 381, 381, - 373, 62, 380, 375, 377, 383, 375, 380, 382, 382, - 383, 384, 385, 390, 386, 387, 389, 385, 386, 388, - 387, 389, 391, 388, 392, 393, 396, 391, 394, 392, - 403, 394, 397, 390, 395, 395, 394, 398, 399, 393, - - 394, 405, 398, 403, 396, 400, 397, 399, 400, 401, - 402, 404, 406, 401, 407, 402, 404, 405, 409, 407, - 408, 409, 410, 411, 406, 410, 408, 412, 411, 413, - 416, 414, 415, 416, 417, 401, 414, 415, 419, 417, - 420, 422, 418, 413, 421, 412, 418, 418, 426, 421, - 422, 419, 423, 420, 424, 423, 428, 429, 424, 424, - 425, 427, 425, 427, 430, 431, 434, 426, 432, 433, - 423, 435, 432, 436, 428, 429, 438, 437, 433, 439, - 439, 434, 437, 430, 443, 431, 440, 441, 436, 435, - 440, 442, 444, 445, 446, 438, 442, 447, 441, 449, - - 443, 446, 447, 448, 449, 451, 445, 450, 452, 453, - 448, 444, 450, 454, 455, 452, 458, 456, 453, 455, - 456, 457, 460, 451, 465, 457, 467, 454, 462, 459, - 459, 460, 463, 462, 464, 466, 463, 458, 459, 468, - 471, 474, 465, 466, 467, 477, 464, 478, 479, 483, - 484, 480, 479, 478, 477, 471, 480, 482, 474, 487, - 485, 489, 482, 485, 468, 469, 487, 483, 486, 486, - 469, 488, 488, 494, 469, 484, 489, 469, 490, 490, - 491, 492, 493, 491, 469, 495, 492, 469, 481, 481, - 481, 496, 481, 494, 498, 481, 497, 497, 499, 496, - - 481, 493, 504, 500, 495, 504, 481, 481, 500, 498, - 501, 501, 502, 503, 505, 506, 499, 502, 503, 507, - 505, 508, 511, 506, 509, 510, 513, 507, 514, 509, - 512, 512, 510, 514, 513, 515, 517, 518, 520, 508, - 519, 511, 522, 519, 525, 517, 518, 521, 521, 527, - 523, 526, 520, 523, 515, 528, 526, 522, 529, 530, - 531, 523, 532, 533, 534, 525, 532, 535, 536, 531, - 527, 537, 538, 539, 542, 528, 535, 537, 542, 530, - 529, 533, 536, 534, 540, 541, 543, 539, 544, 540, - 541, 545, 538, 546, 547, 547, 545, 548, 549, 550, - - 544, 549, 548, 551, 552, 543, 553, 554, 554, 552, - 555, 555, 556, 558, 546, 557, 551, 550, 559, 557, - 560, 561, 564, 566, 563, 565, 553, 556, 563, 571, - 567, 568, 558, 569, 560, 567, 570, 564, 566, 575, - 570, 561, 559, 562, 571, 568, 562, 569, 562, 574, - 565, 572, 562, 573, 562, 576, 572, 578, 573, 562, - 575, 577, 578, 574, 562, 580, 572, 577, 581, 576, - 579, 579, 582, 581, 586, 583, 579, 580, 579, 584, - 584, 587, 586, 585, 588, 594, 582, 583, 585, 589, - 589, 597, 595, 590, 592, 587, 579, 590, 593, 592, - - 598, 593, 596, 588, 594, 595, 599, 596, 600, 601, - 597, 602, 603, 604, 601, 599, 598, 607, 605, 608, - 609, 616, 604, 605, 610, 611, 603, 600, 612, 610, - 611, 602, 613, 612, 616, 609, 607, 608, 614, 614, - 615, 613, 618, 621, 622, 615, 618, 618, 619, 619, - 620, 623, 619, 620, 624, 625, 626, 621, 625, 630, - 627, 634, 628, 629, 622, 627, 623, 628, 636, 629, - 631, 632, 632, 633, 624, 630, 631, 626, 635, 634, - 637, 635, 633, 638, 639, 640, 636, 641, 642, 644, - 640, 643, 641, 645, 643, 648, 646, 639, 650, 637, - - 644, 646, 647, 638, 651, 645, 642, 647, 649, 649, - 648, 652, 653, 654, 656, 655, 653, 650, 651, 657, - 660, 661, 662, 652, 655, 663, 682, 664, 671, 682, - 663, 654, 664, 656, 660, 665, 661, 667, 666, 668, - 665, 669, 662, 666, 657, 670, 669, 671, 672, 673, - 676, 667, 675, 668, 674, 674, 676, 677, 678, 678, - 670, 679, 680, 672, 681, 683, 679, 684, 673, 680, - 675, 686, 688, 690, 685, 687, 684, 677, 681, 685, - 687, 689, 690, 683, 691, 689, 692, 693, 694, 695, - 686, 688, 696, 697, 693, 699, 698, 700, 701, 691, - - 694, 692, 698, 706, 703, 704, 705, 701, 695, 703, - 699, 697, 709, 696, 705, 707, 711, 700, 720, 704, - 707, 708, 57, 706, 712, 708, 708, 710, 710, 711, - 713, 709, 720, 712, 715, 713, 714, 714, 716, 715, - 717, 717, 718, 716, 719, 721, 728, 722, 723, 719, - 724, 718, 722, 723, 725, 724, 726, 728, 725, 727, - 727, 731, 730, 721, 732, 726, 730, 735, 733, 736, - 726, 738, 726, 739, 726, 734, 731, 733, 737, 734, - 734, 735, 732, 740, 742, 738, 737, 747, 736, 741, - 741, 739, 743, 743, 745, 746, 749, 745, 753, 742, - - 746, 748, 748, 750, 750, 751, 747, 755, 740, 754, - 751, 752, 752, 758, 754, 755, 749, 756, 753, 757, - 757, 759, 756, 760, 762, 767, 766, 759, 763, 762, - 760, 758, 764, 763, 765, 766, 768, 764, 770, 765, - 769, 769, 771, 772, 767, 775, 773, 768, 772, 774, - 776, 777, 777, 778, 779, 782, 780, 775, 770, 781, - 773, 786, 783, 789, 781, 771, 773, 783, 776, 774, - 786, 785, 787, 778, 780, 785, 785, 789, 782, 779, - 787, 788, 790, 788, 791, 792, 793, 790, 791, 794, - 795, 797, 796, 798, 799, 801, 792, 796, 799, 800, - - 807, 805, 802, 803, 804, 793, 806, 807, 795, 797, - 809, 806, 811, 798, 801, 794, 802, 800, 803, 804, - 805, 808, 810, 812, 813, 814, 808, 811, 809, 812, - 814, 810, 815, 816, 817, 817, 820, 815, 816, 819, - 819, 821, 822, 823, 824, 813, 821, 826, 824, 824, - 825, 825, 827, 828, 820, 829, 822, 830, 832, 831, - 837, 833, 823, 830, 831, 834, 826, 835, 836, 52, - 838, 827, 839, 839, 829, 840, 843, 832, 841, 828, - 833, 837, 836, 841, 834, 838, 835, 840, 842, 843, - 844, 845, 842, 855, 846, 848, 846, 849, 849, 844, - - 846, 850, 852, 851, 845, 853, 850, 851, 868, 857, - 853, 855, 51, 846, 857, 848, 858, 858, 859, 861, - 861, 867, 852, 859, 863, 863, 865, 866, 866, 865, - 869, 871, 870, 868, 872, 872, 867, 870, 873, 874, - 874, 875, 876, 877, 869, 878, 871, 877, 881, 879, - 885, 882, 884, 876, 879, 883, 883, 884, 873, 886, - 887, 888, 890, 875, 878, 882, 881, 890, 892, 887, - 885, 889, 891, 889, 898, 893, 894, 891, 896, 886, - 893, 888, 895, 895, 896, 899, 899, 900, 892, 901, - 894, 903, 907, 905, 902, 46, 903, 902, 898, 900, - - 902, 904, 905, 906, 908, 909, 904, 908, 906, 901, - 909, 911, 902, 910, 910, 912, 913, 907, 914, 915, - 916, 917, 920, 914, 915, 919, 917, 918, 918, 911, - 919, 921, 922, 923, 912, 925, 913, 924, 927, 926, - 920, 928, 929, 916, 926, 931, 41, 923, 925, 924, - 931, 921, 922, 932, 935, 933, 941, 934, 927, 938, - 938, 928, 933, 929, 939, 942, 934, 939, 932, 934, - 935, 940, 941, 943, 942, 944, 940, 945, 946, 947, - 947, 948, 949, 946, 944, 950, 945, 944, 951, 953, - 954, 956, 943, 952, 958, 949, 955, 955, 14, 958, - - 957, 948, 951, 950, 960, 952, 961, 956, 954, 957, - 959, 959, 963, 960, 953, 964, 960, 963, 965, 967, - 966, 969, 968, 965, 961, 959, 966, 968, 970, 974, - 973, 970, 975, 964, 969, 976, 977, 970, 973, 967, - 978, 977, 974, 979, 981, 982, 983, 984, 985, 982, - 975, 983, 984, 985, 976, 987, 978, 986, 988, 989, - 989, 979, 990, 991, 981, 992, 986, 993, 994, 995, - 991, 996, 997, 988, 995, 998, 990, 992, 987, 993, - 1134, 998, 1134, 996, 999, 999, 1000, 994, 1003, 1000, - 997, 1001, 1001, 1004, 1004, 1005, 1006, 1003, 1008, 1007, - - 1009, 1006, 1011, 1012, 1010, 1013, 1016, 1005, 1007, 1010, - 1008, 1011, 1014, 1014, 1015, 1009, 1017, 1018, 1020, 1015, - 1013, 1019, 1019, 1012, 1011, 1021, 1021, 1016, 1022, 1022, - 1023, 1024, 1028, 1030, 1023, 1017, 1024, 1018, 1020, 1025, - 1027, 1029, 1025, 1031, 1031, 1027, 1029, 1032, 1032, 1033, - 1028, 1034, 1035, 1036, 1033, 1037, 1039, 1038, 1030, 1040, - 1040, 1041, 1043, 1034, 1034, 1034, 1042, 1042, 1047, 1045, - 1034, 1038, 1035, 1036, 1048, 1037, 1049, 1039, 1045, 1046, - 1046, 1048, 1043, 1047, 1050, 1049, 1052, 1041, 1051, 1051, - 1053, 1055, 1056, 1057, 1058, 1059, 1055, 1056, 1060, 1060, - - 1059, 1058, 1061, 1063, 1065, 1062, 1053, 1061, 1064, 1068, - 1050, 1067, 1052, 1057, 1062, 1066, 1065, 1070, 1066, 1069, - 1069, 1071, 1072, 1063, 1073, 1074, 1137, 1064, 1078, 1067, - 1073, 1076, 1070, 1137, 1074, 1068, 1079, 1072, 1075, 1075, - 1071, 1080, 1076, 1077, 1077, 1084, 1080, 1076, 1085, 1078, - 1079, 1081, 1081, 1082, 1083, 1087, 1086, 1082, 1082, 1083, - 1085, 1086, 1088, 1089, 1090, 1091, 1088, 1087, 1092, 1093, - 1091, 1084, 1094, 1096, 1093, 1089, 1096, 1097, 1097, 1098, - 1098, 1099, 1099, 1100, 1094, 1101, 1104, 1102, 1103, 1090, - 1092, 1101, 1102, 1106, 1103, 1104, 1108, 1110, 1106, 1111, - - 1111, 1112, 1113, 1100, 1114, 1115, 1116, 1117, 1108, 1110, - 1116, 1113, 1117, 1118, 1119, 1121, 1121, 1122, 1118, 1129, - 1123, 1112, 1114, 1124, 1115, 1126, 1126, 1121, 1119, 1123, - 1130, 1131, 1124, 1132, 1129, 1122, 1131, 1133, 1133, 1135, - 1135, 1138, 1139, 1139, 1130, 1140, 1141, 1142, 1143, 1145, - 1132, 1144, 1146, 1147, 1140, 1154, 1150, 1149, 1150, 1142, - 1143, 1138, 1149, 1144, 1145, 1151, 1152, 1141, 1156, 1154, - 1155, 1155, 1146, 1147, 1157, 1152, 1158, 1159, 1158, 1157, - 1160, 1161, 1159, 1151, 1162, 1160, 1163, 1164, 1165, 1167, - 1171, 1163, 1164, 1168, 1156, 1172, 1165, 1169, 1169, 1161, - - 1170, 1170, 13, 1186, 1162, 1171, 1173, 1168, 1167, 1174, - 1175, 1173, 1175, 1176, 1174, 1172, 1178, 1177, 1178, 1179, - 1180, 1185, 1182, 1186, 1187, 1176, 1177, 1182, 1179, 1177, - 1183, 1189, 1180, 1191, 1185, 1183, 1192, 1189, 1193, 1191, - 1187, 1194, 1195, 1195, 1196, 1197, 1197, 1198, 1199, 1200, - 1194, 1192, 1199, 1196, 1200, 1201, 1202, 1202, 1204, 1203, - 1207, 1207, 1208, 1193, 1209, 1209, 1198, 1203, 1201, 1210, - 1210, 1208, 1211, 1212, 1213, 1214, 1214, 1216, 1204, 1213, - 1217, 1218, 1219, 1220, 1211, 1217, 1225, 1221, 1220, 1227, - 1222, 1212, 1223, 1223, 1224, 1226, 1230, 1219, 1224, 1228, - - 1226, 1225, 1216, 1231, 1218, 1221, 1222, 1232, 1233, 1234, - 1235, 1237, 1237, 1238, 1240, 1227, 1238, 1239, 1228, 1230, - 1241, 1234, 1242, 1242, 1243, 1243, 1232, 1231, 1240, 1233, - 1239, 1235, 1245, 1241, 1244, 1244, 1246, 1246, 1247, 1247, - 1248, 1248, 1249, 1250, 1250, 1245, 1251, 1251, 1252, 1254, - 1255, 1255, 1256, 1259, 1254, 1257, 1257, 1258, 1263, 1259, - 1260, 1249, 1264, 1260, 1261, 1261, 1267, 1252, 1262, 1262, - 1268, 1256, 1269, 1263, 1270, 1258, 1265, 1265, 1270, 1272, - 1261, 1264, 1271, 1271, 1273, 1273, 1267, 1269, 1274, 1275, - 1275, 1276, 1277, 1268, 1278, 1279, 1280, 1281, 1272, 1278, - - 1276, 1282, 1283, 1284, 1277, 1286, 1282, 1285, 1287, 1280, - 1290, 1288, 1284, 1287, 1274, 1288, 1285, 1283, 1281, 1286, - 1279, 1294, 1292, 1293, 1293, 1297, 1294, 1295, 1295, 1298, - 1290, 1292, 1300, 1304, 1302, 1308, 1295, 1302, 1298, 1312, - 1297, 1303, 1305, 1305, 1300, 1310, 1303, 1307, 1307, 1308, - 1309, 1309, 1311, 1304, 1313, 1313, 1315, 1310, 1312, 1316, - 1315, 1319, 1316, 1317, 1317, 1318, 1311, 1321, 1320, 1322, - 1318, 1321, 1323, 1324, 1325, 1327, 0, 1323, 1324, 1328, - 1325, 1319, 1320, 1329, 1328, 1330, 1334, 1334, 1329, 1322, - 1331, 1327, 1331, 1330, 1338, 1338, 1341, 1342, 1342, 1344, - - 1344, 1341, 1346, 1347, 1347, 1348, 1349, 1346, 1350, 1355, - 1352, 1353, 1353, 1350, 1356, 1357, 1358, 0, 1355, 1356, - 1362, 1348, 1352, 1360, 1360, 1362, 1364, 1363, 1349, 1363, - 1365, 1358, 1369, 1357, 1370, 1365, 1366, 1366, 1367, 1367, - 1364, 1368, 1368, 1371, 1369, 1372, 1373, 1375, 1374, 1376, - 1376, 1377, 1370, 1374, 1378, 1371, 1379, 1372, 1373, 1380, - 1377, 1381, 1384, 1382, 1383, 1385, 1386, 1375, 1387, 1387, - 1385, 1386, 1380, 1388, 1388, 1391, 1379, 1382, 1392, 1393, - 1378, 1395, 1383, 1394, 1384, 1381, 1396, 1397, 1398, 1398, - 1395, 1400, 1400, 1401, 1403, 1391, 1392, 1402, 1404, 1405, - - 1407, 1393, 1401, 1394, 1402, 1397, 1396, 1406, 1409, 1403, - 1408, 1408, 1410, 1409, 1411, 1412, 1404, 1405, 1413, 1407, - 1415, 1418, 1419, 1406, 1422, 1419, 1420, 1420, 1421, 1411, - 1410, 1423, 1425, 1426, 1412, 1423, 1428, 1426, 1413, 1415, - 1431, 1418, 1422, 1421, 1427, 1427, 1438, 1425, 0, 1428, - 1430, 1430, 1432, 1432, 1433, 1433, 1437, 1437, 1439, 1431, - 1440, 1441, 1442, 1443, 1445, 1440, 1441, 1439, 1438, 1446, - 1447, 1443, 1448, 1451, 1446, 1447, 1449, 1449, 1451, 1445, - 1452, 1442, 1450, 1450, 1460, 1452, 1461, 1448, 1453, 1453, - 1454, 1454, 1457, 1460, 1458, 1459, 1462, 1457, 1458, 1464, - - 1459, 1461, 1463, 1466, 1462, 1467, 1466, 1463, 1468, 1469, - 1470, 1464, 1471, 1471, 1474, 1472, 1475, 0, 1469, 1470, - 1476, 1468, 1478, 1467, 1472, 1477, 1477, 1479, 1479, 1480, - 1481, 1478, 1483, 1474, 1484, 1481, 1475, 1480, 1485, 1476, - 1486, 1483, 1485, 1487, 1489, 1489, 1494, 1484, 1491, 1491, - 1495, 1495, 1496, 1500, 1486, 1496, 1497, 1497, 1487, 1498, - 1498, 1499, 1499, 1501, 1502, 1511, 1494, 1503, 1503, 1502, - 1504, 1500, 1507, 1513, 1504, 1508, 1512, 1501, 1507, 1514, - 1508, 1512, 1511, 1511, 1515, 1516, 1516, 1517, 1518, 1519, - 1524, 1513, 1520, 1520, 1521, 1521, 1518, 1522, 1515, 1514, - - 1523, 1525, 1526, 1527, 1528, 1523, 1517, 1532, 1519, 1530, - 1524, 1526, 1530, 1522, 1533, 1533, 1534, 1535, 1536, 1538, - 1534, 1537, 1537, 1527, 1528, 1532, 1535, 1525, 1539, 1541, - 1542, 1543, 1538, 1536, 1547, 1548, 1548, 1539, 1541, 1547, - 1549, 1551, 1542, 1552, 1553, 1554, 1551, 1556, 1555, 1549, - 1557, 1558, 1552, 1555, 1561, 1557, 1543, 1559, 1559, 1562, - 1563, 1563, 1565, 1564, 1553, 1556, 1554, 1564, 1566, 1567, - 1568, 1565, 1569, 1561, 1562, 1570, 1558, 1569, 1568, 1571, - 1571, 1572, 1573, 1573, 1566, 1574, 1576, 1576, 1567, 1577, - 1574, 1578, 1580, 1580, 1581, 1582, 1583, 1583, 1584, 1584, - - 1572, 1570, 1585, 1586, 1587, 1588, 1588, 1589, 1581, 1577, - 1590, 1591, 1592, 1593, 1578, 1586, 1591, 1582, 1593, 1589, - 1594, 1585, 1595, 1595, 1587, 1597, 1597, 1598, 1600, 1601, - 1590, 1592, 0, 1600, 1602, 1603, 1603, 1594, 1594, 1602, - 1604, 1604, 1606, 1601, 1605, 1605, 1598, 1606, 1608, 1608, - 1610, 1610, 1612, 1612, 1613, 1614, 1615, 1615, 1616, 1619, - 1620, 1620, 1624, 1616, 1614, 1621, 1623, 1619, 1613, 1625, - 1621, 1623, 1626, 1627, 1624, 1628, 1629, 1632, 1633, 1633, - 1635, 1629, 1634, 1634, 1635, 1639, 1639, 1625, 1626, 1641, - 1627, 1627, 1644, 1641, 1643, 1643, 1628, 1632, 1646, 1646, - - 1647, 1649, 1650, 1650, 1651, 1651, 1644, 1652, 1653, 1654, - 1657, 1655, 1656, 1658, 1658, 1647, 1655, 1656, 0, 1649, - 1661, 1661, 1667, 1653, 1663, 1663, 1665, 1665, 1671, 1657, - 1654, 1672, 1652, 1671, 1667, 1668, 1668, 1673, 1674, 1676, - 1675, 1682, 1673, 1681, 1684, 1672, 1683, 1681, 1685, 1686, - 1687, 1690, 1688, 1689, 1689, 1676, 1693, 1674, 1675, 1683, - 1690, 1682, 1694, 1684, 1691, 1686, 1685, 1688, 1692, 1691, - 1696, 1695, 1698, 1692, 1699, 1687, 1695, 1694, 1700, 1703, - 1701, 1693, 1702, 1700, 1696, 1701, 1704, 1698, 1705, 1706, - 1707, 1708, 1703, 1699, 1709, 1710, 1702, 1712, 1713, 1713, - - 1710, 1711, 1705, 1707, 1708, 1704, 1711, 1714, 1706, 1715, - 1716, 1717, 1714, 1709, 1715, 1716, 1712, 1718, 1719, 1719, - 1720, 1721, 1718, 1722, 1723, 1724, 1725, 1720, 1727, 1723, - 1717, 1728, 1729, 1727, 1730, 1731, 1731, 1733, 1732, 1725, - 1721, 0, 1722, 1732, 1724, 1734, 1734, 1730, 1735, 1735, - 1728, 1729, 1736, 1737, 1738, 1740, 1733, 1736, 1739, 1739, - 1737, 1741, 1740, 1742, 1743, 1744, 1746, 1747, 1741, 1743, - 1748, 1746, 1747, 1738, 1749, 1750, 1750, 1751, 1752, 1753, - 1753, 1755, 1742, 1764, 1744, 1754, 1754, 1765, 1755, 1748, - 1756, 1756, 1758, 1749, 1757, 1757, 1751, 1752, 1760, 1758, - - 1763, 0, 1764, 1760, 0, 1763, 1765, 1766, 1766, 1767, - 1767, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1772, 1772, - 1772, 1772, 1772, 1772, 1772, 1773, 1773, 1773, 1773, 1773, - 1773, 1773, 1774, 1774, 1774, 1774, 1774, 1774, 1774, 1775, - 1775, 1775, 1775, 1775, 1775, 1775, 1777, 1777, 0, 1777, - 1777, 1777, 1777, 1778, 1778, 0, 0, 0, 1778, 1778, - 1779, 1779, 0, 0, 1779, 0, 1779, 1780, 0, 0, - 0, 0, 0, 1780, 1781, 1781, 0, 0, 0, 1781, - 1781, 1782, 0, 0, 0, 0, 0, 1782, 1783, 1783, - 0, 1783, 1783, 1783, 1783, 1784, 1784, 0, 1784, 1784, - - 1784, 1784, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, - 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, - 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, - 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, 1770, - 1770, 1770 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 3, 3, 4, + 4, 4, 5, 5, 6, 6, 5, 27, 6, 7, + 7, 7, 7, 671, 7, 8, 8, 8, 8, 27, + 8, 9, 9, 9, 10, 10, 10, 15, 45, 45, + + 2170, 15, 23, 3, 27, 50, 4, 769, 50, 5, + 19, 6, 19, 19, 671, 19, 140, 7, 29, 61, + 61, 19, 23, 8, 138, 23, 20, 20, 9, 23, + 29, 10, 11, 11, 11, 11, 11, 11, 12, 12, + 12, 12, 12, 12, 20, 29, 24, 137, 19, 23, + 20, 25, 11, 20, 20, 21, 75, 32, 12, 25, + 24, 70, 21, 32, 853, 70, 21, 96, 28, 21, + 11, 20, 24, 24, 132, 132, 12, 25, 25, 11, + 75, 21, 21, 75, 32, 12, 25, 24, 26, 21, + 28, 26, 853, 21, 30, 28, 21, 22, 26, 96, + + 26, 22, 30, 135, 22, 116, 22, 22, 30, 133, + 31, 26, 30, 34, 31, 26, 77, 116, 26, 22, + 30, 30, 76, 77, 22, 26, 34, 26, 22, 30, + 31, 22, 116, 22, 22, 30, 31, 31, 35, 30, + 34, 31, 35, 77, 134, 76, 37, 134, 37, 76, + 100, 131, 35, 100, 38, 35, 84, 31, 33, 38, + 68, 84, 33, 37, 35, 35, 39, 38, 33, 35, + 39, 33, 37, 37, 39, 37, 80, 100, 33, 35, + 33, 38, 35, 84, 62, 33, 38, 139, 139, 33, + 37, 66, 39, 39, 80, 33, 125, 39, 33, 85, + + 762, 39, 125, 80, 66, 33, 36, 85, 40, 36, + 40, 40, 56, 40, 56, 56, 36, 56, 66, 40, + 36, 36, 64, 125, 64, 64, 85, 64, 36, 67, + 762, 67, 67, 36, 67, 69, 36, 69, 69, 72, + 69, 72, 72, 36, 72, 78, 69, 36, 36, 81, + 72, 87, 79, 82, 83, 83, 57, 86, 78, 82, + 64, 79, 81, 83, 87, 52, 88, 89, 92, 78, + 51, 266, 78, 88, 82, 86, 81, 72, 87, 79, + 82, 83, 83, 89, 93, 78, 82, 90, 91, 86, + 94, 92, 97, 88, 89, 92, 90, 91, 266, 101, + + 97, 46, 86, 94, 95, 98, 93, 95, 104, 99, + 103, 93, 101, 99, 90, 91, 102, 94, 105, 97, + 95, 95, 104, 109, 41, 98, 101, 98, 95, 14, + 103, 95, 98, 99, 95, 104, 99, 103, 105, 102, + 99, 106, 107, 102, 108, 105, 109, 95, 95, 107, + 109, 110, 98, 108, 111, 106, 112, 114, 111, 115, + 110, 113, 117, 112, 114, 115, 119, 120, 106, 107, + 117, 108, 13, 115, 0, 122, 111, 0, 110, 0, + 119, 111, 121, 112, 114, 111, 115, 113, 113, 117, + 118, 123, 115, 119, 118, 122, 124, 121, 0, 120, + + 123, 122, 122, 118, 126, 127, 129, 124, 130, 121, + 0, 128, 0, 0, 0, 129, 0, 118, 123, 0, + 0, 118, 122, 124, 144, 126, 128, 127, 145, 126, + 130, 126, 127, 129, 136, 130, 136, 136, 128, 136, + 141, 146, 141, 141, 142, 141, 142, 142, 144, 142, + 145, 144, 126, 147, 149, 145, 148, 150, 0, 152, + 153, 154, 149, 151, 157, 147, 152, 154, 0, 150, + 155, 0, 156, 146, 160, 148, 0, 176, 153, 0, + 147, 149, 142, 148, 150, 151, 152, 153, 230, 162, + 151, 158, 155, 154, 154, 158, 157, 155, 156, 156, + + 160, 160, 161, 163, 164, 165, 168, 167, 164, 176, + 161, 162, 158, 0, 166, 170, 162, 230, 168, 158, + 167, 0, 158, 0, 170, 163, 171, 172, 165, 161, + 163, 164, 165, 168, 167, 177, 166, 179, 0, 158, + 159, 166, 170, 169, 174, 159, 169, 180, 171, 172, + 159, 174, 0, 171, 172, 175, 159, 159, 169, 173, + 182, 177, 177, 159, 173, 180, 175, 159, 178, 179, + 169, 174, 159, 169, 180, 181, 173, 159, 173, 178, + 184, 181, 175, 159, 159, 173, 173, 183, 185, 0, + 186, 173, 182, 0, 187, 188, 191, 189, 190, 192, + + 178, 191, 181, 173, 189, 173, 178, 194, 187, 183, + 186, 201, 184, 193, 183, 203, 188, 186, 192, 190, + 185, 187, 188, 191, 189, 190, 192, 193, 196, 194, + 195, 197, 198, 199, 194, 207, 200, 205, 197, 196, + 193, 200, 195, 201, 202, 202, 206, 203, 210, 212, + 0, 0, 218, 202, 198, 196, 199, 195, 197, 198, + 199, 204, 205, 200, 205, 209, 206, 207, 204, 208, + 211, 202, 202, 206, 210, 210, 220, 208, 213, 214, + 209, 212, 215, 214, 218, 217, 216, 221, 204, 219, + 0, 223, 209, 211, 216, 213, 208, 215, 225, 221, + + 223, 0, 211, 213, 217, 213, 214, 227, 220, 215, + 222, 219, 217, 216, 221, 224, 219, 225, 223, 226, + 211, 226, 213, 222, 228, 225, 229, 231, 224, 232, + 234, 227, 233, 235, 227, 0, 231, 222, 236, 239, + 237, 234, 224, 238, 241, 235, 226, 242, 244, 228, + 0, 228, 229, 229, 231, 232, 232, 234, 233, 233, + 235, 238, 236, 237, 240, 236, 243, 237, 245, 246, + 238, 239, 248, 242, 242, 245, 241, 240, 246, 247, + 244, 249, 252, 251, 0, 247, 248, 250, 243, 253, + 257, 240, 251, 243, 254, 245, 246, 0, 253, 248, + + 256, 258, 259, 255, 0, 252, 247, 249, 249, 252, + 251, 250, 255, 272, 250, 256, 253, 259, 261, 262, + 254, 254, 257, 260, 263, 258, 0, 256, 258, 259, + 255, 260, 260, 264, 260, 0, 261, 262, 263, 267, + 272, 260, 0, 262, 268, 261, 262, 268, 264, 278, + 260, 263, 265, 265, 268, 269, 278, 270, 260, 260, + 264, 260, 274, 267, 262, 271, 267, 269, 273, 275, + 277, 268, 276, 280, 268, 270, 278, 265, 282, 265, + 265, 275, 269, 271, 270, 277, 279, 283, 274, 274, + 273, 412, 271, 281, 276, 273, 275, 277, 279, 276, + + 281, 284, 285, 286, 285, 280, 289, 284, 0, 283, + 282, 0, 292, 279, 283, 290, 286, 288, 412, 292, + 281, 0, 287, 284, 293, 287, 285, 287, 284, 285, + 286, 285, 291, 287, 284, 288, 293, 290, 289, 292, + 291, 295, 290, 294, 288, 296, 291, 305, 298, 287, + 300, 293, 287, 299, 287, 300, 294, 295, 296, 291, + 298, 303, 0, 301, 343, 295, 302, 291, 295, 301, + 294, 299, 296, 303, 302, 298, 304, 306, 343, 305, + 299, 306, 300, 304, 295, 297, 297, 307, 303, 308, + 301, 343, 0, 302, 307, 297, 308, 297, 297, 297, + + 0, 310, 297, 304, 306, 309, 311, 312, 313, 316, + 297, 0, 297, 297, 307, 313, 308, 309, 311, 314, + 318, 319, 297, 310, 297, 297, 297, 315, 310, 297, + 321, 318, 309, 311, 314, 313, 317, 321, 317, 312, + 315, 316, 322, 319, 320, 320, 314, 318, 319, 323, + 325, 324, 0, 322, 315, 0, 326, 321, 328, 327, + 323, 0, 332, 317, 324, 0, 0, 328, 329, 322, + 331, 335, 334, 320, 327, 325, 323, 325, 324, 326, + 330, 329, 327, 326, 332, 328, 327, 333, 331, 332, + 334, 330, 337, 330, 336, 329, 341, 331, 330, 334, + + 336, 327, 338, 335, 339, 340, 342, 330, 344, 345, + 333, 0, 340, 337, 333, 346, 368, 348, 330, 337, + 330, 336, 341, 341, 347, 338, 339, 349, 342, 338, + 347, 339, 340, 342, 344, 344, 352, 350, 346, 348, + 351, 345, 346, 353, 348, 349, 354, 355, 368, 356, + 0, 347, 350, 355, 349, 351, 358, 0, 360, 352, + 359, 361, 0, 352, 350, 362, 359, 351, 354, 353, + 353, 363, 362, 354, 355, 356, 356, 360, 392, 361, + 372, 367, 358, 358, 369, 360, 363, 359, 361, 366, + 370, 365, 362, 365, 367, 373, 366, 371, 363, 372, + + 365, 374, 369, 375, 392, 392, 376, 372, 367, 377, + 371, 369, 370, 409, 380, 379, 366, 370, 365, 376, + 365, 379, 409, 382, 371, 374, 375, 373, 374, 378, + 0, 377, 381, 376, 378, 375, 377, 380, 383, 384, + 409, 380, 379, 387, 381, 382, 388, 384, 386, 383, + 382, 387, 389, 375, 390, 386, 378, 388, 0, 381, + 394, 391, 389, 0, 395, 383, 384, 385, 391, 393, + 387, 393, 385, 388, 385, 386, 395, 0, 390, 0, + 396, 390, 385, 407, 389, 385, 394, 394, 391, 389, + 397, 395, 385, 385, 385, 396, 393, 398, 399, 385, + + 400, 385, 397, 399, 403, 398, 402, 396, 401, 385, + 411, 404, 385, 406, 402, 407, 403, 397, 413, 385, + 410, 415, 400, 0, 398, 399, 401, 400, 408, 411, + 414, 403, 404, 402, 410, 401, 406, 411, 404, 416, + 406, 417, 419, 408, 418, 414, 420, 410, 421, 422, + 413, 421, 425, 415, 416, 408, 418, 414, 423, 421, + 422, 426, 428, 423, 419, 417, 416, 424, 417, 419, + 420, 418, 427, 420, 429, 421, 422, 430, 421, 425, + 431, 424, 0, 432, 433, 435, 431, 434, 426, 428, + 423, 436, 433, 437, 424, 441, 0, 439, 0, 442, + + 0, 429, 443, 0, 427, 432, 434, 431, 435, 430, + 432, 433, 435, 438, 434, 443, 437, 446, 440, 439, + 437, 442, 438, 436, 439, 440, 442, 441, 444, 443, + 445, 448, 447, 444, 449, 450, 451, 444, 0, 445, + 438, 447, 453, 446, 446, 440, 0, 452, 450, 454, + 0, 455, 444, 448, 463, 444, 449, 445, 448, 447, + 444, 449, 450, 456, 444, 452, 453, 0, 451, 453, + 457, 454, 454, 455, 452, 458, 454, 459, 455, 462, + 461, 457, 460, 0, 464, 456, 463, 468, 465, 458, + 456, 461, 466, 470, 462, 467, 468, 457, 454, 459, + + 460, 471, 458, 473, 459, 464, 462, 461, 469, 460, + 472, 464, 465, 0, 468, 465, 466, 467, 474, 466, + 476, 469, 467, 471, 475, 470, 478, 473, 471, 475, + 473, 0, 477, 479, 476, 469, 480, 481, 482, 0, + 474, 479, 472, 484, 483, 474, 477, 476, 484, 0, + 485, 0, 481, 482, 480, 486, 475, 486, 478, 477, + 479, 481, 487, 480, 481, 482, 483, 489, 495, 0, + 488, 483, 490, 494, 491, 484, 485, 485, 488, 481, + 492, 490, 486, 491, 493, 0, 495, 487, 492, 487, + 496, 493, 489, 499, 489, 495, 494, 488, 498, 490, + + 494, 491, 496, 497, 500, 499, 498, 492, 501, 0, + 502, 493, 497, 503, 0, 504, 501, 496, 502, 506, + 499, 507, 0, 508, 510, 498, 0, 505, 0, 0, + 497, 508, 507, 509, 511, 501, 500, 502, 504, 503, + 503, 506, 504, 505, 510, 512, 506, 509, 507, 513, + 508, 510, 514, 515, 505, 516, 511, 518, 523, 517, + 509, 511, 515, 519, 523, 512, 520, 521, 528, 522, + 518, 513, 512, 0, 514, 516, 513, 517, 0, 514, + 515, 519, 516, 525, 518, 523, 517, 524, 520, 527, + 519, 521, 522, 520, 521, 524, 522, 527, 529, 533, + + 528, 525, 531, 530, 0, 529, 532, 0, 534, 535, + 525, 540, 551, 524, 524, 532, 527, 531, 535, 536, + 547, 536, 524, 540, 543, 529, 530, 534, 549, 531, + 530, 533, 537, 532, 543, 534, 535, 0, 540, 537, + 0, 547, 548, 546, 551, 550, 536, 547, 0, 580, + 0, 543, 554, 553, 549, 549, 558, 555, 554, 537, + 538, 546, 557, 0, 538, 548, 555, 538, 559, 548, + 546, 550, 550, 560, 538, 553, 556, 538, 556, 554, + 553, 580, 538, 558, 555, 561, 557, 538, 559, 557, + 564, 538, 562, 563, 538, 559, 0, 561, 567, 560, + + 560, 538, 565, 556, 538, 552, 552, 0, 552, 566, + 0, 552, 561, 567, 564, 563, 552, 564, 562, 562, + 563, 569, 552, 552, 565, 567, 572, 571, 569, 565, + 573, 552, 552, 552, 566, 552, 566, 568, 552, 570, + 577, 581, 573, 552, 576, 568, 571, 570, 569, 552, + 552, 575, 572, 572, 571, 574, 578, 573, 579, 576, + 575, 593, 577, 582, 568, 583, 570, 577, 574, 584, + 585, 576, 586, 581, 588, 590, 587, 591, 575, 0, + 579, 586, 574, 578, 0, 579, 583, 582, 584, 585, + 582, 592, 583, 593, 588, 591, 584, 585, 587, 586, + + 589, 588, 590, 587, 591, 594, 596, 597, 589, 599, + 592, 598, 603, 594, 601, 600, 604, 602, 592, 604, + 608, 607, 0, 0, 596, 597, 0, 589, 600, 602, + 603, 599, 594, 596, 597, 598, 599, 605, 598, 603, + 601, 601, 600, 604, 602, 605, 607, 608, 607, 609, + 611, 610, 612, 613, 617, 609, 611, 615, 613, 612, + 614, 605, 616, 617, 605, 619, 618, 614, 623, 621, + 622, 620, 605, 610, 618, 615, 609, 611, 610, 612, + 613, 617, 621, 619, 615, 616, 620, 614, 626, 616, + 625, 622, 619, 618, 624, 623, 621, 622, 620, 627, + + 628, 624, 629, 625, 0, 632, 631, 630, 634, 633, + 629, 632, 637, 638, 635, 630, 636, 625, 0, 640, + 626, 624, 630, 628, 642, 636, 637, 628, 631, 629, + 639, 627, 632, 631, 630, 633, 633, 639, 635, 637, + 634, 635, 630, 636, 641, 638, 640, 643, 645, 644, + 647, 642, 646, 641, 648, 646, 645, 639, 649, 643, + 652, 648, 0, 647, 649, 659, 653, 0, 0, 651, + 659, 641, 644, 0, 643, 645, 644, 647, 653, 646, + 654, 648, 654, 652, 657, 649, 650, 652, 650, 655, + 656, 0, 650, 653, 650, 651, 651, 659, 0, 650, + + 661, 658, 656, 664, 650, 660, 657, 654, 662, 665, + 650, 657, 655, 650, 658, 650, 655, 656, 660, 650, + 662, 650, 665, 661, 663, 664, 650, 661, 658, 667, + 664, 650, 660, 666, 663, 662, 665, 668, 669, 666, + 670, 674, 667, 0, 0, 0, 663, 673, 683, 0, + 678, 663, 675, 0, 676, 0, 667, 677, 668, 686, + 666, 663, 673, 674, 668, 675, 679, 670, 674, 676, + 669, 672, 678, 680, 673, 683, 672, 678, 672, 675, + 681, 676, 682, 677, 677, 679, 680, 684, 681, 672, + 682, 686, 689, 679, 687, 690, 672, 672, 672, 0, + + 680, 0, 691, 672, 688, 672, 689, 681, 693, 682, + 684, 695, 688, 704, 684, 694, 672, 692, 687, 689, + 0, 687, 695, 672, 691, 692, 693, 690, 696, 691, + 698, 688, 697, 694, 699, 693, 700, 0, 695, 0, + 697, 699, 694, 701, 692, 704, 696, 702, 703, 700, + 701, 706, 698, 714, 707, 696, 709, 698, 708, 697, + 710, 699, 707, 700, 706, 702, 703, 708, 709, 711, + 701, 712, 713, 715, 702, 703, 725, 718, 706, 714, + 714, 707, 710, 709, 719, 708, 716, 710, 718, 719, + 713, 711, 720, 712, 0, 720, 711, 721, 712, 713, + + 716, 722, 723, 724, 718, 715, 728, 727, 725, 723, + 726, 735, 728, 716, 722, 724, 719, 726, 720, 720, + 729, 721, 720, 731, 721, 730, 732, 0, 722, 723, + 724, 727, 735, 728, 727, 736, 730, 726, 735, 733, + 737, 738, 729, 746, 0, 731, 736, 729, 732, 740, + 731, 739, 730, 732, 733, 741, 742, 744, 740, 745, + 0, 737, 736, 743, 744, 742, 733, 737, 738, 739, + 747, 743, 748, 745, 751, 746, 740, 752, 739, 741, + 750, 753, 741, 742, 744, 754, 745, 755, 756, 750, + 743, 757, 747, 752, 748, 758, 753, 747, 751, 748, + + 756, 751, 759, 760, 752, 761, 764, 750, 753, 766, + 759, 766, 763, 757, 770, 756, 760, 754, 757, 755, + 761, 763, 758, 765, 764, 771, 768, 770, 772, 759, + 760, 765, 761, 764, 768, 772, 766, 771, 773, 763, + 774, 770, 775, 0, 0, 0, 776, 778, 779, 0, + 765, 0, 771, 768, 777, 772, 780, 786, 782, 783, + 778, 779, 0, 0, 775, 781, 782, 793, 784, 775, + 773, 776, 774, 776, 778, 779, 777, 781, 780, 783, + 784, 777, 785, 780, 786, 782, 783, 787, 788, 789, + 785, 790, 781, 793, 793, 784, 798, 788, 790, 794, + + 787, 0, 795, 797, 801, 798, 791, 799, 0, 785, + 789, 796, 801, 800, 787, 788, 789, 791, 790, 802, + 791, 794, 795, 798, 796, 799, 794, 797, 791, 795, + 797, 801, 805, 791, 799, 800, 807, 803, 796, 806, + 800, 802, 809, 808, 791, 803, 802, 791, 810, 813, + 809, 811, 812, 0, 807, 808, 815, 813, 822, 805, + 810, 816, 806, 807, 803, 815, 806, 812, 814, 809, + 808, 811, 817, 818, 814, 810, 813, 0, 811, 812, + 818, 823, 816, 815, 817, 819, 820, 824, 816, 825, + 822, 835, 819, 826, 823, 814, 825, 829, 828, 817, + + 818, 832, 827, 828, 820, 829, 824, 831, 823, 830, + 0, 833, 819, 820, 824, 826, 825, 827, 836, 834, + 826, 831, 830, 835, 829, 833, 837, 832, 832, 827, + 828, 838, 839, 840, 831, 841, 830, 834, 833, 843, + 842, 844, 846, 845, 836, 836, 834, 842, 837, 838, + 847, 846, 848, 837, 839, 840, 845, 843, 838, 839, + 840, 841, 841, 844, 849, 850, 843, 842, 844, 846, + 845, 0, 856, 0, 854, 0, 859, 0, 860, 852, + 858, 0, 847, 860, 848, 857, 849, 0, 850, 858, + 854, 849, 850, 851, 859, 856, 861, 857, 851, 856, + + 851, 854, 851, 859, 851, 852, 852, 858, 862, 861, + 860, 851, 857, 863, 864, 865, 867, 866, 0, 871, + 851, 863, 869, 861, 869, 851, 862, 851, 865, 851, + 866, 851, 870, 864, 867, 862, 868, 873, 872, 876, + 863, 864, 865, 867, 866, 868, 871, 875, 877, 869, + 872, 878, 880, 879, 870, 881, 877, 883, 0, 870, + 879, 876, 882, 868, 873, 872, 876, 886, 882, 884, + 885, 875, 888, 887, 875, 877, 884, 881, 878, 880, + 879, 889, 881, 890, 883, 891, 886, 892, 894, 882, + 889, 895, 885, 897, 886, 887, 884, 885, 888, 888, + + 887, 892, 896, 898, 890, 891, 900, 899, 889, 901, + 890, 902, 891, 904, 892, 899, 905, 904, 902, 903, + 894, 898, 900, 895, 896, 897, 903, 908, 907, 896, + 898, 906, 909, 900, 899, 907, 901, 906, 902, 911, + 904, 910, 908, 914, 906, 909, 903, 915, 905, 912, + 910, 913, 914, 913, 908, 907, 912, 916, 906, 909, + 918, 0, 922, 917, 906, 911, 911, 917, 910, 915, + 914, 920, 921, 923, 915, 924, 912, 921, 913, 920, + 922, 926, 918, 925, 916, 929, 925, 918, 924, 922, + 917, 927, 923, 928, 0, 925, 930, 932, 920, 931, + + 923, 941, 924, 926, 921, 932, 928, 935, 926, 941, + 925, 933, 933, 925, 939, 931, 927, 929, 927, 930, + 928, 934, 936, 930, 932, 937, 931, 940, 941, 935, + 934, 936, 937, 943, 935, 942, 940, 939, 933, 944, + 0, 939, 947, 945, 0, 946, 943, 948, 934, 936, + 942, 944, 937, 946, 940, 945, 949, 951, 954, 950, + 943, 952, 942, 957, 947, 953, 944, 948, 950, 947, + 945, 956, 946, 958, 948, 951, 955, 953, 949, 954, + 959, 962, 955, 949, 951, 954, 950, 952, 952, 960, + 963, 964, 953, 956, 968, 957, 0, 966, 956, 967, + + 0, 965, 968, 955, 971, 958, 959, 959, 962, 964, + 965, 971, 967, 963, 975, 960, 960, 963, 964, 966, + 969, 968, 970, 978, 966, 969, 967, 970, 965, 972, + 973, 971, 974, 976, 976, 977, 979, 972, 973, 980, + 974, 0, 0, 977, 978, 981, 975, 980, 987, 988, + 978, 984, 969, 981, 970, 982, 972, 973, 986, 974, + 976, 983, 977, 982, 984, 985, 980, 0, 979, 983, + 986, 985, 981, 988, 987, 987, 988, 990, 984, 989, + 991, 993, 982, 994, 995, 986, 992, 1000, 983, 1006, + 998, 0, 985, 1001, 989, 993, 0, 998, 995, 996, + + 0, 994, 991, 996, 990, 1002, 989, 991, 993, 992, + 994, 995, 999, 992, 1000, 1001, 996, 998, 1003, 1007, + 1001, 1006, 1004, 999, 996, 1003, 996, 1005, 1002, 1009, + 996, 1004, 1002, 1011, 1005, 1012, 1013, 1015, 1009, 999, + 1017, 0, 1018, 996, 0, 1003, 1007, 1020, 1025, 1004, + 1021, 1022, 1024, 1018, 1005, 1011, 1009, 1023, 0, 1023, + 1011, 1012, 1012, 1022, 1015, 1024, 1027, 1017, 1013, 1018, + 1025, 1020, 1028, 1026, 1020, 1025, 1021, 1021, 1022, 1024, + 1029, 0, 1030, 1031, 1023, 1026, 1032, 1029, 1031, 1033, + 1034, 1037, 1035, 1027, 1038, 1028, 1040, 0, 1034, 1028, + + 1026, 0, 1032, 1038, 1041, 1049, 0, 1029, 1030, 1030, + 1031, 1039, 1033, 1032, 1035, 1044, 1033, 1034, 1037, 1035, + 1042, 1038, 1040, 1040, 1039, 1043, 1041, 1042, 1045, 1046, + 0, 1041, 1043, 1044, 1047, 1048, 1046, 1049, 1039, 1050, + 1051, 1053, 1044, 1054, 0, 0, 1050, 1042, 1056, 1061, + 1045, 1059, 1043, 1060, 1053, 1045, 1046, 1048, 1061, 1047, + 1063, 1047, 1048, 1055, 1058, 1067, 1050, 1058, 1053, 1056, + 1054, 1055, 1051, 1062, 1064, 1056, 1061, 1059, 1059, 1060, + 1060, 1065, 1068, 1066, 1063, 1062, 1066, 1063, 1065, 1064, + 1055, 1058, 1070, 1069, 1071, 1073, 1071, 1067, 1066, 1072, + + 1062, 1064, 1074, 1075, 1068, 1078, 1080, 1066, 1065, 1068, + 1066, 1069, 1075, 1066, 1070, 1077, 1076, 1079, 1082, 1070, + 1069, 1071, 1077, 1072, 1076, 1066, 1072, 1073, 1074, 1074, + 1075, 1081, 1083, 1084, 0, 1081, 1088, 1078, 1080, 1079, + 1082, 1085, 1077, 1076, 1079, 1082, 1086, 1087, 1089, 1088, + 1085, 1090, 1092, 1086, 1087, 1084, 1091, 0, 1081, 1083, + 1084, 1089, 1093, 1088, 1094, 1098, 1090, 1095, 1085, 1093, + 1091, 1094, 1099, 1086, 1087, 1089, 1096, 1102, 1090, 1099, + 1095, 1101, 1096, 1091, 1092, 1100, 1108, 1103, 1108, 1093, + 1103, 1094, 1098, 1101, 1095, 1104, 0, 1102, 1109, 1099, + + 1110, 1112, 1111, 1096, 1102, 1103, 1104, 1100, 1101, 1112, + 1113, 1106, 1100, 1108, 1103, 1115, 1106, 1103, 1117, 1114, + 1120, 1117, 1104, 1106, 1119, 1109, 1111, 1110, 1112, 1111, + 1114, 1116, 1113, 1115, 1118, 1122, 1117, 1113, 1106, 1116, + 1124, 1123, 1115, 1106, 1121, 1117, 1114, 1120, 1117, 1122, + 1123, 1121, 1118, 1124, 1125, 1126, 1119, 1128, 1116, 1128, + 1129, 1118, 1122, 1130, 1131, 1125, 1133, 1124, 1123, 1129, + 1126, 1121, 1134, 1137, 1132, 1131, 1135, 1139, 1137, 1135, + 1141, 1125, 1126, 1143, 1128, 1147, 1134, 1129, 1133, 1130, + 1130, 1131, 1132, 1133, 1135, 1136, 1142, 0, 1134, 1134, + + 1144, 1132, 1140, 1135, 1136, 1137, 1135, 1146, 1152, 1139, + 1148, 1140, 1141, 1134, 1146, 1143, 1152, 1147, 1142, 1149, + 1153, 1144, 1136, 1142, 1148, 1149, 1154, 1144, 1156, 1140, + 1157, 1158, 1155, 1161, 1146, 1152, 1156, 1148, 1163, 1153, + 1154, 1155, 1158, 1149, 1162, 1159, 1149, 1153, 1164, 1167, + 1171, 1162, 1149, 1154, 1159, 1156, 1165, 1166, 1158, 1155, + 1161, 1163, 1157, 1182, 1168, 1163, 1178, 1167, 1168, 1170, + 1164, 1162, 1159, 1172, 1173, 1164, 1167, 1171, 1165, 1166, + 1174, 1170, 1175, 1165, 1166, 1176, 1172, 1179, 1184, 1181, + 1182, 1168, 1177, 1176, 1173, 1174, 1170, 1175, 1178, 1177, + + 1172, 1173, 1179, 1183, 1180, 1187, 1186, 1174, 1188, 1175, + 1181, 1189, 1176, 1180, 1179, 1184, 1181, 1190, 1191, 1177, + 0, 1195, 1196, 1187, 1192, 1191, 1189, 1183, 1186, 1192, + 1183, 1180, 1187, 1186, 1193, 1188, 1194, 1196, 1189, 1195, + 1197, 0, 1190, 1193, 1190, 1191, 1198, 1199, 1195, 1196, + 1200, 1192, 1197, 1202, 1201, 1206, 1203, 1200, 1194, 1207, + 1199, 1193, 1206, 1194, 1204, 1199, 1201, 1197, 1198, 1208, + 1204, 1205, 1209, 1198, 1199, 1211, 1208, 1200, 1210, 1205, + 1202, 1201, 1206, 1212, 1210, 1213, 1207, 1199, 1203, 1214, + 1216, 1204, 1217, 1218, 1220, 0, 1208, 1221, 1205, 1209, + + 1222, 1217, 1211, 1223, 0, 1210, 1212, 1219, 0, 1219, + 1212, 1227, 0, 1214, 0, 1230, 1214, 1213, 1220, 1217, + 1230, 1220, 1216, 1233, 1221, 1218, 1222, 1222, 1231, 1224, + 1224, 1224, 1225, 1226, 1219, 1223, 1224, 1239, 1228, 1225, + 1226, 1231, 1232, 1227, 1224, 1228, 1235, 1230, 1232, 1238, + 1233, 1234, 1234, 1242, 1236, 1231, 1224, 1224, 1224, 1225, + 1226, 1236, 1237, 1224, 1239, 1228, 1244, 1237, 1243, 1232, + 1245, 1242, 1235, 1235, 1243, 1238, 1238, 1249, 1234, 1246, + 1242, 1236, 1245, 1247, 1248, 1248, 1250, 1250, 1254, 1237, + 1253, 1251, 1257, 1244, 1256, 1243, 1258, 1245, 1255, 1246, + + 1259, 1247, 1251, 1249, 1249, 1255, 1246, 1260, 1261, 1262, + 1247, 1248, 1253, 1250, 1256, 1263, 1262, 1253, 1251, 1265, + 1254, 1256, 1264, 1263, 1257, 1255, 1261, 1259, 1258, 1260, + 1266, 1267, 1267, 1268, 1260, 1261, 1262, 1264, 1269, 1266, + 1270, 1273, 1263, 1265, 1272, 1276, 1265, 1274, 1278, 1264, + 1269, 1277, 1272, 1273, 1275, 1274, 1270, 1266, 1267, 1268, + 1268, 1280, 1284, 1270, 1281, 1269, 1276, 1270, 1273, 1277, + 1281, 1272, 1276, 1282, 1274, 1278, 1285, 1275, 1277, 1279, + 1283, 1275, 1287, 1270, 1279, 1286, 1282, 1283, 1280, 1289, + 1286, 1281, 1288, 1288, 1284, 1279, 1290, 1292, 1293, 1295, + + 1282, 1295, 1296, 1285, 1289, 1294, 1279, 1283, 1297, 1298, + 1302, 1279, 1292, 1297, 1287, 1299, 1289, 1286, 1303, 1288, + 1294, 1293, 1301, 1304, 1292, 1293, 1295, 1306, 1290, 1308, + 1299, 1305, 1294, 1307, 1296, 1297, 1302, 1302, 1305, 1310, + 1309, 1298, 1299, 1312, 1314, 1303, 1301, 1315, 1317, 1301, + 1304, 1308, 0, 1319, 1307, 1320, 1308, 1310, 1305, 1306, + 1307, 1309, 1315, 1317, 1318, 1312, 1310, 1309, 1314, 1322, + 1312, 1314, 1321, 1320, 1315, 1317, 1323, 1324, 1325, 1318, + 1319, 1326, 1320, 1323, 1327, 1329, 1332, 1325, 1328, 1326, + 0, 1318, 1333, 1330, 1321, 1324, 1322, 1332, 1334, 1321, + + 1335, 1333, 1337, 1323, 1324, 1325, 1330, 1327, 1326, 1342, + 1328, 1327, 1332, 1332, 1341, 1328, 1334, 1329, 1335, 1333, + 1330, 1339, 1342, 1343, 1332, 1334, 1341, 1335, 0, 1337, + 1344, 1346, 1339, 1345, 1347, 1348, 1342, 1351, 0, 1352, + 1344, 1341, 0, 1350, 1351, 1354, 1358, 1358, 1339, 1353, + 0, 1354, 1366, 1355, 1348, 1343, 1346, 1344, 1346, 1345, + 1345, 1347, 1348, 1350, 1351, 1352, 1352, 1353, 1355, 1356, + 1350, 1357, 1354, 1358, 1362, 1359, 1353, 1366, 1360, 1366, + 1355, 1362, 1363, 1367, 1356, 1365, 1357, 1359, 0, 1363, + 1371, 1360, 1367, 1368, 1369, 0, 1356, 1372, 1357, 1360, + + 1374, 1362, 1359, 1375, 1378, 1360, 1377, 1365, 1371, 1363, + 1367, 0, 1365, 1374, 1369, 1368, 1379, 1371, 1360, 1380, + 1368, 1369, 1372, 1381, 1372, 1376, 1376, 1374, 1377, 1378, + 1375, 1378, 1381, 1377, 1383, 1382, 1384, 1385, 1379, 0, + 1386, 1380, 1382, 1379, 1389, 1388, 1380, 1390, 1394, 1391, + 1381, 1385, 1376, 1388, 1393, 1395, 1392, 1389, 1384, 1386, + 1396, 1393, 1382, 1384, 1385, 1398, 1383, 1386, 1392, 1397, + 1401, 1389, 1388, 1399, 1390, 1391, 1391, 1395, 1403, 1407, + 1394, 1393, 1395, 1392, 1397, 1396, 1400, 1396, 1402, 1400, + 1404, 1398, 1398, 0, 1402, 1401, 1397, 1401, 1408, 1399, + + 1399, 1407, 1411, 1405, 1400, 1403, 1407, 1410, 1404, 1411, + 1412, 1413, 1415, 1400, 1417, 1402, 1400, 1404, 1405, 1412, + 1408, 1410, 1413, 1421, 1418, 1408, 1419, 1420, 1419, 1411, + 1405, 1422, 1423, 1415, 1410, 1417, 1418, 1412, 1413, 1415, + 1424, 1417, 1425, 1427, 1426, 1420, 1433, 1428, 1424, 1422, + 1421, 1418, 1428, 1419, 1420, 1429, 1430, 1427, 1422, 1423, + 0, 1434, 1435, 1430, 1436, 1425, 1426, 1424, 1437, 1425, + 1427, 1426, 1439, 1433, 1429, 1434, 1440, 1438, 1441, 1428, + 1435, 1439, 1429, 1430, 1442, 1443, 1445, 1434, 1434, 1435, + 1446, 1436, 1438, 1449, 1437, 1437, 1448, 1446, 1448, 1439, + + 1441, 1455, 1434, 1452, 1438, 1441, 1450, 1443, 1440, 1445, + 1450, 1442, 1443, 1445, 1451, 1449, 1456, 1446, 1453, 1457, + 1449, 1454, 1458, 1448, 0, 1452, 1451, 1453, 1455, 1460, + 1452, 1457, 1454, 1450, 1459, 1459, 1463, 1460, 1467, 1456, + 1463, 1451, 1462, 1456, 1458, 1453, 1457, 1465, 1454, 1458, + 1462, 1464, 1466, 1467, 1464, 1465, 1460, 1471, 1466, 1470, + 1468, 1459, 1473, 1463, 1472, 1467, 1468, 1474, 1475, 1462, + 1476, 1470, 1477, 1478, 1465, 1481, 1473, 0, 1464, 1466, + 1474, 1479, 1475, 1483, 1471, 1484, 1470, 1468, 1472, 1473, + 1480, 1472, 1485, 1479, 1474, 1475, 1476, 1476, 1487, 1477, + + 1478, 1481, 1481, 1482, 1480, 1486, 1482, 1488, 1479, 1489, + 1483, 1490, 1484, 1486, 1491, 1492, 1488, 1480, 1494, 1485, + 1495, 1482, 1497, 1492, 1500, 1487, 1498, 1491, 1501, 1496, + 1482, 1499, 1486, 1482, 1488, 1498, 1489, 1496, 1490, 1502, + 1494, 1491, 1492, 1501, 1506, 1494, 1511, 1495, 1500, 1497, + 1504, 1500, 1499, 1498, 1501, 1501, 1496, 1503, 1499, 1505, + 1509, 1508, 1504, 1510, 1509, 1503, 1502, 1505, 1508, 1511, + 1501, 1506, 1512, 1511, 1513, 1510, 1514, 1504, 1515, 1519, + 1516, 1522, 1513, 1518, 1503, 1515, 1505, 1509, 1508, 1520, + 1510, 1517, 1517, 1523, 0, 1533, 1522, 1519, 1525, 1512, + + 1516, 1513, 1524, 1514, 1524, 1515, 1519, 1516, 1522, 1518, + 1518, 1526, 1525, 1527, 1520, 1523, 1520, 1526, 1517, 1528, + 1523, 1529, 1534, 1532, 1530, 1525, 1531, 1533, 1539, 1524, + 1536, 1540, 1548, 1529, 1538, 1527, 1532, 1536, 1526, 1541, + 1527, 1528, 1530, 1548, 1531, 1534, 1528, 1541, 1529, 1534, + 1532, 1530, 1538, 1531, 1539, 1539, 1544, 1536, 1545, 1548, + 1542, 1538, 1542, 1540, 1547, 1541, 1541, 1542, 1544, 1549, + 1551, 1552, 1555, 1553, 1541, 1554, 1545, 1557, 1559, 1547, + 1553, 1558, 1560, 1544, 1549, 1545, 1562, 1542, 1561, 1542, + 1554, 1547, 1563, 1552, 1551, 1566, 1549, 1551, 1552, 1555, + + 1553, 1561, 1554, 1558, 1557, 1564, 1565, 1563, 1558, 1560, + 1559, 1568, 1562, 1562, 1565, 1561, 1569, 1570, 1564, 1563, + 1571, 1566, 1566, 1572, 1573, 1575, 1574, 1577, 1576, 1578, + 1572, 1573, 1564, 1565, 1568, 1576, 1579, 1580, 1568, 1574, + 1569, 1584, 1571, 1569, 1570, 1582, 1580, 1571, 1575, 1577, + 1572, 1573, 1575, 1574, 1577, 1576, 1582, 1579, 1583, 1585, + 0, 1578, 1586, 1579, 1580, 1590, 1589, 0, 1592, 1592, + 1591, 1597, 1582, 1584, 1593, 1599, 0, 1602, 1585, 1589, + 1583, 1603, 1604, 1606, 1599, 1583, 1585, 1586, 1608, 1586, + 1609, 1590, 1590, 1589, 1591, 1592, 1610, 1591, 1597, 1602, + + 1593, 1593, 1599, 1603, 1602, 1612, 1611, 1610, 1603, 1604, + 1606, 1611, 1616, 1614, 1615, 1619, 1609, 1609, 1618, 1620, + 1608, 1614, 1621, 1610, 1623, 0, 1625, 1612, 1620, 1615, + 1626, 1628, 1612, 1611, 1621, 1629, 1618, 1627, 1631, 1616, + 1614, 1615, 1630, 1632, 1633, 1618, 1620, 1619, 1629, 1621, + 1634, 1623, 1625, 1625, 1636, 1630, 1628, 1626, 1628, 1627, + 1631, 1635, 1629, 1636, 1627, 1631, 1637, 1638, 1639, 1630, + 1632, 1633, 1640, 1642, 1641, 1643, 1635, 1634, 0, 1644, + 1642, 1636, 1638, 1639, 1645, 1645, 1650, 1640, 1635, 1647, + 1658, 1646, 1637, 1637, 1638, 1639, 1641, 1644, 1646, 1640, + + 1642, 1641, 1643, 1647, 1648, 1651, 1644, 1648, 1649, 1653, + 1652, 1645, 1650, 1650, 1653, 1655, 1647, 1658, 1646, 1652, + 1654, 1649, 1656, 1651, 1654, 1659, 1657, 0, 1660, 1663, + 1664, 1648, 1651, 1666, 1667, 1649, 1653, 1652, 1663, 1655, + 1666, 1670, 1655, 1667, 1656, 1668, 1664, 1654, 1657, 1656, + 1668, 1669, 1659, 1657, 1660, 1660, 1663, 1664, 1669, 1670, + 1666, 1667, 1671, 1675, 1672, 0, 1673, 1676, 1670, 1671, + 1677, 1679, 1668, 1672, 1683, 1678, 1684, 1680, 1669, 1677, + 1685, 1686, 1683, 1679, 1690, 1676, 1680, 1681, 1682, 1671, + 1675, 1672, 1673, 1673, 1676, 1678, 1681, 1677, 1679, 1682, + + 1687, 1683, 1678, 1684, 1680, 1688, 1690, 1685, 1689, 1687, + 1696, 1690, 1691, 1686, 1681, 1682, 1689, 1688, 1692, 1691, + 1693, 1694, 1697, 1698, 1703, 1692, 1701, 1687, 1696, 1697, + 1702, 1698, 1688, 1701, 1705, 1689, 1706, 1696, 1711, 1691, + 1704, 1707, 1693, 1705, 1709, 1692, 1694, 1693, 1694, 1697, + 1698, 1703, 1704, 1701, 1702, 1710, 1709, 1702, 1712, 1714, + 1716, 1705, 1717, 1706, 1707, 1711, 1718, 1704, 1707, 1719, + 1717, 1709, 1712, 1720, 0, 1724, 1725, 1727, 1710, 0, + 1726, 1725, 1710, 1728, 1729, 1712, 1714, 1716, 1737, 1717, + 1730, 1719, 1734, 1718, 1726, 1727, 1719, 1731, 1730, 1735, + + 1720, 1724, 1724, 1725, 1727, 1728, 1729, 1726, 1733, 1738, + 1728, 1729, 1739, 1736, 1734, 1737, 1731, 1730, 1741, 1734, + 1733, 1735, 1740, 0, 1731, 1736, 1735, 1743, 1745, 1742, + 1744, 1746, 1739, 1749, 1752, 1733, 1738, 1751, 1750, 1739, + 1736, 0, 1744, 1750, 1740, 1753, 1781, 1749, 1757, 1740, + 1741, 1742, 1754, 1743, 1743, 1745, 1742, 1744, 1746, 1751, + 1749, 1756, 1755, 1758, 1751, 1762, 1752, 1757, 1753, 1759, + 1750, 1761, 1753, 1756, 1754, 1757, 1765, 1763, 1781, 1754, + 1755, 1766, 1768, 1764, 1759, 1758, 1763, 1762, 1756, 1755, + 1758, 1767, 1762, 1771, 1765, 1761, 1759, 1764, 1761, 1766, + + 1768, 1771, 1774, 1765, 1763, 1772, 1773, 1775, 1766, 1768, + 1764, 1777, 1772, 1776, 1773, 1775, 1778, 1767, 1767, 1779, + 1771, 1780, 1782, 1777, 1786, 1784, 1783, 1779, 1790, 1774, + 1793, 1776, 1772, 1773, 1775, 1789, 1787, 1796, 1777, 0, + 1776, 1790, 1786, 1778, 1780, 1783, 1779, 1784, 1780, 1782, + 1787, 1786, 1784, 1783, 1791, 1790, 1793, 1793, 1789, 1801, + 1798, 1800, 1789, 1787, 1796, 1802, 1791, 1798, 1800, 1803, + 1804, 1805, 1806, 1807, 1809, 1810, 1808, 1817, 1811, 1814, + 0, 1791, 1807, 1816, 1814, 1801, 1801, 1798, 1800, 1808, + 1815, 0, 1802, 1803, 1815, 1819, 1803, 1804, 1805, 1806, + + 1807, 1811, 1810, 1808, 1816, 1811, 1809, 1822, 1823, 1817, + 1816, 1814, 1818, 1825, 1818, 1825, 1827, 1815, 1819, 1828, + 1826, 1826, 1819, 1830, 1829, 1831, 1833, 0, 1828, 1822, + 1826, 1829, 1823, 1832, 1822, 1823, 1830, 1835, 1827, 1818, + 1825, 1832, 1836, 1827, 1837, 1833, 1828, 1826, 1826, 1834, + 1830, 1829, 1831, 1833, 1838, 1839, 1842, 1834, 1846, 1840, + 1832, 1841, 1841, 1835, 1835, 1838, 1840, 1847, 1836, 1836, + 1837, 1837, 1843, 1844, 1842, 1848, 1834, 1839, 1850, 1843, + 1844, 1838, 1839, 1842, 1848, 1846, 1840, 1851, 1841, 1852, + 1855, 1847, 1854, 1857, 1847, 1856, 1858, 0, 1859, 1843, + + 1844, 1854, 1848, 1859, 0, 1850, 1863, 1852, 1858, 1851, + 1860, 1857, 0, 1861, 1851, 0, 1852, 1855, 1856, 1854, + 1857, 1864, 1856, 1858, 1860, 1867, 1865, 1867, 1871, 1873, + 1859, 1861, 1872, 1863, 1878, 1875, 1879, 1860, 1881, 1864, + 1861, 1865, 1876, 1883, 1880, 1876, 1881, 1873, 1864, 1885, + 1871, 1880, 1867, 1865, 1879, 1871, 1873, 1875, 1872, 1872, + 1882, 1878, 1875, 1879, 1884, 1881, 1887, 1886, 1876, 1876, + 1888, 1880, 1876, 1886, 1889, 1883, 1885, 1891, 1890, 1888, + 1890, 1893, 1882, 1894, 1895, 1896, 1884, 1882, 1887, 1893, + 1897, 1884, 1899, 1887, 1886, 1894, 1898, 1888, 1902, 1896, + + 1904, 1900, 1901, 1899, 1891, 1890, 1889, 1907, 1893, 1900, + 1894, 1895, 1896, 1897, 1898, 1903, 1903, 1897, 1905, 1899, + 1902, 1901, 1908, 1898, 1910, 1902, 1905, 1904, 1900, 1901, + 1911, 1912, 1914, 1915, 1907, 1916, 1917, 0, 1919, 1916, + 1915, 1911, 1903, 1920, 1917, 1905, 1923, 1922, 1924, 1908, + 1928, 1910, 1922, 1912, 1934, 1929, 1920, 1911, 1912, 1914, + 1915, 1925, 1916, 1917, 1919, 1919, 1926, 0, 1930, 1925, + 1920, 1927, 1932, 1923, 1922, 1924, 1933, 1928, 1927, 1929, + 1935, 1926, 1929, 1933, 1936, 0, 1934, 1932, 1925, 1940, + 1939, 1937, 1941, 1926, 1930, 1930, 1943, 1940, 1927, 1932, + + 1937, 1945, 1946, 1933, 1942, 1942, 1948, 1935, 1936, 1950, + 1946, 1936, 1939, 1949, 1942, 1951, 1940, 1939, 1937, 1952, + 1953, 1954, 1950, 1943, 1941, 1957, 1964, 1955, 1945, 1946, + 1962, 1942, 1942, 1948, 1961, 1949, 1950, 1951, 1965, 1961, + 1949, 1967, 1951, 1966, 1968, 1969, 1952, 1953, 1954, 1955, + 1966, 1965, 1957, 1964, 1955, 1972, 1962, 1962, 1973, 1967, + 1979, 1961, 1974, 0, 1978, 1965, 1976, 1969, 1967, 1977, + 1966, 1968, 1969, 1976, 1972, 1979, 1977, 1980, 1982, 1985, + 1988, 1983, 1972, 1984, 1974, 1973, 1978, 1979, 1983, 1974, + 1985, 1978, 1984, 1976, 1993, 1987, 1977, 1982, 1980, 1986, + + 1986, 1987, 1988, 1994, 1980, 1982, 1985, 1988, 1983, 1986, + 1984, 1991, 1995, 1999, 2001, 2001, 0, 2004, 1991, 2002, + 2005, 1993, 1987, 2006, 2008, 2009, 1986, 1986, 2013, 2005, + 1994, 2012, 2011, 2014, 2015, 1995, 2006, 2009, 1991, 1995, + 1999, 2011, 2002, 2001, 2004, 2016, 2002, 2005, 2017, 2012, + 2006, 2008, 2009, 2018, 2013, 2013, 2020, 2016, 2012, 2011, + 2014, 2015, 2019, 2021, 2019, 2022, 2023, 2025, 2020, 2021, + 2017, 2024, 2016, 2028, 2030, 2017, 2031, 2032, 2034, 2024, + 2018, 2035, 2037, 2020, 2038, 2040, 2046, 2022, 2023, 2019, + 2021, 0, 2022, 2023, 2025, 2039, 2034, 2037, 2024, 2044, + + 2028, 2030, 2048, 2031, 2032, 2034, 2043, 2039, 2035, 2037, + 2038, 2038, 2040, 2049, 2047, 2043, 2050, 2051, 2046, 2059, + 2064, 2049, 2039, 2044, 2048, 2050, 2044, 2047, 2051, 2048, + 2057, 2060, 2061, 2043, 2065, 2063, 2064, 0, 2060, 2063, + 2049, 2047, 2059, 2050, 2051, 2061, 2059, 2064, 2065, 2069, + 2072, 2069, 2066, 2070, 2057, 2067, 2068, 2057, 2060, 2061, + 2066, 2065, 2063, 2071, 2067, 2070, 2073, 2068, 2074, 2076, + 2071, 2075, 2077, 0, 2080, 2081, 2069, 2072, 2078, 2066, + 2070, 2083, 2067, 2068, 2073, 2079, 2080, 2079, 2090, 2082, + 2071, 2085, 2091, 2073, 2077, 2074, 2076, 2075, 2075, 2077, + + 2078, 2080, 2082, 2085, 2087, 2078, 2089, 2081, 2083, 2092, + 0, 2093, 2079, 2087, 2089, 2094, 2082, 2096, 2085, 2098, + 2090, 2099, 2092, 2094, 2091, 2093, 2097, 2098, 2102, 2100, + 2096, 2087, 2101, 2089, 0, 2099, 2092, 2104, 2093, 2103, + 2101, 2105, 2094, 2100, 2096, 2104, 2098, 2106, 2099, 2097, + 2102, 2111, 0, 2097, 2107, 2102, 2100, 2108, 2109, 2101, + 2112, 2103, 2110, 2117, 2104, 0, 2103, 2115, 2105, 2116, + 2110, 2114, 0, 2106, 2106, 2115, 2107, 2116, 2118, 2108, + 2109, 2107, 2121, 2111, 2108, 2109, 2118, 2112, 2119, 2110, + 2125, 2114, 2122, 2123, 2115, 2117, 2116, 2124, 2114, 2126, + + 2122, 2123, 2119, 2128, 2121, 2118, 2127, 0, 2129, 2121, + 2130, 2124, 2133, 0, 2127, 2119, 2125, 2125, 2131, 2122, + 2123, 2126, 2134, 2132, 2124, 0, 2126, 2135, 2136, 2128, + 2128, 2132, 2130, 2127, 2129, 2129, 2136, 2130, 2131, 2133, + 2137, 2140, 2134, 2138, 2141, 2131, 2144, 2135, 2142, 2134, + 2132, 2138, 2143, 2145, 2135, 2136, 2142, 2146, 0, 2147, + 2143, 2145, 2137, 2140, 2148, 2146, 2141, 2137, 2140, 2149, + 2138, 2141, 2144, 2144, 2150, 2142, 2151, 2152, 2154, 2143, + 2145, 2160, 0, 2161, 2146, 2147, 2147, 2157, 0, 2149, + 2158, 2148, 0, 0, 2159, 0, 2149, 2152, 2158, 0, + + 2154, 2150, 2159, 2151, 2152, 2154, 0, 0, 2160, 2157, + 2161, 0, 0, 0, 2157, 0, 0, 2158, 0, 0, + 0, 2159, 2165, 2165, 2165, 2165, 2165, 2165, 2165, 2166, + 2166, 2166, 2166, 2166, 2166, 2166, 2167, 2167, 2167, 2167, + 2167, 2167, 2167, 2168, 2168, 2168, 2168, 2168, 2168, 2168, + 2169, 2169, 2169, 2169, 2169, 2169, 2169, 2171, 2171, 0, + 2171, 2171, 2171, 2171, 2172, 2172, 0, 0, 0, 2172, + 2172, 2173, 2173, 0, 0, 2173, 0, 2173, 2174, 0, + 0, 0, 0, 0, 2174, 2175, 2175, 0, 0, 0, + 2175, 2175, 2176, 0, 0, 0, 0, 0, 2176, 2177, + + 2177, 0, 2177, 2177, 2177, 2177, 2178, 2178, 0, 2178, + 2178, 2178, 2178, 2164, 2164, 2164, 2164, 2164, 2164, 2164, + 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, + 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, + 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, + 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, + 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, + 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164, 2164 } ; static yy_state_type yy_last_accepting_state; @@ -1814,8 +2562,8 @@ static int yy_more_len = 0; #define YY_MORE_ADJ (yy_more_len) #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "./util/configlexer.lex" -#line 2 "./util/configlexer.lex" +#line 1 "util/configlexer.lex" +#line 2 "util/configlexer.lex" /* * configlexer.lex - lexical analyzer for unbound config file * @@ -1824,6 +2572,12 @@ char *yytext; * See LICENSE for the license. * */ + +/* because flex keeps having sign-unsigned compare problems that are unfixed*/ +#if defined(__clang__)||(defined(__GNUC__)&&((__GNUC__ >4)||(defined(__GNUC_MINOR__)&&(__GNUC__ ==4)&&(__GNUC_MINOR__ >=2)))) +#pragma GCC diagnostic ignored "-Wsign-compare" +#endif + #include <ctype.h> #include <string.h> #include <strings.h> @@ -1880,7 +2634,7 @@ static void config_start_include(const char* filename) ub_c_error_msg("too many include files"); return; } - if(strlen(filename) == 0) { + if(*filename == '\0') { ub_c_error_msg("empty include file name"); return; } @@ -1992,7 +2746,7 @@ static void config_end_include(void) #endif #define YY_NO_INPUT 1 -#line 181 "./util/configlexer.lex" +#line 187 "util/configlexer.lex" #ifndef YY_NO_UNPUT #define YY_NO_UNPUT 1 #endif @@ -2000,7 +2754,7 @@ static void config_end_include(void) #define YY_NO_INPUT 1 #endif -#line 2002 "<stdout>" +#line 2756 "<stdout>" #define INITIAL 0 #define quotedstring 1 @@ -2038,11 +2792,11 @@ void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); -void yyset_in (FILE * in_str ); +void yyset_in (FILE * _in_str ); FILE *yyget_out (void ); -void yyset_out (FILE * out_str ); +void yyset_out (FILE * _out_str ); yy_size_t yyget_leng (void ); @@ -2050,7 +2804,7 @@ char *yyget_text (void ); int yyget_lineno (void ); -void yyset_lineno (int line_number ); +void yyset_lineno (int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -2064,6 +2818,10 @@ extern int yywrap (void ); #endif #endif +#ifndef YY_NO_UNPUT + +#endif + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -2084,7 +2842,12 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -2171,7 +2934,7 @@ extern int yylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -2181,14 +2944,10 @@ extern int yylex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; -#line 201 "./util/configlexer.lex" - -#line 2189 "<stdout>" - if ( !(yy_init) ) { (yy_init) = 1; @@ -2215,7 +2974,12 @@ YY_DECL yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 207 "util/configlexer.lex" + +#line 2979 "<stdout>" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { (yy_more_len) = 0; if ( (yy_more_flag) ) @@ -2237,7 +3001,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -2246,13 +3010,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1771 ) + if ( yy_current_state >= 2165 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 3503 ); + while ( yy_base[yy_current_state] != 6214 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -2278,824 +3042,1049 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 202 "./util/configlexer.lex" +#line 208 "util/configlexer.lex" { LEXOUT(("SP ")); /* ignore */ } YY_BREAK case 2: YY_RULE_SETUP -#line 204 "./util/configlexer.lex" +#line 210 "util/configlexer.lex" { /* note that flex makes the longest match and '.' is any but not nl */ LEXOUT(("comment(%s) ", yytext)); /* ignore */ } YY_BREAK case 3: YY_RULE_SETUP -#line 207 "./util/configlexer.lex" +#line 213 "util/configlexer.lex" { YDVAR(0, VAR_SERVER) } YY_BREAK case 4: YY_RULE_SETUP -#line 208 "./util/configlexer.lex" +#line 214 "util/configlexer.lex" { YDVAR(1, VAR_QNAME_MINIMISATION) } YY_BREAK case 5: YY_RULE_SETUP -#line 209 "./util/configlexer.lex" -{ YDVAR(1, VAR_NUM_THREADS) } +#line 215 "util/configlexer.lex" +{ YDVAR(1, VAR_QNAME_MINIMISATION_STRICT) } YY_BREAK case 6: YY_RULE_SETUP -#line 210 "./util/configlexer.lex" -{ YDVAR(1, VAR_VERBOSITY) } +#line 216 "util/configlexer.lex" +{ YDVAR(1, VAR_NUM_THREADS) } YY_BREAK case 7: YY_RULE_SETUP -#line 211 "./util/configlexer.lex" -{ YDVAR(1, VAR_PORT) } +#line 217 "util/configlexer.lex" +{ YDVAR(1, VAR_VERBOSITY) } YY_BREAK case 8: YY_RULE_SETUP -#line 212 "./util/configlexer.lex" -{ YDVAR(1, VAR_OUTGOING_RANGE) } +#line 218 "util/configlexer.lex" +{ YDVAR(1, VAR_PORT) } YY_BREAK case 9: YY_RULE_SETUP -#line 213 "./util/configlexer.lex" -{ YDVAR(1, VAR_OUTGOING_PORT_PERMIT) } +#line 219 "util/configlexer.lex" +{ YDVAR(1, VAR_OUTGOING_RANGE) } YY_BREAK case 10: YY_RULE_SETUP -#line 214 "./util/configlexer.lex" -{ YDVAR(1, VAR_OUTGOING_PORT_AVOID) } +#line 220 "util/configlexer.lex" +{ YDVAR(1, VAR_OUTGOING_PORT_PERMIT) } YY_BREAK case 11: YY_RULE_SETUP -#line 215 "./util/configlexer.lex" -{ YDVAR(1, VAR_OUTGOING_NUM_TCP) } +#line 221 "util/configlexer.lex" +{ YDVAR(1, VAR_OUTGOING_PORT_AVOID) } YY_BREAK case 12: YY_RULE_SETUP -#line 216 "./util/configlexer.lex" -{ YDVAR(1, VAR_INCOMING_NUM_TCP) } +#line 222 "util/configlexer.lex" +{ YDVAR(1, VAR_OUTGOING_NUM_TCP) } YY_BREAK case 13: YY_RULE_SETUP -#line 217 "./util/configlexer.lex" -{ YDVAR(1, VAR_DO_IP4) } +#line 223 "util/configlexer.lex" +{ YDVAR(1, VAR_INCOMING_NUM_TCP) } YY_BREAK case 14: YY_RULE_SETUP -#line 218 "./util/configlexer.lex" -{ YDVAR(1, VAR_DO_IP6) } +#line 224 "util/configlexer.lex" +{ YDVAR(1, VAR_DO_IP4) } YY_BREAK case 15: YY_RULE_SETUP -#line 219 "./util/configlexer.lex" -{ YDVAR(1, VAR_DO_UDP) } +#line 225 "util/configlexer.lex" +{ YDVAR(1, VAR_DO_IP6) } YY_BREAK case 16: YY_RULE_SETUP -#line 220 "./util/configlexer.lex" -{ YDVAR(1, VAR_DO_TCP) } +#line 226 "util/configlexer.lex" +{ YDVAR(1, VAR_PREFER_IP6) } YY_BREAK case 17: YY_RULE_SETUP -#line 221 "./util/configlexer.lex" -{ YDVAR(1, VAR_TCP_UPSTREAM) } +#line 227 "util/configlexer.lex" +{ YDVAR(1, VAR_DO_UDP) } YY_BREAK case 18: YY_RULE_SETUP -#line 222 "./util/configlexer.lex" -{ YDVAR(1, VAR_SSL_UPSTREAM) } +#line 228 "util/configlexer.lex" +{ YDVAR(1, VAR_DO_TCP) } YY_BREAK case 19: YY_RULE_SETUP -#line 223 "./util/configlexer.lex" -{ YDVAR(1, VAR_SSL_SERVICE_KEY) } +#line 229 "util/configlexer.lex" +{ YDVAR(1, VAR_TCP_UPSTREAM) } YY_BREAK case 20: YY_RULE_SETUP -#line 224 "./util/configlexer.lex" -{ YDVAR(1, VAR_SSL_SERVICE_PEM) } +#line 230 "util/configlexer.lex" +{ YDVAR(1, VAR_TCP_MSS) } YY_BREAK case 21: YY_RULE_SETUP -#line 225 "./util/configlexer.lex" -{ YDVAR(1, VAR_SSL_PORT) } +#line 231 "util/configlexer.lex" +{ YDVAR(1, VAR_OUTGOING_TCP_MSS) } YY_BREAK case 22: YY_RULE_SETUP -#line 226 "./util/configlexer.lex" -{ YDVAR(1, VAR_DO_DAEMONIZE) } +#line 232 "util/configlexer.lex" +{ YDVAR(1, VAR_SSL_UPSTREAM) } YY_BREAK case 23: YY_RULE_SETUP -#line 227 "./util/configlexer.lex" -{ YDVAR(1, VAR_INTERFACE) } +#line 233 "util/configlexer.lex" +{ YDVAR(1, VAR_SSL_SERVICE_KEY) } YY_BREAK case 24: YY_RULE_SETUP -#line 228 "./util/configlexer.lex" -{ YDVAR(1, VAR_INTERFACE) } +#line 234 "util/configlexer.lex" +{ YDVAR(1, VAR_SSL_SERVICE_PEM) } YY_BREAK case 25: YY_RULE_SETUP -#line 229 "./util/configlexer.lex" -{ YDVAR(1, VAR_OUTGOING_INTERFACE) } +#line 235 "util/configlexer.lex" +{ YDVAR(1, VAR_SSL_PORT) } YY_BREAK case 26: YY_RULE_SETUP -#line 230 "./util/configlexer.lex" -{ YDVAR(1, VAR_INTERFACE_AUTOMATIC) } +#line 236 "util/configlexer.lex" +{ YDVAR(1, VAR_USE_SYSTEMD) } YY_BREAK case 27: YY_RULE_SETUP -#line 231 "./util/configlexer.lex" -{ YDVAR(1, VAR_SO_RCVBUF) } +#line 237 "util/configlexer.lex" +{ YDVAR(1, VAR_DO_DAEMONIZE) } YY_BREAK case 28: YY_RULE_SETUP -#line 232 "./util/configlexer.lex" -{ YDVAR(1, VAR_SO_SNDBUF) } +#line 238 "util/configlexer.lex" +{ YDVAR(1, VAR_INTERFACE) } YY_BREAK case 29: YY_RULE_SETUP -#line 233 "./util/configlexer.lex" -{ YDVAR(1, VAR_SO_REUSEPORT) } +#line 239 "util/configlexer.lex" +{ YDVAR(1, VAR_INTERFACE) } YY_BREAK case 30: YY_RULE_SETUP -#line 234 "./util/configlexer.lex" -{ YDVAR(1, VAR_IP_TRANSPARENT) } +#line 240 "util/configlexer.lex" +{ YDVAR(1, VAR_OUTGOING_INTERFACE) } YY_BREAK case 31: YY_RULE_SETUP -#line 235 "./util/configlexer.lex" -{ YDVAR(1, VAR_CHROOT) } +#line 241 "util/configlexer.lex" +{ YDVAR(1, VAR_INTERFACE_AUTOMATIC) } YY_BREAK case 32: YY_RULE_SETUP -#line 236 "./util/configlexer.lex" -{ YDVAR(1, VAR_USERNAME) } +#line 242 "util/configlexer.lex" +{ YDVAR(1, VAR_SO_RCVBUF) } YY_BREAK case 33: YY_RULE_SETUP -#line 237 "./util/configlexer.lex" -{ YDVAR(1, VAR_DIRECTORY) } +#line 243 "util/configlexer.lex" +{ YDVAR(1, VAR_SO_SNDBUF) } YY_BREAK case 34: YY_RULE_SETUP -#line 238 "./util/configlexer.lex" -{ YDVAR(1, VAR_LOGFILE) } +#line 244 "util/configlexer.lex" +{ YDVAR(1, VAR_SO_REUSEPORT) } YY_BREAK case 35: YY_RULE_SETUP -#line 239 "./util/configlexer.lex" -{ YDVAR(1, VAR_PIDFILE) } +#line 245 "util/configlexer.lex" +{ YDVAR(1, VAR_IP_TRANSPARENT) } YY_BREAK case 36: YY_RULE_SETUP -#line 240 "./util/configlexer.lex" -{ YDVAR(1, VAR_ROOT_HINTS) } +#line 246 "util/configlexer.lex" +{ YDVAR(1, VAR_IP_FREEBIND) } YY_BREAK case 37: YY_RULE_SETUP -#line 241 "./util/configlexer.lex" -{ YDVAR(1, VAR_EDNS_BUFFER_SIZE) } +#line 247 "util/configlexer.lex" +{ YDVAR(1, VAR_CHROOT) } YY_BREAK case 38: YY_RULE_SETUP -#line 242 "./util/configlexer.lex" -{ YDVAR(1, VAR_MSG_BUFFER_SIZE) } +#line 248 "util/configlexer.lex" +{ YDVAR(1, VAR_USERNAME) } YY_BREAK case 39: YY_RULE_SETUP -#line 243 "./util/configlexer.lex" -{ YDVAR(1, VAR_MSG_CACHE_SIZE) } +#line 249 "util/configlexer.lex" +{ YDVAR(1, VAR_DIRECTORY) } YY_BREAK case 40: YY_RULE_SETUP -#line 244 "./util/configlexer.lex" -{ YDVAR(1, VAR_MSG_CACHE_SLABS) } +#line 250 "util/configlexer.lex" +{ YDVAR(1, VAR_LOGFILE) } YY_BREAK case 41: YY_RULE_SETUP -#line 245 "./util/configlexer.lex" -{ YDVAR(1, VAR_RRSET_CACHE_SIZE) } +#line 251 "util/configlexer.lex" +{ YDVAR(1, VAR_PIDFILE) } YY_BREAK case 42: YY_RULE_SETUP -#line 246 "./util/configlexer.lex" -{ YDVAR(1, VAR_RRSET_CACHE_SLABS) } +#line 252 "util/configlexer.lex" +{ YDVAR(1, VAR_ROOT_HINTS) } YY_BREAK case 43: YY_RULE_SETUP -#line 247 "./util/configlexer.lex" -{ YDVAR(1, VAR_CACHE_MAX_TTL) } +#line 253 "util/configlexer.lex" +{ YDVAR(1, VAR_EDNS_BUFFER_SIZE) } YY_BREAK case 44: YY_RULE_SETUP -#line 248 "./util/configlexer.lex" -{ YDVAR(1, VAR_CACHE_MAX_NEGATIVE_TTL) } +#line 254 "util/configlexer.lex" +{ YDVAR(1, VAR_MSG_BUFFER_SIZE) } YY_BREAK case 45: YY_RULE_SETUP -#line 249 "./util/configlexer.lex" -{ YDVAR(1, VAR_CACHE_MIN_TTL) } +#line 255 "util/configlexer.lex" +{ YDVAR(1, VAR_MSG_CACHE_SIZE) } YY_BREAK case 46: YY_RULE_SETUP -#line 250 "./util/configlexer.lex" -{ YDVAR(1, VAR_INFRA_HOST_TTL) } +#line 256 "util/configlexer.lex" +{ YDVAR(1, VAR_MSG_CACHE_SLABS) } YY_BREAK case 47: YY_RULE_SETUP -#line 251 "./util/configlexer.lex" -{ YDVAR(1, VAR_INFRA_LAME_TTL) } +#line 257 "util/configlexer.lex" +{ YDVAR(1, VAR_RRSET_CACHE_SIZE) } YY_BREAK case 48: YY_RULE_SETUP -#line 252 "./util/configlexer.lex" -{ YDVAR(1, VAR_INFRA_CACHE_SLABS) } +#line 258 "util/configlexer.lex" +{ YDVAR(1, VAR_RRSET_CACHE_SLABS) } YY_BREAK case 49: YY_RULE_SETUP -#line 253 "./util/configlexer.lex" -{ YDVAR(1, VAR_INFRA_CACHE_NUMHOSTS) } +#line 259 "util/configlexer.lex" +{ YDVAR(1, VAR_CACHE_MAX_TTL) } YY_BREAK case 50: YY_RULE_SETUP -#line 254 "./util/configlexer.lex" -{ YDVAR(1, VAR_INFRA_CACHE_LAME_SIZE) } +#line 260 "util/configlexer.lex" +{ YDVAR(1, VAR_CACHE_MAX_NEGATIVE_TTL) } YY_BREAK case 51: YY_RULE_SETUP -#line 255 "./util/configlexer.lex" -{ YDVAR(1, VAR_INFRA_CACHE_MIN_RTT) } +#line 261 "util/configlexer.lex" +{ YDVAR(1, VAR_CACHE_MIN_TTL) } YY_BREAK case 52: YY_RULE_SETUP -#line 256 "./util/configlexer.lex" -{ YDVAR(1, VAR_NUM_QUERIES_PER_THREAD) } +#line 262 "util/configlexer.lex" +{ YDVAR(1, VAR_INFRA_HOST_TTL) } YY_BREAK case 53: YY_RULE_SETUP -#line 257 "./util/configlexer.lex" -{ YDVAR(1, VAR_JOSTLE_TIMEOUT) } +#line 263 "util/configlexer.lex" +{ YDVAR(1, VAR_INFRA_LAME_TTL) } YY_BREAK case 54: YY_RULE_SETUP -#line 258 "./util/configlexer.lex" -{ YDVAR(1, VAR_DELAY_CLOSE) } +#line 264 "util/configlexer.lex" +{ YDVAR(1, VAR_INFRA_CACHE_SLABS) } YY_BREAK case 55: YY_RULE_SETUP -#line 259 "./util/configlexer.lex" -{ YDVAR(1, VAR_TARGET_FETCH_POLICY) } +#line 265 "util/configlexer.lex" +{ YDVAR(1, VAR_INFRA_CACHE_NUMHOSTS) } YY_BREAK case 56: YY_RULE_SETUP -#line 260 "./util/configlexer.lex" -{ YDVAR(1, VAR_HARDEN_SHORT_BUFSIZE) } +#line 266 "util/configlexer.lex" +{ YDVAR(1, VAR_INFRA_CACHE_LAME_SIZE) } YY_BREAK case 57: YY_RULE_SETUP -#line 261 "./util/configlexer.lex" -{ YDVAR(1, VAR_HARDEN_LARGE_QUERIES) } +#line 267 "util/configlexer.lex" +{ YDVAR(1, VAR_INFRA_CACHE_MIN_RTT) } YY_BREAK case 58: YY_RULE_SETUP -#line 262 "./util/configlexer.lex" -{ YDVAR(1, VAR_HARDEN_GLUE) } +#line 268 "util/configlexer.lex" +{ YDVAR(1, VAR_NUM_QUERIES_PER_THREAD) } YY_BREAK case 59: YY_RULE_SETUP -#line 263 "./util/configlexer.lex" -{ YDVAR(1, VAR_HARDEN_DNSSEC_STRIPPED) } +#line 269 "util/configlexer.lex" +{ YDVAR(1, VAR_JOSTLE_TIMEOUT) } YY_BREAK case 60: YY_RULE_SETUP -#line 264 "./util/configlexer.lex" -{ YDVAR(1, VAR_HARDEN_BELOW_NXDOMAIN) } +#line 270 "util/configlexer.lex" +{ YDVAR(1, VAR_DELAY_CLOSE) } YY_BREAK case 61: YY_RULE_SETUP -#line 265 "./util/configlexer.lex" -{ YDVAR(1, VAR_HARDEN_REFERRAL_PATH) } +#line 271 "util/configlexer.lex" +{ YDVAR(1, VAR_TARGET_FETCH_POLICY) } YY_BREAK case 62: YY_RULE_SETUP -#line 266 "./util/configlexer.lex" -{ YDVAR(1, VAR_HARDEN_ALGO_DOWNGRADE) } +#line 272 "util/configlexer.lex" +{ YDVAR(1, VAR_HARDEN_SHORT_BUFSIZE) } YY_BREAK case 63: YY_RULE_SETUP -#line 267 "./util/configlexer.lex" -{ YDVAR(1, VAR_USE_CAPS_FOR_ID) } +#line 273 "util/configlexer.lex" +{ YDVAR(1, VAR_HARDEN_LARGE_QUERIES) } YY_BREAK case 64: YY_RULE_SETUP -#line 268 "./util/configlexer.lex" -{ YDVAR(1, VAR_CAPS_WHITELIST) } +#line 274 "util/configlexer.lex" +{ YDVAR(1, VAR_HARDEN_GLUE) } YY_BREAK case 65: YY_RULE_SETUP -#line 269 "./util/configlexer.lex" -{ YDVAR(1, VAR_UNWANTED_REPLY_THRESHOLD) } +#line 275 "util/configlexer.lex" +{ YDVAR(1, VAR_HARDEN_DNSSEC_STRIPPED) } YY_BREAK case 66: YY_RULE_SETUP -#line 270 "./util/configlexer.lex" -{ YDVAR(1, VAR_PRIVATE_ADDRESS) } +#line 276 "util/configlexer.lex" +{ YDVAR(1, VAR_HARDEN_BELOW_NXDOMAIN) } YY_BREAK case 67: YY_RULE_SETUP -#line 271 "./util/configlexer.lex" -{ YDVAR(1, VAR_PRIVATE_DOMAIN) } +#line 277 "util/configlexer.lex" +{ YDVAR(1, VAR_HARDEN_REFERRAL_PATH) } YY_BREAK case 68: YY_RULE_SETUP -#line 272 "./util/configlexer.lex" -{ YDVAR(1, VAR_PREFETCH_KEY) } +#line 278 "util/configlexer.lex" +{ YDVAR(1, VAR_HARDEN_ALGO_DOWNGRADE) } YY_BREAK case 69: YY_RULE_SETUP -#line 273 "./util/configlexer.lex" -{ YDVAR(1, VAR_PREFETCH) } +#line 279 "util/configlexer.lex" +{ YDVAR(1, VAR_USE_CAPS_FOR_ID) } YY_BREAK case 70: YY_RULE_SETUP -#line 274 "./util/configlexer.lex" -{ YDVAR(0, VAR_STUB_ZONE) } +#line 280 "util/configlexer.lex" +{ YDVAR(1, VAR_CAPS_WHITELIST) } YY_BREAK case 71: YY_RULE_SETUP -#line 275 "./util/configlexer.lex" -{ YDVAR(1, VAR_NAME) } +#line 281 "util/configlexer.lex" +{ YDVAR(1, VAR_UNWANTED_REPLY_THRESHOLD) } YY_BREAK case 72: YY_RULE_SETUP -#line 276 "./util/configlexer.lex" -{ YDVAR(1, VAR_STUB_ADDR) } +#line 282 "util/configlexer.lex" +{ YDVAR(1, VAR_PRIVATE_ADDRESS) } YY_BREAK case 73: YY_RULE_SETUP -#line 277 "./util/configlexer.lex" -{ YDVAR(1, VAR_STUB_HOST) } +#line 283 "util/configlexer.lex" +{ YDVAR(1, VAR_PRIVATE_DOMAIN) } YY_BREAK case 74: YY_RULE_SETUP -#line 278 "./util/configlexer.lex" -{ YDVAR(1, VAR_STUB_PRIME) } +#line 284 "util/configlexer.lex" +{ YDVAR(1, VAR_PREFETCH_KEY) } YY_BREAK case 75: YY_RULE_SETUP -#line 279 "./util/configlexer.lex" -{ YDVAR(1, VAR_STUB_FIRST) } +#line 285 "util/configlexer.lex" +{ YDVAR(1, VAR_PREFETCH) } YY_BREAK case 76: YY_RULE_SETUP -#line 280 "./util/configlexer.lex" -{ YDVAR(0, VAR_FORWARD_ZONE) } +#line 286 "util/configlexer.lex" +{ YDVAR(0, VAR_STUB_ZONE) } YY_BREAK case 77: YY_RULE_SETUP -#line 281 "./util/configlexer.lex" -{ YDVAR(1, VAR_FORWARD_ADDR) } +#line 287 "util/configlexer.lex" +{ YDVAR(1, VAR_NAME) } YY_BREAK case 78: YY_RULE_SETUP -#line 282 "./util/configlexer.lex" -{ YDVAR(1, VAR_FORWARD_HOST) } +#line 288 "util/configlexer.lex" +{ YDVAR(1, VAR_STUB_ADDR) } YY_BREAK case 79: YY_RULE_SETUP -#line 283 "./util/configlexer.lex" -{ YDVAR(1, VAR_FORWARD_FIRST) } +#line 289 "util/configlexer.lex" +{ YDVAR(1, VAR_STUB_HOST) } YY_BREAK case 80: YY_RULE_SETUP -#line 284 "./util/configlexer.lex" -{ YDVAR(1, VAR_DO_NOT_QUERY_ADDRESS) } +#line 290 "util/configlexer.lex" +{ YDVAR(1, VAR_STUB_PRIME) } YY_BREAK case 81: YY_RULE_SETUP -#line 285 "./util/configlexer.lex" -{ YDVAR(1, VAR_DO_NOT_QUERY_LOCALHOST) } +#line 291 "util/configlexer.lex" +{ YDVAR(1, VAR_STUB_FIRST) } YY_BREAK case 82: YY_RULE_SETUP -#line 286 "./util/configlexer.lex" -{ YDVAR(2, VAR_ACCESS_CONTROL) } +#line 292 "util/configlexer.lex" +{ YDVAR(1, VAR_STUB_SSL_UPSTREAM) } YY_BREAK case 83: YY_RULE_SETUP -#line 287 "./util/configlexer.lex" -{ YDVAR(1, VAR_HIDE_IDENTITY) } +#line 293 "util/configlexer.lex" +{ YDVAR(0, VAR_FORWARD_ZONE) } YY_BREAK case 84: YY_RULE_SETUP -#line 288 "./util/configlexer.lex" -{ YDVAR(1, VAR_HIDE_VERSION) } +#line 294 "util/configlexer.lex" +{ YDVAR(1, VAR_FORWARD_ADDR) } YY_BREAK case 85: YY_RULE_SETUP -#line 289 "./util/configlexer.lex" -{ YDVAR(1, VAR_IDENTITY) } +#line 295 "util/configlexer.lex" +{ YDVAR(1, VAR_FORWARD_HOST) } YY_BREAK case 86: YY_RULE_SETUP -#line 290 "./util/configlexer.lex" -{ YDVAR(1, VAR_VERSION) } +#line 296 "util/configlexer.lex" +{ YDVAR(1, VAR_FORWARD_FIRST) } YY_BREAK case 87: YY_RULE_SETUP -#line 291 "./util/configlexer.lex" -{ YDVAR(1, VAR_MODULE_CONF) } +#line 297 "util/configlexer.lex" +{ YDVAR(1, VAR_FORWARD_SSL_UPSTREAM) } YY_BREAK case 88: YY_RULE_SETUP -#line 292 "./util/configlexer.lex" -{ YDVAR(1, VAR_DLV_ANCHOR) } +#line 298 "util/configlexer.lex" +{ YDVAR(0, VAR_VIEW) } YY_BREAK case 89: YY_RULE_SETUP -#line 293 "./util/configlexer.lex" -{ YDVAR(1, VAR_DLV_ANCHOR_FILE) } +#line 299 "util/configlexer.lex" +{ YDVAR(1, VAR_VIEW_FIRST) } YY_BREAK case 90: YY_RULE_SETUP -#line 294 "./util/configlexer.lex" -{ YDVAR(1, VAR_TRUST_ANCHOR_FILE) } +#line 300 "util/configlexer.lex" +{ YDVAR(1, VAR_DO_NOT_QUERY_ADDRESS) } YY_BREAK case 91: YY_RULE_SETUP -#line 295 "./util/configlexer.lex" -{ YDVAR(1, VAR_AUTO_TRUST_ANCHOR_FILE) } +#line 301 "util/configlexer.lex" +{ YDVAR(1, VAR_DO_NOT_QUERY_LOCALHOST) } YY_BREAK case 92: YY_RULE_SETUP -#line 296 "./util/configlexer.lex" -{ YDVAR(1, VAR_TRUSTED_KEYS_FILE) } +#line 302 "util/configlexer.lex" +{ YDVAR(2, VAR_ACCESS_CONTROL) } YY_BREAK case 93: YY_RULE_SETUP -#line 297 "./util/configlexer.lex" -{ YDVAR(1, VAR_TRUST_ANCHOR) } +#line 303 "util/configlexer.lex" +{ YDVAR(1, VAR_SEND_CLIENT_SUBNET) } YY_BREAK case 94: YY_RULE_SETUP -#line 298 "./util/configlexer.lex" -{ YDVAR(1, VAR_VAL_OVERRIDE_DATE) } +#line 304 "util/configlexer.lex" +{ YDVAR(1, VAR_CLIENT_SUBNET_ALWAYS_FORWARD) } YY_BREAK case 95: YY_RULE_SETUP -#line 299 "./util/configlexer.lex" -{ YDVAR(1, VAR_VAL_SIG_SKEW_MIN) } +#line 305 "util/configlexer.lex" +{ YDVAR(1, VAR_CLIENT_SUBNET_OPCODE) } YY_BREAK case 96: YY_RULE_SETUP -#line 300 "./util/configlexer.lex" -{ YDVAR(1, VAR_VAL_SIG_SKEW_MAX) } +#line 306 "util/configlexer.lex" +{ YDVAR(1, VAR_MAX_CLIENT_SUBNET_IPV4) } YY_BREAK case 97: YY_RULE_SETUP -#line 301 "./util/configlexer.lex" -{ YDVAR(1, VAR_BOGUS_TTL) } +#line 307 "util/configlexer.lex" +{ YDVAR(1, VAR_MAX_CLIENT_SUBNET_IPV6) } YY_BREAK case 98: YY_RULE_SETUP -#line 302 "./util/configlexer.lex" -{ YDVAR(1, VAR_VAL_CLEAN_ADDITIONAL) } +#line 308 "util/configlexer.lex" +{ YDVAR(1, VAR_HIDE_IDENTITY) } YY_BREAK case 99: YY_RULE_SETUP -#line 303 "./util/configlexer.lex" -{ YDVAR(1, VAR_VAL_PERMISSIVE_MODE) } +#line 309 "util/configlexer.lex" +{ YDVAR(1, VAR_HIDE_VERSION) } YY_BREAK case 100: YY_RULE_SETUP -#line 304 "./util/configlexer.lex" -{ YDVAR(1, VAR_IGNORE_CD_FLAG) } +#line 310 "util/configlexer.lex" +{ YDVAR(1, VAR_HIDE_TRUSTANCHOR) } YY_BREAK case 101: YY_RULE_SETUP -#line 305 "./util/configlexer.lex" -{ YDVAR(1, VAR_VAL_LOG_LEVEL) } +#line 311 "util/configlexer.lex" +{ YDVAR(1, VAR_IDENTITY) } YY_BREAK case 102: YY_RULE_SETUP -#line 306 "./util/configlexer.lex" -{ YDVAR(1, VAR_KEY_CACHE_SIZE) } +#line 312 "util/configlexer.lex" +{ YDVAR(1, VAR_VERSION) } YY_BREAK case 103: YY_RULE_SETUP -#line 307 "./util/configlexer.lex" -{ YDVAR(1, VAR_KEY_CACHE_SLABS) } +#line 313 "util/configlexer.lex" +{ YDVAR(1, VAR_MODULE_CONF) } YY_BREAK case 104: YY_RULE_SETUP -#line 308 "./util/configlexer.lex" -{ YDVAR(1, VAR_NEG_CACHE_SIZE) } +#line 314 "util/configlexer.lex" +{ YDVAR(1, VAR_DLV_ANCHOR) } YY_BREAK case 105: YY_RULE_SETUP -#line 309 "./util/configlexer.lex" +#line 315 "util/configlexer.lex" +{ YDVAR(1, VAR_DLV_ANCHOR_FILE) } + YY_BREAK +case 106: +YY_RULE_SETUP +#line 316 "util/configlexer.lex" +{ YDVAR(1, VAR_TRUST_ANCHOR_FILE) } + YY_BREAK +case 107: +YY_RULE_SETUP +#line 317 "util/configlexer.lex" +{ YDVAR(1, VAR_AUTO_TRUST_ANCHOR_FILE) } + YY_BREAK +case 108: +YY_RULE_SETUP +#line 318 "util/configlexer.lex" +{ YDVAR(1, VAR_TRUSTED_KEYS_FILE) } + YY_BREAK +case 109: +YY_RULE_SETUP +#line 319 "util/configlexer.lex" +{ YDVAR(1, VAR_TRUST_ANCHOR) } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 320 "util/configlexer.lex" +{ YDVAR(1, VAR_VAL_OVERRIDE_DATE) } + YY_BREAK +case 111: +YY_RULE_SETUP +#line 321 "util/configlexer.lex" +{ YDVAR(1, VAR_VAL_SIG_SKEW_MIN) } + YY_BREAK +case 112: +YY_RULE_SETUP +#line 322 "util/configlexer.lex" +{ YDVAR(1, VAR_VAL_SIG_SKEW_MAX) } + YY_BREAK +case 113: +YY_RULE_SETUP +#line 323 "util/configlexer.lex" +{ YDVAR(1, VAR_BOGUS_TTL) } + YY_BREAK +case 114: +YY_RULE_SETUP +#line 324 "util/configlexer.lex" +{ YDVAR(1, VAR_VAL_CLEAN_ADDITIONAL) } + YY_BREAK +case 115: +YY_RULE_SETUP +#line 325 "util/configlexer.lex" +{ YDVAR(1, VAR_VAL_PERMISSIVE_MODE) } + YY_BREAK +case 116: +YY_RULE_SETUP +#line 326 "util/configlexer.lex" +{ YDVAR(1, VAR_IGNORE_CD_FLAG) } + YY_BREAK +case 117: +YY_RULE_SETUP +#line 327 "util/configlexer.lex" +{ YDVAR(1, VAR_SERVE_EXPIRED) } + YY_BREAK +case 118: +YY_RULE_SETUP +#line 328 "util/configlexer.lex" +{ YDVAR(1, VAR_FAKE_DSA) } + YY_BREAK +case 119: +YY_RULE_SETUP +#line 329 "util/configlexer.lex" +{ YDVAR(1, VAR_FAKE_SHA1) } + YY_BREAK +case 120: +YY_RULE_SETUP +#line 330 "util/configlexer.lex" +{ YDVAR(1, VAR_VAL_LOG_LEVEL) } + YY_BREAK +case 121: +YY_RULE_SETUP +#line 331 "util/configlexer.lex" +{ YDVAR(1, VAR_KEY_CACHE_SIZE) } + YY_BREAK +case 122: +YY_RULE_SETUP +#line 332 "util/configlexer.lex" +{ YDVAR(1, VAR_KEY_CACHE_SLABS) } + YY_BREAK +case 123: +YY_RULE_SETUP +#line 333 "util/configlexer.lex" +{ YDVAR(1, VAR_NEG_CACHE_SIZE) } + YY_BREAK +case 124: +YY_RULE_SETUP +#line 334 "util/configlexer.lex" { YDVAR(1, VAR_VAL_NSEC3_KEYSIZE_ITERATIONS) } YY_BREAK -case 106: +case 125: YY_RULE_SETUP -#line 311 "./util/configlexer.lex" +#line 336 "util/configlexer.lex" { YDVAR(1, VAR_ADD_HOLDDOWN) } YY_BREAK -case 107: +case 126: YY_RULE_SETUP -#line 312 "./util/configlexer.lex" +#line 337 "util/configlexer.lex" { YDVAR(1, VAR_DEL_HOLDDOWN) } YY_BREAK -case 108: +case 127: YY_RULE_SETUP -#line 313 "./util/configlexer.lex" +#line 338 "util/configlexer.lex" { YDVAR(1, VAR_KEEP_MISSING) } YY_BREAK -case 109: +case 128: YY_RULE_SETUP -#line 314 "./util/configlexer.lex" +#line 339 "util/configlexer.lex" { YDVAR(1, VAR_PERMIT_SMALL_HOLDDOWN) } YY_BREAK -case 110: +case 129: YY_RULE_SETUP -#line 315 "./util/configlexer.lex" +#line 340 "util/configlexer.lex" { YDVAR(1, VAR_USE_SYSLOG) } YY_BREAK -case 111: +case 130: YY_RULE_SETUP -#line 316 "./util/configlexer.lex" +#line 341 "util/configlexer.lex" +{ YDVAR(1, VAR_LOG_IDENTITY) } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 342 "util/configlexer.lex" { YDVAR(1, VAR_LOG_TIME_ASCII) } YY_BREAK -case 112: +case 132: YY_RULE_SETUP -#line 317 "./util/configlexer.lex" +#line 343 "util/configlexer.lex" { YDVAR(1, VAR_LOG_QUERIES) } YY_BREAK -case 113: +case 133: YY_RULE_SETUP -#line 318 "./util/configlexer.lex" +#line 344 "util/configlexer.lex" +{ YDVAR(1, VAR_LOG_REPLIES) } + YY_BREAK +case 134: +YY_RULE_SETUP +#line 345 "util/configlexer.lex" { YDVAR(2, VAR_LOCAL_ZONE) } YY_BREAK -case 114: +case 135: YY_RULE_SETUP -#line 319 "./util/configlexer.lex" +#line 346 "util/configlexer.lex" { YDVAR(1, VAR_LOCAL_DATA) } YY_BREAK -case 115: +case 136: YY_RULE_SETUP -#line 320 "./util/configlexer.lex" +#line 347 "util/configlexer.lex" { YDVAR(1, VAR_LOCAL_DATA_PTR) } YY_BREAK -case 116: +case 137: YY_RULE_SETUP -#line 321 "./util/configlexer.lex" +#line 348 "util/configlexer.lex" { YDVAR(1, VAR_UNBLOCK_LAN_ZONES) } YY_BREAK -case 117: +case 138: YY_RULE_SETUP -#line 322 "./util/configlexer.lex" +#line 349 "util/configlexer.lex" +{ YDVAR(1, VAR_INSECURE_LAN_ZONES) } + YY_BREAK +case 139: +YY_RULE_SETUP +#line 350 "util/configlexer.lex" { YDVAR(1, VAR_STATISTICS_INTERVAL) } YY_BREAK -case 118: +case 140: YY_RULE_SETUP -#line 323 "./util/configlexer.lex" +#line 351 "util/configlexer.lex" { YDVAR(1, VAR_STATISTICS_CUMULATIVE) } YY_BREAK -case 119: +case 141: YY_RULE_SETUP -#line 324 "./util/configlexer.lex" +#line 352 "util/configlexer.lex" { YDVAR(1, VAR_EXTENDED_STATISTICS) } YY_BREAK -case 120: +case 142: +YY_RULE_SETUP +#line 353 "util/configlexer.lex" +{ YDVAR(1, VAR_SHM_ENABLE) } + YY_BREAK +case 143: YY_RULE_SETUP -#line 325 "./util/configlexer.lex" +#line 354 "util/configlexer.lex" +{ YDVAR(1, VAR_SHM_KEY) } + YY_BREAK +case 144: +YY_RULE_SETUP +#line 355 "util/configlexer.lex" { YDVAR(0, VAR_REMOTE_CONTROL) } YY_BREAK -case 121: +case 145: YY_RULE_SETUP -#line 326 "./util/configlexer.lex" +#line 356 "util/configlexer.lex" { YDVAR(1, VAR_CONTROL_ENABLE) } YY_BREAK -case 122: +case 146: YY_RULE_SETUP -#line 327 "./util/configlexer.lex" +#line 357 "util/configlexer.lex" { YDVAR(1, VAR_CONTROL_INTERFACE) } YY_BREAK -case 123: +case 147: YY_RULE_SETUP -#line 328 "./util/configlexer.lex" +#line 358 "util/configlexer.lex" { YDVAR(1, VAR_CONTROL_PORT) } YY_BREAK -case 124: +case 148: YY_RULE_SETUP -#line 329 "./util/configlexer.lex" +#line 359 "util/configlexer.lex" { YDVAR(1, VAR_CONTROL_USE_CERT) } YY_BREAK -case 125: +case 149: YY_RULE_SETUP -#line 330 "./util/configlexer.lex" +#line 360 "util/configlexer.lex" { YDVAR(1, VAR_SERVER_KEY_FILE) } YY_BREAK -case 126: +case 150: YY_RULE_SETUP -#line 331 "./util/configlexer.lex" +#line 361 "util/configlexer.lex" { YDVAR(1, VAR_SERVER_CERT_FILE) } YY_BREAK -case 127: +case 151: YY_RULE_SETUP -#line 332 "./util/configlexer.lex" +#line 362 "util/configlexer.lex" { YDVAR(1, VAR_CONTROL_KEY_FILE) } YY_BREAK -case 128: +case 152: YY_RULE_SETUP -#line 333 "./util/configlexer.lex" +#line 363 "util/configlexer.lex" { YDVAR(1, VAR_CONTROL_CERT_FILE) } YY_BREAK -case 129: +case 153: YY_RULE_SETUP -#line 334 "./util/configlexer.lex" +#line 364 "util/configlexer.lex" { YDVAR(1, VAR_PYTHON_SCRIPT) } YY_BREAK -case 130: +case 154: YY_RULE_SETUP -#line 335 "./util/configlexer.lex" +#line 365 "util/configlexer.lex" { YDVAR(0, VAR_PYTHON) } YY_BREAK -case 131: +case 155: YY_RULE_SETUP -#line 336 "./util/configlexer.lex" +#line 366 "util/configlexer.lex" { YDVAR(1, VAR_DOMAIN_INSECURE) } YY_BREAK -case 132: +case 156: YY_RULE_SETUP -#line 337 "./util/configlexer.lex" +#line 367 "util/configlexer.lex" { YDVAR(1, VAR_MINIMAL_RESPONSES) } YY_BREAK -case 133: +case 157: YY_RULE_SETUP -#line 338 "./util/configlexer.lex" +#line 368 "util/configlexer.lex" { YDVAR(1, VAR_RRSET_ROUNDROBIN) } YY_BREAK -case 134: +case 158: YY_RULE_SETUP -#line 339 "./util/configlexer.lex" +#line 369 "util/configlexer.lex" { YDVAR(1, VAR_MAX_UDP_SIZE) } YY_BREAK -case 135: +case 159: YY_RULE_SETUP -#line 340 "./util/configlexer.lex" +#line 370 "util/configlexer.lex" { YDVAR(1, VAR_DNS64_PREFIX) } YY_BREAK -case 136: +case 160: YY_RULE_SETUP -#line 341 "./util/configlexer.lex" +#line 371 "util/configlexer.lex" { YDVAR(1, VAR_DNS64_SYNTHALL) } YY_BREAK -case 137: +case 161: +YY_RULE_SETUP +#line 372 "util/configlexer.lex" +{ YDVAR(1, VAR_DEFINE_TAG) } + YY_BREAK +case 162: +YY_RULE_SETUP +#line 373 "util/configlexer.lex" +{ YDVAR(2, VAR_LOCAL_ZONE_TAG) } + YY_BREAK +case 163: +YY_RULE_SETUP +#line 374 "util/configlexer.lex" +{ YDVAR(2, VAR_ACCESS_CONTROL_TAG) } + YY_BREAK +case 164: +YY_RULE_SETUP +#line 375 "util/configlexer.lex" +{ YDVAR(3, VAR_ACCESS_CONTROL_TAG_ACTION) } + YY_BREAK +case 165: +YY_RULE_SETUP +#line 376 "util/configlexer.lex" +{ YDVAR(3, VAR_ACCESS_CONTROL_TAG_DATA) } + YY_BREAK +case 166: +YY_RULE_SETUP +#line 377 "util/configlexer.lex" +{ YDVAR(2, VAR_ACCESS_CONTROL_VIEW) } + YY_BREAK +case 167: +YY_RULE_SETUP +#line 378 "util/configlexer.lex" +{ YDVAR(3, VAR_LOCAL_ZONE_OVERRIDE) } + YY_BREAK +case 168: YY_RULE_SETUP -#line 342 "./util/configlexer.lex" +#line 379 "util/configlexer.lex" { YDVAR(0, VAR_DNSTAP) } YY_BREAK -case 138: +case 169: YY_RULE_SETUP -#line 343 "./util/configlexer.lex" +#line 380 "util/configlexer.lex" { YDVAR(1, VAR_DNSTAP_ENABLE) } YY_BREAK -case 139: +case 170: YY_RULE_SETUP -#line 344 "./util/configlexer.lex" +#line 381 "util/configlexer.lex" { YDVAR(1, VAR_DNSTAP_SOCKET_PATH) } YY_BREAK -case 140: +case 171: YY_RULE_SETUP -#line 345 "./util/configlexer.lex" +#line 382 "util/configlexer.lex" { YDVAR(1, VAR_DNSTAP_SEND_IDENTITY) } YY_BREAK -case 141: +case 172: YY_RULE_SETUP -#line 346 "./util/configlexer.lex" +#line 383 "util/configlexer.lex" { YDVAR(1, VAR_DNSTAP_SEND_VERSION) } YY_BREAK -case 142: +case 173: YY_RULE_SETUP -#line 347 "./util/configlexer.lex" +#line 384 "util/configlexer.lex" { YDVAR(1, VAR_DNSTAP_IDENTITY) } YY_BREAK -case 143: +case 174: YY_RULE_SETUP -#line 348 "./util/configlexer.lex" +#line 385 "util/configlexer.lex" { YDVAR(1, VAR_DNSTAP_VERSION) } YY_BREAK -case 144: +case 175: YY_RULE_SETUP -#line 349 "./util/configlexer.lex" +#line 386 "util/configlexer.lex" { YDVAR(1, VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES) } YY_BREAK -case 145: +case 176: YY_RULE_SETUP -#line 351 "./util/configlexer.lex" +#line 388 "util/configlexer.lex" { YDVAR(1, VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES) } YY_BREAK -case 146: +case 177: YY_RULE_SETUP -#line 353 "./util/configlexer.lex" +#line 390 "util/configlexer.lex" { YDVAR(1, VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES) } YY_BREAK -case 147: +case 178: YY_RULE_SETUP -#line 355 "./util/configlexer.lex" +#line 392 "util/configlexer.lex" { YDVAR(1, VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES) } YY_BREAK -case 148: +case 179: YY_RULE_SETUP -#line 357 "./util/configlexer.lex" +#line 394 "util/configlexer.lex" { YDVAR(1, VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES) } YY_BREAK -case 149: +case 180: YY_RULE_SETUP -#line 359 "./util/configlexer.lex" +#line 396 "util/configlexer.lex" { YDVAR(1, VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES) } YY_BREAK -case 150: +case 181: YY_RULE_SETUP -#line 361 "./util/configlexer.lex" +#line 398 "util/configlexer.lex" +{ YDVAR(1, VAR_DISABLE_DNSSEC_LAME_CHECK) } + YY_BREAK +case 182: +YY_RULE_SETUP +#line 399 "util/configlexer.lex" +{ YDVAR(1, VAR_IP_RATELIMIT) } + YY_BREAK +case 183: +YY_RULE_SETUP +#line 400 "util/configlexer.lex" { YDVAR(1, VAR_RATELIMIT) } YY_BREAK -case 151: +case 184: +YY_RULE_SETUP +#line 401 "util/configlexer.lex" +{ YDVAR(1, VAR_IP_RATELIMIT_SLABS) } + YY_BREAK +case 185: YY_RULE_SETUP -#line 362 "./util/configlexer.lex" +#line 402 "util/configlexer.lex" { YDVAR(1, VAR_RATELIMIT_SLABS) } YY_BREAK -case 152: +case 186: YY_RULE_SETUP -#line 363 "./util/configlexer.lex" +#line 403 "util/configlexer.lex" +{ YDVAR(1, VAR_IP_RATELIMIT_SIZE) } + YY_BREAK +case 187: +YY_RULE_SETUP +#line 404 "util/configlexer.lex" { YDVAR(1, VAR_RATELIMIT_SIZE) } YY_BREAK -case 153: +case 188: YY_RULE_SETUP -#line 364 "./util/configlexer.lex" +#line 405 "util/configlexer.lex" { YDVAR(2, VAR_RATELIMIT_FOR_DOMAIN) } YY_BREAK -case 154: +case 189: YY_RULE_SETUP -#line 365 "./util/configlexer.lex" +#line 406 "util/configlexer.lex" { YDVAR(2, VAR_RATELIMIT_BELOW_DOMAIN) } YY_BREAK -case 155: +case 190: +YY_RULE_SETUP +#line 407 "util/configlexer.lex" +{ YDVAR(1, VAR_IP_RATELIMIT_FACTOR) } + YY_BREAK +case 191: YY_RULE_SETUP -#line 366 "./util/configlexer.lex" +#line 408 "util/configlexer.lex" { YDVAR(1, VAR_RATELIMIT_FACTOR) } YY_BREAK -case 156: -/* rule 156 can match eol */ +case 192: +YY_RULE_SETUP +#line 409 "util/configlexer.lex" +{ YDVAR(2, VAR_RESPONSE_IP_TAG) } + YY_BREAK +case 193: +YY_RULE_SETUP +#line 410 "util/configlexer.lex" +{ YDVAR(2, VAR_RESPONSE_IP) } + YY_BREAK +case 194: +YY_RULE_SETUP +#line 411 "util/configlexer.lex" +{ YDVAR(2, VAR_RESPONSE_IP_DATA) } + YY_BREAK +case 195: +YY_RULE_SETUP +#line 412 "util/configlexer.lex" +{ YDVAR(0, VAR_DNSCRYPT) } + YY_BREAK +case 196: +YY_RULE_SETUP +#line 413 "util/configlexer.lex" +{ YDVAR(1, VAR_DNSCRYPT_ENABLE) } + YY_BREAK +case 197: +YY_RULE_SETUP +#line 414 "util/configlexer.lex" +{ YDVAR(1, VAR_DNSCRYPT_PORT) } + YY_BREAK +case 198: +YY_RULE_SETUP +#line 415 "util/configlexer.lex" +{ YDVAR(1, VAR_DNSCRYPT_PROVIDER) } + YY_BREAK +case 199: +YY_RULE_SETUP +#line 416 "util/configlexer.lex" +{ YDVAR(1, VAR_DNSCRYPT_SECRET_KEY) } + YY_BREAK +case 200: +YY_RULE_SETUP +#line 417 "util/configlexer.lex" +{ YDVAR(1, VAR_DNSCRYPT_PROVIDER_CERT) } + YY_BREAK +case 201: +/* rule 201 can match eol */ YY_RULE_SETUP -#line 367 "./util/configlexer.lex" +#line 418 "util/configlexer.lex" { LEXOUT(("NL\n")); cfg_parser->line++; } YY_BREAK /* Quoted strings. Strip leading and ending quotes */ -case 157: +case 202: YY_RULE_SETUP -#line 370 "./util/configlexer.lex" +#line 421 "util/configlexer.lex" { BEGIN(quotedstring); LEXOUT(("QS ")); } YY_BREAK case YY_STATE_EOF(quotedstring): -#line 371 "./util/configlexer.lex" +#line 422 "util/configlexer.lex" { yyerror("EOF inside quoted string"); if(--num_args == 0) { BEGIN(INITIAL); } else { BEGIN(val); } } YY_BREAK -case 158: +case 203: YY_RULE_SETUP -#line 376 "./util/configlexer.lex" +#line 427 "util/configlexer.lex" { LEXOUT(("STR(%s) ", yytext)); yymore(); } YY_BREAK -case 159: -/* rule 159 can match eol */ +case 204: +/* rule 204 can match eol */ YY_RULE_SETUP -#line 377 "./util/configlexer.lex" +#line 428 "util/configlexer.lex" { yyerror("newline inside quoted string, no end \""); cfg_parser->line++; BEGIN(INITIAL); } YY_BREAK -case 160: +case 205: YY_RULE_SETUP -#line 379 "./util/configlexer.lex" +#line 430 "util/configlexer.lex" { LEXOUT(("QE ")); if(--num_args == 0) { BEGIN(INITIAL); } @@ -3108,34 +4097,34 @@ YY_RULE_SETUP } YY_BREAK /* Single Quoted strings. Strip leading and ending quotes */ -case 161: +case 206: YY_RULE_SETUP -#line 391 "./util/configlexer.lex" +#line 442 "util/configlexer.lex" { BEGIN(singlequotedstr); LEXOUT(("SQS ")); } YY_BREAK case YY_STATE_EOF(singlequotedstr): -#line 392 "./util/configlexer.lex" +#line 443 "util/configlexer.lex" { yyerror("EOF inside quoted string"); if(--num_args == 0) { BEGIN(INITIAL); } else { BEGIN(val); } } YY_BREAK -case 162: +case 207: YY_RULE_SETUP -#line 397 "./util/configlexer.lex" +#line 448 "util/configlexer.lex" { LEXOUT(("STR(%s) ", yytext)); yymore(); } YY_BREAK -case 163: -/* rule 163 can match eol */ +case 208: +/* rule 208 can match eol */ YY_RULE_SETUP -#line 398 "./util/configlexer.lex" +#line 449 "util/configlexer.lex" { yyerror("newline inside quoted string, no end '"); cfg_parser->line++; BEGIN(INITIAL); } YY_BREAK -case 164: +case 209: YY_RULE_SETUP -#line 400 "./util/configlexer.lex" +#line 451 "util/configlexer.lex" { LEXOUT(("SQE ")); if(--num_args == 0) { BEGIN(INITIAL); } @@ -3148,38 +4137,38 @@ YY_RULE_SETUP } YY_BREAK /* include: directive */ -case 165: +case 210: YY_RULE_SETUP -#line 412 "./util/configlexer.lex" +#line 463 "util/configlexer.lex" { LEXOUT(("v(%s) ", yytext)); inc_prev = YYSTATE; BEGIN(include); } YY_BREAK case YY_STATE_EOF(include): -#line 414 "./util/configlexer.lex" +#line 465 "util/configlexer.lex" { yyerror("EOF inside include directive"); BEGIN(inc_prev); } YY_BREAK -case 166: +case 211: YY_RULE_SETUP -#line 418 "./util/configlexer.lex" +#line 469 "util/configlexer.lex" { LEXOUT(("ISP ")); /* ignore */ } YY_BREAK -case 167: -/* rule 167 can match eol */ +case 212: +/* rule 212 can match eol */ YY_RULE_SETUP -#line 419 "./util/configlexer.lex" +#line 470 "util/configlexer.lex" { LEXOUT(("NL\n")); cfg_parser->line++;} YY_BREAK -case 168: +case 213: YY_RULE_SETUP -#line 420 "./util/configlexer.lex" +#line 471 "util/configlexer.lex" { LEXOUT(("IQS ")); BEGIN(include_quoted); } YY_BREAK -case 169: +case 214: YY_RULE_SETUP -#line 421 "./util/configlexer.lex" +#line 472 "util/configlexer.lex" { LEXOUT(("Iunquotedstr(%s) ", yytext)); config_start_include_glob(yytext); @@ -3187,27 +4176,27 @@ YY_RULE_SETUP } YY_BREAK case YY_STATE_EOF(include_quoted): -#line 426 "./util/configlexer.lex" +#line 477 "util/configlexer.lex" { yyerror("EOF inside quoted string"); BEGIN(inc_prev); } YY_BREAK -case 170: +case 215: YY_RULE_SETUP -#line 430 "./util/configlexer.lex" +#line 481 "util/configlexer.lex" { LEXOUT(("ISTR(%s) ", yytext)); yymore(); } YY_BREAK -case 171: -/* rule 171 can match eol */ +case 216: +/* rule 216 can match eol */ YY_RULE_SETUP -#line 431 "./util/configlexer.lex" +#line 482 "util/configlexer.lex" { yyerror("newline before \" in include name"); cfg_parser->line++; BEGIN(inc_prev); } YY_BREAK -case 172: +case 217: YY_RULE_SETUP -#line 433 "./util/configlexer.lex" +#line 484 "util/configlexer.lex" { LEXOUT(("IQE ")); yytext[yyleng - 1] = '\0'; @@ -3217,7 +4206,7 @@ YY_RULE_SETUP YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(val): -#line 439 "./util/configlexer.lex" +#line 490 "util/configlexer.lex" { LEXOUT(("LEXEOF ")); yy_set_bol(1); /* Set beginning of line, so "^" rules match. */ @@ -3229,33 +4218,33 @@ case YY_STATE_EOF(val): } } YY_BREAK -case 173: +case 218: YY_RULE_SETUP -#line 450 "./util/configlexer.lex" +#line 501 "util/configlexer.lex" { LEXOUT(("unquotedstr(%s) ", yytext)); if(--num_args == 0) { BEGIN(INITIAL); } yylval.str = strdup(yytext); return STRING_ARG; } YY_BREAK -case 174: +case 219: YY_RULE_SETUP -#line 454 "./util/configlexer.lex" +#line 505 "util/configlexer.lex" { ub_c_error_msg("unknown keyword '%s'", yytext); } YY_BREAK -case 175: +case 220: YY_RULE_SETUP -#line 458 "./util/configlexer.lex" +#line 509 "util/configlexer.lex" { ub_c_error_msg("stray '%s'", yytext); } YY_BREAK -case 176: +case 221: YY_RULE_SETUP -#line 462 "./util/configlexer.lex" +#line 513 "util/configlexer.lex" ECHO; YY_BREAK -#line 3257 "<stdout>" +#line 4246 "<stdout>" case YY_END_OF_BUFFER: { @@ -3384,6 +4373,7 @@ ECHO; "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -3395,9 +4385,9 @@ ECHO; */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + yy_size_t number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -3426,7 +4416,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -3439,7 +4429,7 @@ static int yy_get_next_buffer (void) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -3529,14 +4519,14 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -3545,7 +4535,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1771 ) + if ( yy_current_state >= 2165 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -3561,10 +4551,10 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -3573,15 +4563,19 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1771 ) + if ( yy_current_state >= 2165 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 1770); + yy_is_jam = (yy_current_state == 2164); return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -3731,7 +4725,7 @@ static void yy_load_buffer_state (void) if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. @@ -3886,7 +4880,7 @@ static void yyensure_buffer_stack (void) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); @@ -3903,7 +4897,7 @@ static void yyensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc @@ -4011,7 +5005,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -4022,7 +5016,7 @@ static void yy_fatal_error (yyconst char* msg ) do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ + yy_size_t yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ @@ -4077,29 +5071,29 @@ char *yyget_text (void) } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void yyset_lineno (int line_number ) +void yyset_lineno (int _line_number ) { - yylineno = line_number; + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ -void yyset_in (FILE * in_str ) +void yyset_in (FILE * _in_str ) { - yyin = in_str ; + yyin = _in_str ; } -void yyset_out (FILE * out_str ) +void yyset_out (FILE * _out_str ) { - yyout = out_str ; + yyout = _out_str ; } int yyget_debug (void) @@ -4107,9 +5101,9 @@ int yyget_debug (void) return yy_flex_debug; } -void yyset_debug (int bdebug ) +void yyset_debug (int _bdebug ) { - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) @@ -4169,7 +5163,8 @@ int yylex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -4178,7 +5173,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -4188,11 +5183,12 @@ static int yy_flex_strlen (yyconst char * s ) void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -4205,12 +5201,12 @@ void *yyrealloc (void * ptr, yy_size_t size ) void yyfree (void * ptr ) { - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 462 "./util/configlexer.lex" +#line 513 "util/configlexer.lex" diff --git a/external/unbound/util/configlexer.lex b/external/unbound/util/configlexer.lex index 6637943e4..a6323f2c1 100644 --- a/external/unbound/util/configlexer.lex +++ b/external/unbound/util/configlexer.lex @@ -7,6 +7,12 @@ * See LICENSE for the license. * */ + +/* because flex keeps having sign-unsigned compare problems that are unfixed*/ +#if defined(__clang__)||(defined(__GNUC__)&&((__GNUC__ >4)||(defined(__GNUC_MINOR__)&&(__GNUC__ ==4)&&(__GNUC_MINOR__ >=2)))) +#pragma GCC diagnostic ignored "-Wsign-compare" +#endif + #include <ctype.h> #include <string.h> #include <strings.h> @@ -63,7 +69,7 @@ static void config_start_include(const char* filename) ub_c_error_msg("too many include files"); return; } - if(strlen(filename) == 0) { + if(*filename == '\0') { ub_c_error_msg("empty include file name"); return; } @@ -206,6 +212,7 @@ SQANY [^\'\n\r\\]|\\. LEXOUT(("comment(%s) ", yytext)); /* ignore */ } server{COLON} { YDVAR(0, VAR_SERVER) } qname-minimisation{COLON} { YDVAR(1, VAR_QNAME_MINIMISATION) } +qname-minimisation-strict{COLON} { YDVAR(1, VAR_QNAME_MINIMISATION_STRICT) } num-threads{COLON} { YDVAR(1, VAR_NUM_THREADS) } verbosity{COLON} { YDVAR(1, VAR_VERBOSITY) } port{COLON} { YDVAR(1, VAR_PORT) } @@ -216,13 +223,17 @@ outgoing-num-tcp{COLON} { YDVAR(1, VAR_OUTGOING_NUM_TCP) } incoming-num-tcp{COLON} { YDVAR(1, VAR_INCOMING_NUM_TCP) } do-ip4{COLON} { YDVAR(1, VAR_DO_IP4) } do-ip6{COLON} { YDVAR(1, VAR_DO_IP6) } +prefer-ip6{COLON} { YDVAR(1, VAR_PREFER_IP6) } do-udp{COLON} { YDVAR(1, VAR_DO_UDP) } do-tcp{COLON} { YDVAR(1, VAR_DO_TCP) } tcp-upstream{COLON} { YDVAR(1, VAR_TCP_UPSTREAM) } +tcp-mss{COLON} { YDVAR(1, VAR_TCP_MSS) } +outgoing-tcp-mss{COLON} { YDVAR(1, VAR_OUTGOING_TCP_MSS) } ssl-upstream{COLON} { YDVAR(1, VAR_SSL_UPSTREAM) } ssl-service-key{COLON} { YDVAR(1, VAR_SSL_SERVICE_KEY) } ssl-service-pem{COLON} { YDVAR(1, VAR_SSL_SERVICE_PEM) } ssl-port{COLON} { YDVAR(1, VAR_SSL_PORT) } +use-systemd{COLON} { YDVAR(1, VAR_USE_SYSTEMD) } do-daemonize{COLON} { YDVAR(1, VAR_DO_DAEMONIZE) } interface{COLON} { YDVAR(1, VAR_INTERFACE) } ip-address{COLON} { YDVAR(1, VAR_INTERFACE) } @@ -232,6 +243,7 @@ so-rcvbuf{COLON} { YDVAR(1, VAR_SO_RCVBUF) } so-sndbuf{COLON} { YDVAR(1, VAR_SO_SNDBUF) } so-reuseport{COLON} { YDVAR(1, VAR_SO_REUSEPORT) } ip-transparent{COLON} { YDVAR(1, VAR_IP_TRANSPARENT) } +ip-freebind{COLON} { YDVAR(1, VAR_IP_FREEBIND) } chroot{COLON} { YDVAR(1, VAR_CHROOT) } username{COLON} { YDVAR(1, VAR_USERNAME) } directory{COLON} { YDVAR(1, VAR_DIRECTORY) } @@ -277,15 +289,25 @@ stub-addr{COLON} { YDVAR(1, VAR_STUB_ADDR) } stub-host{COLON} { YDVAR(1, VAR_STUB_HOST) } stub-prime{COLON} { YDVAR(1, VAR_STUB_PRIME) } stub-first{COLON} { YDVAR(1, VAR_STUB_FIRST) } +stub-ssl-upstream{COLON} { YDVAR(1, VAR_STUB_SSL_UPSTREAM) } forward-zone{COLON} { YDVAR(0, VAR_FORWARD_ZONE) } forward-addr{COLON} { YDVAR(1, VAR_FORWARD_ADDR) } forward-host{COLON} { YDVAR(1, VAR_FORWARD_HOST) } forward-first{COLON} { YDVAR(1, VAR_FORWARD_FIRST) } +forward-ssl-upstream{COLON} { YDVAR(1, VAR_FORWARD_SSL_UPSTREAM) } +view{COLON} { YDVAR(0, VAR_VIEW) } +view-first{COLON} { YDVAR(1, VAR_VIEW_FIRST) } do-not-query-address{COLON} { YDVAR(1, VAR_DO_NOT_QUERY_ADDRESS) } do-not-query-localhost{COLON} { YDVAR(1, VAR_DO_NOT_QUERY_LOCALHOST) } access-control{COLON} { YDVAR(2, VAR_ACCESS_CONTROL) } +send-client-subnet{COLON} { YDVAR(1, VAR_SEND_CLIENT_SUBNET) } +client-subnet-always-forward{COLON} { YDVAR(1, VAR_CLIENT_SUBNET_ALWAYS_FORWARD) } +client-subnet-opcode{COLON} { YDVAR(1, VAR_CLIENT_SUBNET_OPCODE) } +max-client-subnet-ipv4{COLON} { YDVAR(1, VAR_MAX_CLIENT_SUBNET_IPV4) } +max-client-subnet-ipv6{COLON} { YDVAR(1, VAR_MAX_CLIENT_SUBNET_IPV6) } hide-identity{COLON} { YDVAR(1, VAR_HIDE_IDENTITY) } hide-version{COLON} { YDVAR(1, VAR_HIDE_VERSION) } +hide-trustanchor{COLON} { YDVAR(1, VAR_HIDE_TRUSTANCHOR) } identity{COLON} { YDVAR(1, VAR_IDENTITY) } version{COLON} { YDVAR(1, VAR_VERSION) } module-config{COLON} { YDVAR(1, VAR_MODULE_CONF) } @@ -302,6 +324,9 @@ val-bogus-ttl{COLON} { YDVAR(1, VAR_BOGUS_TTL) } val-clean-additional{COLON} { YDVAR(1, VAR_VAL_CLEAN_ADDITIONAL) } val-permissive-mode{COLON} { YDVAR(1, VAR_VAL_PERMISSIVE_MODE) } ignore-cd-flag{COLON} { YDVAR(1, VAR_IGNORE_CD_FLAG) } +serve-expired{COLON} { YDVAR(1, VAR_SERVE_EXPIRED) } +fake-dsa{COLON} { YDVAR(1, VAR_FAKE_DSA) } +fake-sha1{COLON} { YDVAR(1, VAR_FAKE_SHA1) } val-log-level{COLON} { YDVAR(1, VAR_VAL_LOG_LEVEL) } key-cache-size{COLON} { YDVAR(1, VAR_KEY_CACHE_SIZE) } key-cache-slabs{COLON} { YDVAR(1, VAR_KEY_CACHE_SLABS) } @@ -313,15 +338,20 @@ del-holddown{COLON} { YDVAR(1, VAR_DEL_HOLDDOWN) } keep-missing{COLON} { YDVAR(1, VAR_KEEP_MISSING) } permit-small-holddown{COLON} { YDVAR(1, VAR_PERMIT_SMALL_HOLDDOWN) } use-syslog{COLON} { YDVAR(1, VAR_USE_SYSLOG) } +log-identity{COLON} { YDVAR(1, VAR_LOG_IDENTITY) } log-time-ascii{COLON} { YDVAR(1, VAR_LOG_TIME_ASCII) } log-queries{COLON} { YDVAR(1, VAR_LOG_QUERIES) } +log-replies{COLON} { YDVAR(1, VAR_LOG_REPLIES) } local-zone{COLON} { YDVAR(2, VAR_LOCAL_ZONE) } local-data{COLON} { YDVAR(1, VAR_LOCAL_DATA) } local-data-ptr{COLON} { YDVAR(1, VAR_LOCAL_DATA_PTR) } unblock-lan-zones{COLON} { YDVAR(1, VAR_UNBLOCK_LAN_ZONES) } +insecure-lan-zones{COLON} { YDVAR(1, VAR_INSECURE_LAN_ZONES) } statistics-interval{COLON} { YDVAR(1, VAR_STATISTICS_INTERVAL) } statistics-cumulative{COLON} { YDVAR(1, VAR_STATISTICS_CUMULATIVE) } extended-statistics{COLON} { YDVAR(1, VAR_EXTENDED_STATISTICS) } +shm-enable{COLON} { YDVAR(1, VAR_SHM_ENABLE) } +shm-key{COLON} { YDVAR(1, VAR_SHM_KEY) } remote-control{COLON} { YDVAR(0, VAR_REMOTE_CONTROL) } control-enable{COLON} { YDVAR(1, VAR_CONTROL_ENABLE) } control-interface{COLON} { YDVAR(1, VAR_CONTROL_INTERFACE) } @@ -339,6 +369,13 @@ rrset-roundrobin{COLON} { YDVAR(1, VAR_RRSET_ROUNDROBIN) } max-udp-size{COLON} { YDVAR(1, VAR_MAX_UDP_SIZE) } dns64-prefix{COLON} { YDVAR(1, VAR_DNS64_PREFIX) } dns64-synthall{COLON} { YDVAR(1, VAR_DNS64_SYNTHALL) } +define-tag{COLON} { YDVAR(1, VAR_DEFINE_TAG) } +local-zone-tag{COLON} { YDVAR(2, VAR_LOCAL_ZONE_TAG) } +access-control-tag{COLON} { YDVAR(2, VAR_ACCESS_CONTROL_TAG) } +access-control-tag-action{COLON} { YDVAR(3, VAR_ACCESS_CONTROL_TAG_ACTION) } +access-control-tag-data{COLON} { YDVAR(3, VAR_ACCESS_CONTROL_TAG_DATA) } +access-control-view{COLON} { YDVAR(2, VAR_ACCESS_CONTROL_VIEW) } +local-zone-override{COLON} { YDVAR(3, VAR_LOCAL_ZONE_OVERRIDE) } dnstap{COLON} { YDVAR(0, VAR_DNSTAP) } dnstap-enable{COLON} { YDVAR(1, VAR_DNSTAP_ENABLE) } dnstap-socket-path{COLON} { YDVAR(1, VAR_DNSTAP_SOCKET_PATH) } @@ -358,12 +395,26 @@ dnstap-log-forwarder-query-messages{COLON} { YDVAR(1, VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES) } dnstap-log-forwarder-response-messages{COLON} { YDVAR(1, VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES) } +disable-dnssec-lame-check{COLON} { YDVAR(1, VAR_DISABLE_DNSSEC_LAME_CHECK) } +ip-ratelimit{COLON} { YDVAR(1, VAR_IP_RATELIMIT) } ratelimit{COLON} { YDVAR(1, VAR_RATELIMIT) } +ip-ratelimit-slabs{COLON} { YDVAR(1, VAR_IP_RATELIMIT_SLABS) } ratelimit-slabs{COLON} { YDVAR(1, VAR_RATELIMIT_SLABS) } +ip-ratelimit-size{COLON} { YDVAR(1, VAR_IP_RATELIMIT_SIZE) } ratelimit-size{COLON} { YDVAR(1, VAR_RATELIMIT_SIZE) } ratelimit-for-domain{COLON} { YDVAR(2, VAR_RATELIMIT_FOR_DOMAIN) } ratelimit-below-domain{COLON} { YDVAR(2, VAR_RATELIMIT_BELOW_DOMAIN) } +ip-ratelimit-factor{COLON} { YDVAR(1, VAR_IP_RATELIMIT_FACTOR) } ratelimit-factor{COLON} { YDVAR(1, VAR_RATELIMIT_FACTOR) } +response-ip-tag{COLON} { YDVAR(2, VAR_RESPONSE_IP_TAG) } +response-ip{COLON} { YDVAR(2, VAR_RESPONSE_IP) } +response-ip-data{COLON} { YDVAR(2, VAR_RESPONSE_IP_DATA) } +dnscrypt{COLON} { YDVAR(0, VAR_DNSCRYPT) } +dnscrypt-enable{COLON} { YDVAR(1, VAR_DNSCRYPT_ENABLE) } +dnscrypt-port{COLON} { YDVAR(1, VAR_DNSCRYPT_PORT) } +dnscrypt-provider{COLON} { YDVAR(1, VAR_DNSCRYPT_PROVIDER) } +dnscrypt-secret-key{COLON} { YDVAR(1, VAR_DNSCRYPT_SECRET_KEY) } +dnscrypt-provider-cert{COLON} { YDVAR(1, VAR_DNSCRYPT_PROVIDER_CERT) } <INITIAL,val>{NEWLINE} { LEXOUT(("NL\n")); cfg_parser->line++; } /* Quoted strings. Strip leading and ending quotes */ diff --git a/external/unbound/util/configparser.c b/external/unbound/util/configparser.c index 50346f6ee..f70b948b7 100644 --- a/external/unbound/util/configparser.c +++ b/external/unbound/util/configparser.c @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7" +#define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -62,8 +62,7 @@ /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 38 "./util/configparser.y" +#line 38 "util/configparser.y" /* yacc.c:339 */ #include "config.h" @@ -80,6 +79,8 @@ int ub_c_lex(void); void ub_c_error(const char *message); +static void validate_respip_action(const char* action); + /* these need to be global, otherwise they cannot be used inside yacc */ extern struct config_parser_state* cfg_parser; @@ -90,14 +91,13 @@ extern struct config_parser_state* cfg_parser; #endif -/* Line 371 of yacc.c */ -#line 95 "util/configparser.c" +#line 95 "util/configparser.c" /* yacc.c:339 */ -# ifndef YY_NULL +# ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# define YY_NULLPTR nullptr # else -# define YY_NULL 0 +# define YY_NULLPTR 0 # endif # endif @@ -113,7 +113,7 @@ extern struct config_parser_state* cfg_parser; by #include "configparser.h". */ #ifndef YY_YY_UTIL_CONFIGPARSER_H_INCLUDED # define YY_YY_UTIL_CONFIGPARSER_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -121,173 +121,217 @@ extern struct config_parser_state* cfg_parser; extern int yydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - SPACE = 258, - LETTER = 259, - NEWLINE = 260, - COMMENT = 261, - COLON = 262, - ANY = 263, - ZONESTR = 264, - STRING_ARG = 265, - VAR_SERVER = 266, - VAR_VERBOSITY = 267, - VAR_NUM_THREADS = 268, - VAR_PORT = 269, - VAR_OUTGOING_RANGE = 270, - VAR_INTERFACE = 271, - VAR_DO_IP4 = 272, - VAR_DO_IP6 = 273, - VAR_DO_UDP = 274, - VAR_DO_TCP = 275, - VAR_CHROOT = 276, - VAR_USERNAME = 277, - VAR_DIRECTORY = 278, - VAR_LOGFILE = 279, - VAR_PIDFILE = 280, - VAR_MSG_CACHE_SIZE = 281, - VAR_MSG_CACHE_SLABS = 282, - VAR_NUM_QUERIES_PER_THREAD = 283, - VAR_RRSET_CACHE_SIZE = 284, - VAR_RRSET_CACHE_SLABS = 285, - VAR_OUTGOING_NUM_TCP = 286, - VAR_INFRA_HOST_TTL = 287, - VAR_INFRA_LAME_TTL = 288, - VAR_INFRA_CACHE_SLABS = 289, - VAR_INFRA_CACHE_NUMHOSTS = 290, - VAR_INFRA_CACHE_LAME_SIZE = 291, - VAR_NAME = 292, - VAR_STUB_ZONE = 293, - VAR_STUB_HOST = 294, - VAR_STUB_ADDR = 295, - VAR_TARGET_FETCH_POLICY = 296, - VAR_HARDEN_SHORT_BUFSIZE = 297, - VAR_HARDEN_LARGE_QUERIES = 298, - VAR_FORWARD_ZONE = 299, - VAR_FORWARD_HOST = 300, - VAR_FORWARD_ADDR = 301, - VAR_DO_NOT_QUERY_ADDRESS = 302, - VAR_HIDE_IDENTITY = 303, - VAR_HIDE_VERSION = 304, - VAR_IDENTITY = 305, - VAR_VERSION = 306, - VAR_HARDEN_GLUE = 307, - VAR_MODULE_CONF = 308, - VAR_TRUST_ANCHOR_FILE = 309, - VAR_TRUST_ANCHOR = 310, - VAR_VAL_OVERRIDE_DATE = 311, - VAR_BOGUS_TTL = 312, - VAR_VAL_CLEAN_ADDITIONAL = 313, - VAR_VAL_PERMISSIVE_MODE = 314, - VAR_INCOMING_NUM_TCP = 315, - VAR_MSG_BUFFER_SIZE = 316, - VAR_KEY_CACHE_SIZE = 317, - VAR_KEY_CACHE_SLABS = 318, - VAR_TRUSTED_KEYS_FILE = 319, - VAR_VAL_NSEC3_KEYSIZE_ITERATIONS = 320, - VAR_USE_SYSLOG = 321, - VAR_OUTGOING_INTERFACE = 322, - VAR_ROOT_HINTS = 323, - VAR_DO_NOT_QUERY_LOCALHOST = 324, - VAR_CACHE_MAX_TTL = 325, - VAR_HARDEN_DNSSEC_STRIPPED = 326, - VAR_ACCESS_CONTROL = 327, - VAR_LOCAL_ZONE = 328, - VAR_LOCAL_DATA = 329, - VAR_INTERFACE_AUTOMATIC = 330, - VAR_STATISTICS_INTERVAL = 331, - VAR_DO_DAEMONIZE = 332, - VAR_USE_CAPS_FOR_ID = 333, - VAR_STATISTICS_CUMULATIVE = 334, - VAR_OUTGOING_PORT_PERMIT = 335, - VAR_OUTGOING_PORT_AVOID = 336, - VAR_DLV_ANCHOR_FILE = 337, - VAR_DLV_ANCHOR = 338, - VAR_NEG_CACHE_SIZE = 339, - VAR_HARDEN_REFERRAL_PATH = 340, - VAR_PRIVATE_ADDRESS = 341, - VAR_PRIVATE_DOMAIN = 342, - VAR_REMOTE_CONTROL = 343, - VAR_CONTROL_ENABLE = 344, - VAR_CONTROL_INTERFACE = 345, - VAR_CONTROL_PORT = 346, - VAR_SERVER_KEY_FILE = 347, - VAR_SERVER_CERT_FILE = 348, - VAR_CONTROL_KEY_FILE = 349, - VAR_CONTROL_CERT_FILE = 350, - VAR_CONTROL_USE_CERT = 351, - VAR_EXTENDED_STATISTICS = 352, - VAR_LOCAL_DATA_PTR = 353, - VAR_JOSTLE_TIMEOUT = 354, - VAR_STUB_PRIME = 355, - VAR_UNWANTED_REPLY_THRESHOLD = 356, - VAR_LOG_TIME_ASCII = 357, - VAR_DOMAIN_INSECURE = 358, - VAR_PYTHON = 359, - VAR_PYTHON_SCRIPT = 360, - VAR_VAL_SIG_SKEW_MIN = 361, - VAR_VAL_SIG_SKEW_MAX = 362, - VAR_CACHE_MIN_TTL = 363, - VAR_VAL_LOG_LEVEL = 364, - VAR_AUTO_TRUST_ANCHOR_FILE = 365, - VAR_KEEP_MISSING = 366, - VAR_ADD_HOLDDOWN = 367, - VAR_DEL_HOLDDOWN = 368, - VAR_SO_RCVBUF = 369, - VAR_EDNS_BUFFER_SIZE = 370, - VAR_PREFETCH = 371, - VAR_PREFETCH_KEY = 372, - VAR_SO_SNDBUF = 373, - VAR_SO_REUSEPORT = 374, - VAR_HARDEN_BELOW_NXDOMAIN = 375, - VAR_IGNORE_CD_FLAG = 376, - VAR_LOG_QUERIES = 377, - VAR_TCP_UPSTREAM = 378, - VAR_SSL_UPSTREAM = 379, - VAR_SSL_SERVICE_KEY = 380, - VAR_SSL_SERVICE_PEM = 381, - VAR_SSL_PORT = 382, - VAR_FORWARD_FIRST = 383, - VAR_STUB_FIRST = 384, - VAR_MINIMAL_RESPONSES = 385, - VAR_RRSET_ROUNDROBIN = 386, - VAR_MAX_UDP_SIZE = 387, - VAR_DELAY_CLOSE = 388, - VAR_UNBLOCK_LAN_ZONES = 389, - VAR_INFRA_CACHE_MIN_RTT = 390, - VAR_DNS64_PREFIX = 391, - VAR_DNS64_SYNTHALL = 392, - VAR_DNSTAP = 393, - VAR_DNSTAP_ENABLE = 394, - VAR_DNSTAP_SOCKET_PATH = 395, - VAR_DNSTAP_SEND_IDENTITY = 396, - VAR_DNSTAP_SEND_VERSION = 397, - VAR_DNSTAP_IDENTITY = 398, - VAR_DNSTAP_VERSION = 399, - VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES = 400, - VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES = 401, - VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES = 402, - VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES = 403, - VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES = 404, - VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES = 405, - VAR_HARDEN_ALGO_DOWNGRADE = 406, - VAR_IP_TRANSPARENT = 407, - VAR_RATELIMIT = 408, - VAR_RATELIMIT_SLABS = 409, - VAR_RATELIMIT_SIZE = 410, - VAR_RATELIMIT_FOR_DOMAIN = 411, - VAR_RATELIMIT_BELOW_DOMAIN = 412, - VAR_RATELIMIT_FACTOR = 413, - VAR_CAPS_WHITELIST = 414, - VAR_CACHE_MAX_NEGATIVE_TTL = 415, - VAR_PERMIT_SMALL_HOLDDOWN = 416, - VAR_QNAME_MINIMISATION = 417 - }; + enum yytokentype + { + SPACE = 258, + LETTER = 259, + NEWLINE = 260, + COMMENT = 261, + COLON = 262, + ANY = 263, + ZONESTR = 264, + STRING_ARG = 265, + VAR_SERVER = 266, + VAR_VERBOSITY = 267, + VAR_NUM_THREADS = 268, + VAR_PORT = 269, + VAR_OUTGOING_RANGE = 270, + VAR_INTERFACE = 271, + VAR_DO_IP4 = 272, + VAR_DO_IP6 = 273, + VAR_PREFER_IP6 = 274, + VAR_DO_UDP = 275, + VAR_DO_TCP = 276, + VAR_TCP_MSS = 277, + VAR_OUTGOING_TCP_MSS = 278, + VAR_CHROOT = 279, + VAR_USERNAME = 280, + VAR_DIRECTORY = 281, + VAR_LOGFILE = 282, + VAR_PIDFILE = 283, + VAR_MSG_CACHE_SIZE = 284, + VAR_MSG_CACHE_SLABS = 285, + VAR_NUM_QUERIES_PER_THREAD = 286, + VAR_RRSET_CACHE_SIZE = 287, + VAR_RRSET_CACHE_SLABS = 288, + VAR_OUTGOING_NUM_TCP = 289, + VAR_INFRA_HOST_TTL = 290, + VAR_INFRA_LAME_TTL = 291, + VAR_INFRA_CACHE_SLABS = 292, + VAR_INFRA_CACHE_NUMHOSTS = 293, + VAR_INFRA_CACHE_LAME_SIZE = 294, + VAR_NAME = 295, + VAR_STUB_ZONE = 296, + VAR_STUB_HOST = 297, + VAR_STUB_ADDR = 298, + VAR_TARGET_FETCH_POLICY = 299, + VAR_HARDEN_SHORT_BUFSIZE = 300, + VAR_HARDEN_LARGE_QUERIES = 301, + VAR_FORWARD_ZONE = 302, + VAR_FORWARD_HOST = 303, + VAR_FORWARD_ADDR = 304, + VAR_DO_NOT_QUERY_ADDRESS = 305, + VAR_HIDE_IDENTITY = 306, + VAR_HIDE_VERSION = 307, + VAR_IDENTITY = 308, + VAR_VERSION = 309, + VAR_HARDEN_GLUE = 310, + VAR_MODULE_CONF = 311, + VAR_TRUST_ANCHOR_FILE = 312, + VAR_TRUST_ANCHOR = 313, + VAR_VAL_OVERRIDE_DATE = 314, + VAR_BOGUS_TTL = 315, + VAR_VAL_CLEAN_ADDITIONAL = 316, + VAR_VAL_PERMISSIVE_MODE = 317, + VAR_INCOMING_NUM_TCP = 318, + VAR_MSG_BUFFER_SIZE = 319, + VAR_KEY_CACHE_SIZE = 320, + VAR_KEY_CACHE_SLABS = 321, + VAR_TRUSTED_KEYS_FILE = 322, + VAR_VAL_NSEC3_KEYSIZE_ITERATIONS = 323, + VAR_USE_SYSLOG = 324, + VAR_OUTGOING_INTERFACE = 325, + VAR_ROOT_HINTS = 326, + VAR_DO_NOT_QUERY_LOCALHOST = 327, + VAR_CACHE_MAX_TTL = 328, + VAR_HARDEN_DNSSEC_STRIPPED = 329, + VAR_ACCESS_CONTROL = 330, + VAR_LOCAL_ZONE = 331, + VAR_LOCAL_DATA = 332, + VAR_INTERFACE_AUTOMATIC = 333, + VAR_STATISTICS_INTERVAL = 334, + VAR_DO_DAEMONIZE = 335, + VAR_USE_CAPS_FOR_ID = 336, + VAR_STATISTICS_CUMULATIVE = 337, + VAR_OUTGOING_PORT_PERMIT = 338, + VAR_OUTGOING_PORT_AVOID = 339, + VAR_DLV_ANCHOR_FILE = 340, + VAR_DLV_ANCHOR = 341, + VAR_NEG_CACHE_SIZE = 342, + VAR_HARDEN_REFERRAL_PATH = 343, + VAR_PRIVATE_ADDRESS = 344, + VAR_PRIVATE_DOMAIN = 345, + VAR_REMOTE_CONTROL = 346, + VAR_CONTROL_ENABLE = 347, + VAR_CONTROL_INTERFACE = 348, + VAR_CONTROL_PORT = 349, + VAR_SERVER_KEY_FILE = 350, + VAR_SERVER_CERT_FILE = 351, + VAR_CONTROL_KEY_FILE = 352, + VAR_CONTROL_CERT_FILE = 353, + VAR_CONTROL_USE_CERT = 354, + VAR_EXTENDED_STATISTICS = 355, + VAR_LOCAL_DATA_PTR = 356, + VAR_JOSTLE_TIMEOUT = 357, + VAR_STUB_PRIME = 358, + VAR_UNWANTED_REPLY_THRESHOLD = 359, + VAR_LOG_TIME_ASCII = 360, + VAR_DOMAIN_INSECURE = 361, + VAR_PYTHON = 362, + VAR_PYTHON_SCRIPT = 363, + VAR_VAL_SIG_SKEW_MIN = 364, + VAR_VAL_SIG_SKEW_MAX = 365, + VAR_CACHE_MIN_TTL = 366, + VAR_VAL_LOG_LEVEL = 367, + VAR_AUTO_TRUST_ANCHOR_FILE = 368, + VAR_KEEP_MISSING = 369, + VAR_ADD_HOLDDOWN = 370, + VAR_DEL_HOLDDOWN = 371, + VAR_SO_RCVBUF = 372, + VAR_EDNS_BUFFER_SIZE = 373, + VAR_PREFETCH = 374, + VAR_PREFETCH_KEY = 375, + VAR_SO_SNDBUF = 376, + VAR_SO_REUSEPORT = 377, + VAR_HARDEN_BELOW_NXDOMAIN = 378, + VAR_IGNORE_CD_FLAG = 379, + VAR_LOG_QUERIES = 380, + VAR_LOG_REPLIES = 381, + VAR_TCP_UPSTREAM = 382, + VAR_SSL_UPSTREAM = 383, + VAR_SSL_SERVICE_KEY = 384, + VAR_SSL_SERVICE_PEM = 385, + VAR_SSL_PORT = 386, + VAR_FORWARD_FIRST = 387, + VAR_STUB_SSL_UPSTREAM = 388, + VAR_FORWARD_SSL_UPSTREAM = 389, + VAR_STUB_FIRST = 390, + VAR_MINIMAL_RESPONSES = 391, + VAR_RRSET_ROUNDROBIN = 392, + VAR_MAX_UDP_SIZE = 393, + VAR_DELAY_CLOSE = 394, + VAR_UNBLOCK_LAN_ZONES = 395, + VAR_INSECURE_LAN_ZONES = 396, + VAR_INFRA_CACHE_MIN_RTT = 397, + VAR_DNS64_PREFIX = 398, + VAR_DNS64_SYNTHALL = 399, + VAR_DNSTAP = 400, + VAR_DNSTAP_ENABLE = 401, + VAR_DNSTAP_SOCKET_PATH = 402, + VAR_DNSTAP_SEND_IDENTITY = 403, + VAR_DNSTAP_SEND_VERSION = 404, + VAR_DNSTAP_IDENTITY = 405, + VAR_DNSTAP_VERSION = 406, + VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES = 407, + VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES = 408, + VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES = 409, + VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES = 410, + VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES = 411, + VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES = 412, + VAR_RESPONSE_IP_TAG = 413, + VAR_RESPONSE_IP = 414, + VAR_RESPONSE_IP_DATA = 415, + VAR_HARDEN_ALGO_DOWNGRADE = 416, + VAR_IP_TRANSPARENT = 417, + VAR_DISABLE_DNSSEC_LAME_CHECK = 418, + VAR_IP_RATELIMIT = 419, + VAR_IP_RATELIMIT_SLABS = 420, + VAR_IP_RATELIMIT_SIZE = 421, + VAR_RATELIMIT = 422, + VAR_RATELIMIT_SLABS = 423, + VAR_RATELIMIT_SIZE = 424, + VAR_RATELIMIT_FOR_DOMAIN = 425, + VAR_RATELIMIT_BELOW_DOMAIN = 426, + VAR_IP_RATELIMIT_FACTOR = 427, + VAR_RATELIMIT_FACTOR = 428, + VAR_SEND_CLIENT_SUBNET = 429, + VAR_CLIENT_SUBNET_ALWAYS_FORWARD = 430, + VAR_CLIENT_SUBNET_OPCODE = 431, + VAR_MAX_CLIENT_SUBNET_IPV4 = 432, + VAR_MAX_CLIENT_SUBNET_IPV6 = 433, + VAR_CAPS_WHITELIST = 434, + VAR_CACHE_MAX_NEGATIVE_TTL = 435, + VAR_PERMIT_SMALL_HOLDDOWN = 436, + VAR_QNAME_MINIMISATION = 437, + VAR_QNAME_MINIMISATION_STRICT = 438, + VAR_IP_FREEBIND = 439, + VAR_DEFINE_TAG = 440, + VAR_LOCAL_ZONE_TAG = 441, + VAR_ACCESS_CONTROL_TAG = 442, + VAR_LOCAL_ZONE_OVERRIDE = 443, + VAR_ACCESS_CONTROL_TAG_ACTION = 444, + VAR_ACCESS_CONTROL_TAG_DATA = 445, + VAR_VIEW = 446, + VAR_ACCESS_CONTROL_VIEW = 447, + VAR_VIEW_FIRST = 448, + VAR_SERVE_EXPIRED = 449, + VAR_FAKE_DSA = 450, + VAR_FAKE_SHA1 = 451, + VAR_LOG_IDENTITY = 452, + VAR_HIDE_TRUSTANCHOR = 453, + VAR_USE_SYSTEMD = 454, + VAR_SHM_ENABLE = 455, + VAR_SHM_KEY = 456, + VAR_DNSCRYPT = 457, + VAR_DNSCRYPT_ENABLE = 458, + VAR_DNSCRYPT_PORT = 459, + VAR_DNSCRYPT_PROVIDER = 460, + VAR_DNSCRYPT_SECRET_KEY = 461, + VAR_DNSCRYPT_PROVIDER_CERT = 462 + }; #endif /* Tokens. */ #define SPACE 258 @@ -306,192 +350,223 @@ extern int yydebug; #define VAR_INTERFACE 271 #define VAR_DO_IP4 272 #define VAR_DO_IP6 273 -#define VAR_DO_UDP 274 -#define VAR_DO_TCP 275 -#define VAR_CHROOT 276 -#define VAR_USERNAME 277 -#define VAR_DIRECTORY 278 -#define VAR_LOGFILE 279 -#define VAR_PIDFILE 280 -#define VAR_MSG_CACHE_SIZE 281 -#define VAR_MSG_CACHE_SLABS 282 -#define VAR_NUM_QUERIES_PER_THREAD 283 -#define VAR_RRSET_CACHE_SIZE 284 -#define VAR_RRSET_CACHE_SLABS 285 -#define VAR_OUTGOING_NUM_TCP 286 -#define VAR_INFRA_HOST_TTL 287 -#define VAR_INFRA_LAME_TTL 288 -#define VAR_INFRA_CACHE_SLABS 289 -#define VAR_INFRA_CACHE_NUMHOSTS 290 -#define VAR_INFRA_CACHE_LAME_SIZE 291 -#define VAR_NAME 292 -#define VAR_STUB_ZONE 293 -#define VAR_STUB_HOST 294 -#define VAR_STUB_ADDR 295 -#define VAR_TARGET_FETCH_POLICY 296 -#define VAR_HARDEN_SHORT_BUFSIZE 297 -#define VAR_HARDEN_LARGE_QUERIES 298 -#define VAR_FORWARD_ZONE 299 -#define VAR_FORWARD_HOST 300 -#define VAR_FORWARD_ADDR 301 -#define VAR_DO_NOT_QUERY_ADDRESS 302 -#define VAR_HIDE_IDENTITY 303 -#define VAR_HIDE_VERSION 304 -#define VAR_IDENTITY 305 -#define VAR_VERSION 306 -#define VAR_HARDEN_GLUE 307 -#define VAR_MODULE_CONF 308 -#define VAR_TRUST_ANCHOR_FILE 309 -#define VAR_TRUST_ANCHOR 310 -#define VAR_VAL_OVERRIDE_DATE 311 -#define VAR_BOGUS_TTL 312 -#define VAR_VAL_CLEAN_ADDITIONAL 313 -#define VAR_VAL_PERMISSIVE_MODE 314 -#define VAR_INCOMING_NUM_TCP 315 -#define VAR_MSG_BUFFER_SIZE 316 -#define VAR_KEY_CACHE_SIZE 317 -#define VAR_KEY_CACHE_SLABS 318 -#define VAR_TRUSTED_KEYS_FILE 319 -#define VAR_VAL_NSEC3_KEYSIZE_ITERATIONS 320 -#define VAR_USE_SYSLOG 321 -#define VAR_OUTGOING_INTERFACE 322 -#define VAR_ROOT_HINTS 323 -#define VAR_DO_NOT_QUERY_LOCALHOST 324 -#define VAR_CACHE_MAX_TTL 325 -#define VAR_HARDEN_DNSSEC_STRIPPED 326 -#define VAR_ACCESS_CONTROL 327 -#define VAR_LOCAL_ZONE 328 -#define VAR_LOCAL_DATA 329 -#define VAR_INTERFACE_AUTOMATIC 330 -#define VAR_STATISTICS_INTERVAL 331 -#define VAR_DO_DAEMONIZE 332 -#define VAR_USE_CAPS_FOR_ID 333 -#define VAR_STATISTICS_CUMULATIVE 334 -#define VAR_OUTGOING_PORT_PERMIT 335 -#define VAR_OUTGOING_PORT_AVOID 336 -#define VAR_DLV_ANCHOR_FILE 337 -#define VAR_DLV_ANCHOR 338 -#define VAR_NEG_CACHE_SIZE 339 -#define VAR_HARDEN_REFERRAL_PATH 340 -#define VAR_PRIVATE_ADDRESS 341 -#define VAR_PRIVATE_DOMAIN 342 -#define VAR_REMOTE_CONTROL 343 -#define VAR_CONTROL_ENABLE 344 -#define VAR_CONTROL_INTERFACE 345 -#define VAR_CONTROL_PORT 346 -#define VAR_SERVER_KEY_FILE 347 -#define VAR_SERVER_CERT_FILE 348 -#define VAR_CONTROL_KEY_FILE 349 -#define VAR_CONTROL_CERT_FILE 350 -#define VAR_CONTROL_USE_CERT 351 -#define VAR_EXTENDED_STATISTICS 352 -#define VAR_LOCAL_DATA_PTR 353 -#define VAR_JOSTLE_TIMEOUT 354 -#define VAR_STUB_PRIME 355 -#define VAR_UNWANTED_REPLY_THRESHOLD 356 -#define VAR_LOG_TIME_ASCII 357 -#define VAR_DOMAIN_INSECURE 358 -#define VAR_PYTHON 359 -#define VAR_PYTHON_SCRIPT 360 -#define VAR_VAL_SIG_SKEW_MIN 361 -#define VAR_VAL_SIG_SKEW_MAX 362 -#define VAR_CACHE_MIN_TTL 363 -#define VAR_VAL_LOG_LEVEL 364 -#define VAR_AUTO_TRUST_ANCHOR_FILE 365 -#define VAR_KEEP_MISSING 366 -#define VAR_ADD_HOLDDOWN 367 -#define VAR_DEL_HOLDDOWN 368 -#define VAR_SO_RCVBUF 369 -#define VAR_EDNS_BUFFER_SIZE 370 -#define VAR_PREFETCH 371 -#define VAR_PREFETCH_KEY 372 -#define VAR_SO_SNDBUF 373 -#define VAR_SO_REUSEPORT 374 -#define VAR_HARDEN_BELOW_NXDOMAIN 375 -#define VAR_IGNORE_CD_FLAG 376 -#define VAR_LOG_QUERIES 377 -#define VAR_TCP_UPSTREAM 378 -#define VAR_SSL_UPSTREAM 379 -#define VAR_SSL_SERVICE_KEY 380 -#define VAR_SSL_SERVICE_PEM 381 -#define VAR_SSL_PORT 382 -#define VAR_FORWARD_FIRST 383 -#define VAR_STUB_FIRST 384 -#define VAR_MINIMAL_RESPONSES 385 -#define VAR_RRSET_ROUNDROBIN 386 -#define VAR_MAX_UDP_SIZE 387 -#define VAR_DELAY_CLOSE 388 -#define VAR_UNBLOCK_LAN_ZONES 389 -#define VAR_INFRA_CACHE_MIN_RTT 390 -#define VAR_DNS64_PREFIX 391 -#define VAR_DNS64_SYNTHALL 392 -#define VAR_DNSTAP 393 -#define VAR_DNSTAP_ENABLE 394 -#define VAR_DNSTAP_SOCKET_PATH 395 -#define VAR_DNSTAP_SEND_IDENTITY 396 -#define VAR_DNSTAP_SEND_VERSION 397 -#define VAR_DNSTAP_IDENTITY 398 -#define VAR_DNSTAP_VERSION 399 -#define VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES 400 -#define VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES 401 -#define VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES 402 -#define VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES 403 -#define VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES 404 -#define VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES 405 -#define VAR_HARDEN_ALGO_DOWNGRADE 406 -#define VAR_IP_TRANSPARENT 407 -#define VAR_RATELIMIT 408 -#define VAR_RATELIMIT_SLABS 409 -#define VAR_RATELIMIT_SIZE 410 -#define VAR_RATELIMIT_FOR_DOMAIN 411 -#define VAR_RATELIMIT_BELOW_DOMAIN 412 -#define VAR_RATELIMIT_FACTOR 413 -#define VAR_CAPS_WHITELIST 414 -#define VAR_CACHE_MAX_NEGATIVE_TTL 415 -#define VAR_PERMIT_SMALL_HOLDDOWN 416 -#define VAR_QNAME_MINIMISATION 417 - - - +#define VAR_PREFER_IP6 274 +#define VAR_DO_UDP 275 +#define VAR_DO_TCP 276 +#define VAR_TCP_MSS 277 +#define VAR_OUTGOING_TCP_MSS 278 +#define VAR_CHROOT 279 +#define VAR_USERNAME 280 +#define VAR_DIRECTORY 281 +#define VAR_LOGFILE 282 +#define VAR_PIDFILE 283 +#define VAR_MSG_CACHE_SIZE 284 +#define VAR_MSG_CACHE_SLABS 285 +#define VAR_NUM_QUERIES_PER_THREAD 286 +#define VAR_RRSET_CACHE_SIZE 287 +#define VAR_RRSET_CACHE_SLABS 288 +#define VAR_OUTGOING_NUM_TCP 289 +#define VAR_INFRA_HOST_TTL 290 +#define VAR_INFRA_LAME_TTL 291 +#define VAR_INFRA_CACHE_SLABS 292 +#define VAR_INFRA_CACHE_NUMHOSTS 293 +#define VAR_INFRA_CACHE_LAME_SIZE 294 +#define VAR_NAME 295 +#define VAR_STUB_ZONE 296 +#define VAR_STUB_HOST 297 +#define VAR_STUB_ADDR 298 +#define VAR_TARGET_FETCH_POLICY 299 +#define VAR_HARDEN_SHORT_BUFSIZE 300 +#define VAR_HARDEN_LARGE_QUERIES 301 +#define VAR_FORWARD_ZONE 302 +#define VAR_FORWARD_HOST 303 +#define VAR_FORWARD_ADDR 304 +#define VAR_DO_NOT_QUERY_ADDRESS 305 +#define VAR_HIDE_IDENTITY 306 +#define VAR_HIDE_VERSION 307 +#define VAR_IDENTITY 308 +#define VAR_VERSION 309 +#define VAR_HARDEN_GLUE 310 +#define VAR_MODULE_CONF 311 +#define VAR_TRUST_ANCHOR_FILE 312 +#define VAR_TRUST_ANCHOR 313 +#define VAR_VAL_OVERRIDE_DATE 314 +#define VAR_BOGUS_TTL 315 +#define VAR_VAL_CLEAN_ADDITIONAL 316 +#define VAR_VAL_PERMISSIVE_MODE 317 +#define VAR_INCOMING_NUM_TCP 318 +#define VAR_MSG_BUFFER_SIZE 319 +#define VAR_KEY_CACHE_SIZE 320 +#define VAR_KEY_CACHE_SLABS 321 +#define VAR_TRUSTED_KEYS_FILE 322 +#define VAR_VAL_NSEC3_KEYSIZE_ITERATIONS 323 +#define VAR_USE_SYSLOG 324 +#define VAR_OUTGOING_INTERFACE 325 +#define VAR_ROOT_HINTS 326 +#define VAR_DO_NOT_QUERY_LOCALHOST 327 +#define VAR_CACHE_MAX_TTL 328 +#define VAR_HARDEN_DNSSEC_STRIPPED 329 +#define VAR_ACCESS_CONTROL 330 +#define VAR_LOCAL_ZONE 331 +#define VAR_LOCAL_DATA 332 +#define VAR_INTERFACE_AUTOMATIC 333 +#define VAR_STATISTICS_INTERVAL 334 +#define VAR_DO_DAEMONIZE 335 +#define VAR_USE_CAPS_FOR_ID 336 +#define VAR_STATISTICS_CUMULATIVE 337 +#define VAR_OUTGOING_PORT_PERMIT 338 +#define VAR_OUTGOING_PORT_AVOID 339 +#define VAR_DLV_ANCHOR_FILE 340 +#define VAR_DLV_ANCHOR 341 +#define VAR_NEG_CACHE_SIZE 342 +#define VAR_HARDEN_REFERRAL_PATH 343 +#define VAR_PRIVATE_ADDRESS 344 +#define VAR_PRIVATE_DOMAIN 345 +#define VAR_REMOTE_CONTROL 346 +#define VAR_CONTROL_ENABLE 347 +#define VAR_CONTROL_INTERFACE 348 +#define VAR_CONTROL_PORT 349 +#define VAR_SERVER_KEY_FILE 350 +#define VAR_SERVER_CERT_FILE 351 +#define VAR_CONTROL_KEY_FILE 352 +#define VAR_CONTROL_CERT_FILE 353 +#define VAR_CONTROL_USE_CERT 354 +#define VAR_EXTENDED_STATISTICS 355 +#define VAR_LOCAL_DATA_PTR 356 +#define VAR_JOSTLE_TIMEOUT 357 +#define VAR_STUB_PRIME 358 +#define VAR_UNWANTED_REPLY_THRESHOLD 359 +#define VAR_LOG_TIME_ASCII 360 +#define VAR_DOMAIN_INSECURE 361 +#define VAR_PYTHON 362 +#define VAR_PYTHON_SCRIPT 363 +#define VAR_VAL_SIG_SKEW_MIN 364 +#define VAR_VAL_SIG_SKEW_MAX 365 +#define VAR_CACHE_MIN_TTL 366 +#define VAR_VAL_LOG_LEVEL 367 +#define VAR_AUTO_TRUST_ANCHOR_FILE 368 +#define VAR_KEEP_MISSING 369 +#define VAR_ADD_HOLDDOWN 370 +#define VAR_DEL_HOLDDOWN 371 +#define VAR_SO_RCVBUF 372 +#define VAR_EDNS_BUFFER_SIZE 373 +#define VAR_PREFETCH 374 +#define VAR_PREFETCH_KEY 375 +#define VAR_SO_SNDBUF 376 +#define VAR_SO_REUSEPORT 377 +#define VAR_HARDEN_BELOW_NXDOMAIN 378 +#define VAR_IGNORE_CD_FLAG 379 +#define VAR_LOG_QUERIES 380 +#define VAR_LOG_REPLIES 381 +#define VAR_TCP_UPSTREAM 382 +#define VAR_SSL_UPSTREAM 383 +#define VAR_SSL_SERVICE_KEY 384 +#define VAR_SSL_SERVICE_PEM 385 +#define VAR_SSL_PORT 386 +#define VAR_FORWARD_FIRST 387 +#define VAR_STUB_SSL_UPSTREAM 388 +#define VAR_FORWARD_SSL_UPSTREAM 389 +#define VAR_STUB_FIRST 390 +#define VAR_MINIMAL_RESPONSES 391 +#define VAR_RRSET_ROUNDROBIN 392 +#define VAR_MAX_UDP_SIZE 393 +#define VAR_DELAY_CLOSE 394 +#define VAR_UNBLOCK_LAN_ZONES 395 +#define VAR_INSECURE_LAN_ZONES 396 +#define VAR_INFRA_CACHE_MIN_RTT 397 +#define VAR_DNS64_PREFIX 398 +#define VAR_DNS64_SYNTHALL 399 +#define VAR_DNSTAP 400 +#define VAR_DNSTAP_ENABLE 401 +#define VAR_DNSTAP_SOCKET_PATH 402 +#define VAR_DNSTAP_SEND_IDENTITY 403 +#define VAR_DNSTAP_SEND_VERSION 404 +#define VAR_DNSTAP_IDENTITY 405 +#define VAR_DNSTAP_VERSION 406 +#define VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES 407 +#define VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES 408 +#define VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES 409 +#define VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES 410 +#define VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES 411 +#define VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES 412 +#define VAR_RESPONSE_IP_TAG 413 +#define VAR_RESPONSE_IP 414 +#define VAR_RESPONSE_IP_DATA 415 +#define VAR_HARDEN_ALGO_DOWNGRADE 416 +#define VAR_IP_TRANSPARENT 417 +#define VAR_DISABLE_DNSSEC_LAME_CHECK 418 +#define VAR_IP_RATELIMIT 419 +#define VAR_IP_RATELIMIT_SLABS 420 +#define VAR_IP_RATELIMIT_SIZE 421 +#define VAR_RATELIMIT 422 +#define VAR_RATELIMIT_SLABS 423 +#define VAR_RATELIMIT_SIZE 424 +#define VAR_RATELIMIT_FOR_DOMAIN 425 +#define VAR_RATELIMIT_BELOW_DOMAIN 426 +#define VAR_IP_RATELIMIT_FACTOR 427 +#define VAR_RATELIMIT_FACTOR 428 +#define VAR_SEND_CLIENT_SUBNET 429 +#define VAR_CLIENT_SUBNET_ALWAYS_FORWARD 430 +#define VAR_CLIENT_SUBNET_OPCODE 431 +#define VAR_MAX_CLIENT_SUBNET_IPV4 432 +#define VAR_MAX_CLIENT_SUBNET_IPV6 433 +#define VAR_CAPS_WHITELIST 434 +#define VAR_CACHE_MAX_NEGATIVE_TTL 435 +#define VAR_PERMIT_SMALL_HOLDDOWN 436 +#define VAR_QNAME_MINIMISATION 437 +#define VAR_QNAME_MINIMISATION_STRICT 438 +#define VAR_IP_FREEBIND 439 +#define VAR_DEFINE_TAG 440 +#define VAR_LOCAL_ZONE_TAG 441 +#define VAR_ACCESS_CONTROL_TAG 442 +#define VAR_LOCAL_ZONE_OVERRIDE 443 +#define VAR_ACCESS_CONTROL_TAG_ACTION 444 +#define VAR_ACCESS_CONTROL_TAG_DATA 445 +#define VAR_VIEW 446 +#define VAR_ACCESS_CONTROL_VIEW 447 +#define VAR_VIEW_FIRST 448 +#define VAR_SERVE_EXPIRED 449 +#define VAR_FAKE_DSA 450 +#define VAR_FAKE_SHA1 451 +#define VAR_LOG_IDENTITY 452 +#define VAR_HIDE_TRUSTANCHOR 453 +#define VAR_USE_SYSTEMD 454 +#define VAR_SHM_ENABLE 455 +#define VAR_SHM_KEY 456 +#define VAR_DNSCRYPT 457 +#define VAR_DNSCRYPT_ENABLE 458 +#define VAR_DNSCRYPT_PORT 459 +#define VAR_DNSCRYPT_PROVIDER 460 +#define VAR_DNSCRYPT_SECRET_KEY 461 +#define VAR_DNSCRYPT_PROVIDER_CERT 462 + +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 387 of yacc.c */ -#line 64 "./util/configparser.y" +#line 66 "util/configparser.y" /* yacc.c:355 */ char* str; +#line 553 "util/configparser.c" /* yacc.c:355 */ +}; -/* Line 387 of yacc.c */ -#line 467 "util/configparser.c" -} YYSTYPE; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE yylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_YY_UTIL_CONFIGPARSER_H_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 495 "util/configparser.c" +#line 570 "util/configparser.c" /* yacc.c:358 */ #ifdef short # undef short @@ -505,11 +580,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -529,8 +601,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -552,6 +623,33 @@ typedef short int yytype_int16; # endif #endif +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -559,23 +657,25 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + #if ! defined yyoverflow || YYERROR_VERBOSE @@ -594,8 +694,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -607,8 +706,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -624,7 +723,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -632,15 +731,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -650,7 +747,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -675,16 +772,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif @@ -703,7 +800,7 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -711,25 +808,27 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 305 +#define YYLAST 421 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 163 +#define YYNTOKENS 208 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 168 +#define YYNNTS 223 /* YYNRULES -- Number of rules. */ -#define YYNRULES 321 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 473 +#define YYNRULES 427 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 643 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 417 +#define YYMAXUTOK 462 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -773,170 +872,61 @@ static const yytype_uint8 yytranslate[] = 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162 + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207 }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 4, 7, 10, 13, 16, 19, 22, - 25, 27, 30, 31, 33, 35, 37, 39, 41, 43, - 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, - 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, - 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, - 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, - 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, - 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, - 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, - 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, - 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, - 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, - 245, 247, 249, 251, 253, 255, 257, 259, 261, 263, - 265, 267, 270, 271, 273, 275, 277, 279, 281, 283, - 286, 287, 289, 291, 293, 295, 298, 301, 304, 307, - 310, 313, 316, 319, 322, 325, 328, 331, 334, 337, - 340, 343, 346, 349, 352, 355, 358, 361, 364, 367, - 370, 373, 376, 379, 382, 385, 388, 391, 394, 397, - 400, 403, 406, 409, 412, 415, 418, 421, 424, 427, - 430, 433, 436, 439, 442, 445, 448, 451, 454, 457, - 460, 463, 466, 469, 472, 475, 478, 481, 484, 487, - 490, 493, 496, 499, 502, 505, 508, 511, 514, 517, - 520, 523, 526, 529, 532, 535, 538, 542, 545, 548, - 551, 554, 557, 560, 563, 566, 569, 572, 575, 578, - 581, 584, 587, 590, 593, 596, 599, 602, 606, 609, - 612, 615, 618, 621, 624, 627, 630, 633, 636, 640, - 644, 647, 650, 653, 656, 659, 662, 665, 668, 671, - 674, 677, 679, 682, 683, 685, 687, 689, 691, 693, - 695, 697, 699, 702, 705, 708, 711, 714, 717, 720, - 723, 725, 728, 729, 731, 733, 735, 737, 739, 741, - 743, 745, 747, 749, 751, 753, 756, 759, 762, 765, - 768, 771, 774, 777, 780, 783, 786, 789, 791, 794, - 795, 797 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 164, 0, -1, -1, 164, 165, -1, 166, 167, -1, - 169, 170, -1, 172, 173, -1, 327, 328, -1, 301, - 302, -1, 312, 313, -1, 11, -1, 167, 168, -1, - -1, 175, -1, 176, -1, 180, -1, 183, -1, 189, - -1, 190, -1, 191, -1, 192, -1, 181, -1, 202, - -1, 203, -1, 204, -1, 205, -1, 206, -1, 225, - -1, 226, -1, 227, -1, 231, -1, 232, -1, 186, - -1, 233, -1, 234, -1, 237, -1, 235, -1, 236, - -1, 239, -1, 240, -1, 241, -1, 254, -1, 215, - -1, 216, -1, 217, -1, 218, -1, 242, -1, 257, - -1, 211, -1, 213, -1, 258, -1, 264, -1, 265, - -1, 266, -1, 187, -1, 224, -1, 274, -1, 275, - -1, 212, -1, 269, -1, 199, -1, 182, -1, 207, - -1, 255, -1, 261, -1, 243, -1, 256, -1, 277, - -1, 278, -1, 188, -1, 177, -1, 198, -1, 247, - -1, 178, -1, 184, -1, 185, -1, 208, -1, 209, - -1, 276, -1, 245, -1, 249, -1, 250, -1, 179, - -1, 279, -1, 228, -1, 253, -1, 200, -1, 214, - -1, 259, -1, 260, -1, 263, -1, 268, -1, 210, - -1, 270, -1, 271, -1, 272, -1, 219, -1, 223, - -1, 251, -1, 252, -1, 220, -1, 244, -1, 267, - -1, 201, -1, 193, -1, 194, -1, 195, -1, 196, - -1, 197, -1, 280, -1, 281, -1, 282, -1, 221, - -1, 229, -1, 230, -1, 283, -1, 284, -1, 238, - -1, 246, -1, 222, -1, 285, -1, 287, -1, 286, - -1, 288, -1, 289, -1, 290, -1, 248, -1, 262, - -1, 273, -1, 291, -1, 38, -1, 170, 171, -1, - -1, 292, -1, 293, -1, 294, -1, 296, -1, 295, - -1, 44, -1, 173, 174, -1, -1, 297, -1, 298, - -1, 299, -1, 300, -1, 13, 10, -1, 12, 10, - -1, 76, 10, -1, 79, 10, -1, 97, 10, -1, - 14, 10, -1, 16, 10, -1, 67, 10, -1, 15, - 10, -1, 80, 10, -1, 81, 10, -1, 31, 10, - -1, 60, 10, -1, 75, 10, -1, 17, 10, -1, - 18, 10, -1, 19, 10, -1, 20, 10, -1, 123, - 10, -1, 124, 10, -1, 125, 10, -1, 126, 10, - -1, 127, 10, -1, 77, 10, -1, 66, 10, -1, - 102, 10, -1, 122, 10, -1, 21, 10, -1, 22, - 10, -1, 23, 10, -1, 24, 10, -1, 25, 10, - -1, 68, 10, -1, 82, 10, -1, 83, 10, -1, - 110, 10, -1, 54, 10, -1, 64, 10, -1, 55, - 10, -1, 103, 10, -1, 48, 10, -1, 49, 10, - -1, 50, 10, -1, 51, 10, -1, 114, 10, -1, - 118, 10, -1, 119, 10, -1, 152, 10, -1, 115, - 10, -1, 61, 10, -1, 26, 10, -1, 27, 10, - -1, 28, 10, -1, 99, 10, -1, 133, 10, -1, - 134, 10, -1, 29, 10, -1, 30, 10, -1, 32, - 10, -1, 33, 10, -1, 35, 10, -1, 36, 10, - -1, 34, 10, -1, 135, 10, -1, 41, 10, -1, - 42, 10, -1, 43, 10, -1, 52, 10, -1, 71, - 10, -1, 120, 10, -1, 85, 10, -1, 151, 10, - -1, 78, 10, -1, 159, 10, -1, 86, 10, -1, - 87, 10, -1, 116, 10, -1, 117, 10, -1, 101, - 10, -1, 47, 10, -1, 69, 10, -1, 72, 10, - 10, -1, 53, 10, -1, 56, 10, -1, 106, 10, - -1, 107, 10, -1, 70, 10, -1, 160, 10, -1, - 108, 10, -1, 57, 10, -1, 58, 10, -1, 59, - 10, -1, 121, 10, -1, 109, 10, -1, 65, 10, - -1, 112, 10, -1, 113, 10, -1, 111, 10, -1, - 161, 10, -1, 62, 10, -1, 63, 10, -1, 84, - 10, -1, 73, 10, 10, -1, 74, 10, -1, 98, - 10, -1, 130, 10, -1, 131, 10, -1, 132, 10, - -1, 136, 10, -1, 137, 10, -1, 153, 10, -1, - 155, 10, -1, 154, 10, -1, 156, 10, 10, -1, - 157, 10, 10, -1, 158, 10, -1, 162, 10, -1, - 37, 10, -1, 39, 10, -1, 40, 10, -1, 129, - 10, -1, 100, 10, -1, 37, 10, -1, 45, 10, - -1, 46, 10, -1, 128, 10, -1, 88, -1, 302, - 303, -1, -1, 304, -1, 306, -1, 305, -1, 308, - -1, 309, -1, 310, -1, 311, -1, 307, -1, 89, - 10, -1, 91, 10, -1, 90, 10, -1, 96, 10, - -1, 92, 10, -1, 93, 10, -1, 94, 10, -1, - 95, 10, -1, 138, -1, 313, 314, -1, -1, 315, - -1, 316, -1, 317, -1, 318, -1, 319, -1, 320, - -1, 321, -1, 322, -1, 323, -1, 324, -1, 325, - -1, 326, -1, 139, 10, -1, 140, 10, -1, 141, - 10, -1, 142, 10, -1, 143, 10, -1, 144, 10, - -1, 145, 10, -1, 146, 10, -1, 147, 10, -1, - 148, 10, -1, 149, 10, -1, 150, 10, -1, 104, - -1, 328, 329, -1, -1, 330, -1, 105, 10, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 128, 128, 128, 129, 129, 130, 130, 131, 131, - 135, 140, 141, 142, 142, 142, 143, 143, 144, 144, - 144, 145, 145, 145, 146, 146, 146, 147, 147, 148, - 148, 149, 149, 150, 150, 151, 151, 152, 152, 153, - 153, 154, 154, 155, 155, 155, 156, 156, 156, 157, - 157, 157, 158, 158, 159, 159, 160, 160, 161, 161, - 162, 162, 162, 163, 163, 164, 164, 165, 165, 165, - 166, 166, 167, 167, 168, 168, 169, 169, 169, 170, - 170, 171, 171, 172, 172, 173, 173, 174, 174, 175, - 175, 175, 176, 176, 177, 177, 177, 178, 178, 178, - 179, 179, 179, 180, 180, 180, 181, 181, 181, 182, - 182, 182, 183, 183, 183, 184, 184, 185, 185, 186, - 186, 186, 187, 187, 188, 188, 189, 189, 190, 190, - 192, 204, 205, 206, 206, 206, 206, 206, 208, 220, - 221, 222, 222, 222, 222, 224, 233, 242, 253, 262, - 271, 280, 293, 308, 317, 326, 335, 344, 353, 362, - 371, 380, 389, 398, 407, 416, 423, 430, 439, 448, - 462, 471, 480, 487, 494, 501, 509, 516, 523, 530, - 537, 545, 553, 561, 568, 575, 584, 593, 600, 607, - 615, 623, 633, 643, 656, 667, 675, 688, 697, 706, - 715, 725, 733, 746, 755, 763, 772, 780, 793, 802, - 809, 819, 829, 839, 849, 859, 869, 879, 889, 896, - 903, 910, 919, 928, 937, 944, 954, 971, 978, 996, - 1009, 1022, 1031, 1040, 1049, 1058, 1068, 1078, 1087, 1096, - 1103, 1112, 1121, 1130, 1139, 1147, 1160, 1168, 1192, 1199, - 1214, 1224, 1234, 1241, 1248, 1257, 1266, 1274, 1287, 1300, - 1313, 1322, 1332, 1342, 1349, 1356, 1365, 1375, 1385, 1392, - 1399, 1408, 1413, 1414, 1415, 1415, 1415, 1416, 1416, 1416, - 1417, 1417, 1419, 1429, 1438, 1445, 1455, 1462, 1469, 1476, - 1483, 1488, 1489, 1490, 1490, 1491, 1491, 1492, 1492, 1493, - 1494, 1495, 1496, 1497, 1498, 1500, 1508, 1515, 1523, 1531, - 1538, 1545, 1554, 1563, 1572, 1581, 1590, 1599, 1604, 1605, - 1606, 1608 + 0, 149, 149, 149, 150, 150, 151, 151, 152, 152, + 152, 154, 158, 163, 164, 165, 165, 165, 166, 166, + 167, 167, 168, 168, 169, 169, 170, 170, 170, 171, + 171, 171, 172, 172, 173, 173, 174, 174, 175, 175, + 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, + 180, 181, 181, 181, 182, 182, 182, 183, 183, 184, + 184, 185, 185, 186, 186, 187, 187, 187, 188, 188, + 189, 189, 190, 190, 190, 191, 191, 192, 192, 193, + 193, 194, 194, 194, 195, 195, 196, 196, 197, 197, + 198, 198, 199, 199, 200, 200, 200, 201, 201, 202, + 202, 202, 203, 203, 203, 204, 204, 204, 205, 205, + 205, 205, 206, 206, 206, 207, 207, 207, 208, 208, + 209, 209, 210, 210, 211, 211, 212, 212, 212, 213, + 213, 214, 214, 215, 216, 216, 217, 217, 218, 219, + 220, 220, 221, 221, 222, 222, 223, 223, 223, 224, + 224, 225, 225, 226, 226, 227, 227, 228, 228, 228, + 229, 229, 229, 230, 230, 230, 231, 233, 245, 246, + 247, 247, 247, 247, 247, 248, 250, 262, 263, 264, + 264, 264, 264, 265, 267, 281, 282, 283, 283, 283, + 283, 284, 284, 284, 286, 295, 304, 315, 324, 333, + 342, 353, 362, 374, 389, 400, 417, 434, 447, 462, + 471, 480, 489, 498, 507, 516, 525, 534, 543, 552, + 561, 570, 579, 588, 597, 604, 611, 620, 629, 638, + 652, 661, 670, 679, 686, 693, 719, 727, 734, 741, + 748, 755, 763, 771, 779, 786, 793, 802, 811, 820, + 827, 834, 842, 850, 860, 870, 880, 893, 904, 912, + 925, 934, 943, 952, 962, 972, 980, 993, 1002, 1010, + 1019, 1027, 1040, 1049, 1056, 1066, 1076, 1086, 1096, 1106, + 1116, 1126, 1136, 1143, 1150, 1157, 1166, 1175, 1184, 1191, + 1201, 1218, 1225, 1243, 1256, 1269, 1278, 1287, 1296, 1305, + 1315, 1325, 1334, 1343, 1356, 1369, 1378, 1385, 1394, 1403, + 1412, 1421, 1429, 1442, 1450, 1478, 1485, 1500, 1510, 1520, + 1527, 1534, 1543, 1557, 1576, 1595, 1607, 1619, 1631, 1642, + 1661, 1671, 1680, 1688, 1696, 1709, 1722, 1735, 1748, 1757, + 1766, 1776, 1786, 1796, 1803, 1810, 1819, 1829, 1839, 1849, + 1856, 1863, 1872, 1882, 1892, 1921, 1931, 1939, 1948, 1963, + 1972, 1977, 1978, 1979, 1979, 1979, 1980, 1980, 1980, 1981, + 1981, 1983, 1993, 2002, 2009, 2019, 2026, 2033, 2040, 2047, + 2052, 2053, 2054, 2054, 2055, 2055, 2056, 2056, 2057, 2058, + 2059, 2060, 2061, 2062, 2064, 2072, 2079, 2087, 2095, 2102, + 2109, 2118, 2127, 2136, 2145, 2154, 2163, 2168, 2169, 2170, + 2172, 2178, 2188, 2195, 2204, 2212, 2218, 2219, 2221, 2221, + 2221, 2222, 2222, 2224, 2233, 2243, 2250, 2257 }; #endif @@ -948,12 +938,12 @@ static const char *const yytname[] = "$end", "error", "$undefined", "SPACE", "LETTER", "NEWLINE", "COMMENT", "COLON", "ANY", "ZONESTR", "STRING_ARG", "VAR_SERVER", "VAR_VERBOSITY", "VAR_NUM_THREADS", "VAR_PORT", "VAR_OUTGOING_RANGE", "VAR_INTERFACE", - "VAR_DO_IP4", "VAR_DO_IP6", "VAR_DO_UDP", "VAR_DO_TCP", "VAR_CHROOT", - "VAR_USERNAME", "VAR_DIRECTORY", "VAR_LOGFILE", "VAR_PIDFILE", - "VAR_MSG_CACHE_SIZE", "VAR_MSG_CACHE_SLABS", - "VAR_NUM_QUERIES_PER_THREAD", "VAR_RRSET_CACHE_SIZE", - "VAR_RRSET_CACHE_SLABS", "VAR_OUTGOING_NUM_TCP", "VAR_INFRA_HOST_TTL", - "VAR_INFRA_LAME_TTL", "VAR_INFRA_CACHE_SLABS", + "VAR_DO_IP4", "VAR_DO_IP6", "VAR_PREFER_IP6", "VAR_DO_UDP", "VAR_DO_TCP", + "VAR_TCP_MSS", "VAR_OUTGOING_TCP_MSS", "VAR_CHROOT", "VAR_USERNAME", + "VAR_DIRECTORY", "VAR_LOGFILE", "VAR_PIDFILE", "VAR_MSG_CACHE_SIZE", + "VAR_MSG_CACHE_SLABS", "VAR_NUM_QUERIES_PER_THREAD", + "VAR_RRSET_CACHE_SIZE", "VAR_RRSET_CACHE_SLABS", "VAR_OUTGOING_NUM_TCP", + "VAR_INFRA_HOST_TTL", "VAR_INFRA_LAME_TTL", "VAR_INFRA_CACHE_SLABS", "VAR_INFRA_CACHE_NUMHOSTS", "VAR_INFRA_CACHE_LAME_SIZE", "VAR_NAME", "VAR_STUB_ZONE", "VAR_STUB_HOST", "VAR_STUB_ADDR", "VAR_TARGET_FETCH_POLICY", "VAR_HARDEN_SHORT_BUFSIZE", @@ -984,50 +974,72 @@ static const char *const yytname[] = "VAR_SO_RCVBUF", "VAR_EDNS_BUFFER_SIZE", "VAR_PREFETCH", "VAR_PREFETCH_KEY", "VAR_SO_SNDBUF", "VAR_SO_REUSEPORT", "VAR_HARDEN_BELOW_NXDOMAIN", "VAR_IGNORE_CD_FLAG", "VAR_LOG_QUERIES", - "VAR_TCP_UPSTREAM", "VAR_SSL_UPSTREAM", "VAR_SSL_SERVICE_KEY", - "VAR_SSL_SERVICE_PEM", "VAR_SSL_PORT", "VAR_FORWARD_FIRST", + "VAR_LOG_REPLIES", "VAR_TCP_UPSTREAM", "VAR_SSL_UPSTREAM", + "VAR_SSL_SERVICE_KEY", "VAR_SSL_SERVICE_PEM", "VAR_SSL_PORT", + "VAR_FORWARD_FIRST", "VAR_STUB_SSL_UPSTREAM", "VAR_FORWARD_SSL_UPSTREAM", "VAR_STUB_FIRST", "VAR_MINIMAL_RESPONSES", "VAR_RRSET_ROUNDROBIN", "VAR_MAX_UDP_SIZE", "VAR_DELAY_CLOSE", "VAR_UNBLOCK_LAN_ZONES", - "VAR_INFRA_CACHE_MIN_RTT", "VAR_DNS64_PREFIX", "VAR_DNS64_SYNTHALL", - "VAR_DNSTAP", "VAR_DNSTAP_ENABLE", "VAR_DNSTAP_SOCKET_PATH", - "VAR_DNSTAP_SEND_IDENTITY", "VAR_DNSTAP_SEND_VERSION", - "VAR_DNSTAP_IDENTITY", "VAR_DNSTAP_VERSION", + "VAR_INSECURE_LAN_ZONES", "VAR_INFRA_CACHE_MIN_RTT", "VAR_DNS64_PREFIX", + "VAR_DNS64_SYNTHALL", "VAR_DNSTAP", "VAR_DNSTAP_ENABLE", + "VAR_DNSTAP_SOCKET_PATH", "VAR_DNSTAP_SEND_IDENTITY", + "VAR_DNSTAP_SEND_VERSION", "VAR_DNSTAP_IDENTITY", "VAR_DNSTAP_VERSION", "VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES", "VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES", "VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES", "VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES", "VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES", - "VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES", - "VAR_HARDEN_ALGO_DOWNGRADE", "VAR_IP_TRANSPARENT", "VAR_RATELIMIT", - "VAR_RATELIMIT_SLABS", "VAR_RATELIMIT_SIZE", "VAR_RATELIMIT_FOR_DOMAIN", - "VAR_RATELIMIT_BELOW_DOMAIN", "VAR_RATELIMIT_FACTOR", - "VAR_CAPS_WHITELIST", "VAR_CACHE_MAX_NEGATIVE_TTL", - "VAR_PERMIT_SMALL_HOLDDOWN", "VAR_QNAME_MINIMISATION", "$accept", - "toplevelvars", "toplevelvar", "serverstart", "contents_server", - "content_server", "stubstart", "contents_stub", "content_stub", - "forwardstart", "contents_forward", "content_forward", + "VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES", "VAR_RESPONSE_IP_TAG", + "VAR_RESPONSE_IP", "VAR_RESPONSE_IP_DATA", "VAR_HARDEN_ALGO_DOWNGRADE", + "VAR_IP_TRANSPARENT", "VAR_DISABLE_DNSSEC_LAME_CHECK", + "VAR_IP_RATELIMIT", "VAR_IP_RATELIMIT_SLABS", "VAR_IP_RATELIMIT_SIZE", + "VAR_RATELIMIT", "VAR_RATELIMIT_SLABS", "VAR_RATELIMIT_SIZE", + "VAR_RATELIMIT_FOR_DOMAIN", "VAR_RATELIMIT_BELOW_DOMAIN", + "VAR_IP_RATELIMIT_FACTOR", "VAR_RATELIMIT_FACTOR", + "VAR_SEND_CLIENT_SUBNET", "VAR_CLIENT_SUBNET_ALWAYS_FORWARD", + "VAR_CLIENT_SUBNET_OPCODE", "VAR_MAX_CLIENT_SUBNET_IPV4", + "VAR_MAX_CLIENT_SUBNET_IPV6", "VAR_CAPS_WHITELIST", + "VAR_CACHE_MAX_NEGATIVE_TTL", "VAR_PERMIT_SMALL_HOLDDOWN", + "VAR_QNAME_MINIMISATION", "VAR_QNAME_MINIMISATION_STRICT", + "VAR_IP_FREEBIND", "VAR_DEFINE_TAG", "VAR_LOCAL_ZONE_TAG", + "VAR_ACCESS_CONTROL_TAG", "VAR_LOCAL_ZONE_OVERRIDE", + "VAR_ACCESS_CONTROL_TAG_ACTION", "VAR_ACCESS_CONTROL_TAG_DATA", + "VAR_VIEW", "VAR_ACCESS_CONTROL_VIEW", "VAR_VIEW_FIRST", + "VAR_SERVE_EXPIRED", "VAR_FAKE_DSA", "VAR_FAKE_SHA1", "VAR_LOG_IDENTITY", + "VAR_HIDE_TRUSTANCHOR", "VAR_USE_SYSTEMD", "VAR_SHM_ENABLE", + "VAR_SHM_KEY", "VAR_DNSCRYPT", "VAR_DNSCRYPT_ENABLE", + "VAR_DNSCRYPT_PORT", "VAR_DNSCRYPT_PROVIDER", "VAR_DNSCRYPT_SECRET_KEY", + "VAR_DNSCRYPT_PROVIDER_CERT", "$accept", "toplevelvars", "toplevelvar", + "serverstart", "contents_server", "content_server", "stubstart", + "contents_stub", "content_stub", "forwardstart", "contents_forward", + "content_forward", "viewstart", "contents_view", "content_view", "server_num_threads", "server_verbosity", "server_statistics_interval", "server_statistics_cumulative", "server_extended_statistics", - "server_port", "server_interface", "server_outgoing_interface", - "server_outgoing_range", "server_outgoing_port_permit", - "server_outgoing_port_avoid", "server_outgoing_num_tcp", - "server_incoming_num_tcp", "server_interface_automatic", "server_do_ip4", - "server_do_ip6", "server_do_udp", "server_do_tcp", "server_tcp_upstream", - "server_ssl_upstream", "server_ssl_service_key", - "server_ssl_service_pem", "server_ssl_port", "server_do_daemonize", - "server_use_syslog", "server_log_time_ascii", "server_log_queries", + "server_shm_enable", "server_shm_key", "server_port", + "server_send_client_subnet", "server_client_subnet_always_forward", + "server_client_subnet_opcode", "server_max_client_subnet_ipv4", + "server_max_client_subnet_ipv6", "server_interface", + "server_outgoing_interface", "server_outgoing_range", + "server_outgoing_port_permit", "server_outgoing_port_avoid", + "server_outgoing_num_tcp", "server_incoming_num_tcp", + "server_interface_automatic", "server_do_ip4", "server_do_ip6", + "server_do_udp", "server_do_tcp", "server_prefer_ip6", "server_tcp_mss", + "server_outgoing_tcp_mss", "server_tcp_upstream", "server_ssl_upstream", + "server_ssl_service_key", "server_ssl_service_pem", "server_ssl_port", + "server_use_systemd", "server_do_daemonize", "server_use_syslog", + "server_log_time_ascii", "server_log_queries", "server_log_replies", "server_chroot", "server_username", "server_directory", "server_logfile", "server_pidfile", "server_root_hints", "server_dlv_anchor_file", "server_dlv_anchor", "server_auto_trust_anchor_file", "server_trust_anchor_file", "server_trusted_keys_file", "server_trust_anchor", "server_domain_insecure", "server_hide_identity", - "server_hide_version", "server_identity", "server_version", - "server_so_rcvbuf", "server_so_sndbuf", "server_so_reuseport", - "server_ip_transparent", "server_edns_buffer_size", - "server_msg_buffer_size", "server_msg_cache_size", - "server_msg_cache_slabs", "server_num_queries_per_thread", - "server_jostle_timeout", "server_delay_close", - "server_unblock_lan_zones", "server_rrset_cache_size", + "server_hide_version", "server_hide_trustanchor", "server_identity", + "server_version", "server_so_rcvbuf", "server_so_sndbuf", + "server_so_reuseport", "server_ip_transparent", "server_ip_freebind", + "server_edns_buffer_size", "server_msg_buffer_size", + "server_msg_cache_size", "server_msg_cache_slabs", + "server_num_queries_per_thread", "server_jostle_timeout", + "server_delay_close", "server_unblock_lan_zones", + "server_insecure_lan_zones", "server_rrset_cache_size", "server_rrset_cache_slabs", "server_infra_host_ttl", "server_infra_lame_ttl", "server_infra_cache_numhosts", "server_infra_cache_lame_size", "server_infra_cache_slabs", @@ -1045,38 +1057,53 @@ static const char *const yytname[] = "server_cache_max_ttl", "server_cache_max_negative_ttl", "server_cache_min_ttl", "server_bogus_ttl", "server_val_clean_additional", "server_val_permissive_mode", - "server_ignore_cd_flag", "server_val_log_level", + "server_ignore_cd_flag", "server_serve_expired", "server_fake_dsa", + "server_fake_sha1", "server_val_log_level", "server_val_nsec3_keysize_iterations", "server_add_holddown", "server_del_holddown", "server_keep_missing", "server_permit_small_holddown", "server_key_cache_size", "server_key_cache_slabs", "server_neg_cache_size", "server_local_zone", "server_local_data", "server_local_data_ptr", "server_minimal_responses", "server_rrset_roundrobin", "server_max_udp_size", "server_dns64_prefix", - "server_dns64_synthall", "server_ratelimit", "server_ratelimit_size", + "server_dns64_synthall", "server_define_tag", "server_local_zone_tag", + "server_access_control_tag", "server_access_control_tag_action", + "server_access_control_tag_data", "server_local_zone_override", + "server_access_control_view", "server_response_ip_tag", + "server_ip_ratelimit", "server_ratelimit", "server_ip_ratelimit_size", + "server_ratelimit_size", "server_ip_ratelimit_slabs", "server_ratelimit_slabs", "server_ratelimit_for_domain", - "server_ratelimit_below_domain", "server_ratelimit_factor", - "server_qname_minimisation", "stub_name", "stub_host", "stub_addr", - "stub_first", "stub_prime", "forward_name", "forward_host", - "forward_addr", "forward_first", "rcstart", "contents_rc", "content_rc", - "rc_control_enable", "rc_control_port", "rc_control_interface", - "rc_control_use_cert", "rc_server_key_file", "rc_server_cert_file", - "rc_control_key_file", "rc_control_cert_file", "dtstart", "contents_dt", - "content_dt", "dt_dnstap_enable", "dt_dnstap_socket_path", - "dt_dnstap_send_identity", "dt_dnstap_send_version", - "dt_dnstap_identity", "dt_dnstap_version", + "server_ratelimit_below_domain", "server_ip_ratelimit_factor", + "server_ratelimit_factor", "server_qname_minimisation", + "server_qname_minimisation_strict", "stub_name", "stub_host", + "stub_addr", "stub_first", "stub_ssl_upstream", "stub_prime", + "forward_name", "forward_host", "forward_addr", "forward_first", + "forward_ssl_upstream", "view_name", "view_local_zone", + "view_response_ip", "view_response_ip_data", "view_local_data", + "view_local_data_ptr", "view_first", "rcstart", "contents_rc", + "content_rc", "rc_control_enable", "rc_control_port", + "rc_control_interface", "rc_control_use_cert", "rc_server_key_file", + "rc_server_cert_file", "rc_control_key_file", "rc_control_cert_file", + "dtstart", "contents_dt", "content_dt", "dt_dnstap_enable", + "dt_dnstap_socket_path", "dt_dnstap_send_identity", + "dt_dnstap_send_version", "dt_dnstap_identity", "dt_dnstap_version", "dt_dnstap_log_resolver_query_messages", "dt_dnstap_log_resolver_response_messages", "dt_dnstap_log_client_query_messages", "dt_dnstap_log_client_response_messages", "dt_dnstap_log_forwarder_query_messages", "dt_dnstap_log_forwarder_response_messages", "pythonstart", - "contents_py", "content_py", "py_script", YY_NULL + "contents_py", "content_py", "py_script", + "server_disable_dnssec_lame_check", "server_log_identity", + "server_response_ip", "server_response_ip_data", "dnscstart", + "contents_dnsc", "content_dnsc", "dnsc_dnscrypt_enable", + "dnsc_dnscrypt_port", "dnsc_dnscrypt_provider", + "dnsc_dnscrypt_provider_cert", "dnsc_dnscrypt_secret_key", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -1095,94 +1122,103 @@ static const yytype_uint16 yytoknum[] = 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417 + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462 }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint16 yyr1[] = -{ - 0, 163, 164, 164, 165, 165, 165, 165, 165, 165, - 166, 167, 167, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 169, 170, 170, 171, 171, 171, 171, 171, 172, 173, - 173, 174, 174, 174, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 302, 303, 303, 303, 303, 303, 303, - 303, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 313, 314, 314, 314, 314, 314, 314, 314, - 314, 314, 314, 314, 314, 315, 316, 317, 318, 319, - 320, 321, 322, 323, 324, 325, 326, 327, 328, 328, - 329, 330 -}; +#define YYPACT_NINF -162 -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-162))) + +#define YYTABLE_NINF -1 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = { - 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, - 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, - 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 1, 2, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 1, 2, 0, - 1, 2 + -162, 0, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + 191, -38, -34, -39, -64, -130, -105, -161, -3, -2, + -1, 2, 3, 26, 29, 30, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 82, 83, 84, + 86, 89, 91, 92, 93, 94, 95, 96, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 136, 137, 138, 139, 140, 141, 142, + 143, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 221, 222, 223, 224, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, 228, 229, 230, 272, 273, 274, -162, + -162, -162, -162, -162, -162, -162, 275, 276, 277, 278, + 279, -162, -162, -162, -162, -162, -162, 280, 284, 288, + 289, 313, 314, 315, -162, -162, -162, -162, -162, -162, + -162, -162, 316, 326, 327, 328, 329, 330, 331, 332, + -162, -162, -162, -162, -162, -162, -162, -162, -162, 333, + 334, 335, 336, 337, 338, 372, 374, 383, 384, 385, + 386, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, 387, -162, -162, 388, 389, 390, + 391, 392, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, 393, 394, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, 395, 396, + 397, -162, -162, -162, -162, -162, -162, -162, -162, -162, + 398, 399, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, 400, 401, 402, 403, + 404, 405, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, 406, -162, -162, 407, 408, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, 409, 410, 411, -162, -162, -162, -162, + -162, -162, -162 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_uint16 yydefact[] = { - 2, 0, 1, 10, 130, 138, 271, 317, 290, 3, - 12, 132, 140, 273, 292, 319, 4, 5, 6, 8, - 9, 7, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 1, 12, 167, 176, 360, 406, 379, 184, + 415, 3, 14, 169, 178, 186, 362, 381, 408, 417, + 4, 5, 6, 10, 8, 9, 7, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1193,259 +1229,267 @@ static const yytype_uint16 yydefact[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, - 13, 14, 70, 73, 82, 15, 21, 61, 16, 74, - 75, 32, 54, 69, 17, 18, 19, 20, 104, 105, - 106, 107, 108, 71, 60, 86, 103, 22, 23, 24, - 25, 26, 62, 76, 77, 92, 48, 58, 49, 87, - 42, 43, 44, 45, 96, 100, 112, 119, 97, 55, - 27, 28, 29, 84, 113, 114, 30, 31, 33, 34, - 36, 37, 35, 117, 38, 39, 40, 46, 65, 101, - 79, 118, 72, 126, 80, 81, 98, 99, 85, 41, - 63, 66, 47, 50, 88, 89, 64, 127, 90, 51, - 52, 53, 102, 91, 59, 93, 94, 95, 128, 56, - 57, 78, 67, 68, 83, 109, 110, 111, 115, 116, - 120, 122, 121, 123, 124, 125, 129, 0, 0, 0, - 0, 0, 131, 133, 134, 135, 137, 136, 0, 0, - 0, 0, 139, 141, 142, 143, 144, 0, 0, 0, - 0, 0, 0, 0, 0, 272, 274, 276, 275, 281, - 277, 278, 279, 280, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 291, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 0, - 318, 320, 146, 145, 150, 153, 151, 159, 160, 161, - 162, 172, 173, 174, 175, 176, 195, 196, 197, 201, - 202, 156, 203, 204, 207, 205, 206, 209, 210, 211, - 224, 185, 186, 187, 188, 212, 227, 181, 183, 228, - 234, 235, 236, 157, 194, 244, 245, 182, 239, 169, - 152, 177, 225, 231, 213, 0, 0, 248, 158, 147, - 168, 217, 148, 154, 155, 178, 179, 246, 215, 219, - 220, 149, 249, 198, 223, 170, 184, 229, 230, 233, - 238, 180, 242, 240, 241, 189, 193, 221, 222, 190, - 191, 214, 237, 171, 163, 164, 165, 166, 167, 250, - 251, 252, 199, 200, 208, 253, 254, 216, 192, 255, - 257, 256, 0, 0, 260, 218, 232, 243, 261, 262, - 263, 264, 266, 265, 267, 268, 269, 270, 282, 284, - 283, 286, 287, 288, 289, 285, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 321, 226, - 247, 258, 259 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 1, 9, 10, 16, 139, 11, 17, 262, 12, - 18, 272, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 263, - 264, 265, 266, 267, 273, 274, 275, 276, 13, 19, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 14, - 20, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 15, 21, 320, 321 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 13, 15, 16, 75, 78, 87, 163, 164, 17, 137, + 138, 139, 140, 141, 26, 66, 18, 79, 80, 37, + 59, 74, 19, 20, 22, 23, 21, 24, 25, 110, + 111, 112, 113, 114, 159, 76, 65, 91, 108, 109, + 27, 28, 29, 30, 31, 67, 81, 82, 97, 53, + 63, 54, 92, 47, 48, 166, 49, 50, 101, 105, + 118, 126, 146, 102, 60, 32, 33, 34, 89, 119, + 120, 121, 35, 36, 38, 39, 41, 42, 40, 124, + 43, 44, 45, 51, 70, 106, 84, 125, 77, 142, + 85, 86, 103, 104, 90, 46, 68, 71, 52, 55, + 93, 94, 69, 143, 95, 56, 57, 58, 107, 156, + 157, 165, 96, 64, 98, 99, 100, 144, 61, 62, + 83, 72, 73, 88, 115, 116, 117, 122, 123, 147, + 148, 150, 152, 153, 151, 154, 160, 127, 128, 131, + 132, 129, 130, 133, 134, 136, 135, 145, 155, 149, + 158, 161, 162, 0, 0, 0, 0, 0, 0, 168, + 170, 171, 172, 174, 175, 173, 0, 0, 0, 0, + 0, 177, 179, 180, 181, 182, 183, 0, 0, 0, + 0, 0, 0, 0, 185, 187, 188, 191, 192, 189, + 193, 190, 0, 0, 0, 0, 0, 0, 0, 0, + 361, 363, 365, 364, 370, 366, 367, 368, 369, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 380, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 0, 407, 409, 0, 0, 0, + 0, 0, 416, 418, 419, 420, 422, 421, 195, 194, + 201, 209, 207, 215, 216, 219, 217, 218, 220, 221, + 233, 234, 235, 236, 237, 258, 259, 260, 265, 266, + 212, 267, 268, 271, 269, 270, 273, 274, 275, 288, + 246, 247, 249, 250, 276, 291, 242, 244, 292, 298, + 299, 300, 213, 257, 311, 312, 243, 306, 229, 208, + 238, 289, 295, 277, 0, 0, 315, 214, 196, 228, + 281, 197, 210, 211, 239, 240, 313, 279, 283, 284, + 198, 316, 261, 287, 230, 245, 293, 294, 297, 305, + 241, 309, 307, 308, 251, 256, 285, 286, 252, 253, + 278, 301, 231, 232, 222, 223, 224, 225, 226, 317, + 318, 319, 262, 263, 264, 272, 320, 321, 0, 0, + 0, 280, 254, 411, 330, 334, 332, 331, 335, 333, + 0, 0, 338, 339, 202, 203, 204, 205, 206, 282, + 296, 310, 340, 341, 255, 322, 0, 0, 0, 0, + 0, 0, 302, 303, 304, 412, 248, 227, 199, 200, + 342, 343, 344, 347, 346, 345, 348, 349, 350, 351, + 352, 353, 0, 357, 358, 0, 0, 359, 371, 373, + 372, 375, 376, 377, 378, 374, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 410, 423, + 424, 425, 427, 426, 290, 314, 329, 413, 414, 336, + 337, 323, 324, 0, 0, 0, 328, 354, 355, 356, + 327, 325, 326 }; -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -81 -static const yytype_int16 yypact[] = + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = { - -81, 116, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -12, 89, 47, -13, - 22, -80, 16, 17, 18, 23, 24, 78, 107, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 141, 142, - 143, 145, 146, 147, 148, 149, 163, 164, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 209, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, 262, 263, 264, - 265, 266, -81, -81, -81, -81, -81, -81, 267, 268, - 269, 270, -81, -81, -81, -81, -81, 271, 272, 273, - 274, 275, 276, 277, 278, -81, -81, -81, -81, -81, - -81, -81, -81, -81, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, 291, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, 292, 293, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, 294, 295, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81 + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162, -162, -162, -162, -162, -162, -162, -162, + -162, -162, -162 }; -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = { - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81 + -1, 1, 11, 12, 20, 180, 13, 21, 339, 14, + 22, 351, 15, 23, 364, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 340, 341, 342, 343, 344, 345, 352, + 353, 354, 355, 356, 365, 366, 367, 368, 369, 370, + 371, 16, 24, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 17, 25, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 18, 26, 415, + 416, 329, 330, 331, 332, 19, 27, 422, 423, 424, + 425, 426, 427 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint16 yytable[] = { - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 319, 322, 323, 324, 47, - 48, 49, 0, 325, 326, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 277, 278, 279, 280, - 281, 282, 283, 284, 268, 91, 92, 93, 327, 94, - 95, 96, 269, 270, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 2, 328, 119, 120, - 121, 122, 123, 124, 125, 126, 257, 3, 258, 259, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 338, 339, 340, 4, 341, 342, 343, 344, 345, - 5, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 346, 347, 271, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 260, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, - 371, 372, 373, 374, 6, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 261, 388, - 7, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, - 418, 419, 420, 421, 8, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, - 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, - 467, 468, 469, 470, 471, 472 + 2, 357, 333, 414, 334, 335, 346, 428, 429, 430, + 0, 3, 431, 432, 347, 348, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 372, 373, + 374, 375, 376, 377, 378, 379, 433, 358, 359, 434, + 435, 4, 417, 418, 419, 420, 421, 5, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 449, 360, 450, 451, 336, 452, 453, 454, 455, + 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, + 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, + 476, 6, 477, 478, 479, 337, 480, 338, 349, 481, + 350, 482, 483, 484, 485, 486, 487, 7, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, + 361, 362, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 8, 523, 524, 525, 526, + 527, 528, 529, 530, 363, 531, 532, 533, 534, 535, + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, + 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 9, 567, 568, 569, 570, 571, 572, 573, 574, + 575, 0, 10, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 576, 577, 578, 579, 56, 57, 58, 580, 581, + 582, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 583, 584, 585, 586, 587, 588, 589, 590, + 591, 100, 101, 102, 592, 103, 104, 105, 593, 594, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 595, 596, 597, 598, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 599, 600, 601, 602, + 603, 604, 605, 606, 607, 608, 609, 610, 611, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 612, 171, 613, 172, 173, 174, 175, 176, + 177, 178, 179, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-81))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - static const yytype_int16 yycheck[] = { - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 105, 10, 10, 10, 41, - 42, 43, -1, 10, 10, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 89, 90, 91, 92, - 93, 94, 95, 96, 37, 97, 98, 99, 10, 101, - 102, 103, 45, 46, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 0, 10, 130, 131, - 132, 133, 134, 135, 136, 137, 37, 11, 39, 40, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 10, 10, 10, 38, 10, 10, 10, 10, 10, - 44, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 10, 10, 128, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 100, + 0, 40, 40, 108, 42, 43, 40, 10, 10, 10, + -1, 11, 10, 10, 48, 49, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 92, 93, + 94, 95, 96, 97, 98, 99, 10, 76, 77, 10, + 10, 41, 203, 204, 205, 206, 207, 47, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 101, 10, 10, 103, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 88, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 129, 10, - 104, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 91, 10, 10, 10, 133, 10, 135, 132, 10, + 134, 10, 10, 10, 10, 10, 10, 107, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 138, 10, 10, 10, 10, 10, + 159, 160, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 145, 10, 10, 10, 10, + 10, 10, 10, 10, 193, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10 + 10, 191, 10, 10, 10, 10, 10, 10, 10, 10, + 10, -1, 202, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 10, 10, 10, 10, 44, 45, 46, 10, 10, + 10, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 100, 101, 102, 10, 104, 105, 106, 10, 10, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 10, 10, 10, 10, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 10, 192, 10, 194, 195, 196, 197, 198, + 199, 200, 201, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { - 0, 164, 0, 11, 38, 44, 88, 104, 138, 165, - 166, 169, 172, 301, 312, 327, 167, 170, 173, 302, - 313, 328, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 41, 42, 43, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 97, 98, 99, 101, 102, 103, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 130, - 131, 132, 133, 134, 135, 136, 137, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 168, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 37, 39, 40, - 100, 129, 171, 292, 293, 294, 295, 296, 37, 45, - 46, 128, 174, 297, 298, 299, 300, 89, 90, 91, - 92, 93, 94, 95, 96, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 314, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 105, - 329, 330, 10, 10, 10, 10, 10, 10, 10, 10, + 0, 209, 0, 11, 41, 47, 91, 107, 145, 191, + 202, 210, 211, 214, 217, 220, 389, 400, 415, 423, + 212, 215, 218, 221, 390, 401, 416, 424, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 44, 45, 46, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 100, 101, 102, 104, 105, 106, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 192, 194, 195, 196, 197, 198, 199, 200, 201, + 213, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 419, + 420, 421, 422, 40, 42, 43, 103, 133, 135, 216, + 371, 372, 373, 374, 375, 376, 40, 48, 49, 132, + 134, 219, 377, 378, 379, 380, 381, 40, 76, 77, + 101, 159, 160, 193, 222, 382, 383, 384, 385, 386, + 387, 388, 92, 93, 94, 95, 96, 97, 98, 99, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 108, 417, 418, 203, 204, 205, + 206, 207, 425, 426, 427, 428, 429, 430, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, @@ -1463,30 +1507,112 @@ static const yytype_uint16 yystos[] = 10, 10, 10 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint16 yyr1[] = +{ + 0, 208, 209, 209, 210, 210, 210, 210, 210, 210, + 210, 210, 211, 212, 212, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 214, 215, 215, + 216, 216, 216, 216, 216, 216, 217, 218, 218, 219, + 219, 219, 219, 219, 220, 221, 221, 222, 222, 222, + 222, 222, 222, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 390, 391, 391, 391, 391, 391, 391, 391, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 401, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 424, 425, 425, + 425, 425, 425, 426, 427, 428, 429, 430 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 1, 2, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, + 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, + 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, + 2, 2, 2, 3, 3, 4, 4, 4, 3, 3, + 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 3, 3, 3, 2, 2, 2, + 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, + 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 0, 1, + 2, 2, 2, 3, 3, 1, 2, 0, 1, 1, + 1, 1, 1, 2, 2, 2, 2, 2 +}; + + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + #define YYRECOVERING() (!!yyerrstatus) @@ -1503,27 +1629,15 @@ do \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -1533,40 +1647,36 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { FILE *yyo = yyoutput; YYUSE (yyo); @@ -1575,14 +1685,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -1590,22 +1694,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); @@ -1616,16 +1709,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1636,49 +1721,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1692,7 +1770,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1715,15 +1793,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1739,16 +1810,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1778,27 +1841,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1821,11 +1884,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1833,10 +1896,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1886,7 +1945,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -1953,31 +2012,17 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif { YYUSE (yyvaluep); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1986,18 +2031,8 @@ yydestruct (yymsg, yytype, yyvaluep) /* The lookahead symbol. */ int yychar; - -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - +YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; @@ -2006,35 +2041,16 @@ int yynerrs; | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (void) -#else -int -yyparse () - -#endif -#endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -2102,23 +2118,23 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -2126,22 +2142,22 @@ yyparse () # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -2150,10 +2166,10 @@ yyparse () yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -2182,7 +2198,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (); } if (yychar <= YYEOF) @@ -2247,7 +2263,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -2260,17 +2276,16 @@ yyreduce: YY_REDUCE_PRINT (yyn); switch (yyn) { - case 10: -/* Line 1792 of yacc.c */ -#line 136 "./util/configparser.y" + case 12: +#line 159 "util/configparser.y" /* yacc.c:1646 */ { OUTYY(("\nP(server:)\n")); } +#line 2285 "util/configparser.c" /* yacc.c:1646 */ break; - case 130: -/* Line 1792 of yacc.c */ -#line 193 "./util/configparser.y" + case 167: +#line 234 "util/configparser.y" /* yacc.c:1646 */ { struct config_stub* s; OUTYY(("\nP(stub_zone:)\n")); @@ -2281,11 +2296,11 @@ yyreduce: } else yyerror("out of memory"); } +#line 2300 "util/configparser.c" /* yacc.c:1646 */ break; - case 138: -/* Line 1792 of yacc.c */ -#line 209 "./util/configparser.y" + case 176: +#line 251 "util/configparser.y" /* yacc.c:1646 */ { struct config_stub* s; OUTYY(("\nP(forward_zone:)\n")); @@ -2296,87 +2311,216 @@ yyreduce: } else yyerror("out of memory"); } +#line 2315 "util/configparser.c" /* yacc.c:1646 */ break; - case 145: -/* Line 1792 of yacc.c */ -#line 225 "./util/configparser.y" + case 184: +#line 268 "util/configparser.y" /* yacc.c:1646 */ + { + struct config_view* s; + OUTYY(("\nP(view:)\n")); + s = (struct config_view*)calloc(1, sizeof(struct config_view)); + if(s) { + s->next = cfg_parser->cfg->views; + if(s->next && !s->next->name) + yyerror("view without name"); + cfg_parser->cfg->views = s; + } else + yyerror("out of memory"); + } +#line 2332 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 194: +#line 287 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_num_threads:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_num_threads:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->num_threads = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->num_threads = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 2344 "util/configparser.c" /* yacc.c:1646 */ break; - case 146: -/* Line 1792 of yacc.c */ -#line 234 "./util/configparser.y" + case 195: +#line 296 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_verbosity:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_verbosity:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->verbosity = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->verbosity = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 2356 "util/configparser.c" /* yacc.c:1646 */ break; - case 147: -/* Line 1792 of yacc.c */ -#line 243 "./util/configparser.y" + case 196: +#line 305 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_statistics_interval:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "") == 0 || strcmp((yyvsp[(2) - (2)].str), "0") == 0) + OUTYY(("P(server_statistics_interval:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "") == 0 || strcmp((yyvsp[0].str), "0") == 0) cfg_parser->cfg->stat_interval = 0; - else if(atoi((yyvsp[(2) - (2)].str)) == 0) + else if(atoi((yyvsp[0].str)) == 0) yyerror("number expected"); - else cfg_parser->cfg->stat_interval = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->stat_interval = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 2370 "util/configparser.c" /* yacc.c:1646 */ break; - case 148: -/* Line 1792 of yacc.c */ -#line 254 "./util/configparser.y" + case 197: +#line 316 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_statistics_cumulative:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_statistics_cumulative:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->stat_cumulative = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->stat_cumulative = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 2382 "util/configparser.c" /* yacc.c:1646 */ break; - case 149: -/* Line 1792 of yacc.c */ -#line 263 "./util/configparser.y" + case 198: +#line 325 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_extended_statistics:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_extended_statistics:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->stat_extended = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->stat_extended = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 2394 "util/configparser.c" /* yacc.c:1646 */ break; - case 150: -/* Line 1792 of yacc.c */ -#line 272 "./util/configparser.y" + case 199: +#line 334 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_port:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0) + OUTYY(("P(server_shm_enable:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->shm_enable = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 2406 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 200: +#line 343 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_shm_key:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "") == 0 || strcmp((yyvsp[0].str), "0") == 0) + cfg_parser->cfg->shm_key = 0; + else if(atoi((yyvsp[0].str)) == 0) + yyerror("number expected"); + else cfg_parser->cfg->shm_key = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); + } +#line 2420 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 201: +#line 354 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_port:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) yyerror("port number expected"); - else cfg_parser->cfg->port = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->port = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); + } +#line 2432 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 202: +#line 363 "util/configparser.y" /* yacc.c:1646 */ + { + #ifdef CLIENT_SUBNET + OUTYY(("P(server_send_client_subnet:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->client_subnet, (yyvsp[0].str))) + fatal_exit("out of memory adding client-subnet"); + #else + OUTYY(("P(Compiled without edns subnet option, ignoring)\n")); + #endif } +#line 2446 "util/configparser.c" /* yacc.c:1646 */ break; - case 151: -/* Line 1792 of yacc.c */ -#line 281 "./util/configparser.y" + case 203: +#line 375 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_interface:%s)\n", (yyvsp[(2) - (2)].str))); + #ifdef CLIENT_SUBNET + OUTYY(("P(server_client_subnet_always_forward:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else + cfg_parser->cfg->client_subnet_always_forward = + (strcmp((yyvsp[0].str), "yes")==0); + #else + OUTYY(("P(Compiled without edns subnet option, ignoring)\n")); + #endif + free((yyvsp[0].str)); + } +#line 2464 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 204: +#line 390 "util/configparser.y" /* yacc.c:1646 */ + { + #ifdef CLIENT_SUBNET + OUTYY(("P(client_subnet_opcode:%s)\n", (yyvsp[0].str))); + OUTYY(("P(Depricated option, ignoring)\n")); + #else + OUTYY(("P(Compiled without edns subnet option, ignoring)\n")); + #endif + free((yyvsp[0].str)); + } +#line 2478 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 205: +#line 401 "util/configparser.y" /* yacc.c:1646 */ + { + #ifdef CLIENT_SUBNET + OUTYY(("P(max_client_subnet_ipv4:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) + yyerror("IPv4 subnet length expected"); + else if (atoi((yyvsp[0].str)) > 32) + cfg_parser->cfg->max_client_subnet_ipv4 = 32; + else if (atoi((yyvsp[0].str)) < 0) + cfg_parser->cfg->max_client_subnet_ipv4 = 0; + else cfg_parser->cfg->max_client_subnet_ipv4 = (uint8_t)atoi((yyvsp[0].str)); + #else + OUTYY(("P(Compiled without edns subnet option, ignoring)\n")); + #endif + free((yyvsp[0].str)); + } +#line 2498 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 206: +#line 418 "util/configparser.y" /* yacc.c:1646 */ + { + #ifdef CLIENT_SUBNET + OUTYY(("P(max_client_subnet_ipv6:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) + yyerror("Ipv6 subnet length expected"); + else if (atoi((yyvsp[0].str)) > 128) + cfg_parser->cfg->max_client_subnet_ipv6 = 128; + else if (atoi((yyvsp[0].str)) < 0) + cfg_parser->cfg->max_client_subnet_ipv6 = 0; + else cfg_parser->cfg->max_client_subnet_ipv6 = (uint8_t)atoi((yyvsp[0].str)); + #else + OUTYY(("P(Compiled without edns subnet option, ignoring)\n")); + #endif + free((yyvsp[0].str)); + } +#line 2518 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 207: +#line 435 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_interface:%s)\n", (yyvsp[0].str))); if(cfg_parser->cfg->num_ifs == 0) cfg_parser->cfg->ifs = calloc(1, sizeof(char*)); else cfg_parser->cfg->ifs = realloc(cfg_parser->cfg->ifs, @@ -2384,15 +2528,15 @@ yyreduce: if(!cfg_parser->cfg->ifs) yyerror("out of memory"); else - cfg_parser->cfg->ifs[cfg_parser->cfg->num_ifs++] = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->ifs[cfg_parser->cfg->num_ifs++] = (yyvsp[0].str); } +#line 2534 "util/configparser.c" /* yacc.c:1646 */ break; - case 152: -/* Line 1792 of yacc.c */ -#line 294 "./util/configparser.y" + case 208: +#line 448 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_outgoing_interface:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_outgoing_interface:%s)\n", (yyvsp[0].str))); if(cfg_parser->cfg->num_out_ifs == 0) cfg_parser->cfg->out_ifs = calloc(1, sizeof(char*)); else cfg_parser->cfg->out_ifs = realloc( @@ -2402,1198 +2546,1363 @@ yyreduce: yyerror("out of memory"); else cfg_parser->cfg->out_ifs[ - cfg_parser->cfg->num_out_ifs++] = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->num_out_ifs++] = (yyvsp[0].str); } +#line 2552 "util/configparser.c" /* yacc.c:1646 */ break; - case 153: -/* Line 1792 of yacc.c */ -#line 309 "./util/configparser.y" + case 209: +#line 463 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_outgoing_range:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0) + OUTYY(("P(server_outgoing_range:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) yyerror("number expected"); - else cfg_parser->cfg->outgoing_num_ports = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->outgoing_num_ports = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 2564 "util/configparser.c" /* yacc.c:1646 */ break; - case 154: -/* Line 1792 of yacc.c */ -#line 318 "./util/configparser.y" + case 210: +#line 472 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_outgoing_port_permit:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_mark_ports((yyvsp[(2) - (2)].str), 1, + OUTYY(("P(server_outgoing_port_permit:%s)\n", (yyvsp[0].str))); + if(!cfg_mark_ports((yyvsp[0].str), 1, cfg_parser->cfg->outgoing_avail_ports, 65536)) yyerror("port number or range (\"low-high\") expected"); - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 2576 "util/configparser.c" /* yacc.c:1646 */ break; - case 155: -/* Line 1792 of yacc.c */ -#line 327 "./util/configparser.y" + case 211: +#line 481 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_outgoing_port_avoid:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_mark_ports((yyvsp[(2) - (2)].str), 0, + OUTYY(("P(server_outgoing_port_avoid:%s)\n", (yyvsp[0].str))); + if(!cfg_mark_ports((yyvsp[0].str), 0, cfg_parser->cfg->outgoing_avail_ports, 65536)) yyerror("port number or range (\"low-high\") expected"); - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 2588 "util/configparser.c" /* yacc.c:1646 */ break; - case 156: -/* Line 1792 of yacc.c */ -#line 336 "./util/configparser.y" + case 212: +#line 490 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_outgoing_num_tcp:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_outgoing_num_tcp:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->outgoing_num_tcp = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->outgoing_num_tcp = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 2600 "util/configparser.c" /* yacc.c:1646 */ break; - case 157: -/* Line 1792 of yacc.c */ -#line 345 "./util/configparser.y" + case 213: +#line 499 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_incoming_num_tcp:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_incoming_num_tcp:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->incoming_num_tcp = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->incoming_num_tcp = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 2612 "util/configparser.c" /* yacc.c:1646 */ break; - case 158: -/* Line 1792 of yacc.c */ -#line 354 "./util/configparser.y" + case 214: +#line 508 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_interface_automatic:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_interface_automatic:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->if_automatic = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->if_automatic = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 2624 "util/configparser.c" /* yacc.c:1646 */ break; - case 159: -/* Line 1792 of yacc.c */ -#line 363 "./util/configparser.y" + case 215: +#line 517 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_do_ip4:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_do_ip4:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->do_ip4 = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->do_ip4 = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 2636 "util/configparser.c" /* yacc.c:1646 */ break; - case 160: -/* Line 1792 of yacc.c */ -#line 372 "./util/configparser.y" + case 216: +#line 526 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_do_ip6:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->do_ip6 = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 2648 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 217: +#line 535 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_do_ip6:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_do_udp:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->do_ip6 = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->do_udp = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 2660 "util/configparser.c" /* yacc.c:1646 */ break; - case 161: -/* Line 1792 of yacc.c */ -#line 381 "./util/configparser.y" + case 218: +#line 544 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_do_udp:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_do_tcp:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->do_udp = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->do_tcp = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 2672 "util/configparser.c" /* yacc.c:1646 */ break; - case 162: -/* Line 1792 of yacc.c */ -#line 390 "./util/configparser.y" + case 219: +#line 553 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_do_tcp:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_prefer_ip6:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->do_tcp = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->prefer_ip6 = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 2684 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 220: +#line 562 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_tcp_mss:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) + yyerror("number expected"); + else cfg_parser->cfg->tcp_mss = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 2696 "util/configparser.c" /* yacc.c:1646 */ break; - case 163: -/* Line 1792 of yacc.c */ -#line 399 "./util/configparser.y" + case 221: +#line 571 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_tcp_upstream:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_outgoing_tcp_mss:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) + yyerror("number expected"); + else cfg_parser->cfg->outgoing_tcp_mss = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); + } +#line 2708 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 222: +#line 580 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_tcp_upstream:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->tcp_upstream = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->tcp_upstream = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 2720 "util/configparser.c" /* yacc.c:1646 */ break; - case 164: -/* Line 1792 of yacc.c */ -#line 408 "./util/configparser.y" + case 223: +#line 589 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_ssl_upstream:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_ssl_upstream:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->ssl_upstream = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->ssl_upstream = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 2732 "util/configparser.c" /* yacc.c:1646 */ break; - case 165: -/* Line 1792 of yacc.c */ -#line 417 "./util/configparser.y" + case 224: +#line 598 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_ssl_service_key:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_ssl_service_key:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->ssl_service_key); - cfg_parser->cfg->ssl_service_key = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->ssl_service_key = (yyvsp[0].str); } +#line 2742 "util/configparser.c" /* yacc.c:1646 */ break; - case 166: -/* Line 1792 of yacc.c */ -#line 424 "./util/configparser.y" + case 225: +#line 605 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_ssl_service_pem:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_ssl_service_pem:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->ssl_service_pem); - cfg_parser->cfg->ssl_service_pem = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->ssl_service_pem = (yyvsp[0].str); } +#line 2752 "util/configparser.c" /* yacc.c:1646 */ break; - case 167: -/* Line 1792 of yacc.c */ -#line 431 "./util/configparser.y" + case 226: +#line 612 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_ssl_port:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0) + OUTYY(("P(server_ssl_port:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) yyerror("port number expected"); - else cfg_parser->cfg->ssl_port = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->ssl_port = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 2764 "util/configparser.c" /* yacc.c:1646 */ break; - case 168: -/* Line 1792 of yacc.c */ -#line 440 "./util/configparser.y" + case 227: +#line 621 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_do_daemonize:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_use_systemd:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->do_daemonize = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->use_systemd = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 2776 "util/configparser.c" /* yacc.c:1646 */ break; - case 169: -/* Line 1792 of yacc.c */ -#line 449 "./util/configparser.y" + case 228: +#line 630 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_use_syslog:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_do_daemonize:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->use_syslog = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); + else cfg_parser->cfg->do_daemonize = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 2788 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 229: +#line 639 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_use_syslog:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->use_syslog = (strcmp((yyvsp[0].str), "yes")==0); #if !defined(HAVE_SYSLOG_H) && !defined(UB_ON_WINDOWS) - if(strcmp((yyvsp[(2) - (2)].str), "yes") == 0) + if(strcmp((yyvsp[0].str), "yes") == 0) yyerror("no syslog services are available. " "(reconfigure and compile to add)"); #endif - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 2805 "util/configparser.c" /* yacc.c:1646 */ break; - case 170: -/* Line 1792 of yacc.c */ -#line 463 "./util/configparser.y" + case 230: +#line 653 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_log_time_ascii:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_log_time_ascii:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->log_time_ascii = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->log_time_ascii = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 2817 "util/configparser.c" /* yacc.c:1646 */ break; - case 171: -/* Line 1792 of yacc.c */ -#line 472 "./util/configparser.y" + case 231: +#line 662 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_log_queries:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_log_queries:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->log_queries = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->log_queries = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 2829 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 232: +#line 671 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_log_replies:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->log_replies = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 2841 "util/configparser.c" /* yacc.c:1646 */ break; - case 172: -/* Line 1792 of yacc.c */ -#line 481 "./util/configparser.y" + case 233: +#line 680 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_chroot:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_chroot:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->chrootdir); - cfg_parser->cfg->chrootdir = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->chrootdir = (yyvsp[0].str); } +#line 2851 "util/configparser.c" /* yacc.c:1646 */ break; - case 173: -/* Line 1792 of yacc.c */ -#line 488 "./util/configparser.y" + case 234: +#line 687 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_username:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_username:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->username); - cfg_parser->cfg->username = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->username = (yyvsp[0].str); } +#line 2861 "util/configparser.c" /* yacc.c:1646 */ break; - case 174: -/* Line 1792 of yacc.c */ -#line 495 "./util/configparser.y" + case 235: +#line 694 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_directory:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_directory:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->directory); - cfg_parser->cfg->directory = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->directory = (yyvsp[0].str); + /* change there right away for includes relative to this */ + if((yyvsp[0].str)[0]) { + char* d; +#ifdef UB_ON_WINDOWS + w_config_adjust_directory(cfg_parser->cfg); +#endif + d = cfg_parser->cfg->directory; + /* adjust directory if we have already chroot, + * like, we reread after sighup */ + if(cfg_parser->chroot && cfg_parser->chroot[0] && + strncmp(d, cfg_parser->chroot, strlen( + cfg_parser->chroot)) == 0) + d += strlen(cfg_parser->chroot); + if(d[0]) { + if(chdir(d)) + log_err("cannot chdir to directory: %s (%s)", + d, strerror(errno)); + } + } } +#line 2890 "util/configparser.c" /* yacc.c:1646 */ break; - case 175: -/* Line 1792 of yacc.c */ -#line 502 "./util/configparser.y" + case 236: +#line 720 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_logfile:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_logfile:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->logfile); - cfg_parser->cfg->logfile = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->logfile = (yyvsp[0].str); cfg_parser->cfg->use_syslog = 0; } +#line 2901 "util/configparser.c" /* yacc.c:1646 */ break; - case 176: -/* Line 1792 of yacc.c */ -#line 510 "./util/configparser.y" + case 237: +#line 728 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_pidfile:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_pidfile:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->pidfile); - cfg_parser->cfg->pidfile = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->pidfile = (yyvsp[0].str); } +#line 2911 "util/configparser.c" /* yacc.c:1646 */ break; - case 177: -/* Line 1792 of yacc.c */ -#line 517 "./util/configparser.y" + case 238: +#line 735 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_root_hints:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->root_hints, (yyvsp[(2) - (2)].str))) + OUTYY(("P(server_root_hints:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->root_hints, (yyvsp[0].str))) yyerror("out of memory"); } +#line 2921 "util/configparser.c" /* yacc.c:1646 */ break; - case 178: -/* Line 1792 of yacc.c */ -#line 524 "./util/configparser.y" + case 239: +#line 742 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_dlv_anchor_file:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_dlv_anchor_file:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->dlv_anchor_file); - cfg_parser->cfg->dlv_anchor_file = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->dlv_anchor_file = (yyvsp[0].str); } +#line 2931 "util/configparser.c" /* yacc.c:1646 */ break; - case 179: -/* Line 1792 of yacc.c */ -#line 531 "./util/configparser.y" + case 240: +#line 749 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_dlv_anchor:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->dlv_anchor_list, (yyvsp[(2) - (2)].str))) + OUTYY(("P(server_dlv_anchor:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->dlv_anchor_list, (yyvsp[0].str))) yyerror("out of memory"); } +#line 2941 "util/configparser.c" /* yacc.c:1646 */ break; - case 180: -/* Line 1792 of yacc.c */ -#line 538 "./util/configparser.y" + case 241: +#line 756 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_auto_trust_anchor_file:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_auto_trust_anchor_file:%s)\n", (yyvsp[0].str))); if(!cfg_strlist_insert(&cfg_parser->cfg-> - auto_trust_anchor_file_list, (yyvsp[(2) - (2)].str))) + auto_trust_anchor_file_list, (yyvsp[0].str))) yyerror("out of memory"); } +#line 2952 "util/configparser.c" /* yacc.c:1646 */ break; - case 181: -/* Line 1792 of yacc.c */ -#line 546 "./util/configparser.y" + case 242: +#line 764 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_trust_anchor_file:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_trust_anchor_file:%s)\n", (yyvsp[0].str))); if(!cfg_strlist_insert(&cfg_parser->cfg-> - trust_anchor_file_list, (yyvsp[(2) - (2)].str))) + trust_anchor_file_list, (yyvsp[0].str))) yyerror("out of memory"); } +#line 2963 "util/configparser.c" /* yacc.c:1646 */ break; - case 182: -/* Line 1792 of yacc.c */ -#line 554 "./util/configparser.y" + case 243: +#line 772 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_trusted_keys_file:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_trusted_keys_file:%s)\n", (yyvsp[0].str))); if(!cfg_strlist_insert(&cfg_parser->cfg-> - trusted_keys_file_list, (yyvsp[(2) - (2)].str))) + trusted_keys_file_list, (yyvsp[0].str))) yyerror("out of memory"); } +#line 2974 "util/configparser.c" /* yacc.c:1646 */ break; - case 183: -/* Line 1792 of yacc.c */ -#line 562 "./util/configparser.y" + case 244: +#line 780 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_trust_anchor:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->trust_anchor_list, (yyvsp[(2) - (2)].str))) + OUTYY(("P(server_trust_anchor:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->trust_anchor_list, (yyvsp[0].str))) yyerror("out of memory"); } +#line 2984 "util/configparser.c" /* yacc.c:1646 */ break; - case 184: -/* Line 1792 of yacc.c */ -#line 569 "./util/configparser.y" + case 245: +#line 787 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_domain_insecure:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->domain_insecure, (yyvsp[(2) - (2)].str))) + OUTYY(("P(server_domain_insecure:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->domain_insecure, (yyvsp[0].str))) yyerror("out of memory"); } +#line 2994 "util/configparser.c" /* yacc.c:1646 */ break; - case 185: -/* Line 1792 of yacc.c */ -#line 576 "./util/configparser.y" + case 246: +#line 794 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_hide_identity:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_hide_identity:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->hide_identity = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->hide_identity = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3006 "util/configparser.c" /* yacc.c:1646 */ break; - case 186: -/* Line 1792 of yacc.c */ -#line 585 "./util/configparser.y" + case 247: +#line 803 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_hide_version:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_hide_version:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->hide_version = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->hide_version = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3018 "util/configparser.c" /* yacc.c:1646 */ break; - case 187: -/* Line 1792 of yacc.c */ -#line 594 "./util/configparser.y" + case 248: +#line 812 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_identity:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_hide_trustanchor:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->hide_trustanchor = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 3030 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 249: +#line 821 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_identity:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->identity); - cfg_parser->cfg->identity = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->identity = (yyvsp[0].str); } +#line 3040 "util/configparser.c" /* yacc.c:1646 */ break; - case 188: -/* Line 1792 of yacc.c */ -#line 601 "./util/configparser.y" + case 250: +#line 828 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_version:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_version:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->version); - cfg_parser->cfg->version = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->version = (yyvsp[0].str); } +#line 3050 "util/configparser.c" /* yacc.c:1646 */ break; - case 189: -/* Line 1792 of yacc.c */ -#line 608 "./util/configparser.y" + case 251: +#line 835 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_so_rcvbuf:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_parse_memsize((yyvsp[(2) - (2)].str), &cfg_parser->cfg->so_rcvbuf)) + OUTYY(("P(server_so_rcvbuf:%s)\n", (yyvsp[0].str))); + if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->so_rcvbuf)) yyerror("buffer size expected"); - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 3061 "util/configparser.c" /* yacc.c:1646 */ break; - case 190: -/* Line 1792 of yacc.c */ -#line 616 "./util/configparser.y" + case 252: +#line 843 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_so_sndbuf:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_parse_memsize((yyvsp[(2) - (2)].str), &cfg_parser->cfg->so_sndbuf)) + OUTYY(("P(server_so_sndbuf:%s)\n", (yyvsp[0].str))); + if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->so_sndbuf)) yyerror("buffer size expected"); - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 3072 "util/configparser.c" /* yacc.c:1646 */ break; - case 191: -/* Line 1792 of yacc.c */ -#line 624 "./util/configparser.y" + case 253: +#line 851 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_so_reuseport:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_so_reuseport:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->so_reuseport = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3085 "util/configparser.c" /* yacc.c:1646 */ break; - case 192: -/* Line 1792 of yacc.c */ -#line 634 "./util/configparser.y" + case 254: +#line 861 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_ip_transparent:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_ip_transparent:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->ip_transparent = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 3098 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 255: +#line 871 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_ip_freebind:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->ip_freebind = + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3111 "util/configparser.c" /* yacc.c:1646 */ break; - case 193: -/* Line 1792 of yacc.c */ -#line 644 "./util/configparser.y" + case 256: +#line 881 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_edns_buffer_size:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0) + OUTYY(("P(server_edns_buffer_size:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) yyerror("number expected"); - else if (atoi((yyvsp[(2) - (2)].str)) < 12) + else if (atoi((yyvsp[0].str)) < 12) yyerror("edns buffer size too small"); - else if (atoi((yyvsp[(2) - (2)].str)) > 65535) + else if (atoi((yyvsp[0].str)) > 65535) cfg_parser->cfg->edns_buffer_size = 65535; - else cfg_parser->cfg->edns_buffer_size = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->edns_buffer_size = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3127 "util/configparser.c" /* yacc.c:1646 */ break; - case 194: -/* Line 1792 of yacc.c */ -#line 657 "./util/configparser.y" + case 257: +#line 894 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_msg_buffer_size:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0) + OUTYY(("P(server_msg_buffer_size:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) yyerror("number expected"); - else if (atoi((yyvsp[(2) - (2)].str)) < 4096) + else if (atoi((yyvsp[0].str)) < 4096) yyerror("message buffer size too small (use 4096)"); - else cfg_parser->cfg->msg_buffer_size = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->msg_buffer_size = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3141 "util/configparser.c" /* yacc.c:1646 */ break; - case 195: -/* Line 1792 of yacc.c */ -#line 668 "./util/configparser.y" + case 258: +#line 905 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_msg_cache_size:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_parse_memsize((yyvsp[(2) - (2)].str), &cfg_parser->cfg->msg_cache_size)) + OUTYY(("P(server_msg_cache_size:%s)\n", (yyvsp[0].str))); + if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->msg_cache_size)) yyerror("memory size expected"); - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 3152 "util/configparser.c" /* yacc.c:1646 */ break; - case 196: -/* Line 1792 of yacc.c */ -#line 676 "./util/configparser.y" + case 259: +#line 913 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_msg_cache_slabs:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0) + OUTYY(("P(server_msg_cache_slabs:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) yyerror("number expected"); else { - cfg_parser->cfg->msg_cache_slabs = atoi((yyvsp[(2) - (2)].str)); + cfg_parser->cfg->msg_cache_slabs = atoi((yyvsp[0].str)); if(!is_pow2(cfg_parser->cfg->msg_cache_slabs)) yyerror("must be a power of 2"); } - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 3168 "util/configparser.c" /* yacc.c:1646 */ break; - case 197: -/* Line 1792 of yacc.c */ -#line 689 "./util/configparser.y" + case 260: +#line 926 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_num_queries_per_thread:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0) + OUTYY(("P(server_num_queries_per_thread:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) yyerror("number expected"); - else cfg_parser->cfg->num_queries_per_thread = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->num_queries_per_thread = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3180 "util/configparser.c" /* yacc.c:1646 */ break; - case 198: -/* Line 1792 of yacc.c */ -#line 698 "./util/configparser.y" + case 261: +#line 935 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_jostle_timeout:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_jostle_timeout:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->jostle_time = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->jostle_time = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3192 "util/configparser.c" /* yacc.c:1646 */ break; - case 199: -/* Line 1792 of yacc.c */ -#line 707 "./util/configparser.y" + case 262: +#line 944 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_delay_close:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_delay_close:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->delay_close = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->delay_close = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3204 "util/configparser.c" /* yacc.c:1646 */ break; - case 200: -/* Line 1792 of yacc.c */ -#line 716 "./util/configparser.y" + case 263: +#line 953 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_unblock_lan_zones:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_unblock_lan_zones:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->unblock_lan_zones = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3217 "util/configparser.c" /* yacc.c:1646 */ break; - case 201: -/* Line 1792 of yacc.c */ -#line 726 "./util/configparser.y" + case 264: +#line 963 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_rrset_cache_size:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_parse_memsize((yyvsp[(2) - (2)].str), &cfg_parser->cfg->rrset_cache_size)) + OUTYY(("P(server_insecure_lan_zones:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->insecure_lan_zones = + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 3230 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 265: +#line 973 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_rrset_cache_size:%s)\n", (yyvsp[0].str))); + if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->rrset_cache_size)) yyerror("memory size expected"); - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 3241 "util/configparser.c" /* yacc.c:1646 */ break; - case 202: -/* Line 1792 of yacc.c */ -#line 734 "./util/configparser.y" + case 266: +#line 981 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_rrset_cache_slabs:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0) + OUTYY(("P(server_rrset_cache_slabs:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) yyerror("number expected"); else { - cfg_parser->cfg->rrset_cache_slabs = atoi((yyvsp[(2) - (2)].str)); + cfg_parser->cfg->rrset_cache_slabs = atoi((yyvsp[0].str)); if(!is_pow2(cfg_parser->cfg->rrset_cache_slabs)) yyerror("must be a power of 2"); } - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 3257 "util/configparser.c" /* yacc.c:1646 */ break; - case 203: -/* Line 1792 of yacc.c */ -#line 747 "./util/configparser.y" + case 267: +#line 994 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_infra_host_ttl:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_infra_host_ttl:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->host_ttl = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->host_ttl = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3269 "util/configparser.c" /* yacc.c:1646 */ break; - case 204: -/* Line 1792 of yacc.c */ -#line 756 "./util/configparser.y" + case 268: +#line 1003 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_infra_lame_ttl:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_infra_lame_ttl:%s)\n", (yyvsp[0].str))); verbose(VERB_DETAIL, "ignored infra-lame-ttl: %s (option " - "removed, use infra-host-ttl)", (yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + "removed, use infra-host-ttl)", (yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3280 "util/configparser.c" /* yacc.c:1646 */ break; - case 205: -/* Line 1792 of yacc.c */ -#line 764 "./util/configparser.y" + case 269: +#line 1011 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_infra_cache_numhosts:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0) + OUTYY(("P(server_infra_cache_numhosts:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) yyerror("number expected"); - else cfg_parser->cfg->infra_cache_numhosts = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->infra_cache_numhosts = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3292 "util/configparser.c" /* yacc.c:1646 */ break; - case 206: -/* Line 1792 of yacc.c */ -#line 773 "./util/configparser.y" + case 270: +#line 1020 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_infra_cache_lame_size:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_infra_cache_lame_size:%s)\n", (yyvsp[0].str))); verbose(VERB_DETAIL, "ignored infra-cache-lame-size: %s " - "(option removed, use infra-cache-numhosts)", (yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + "(option removed, use infra-cache-numhosts)", (yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3303 "util/configparser.c" /* yacc.c:1646 */ break; - case 207: -/* Line 1792 of yacc.c */ -#line 781 "./util/configparser.y" + case 271: +#line 1028 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_infra_cache_slabs:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0) + OUTYY(("P(server_infra_cache_slabs:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) yyerror("number expected"); else { - cfg_parser->cfg->infra_cache_slabs = atoi((yyvsp[(2) - (2)].str)); + cfg_parser->cfg->infra_cache_slabs = atoi((yyvsp[0].str)); if(!is_pow2(cfg_parser->cfg->infra_cache_slabs)) yyerror("must be a power of 2"); } - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 3319 "util/configparser.c" /* yacc.c:1646 */ break; - case 208: -/* Line 1792 of yacc.c */ -#line 794 "./util/configparser.y" + case 272: +#line 1041 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_infra_cache_min_rtt:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_infra_cache_min_rtt:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->infra_cache_min_rtt = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->infra_cache_min_rtt = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3331 "util/configparser.c" /* yacc.c:1646 */ break; - case 209: -/* Line 1792 of yacc.c */ -#line 803 "./util/configparser.y" + case 273: +#line 1050 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_target_fetch_policy:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_target_fetch_policy:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->target_fetch_policy); - cfg_parser->cfg->target_fetch_policy = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->target_fetch_policy = (yyvsp[0].str); } +#line 3341 "util/configparser.c" /* yacc.c:1646 */ break; - case 210: -/* Line 1792 of yacc.c */ -#line 810 "./util/configparser.y" + case 274: +#line 1057 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_harden_short_bufsize:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_harden_short_bufsize:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->harden_short_bufsize = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3354 "util/configparser.c" /* yacc.c:1646 */ break; - case 211: -/* Line 1792 of yacc.c */ -#line 820 "./util/configparser.y" + case 275: +#line 1067 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_harden_large_queries:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_harden_large_queries:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->harden_large_queries = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3367 "util/configparser.c" /* yacc.c:1646 */ break; - case 212: -/* Line 1792 of yacc.c */ -#line 830 "./util/configparser.y" + case 276: +#line 1077 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_harden_glue:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_harden_glue:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->harden_glue = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3380 "util/configparser.c" /* yacc.c:1646 */ break; - case 213: -/* Line 1792 of yacc.c */ -#line 840 "./util/configparser.y" + case 277: +#line 1087 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_harden_dnssec_stripped:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_harden_dnssec_stripped:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->harden_dnssec_stripped = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3393 "util/configparser.c" /* yacc.c:1646 */ break; - case 214: -/* Line 1792 of yacc.c */ -#line 850 "./util/configparser.y" + case 278: +#line 1097 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_harden_below_nxdomain:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_harden_below_nxdomain:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->harden_below_nxdomain = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3406 "util/configparser.c" /* yacc.c:1646 */ break; - case 215: -/* Line 1792 of yacc.c */ -#line 860 "./util/configparser.y" + case 279: +#line 1107 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_harden_referral_path:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_harden_referral_path:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->harden_referral_path = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3419 "util/configparser.c" /* yacc.c:1646 */ break; - case 216: -/* Line 1792 of yacc.c */ -#line 870 "./util/configparser.y" + case 280: +#line 1117 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_harden_algo_downgrade:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_harden_algo_downgrade:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->harden_algo_downgrade = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3432 "util/configparser.c" /* yacc.c:1646 */ break; - case 217: -/* Line 1792 of yacc.c */ -#line 880 "./util/configparser.y" + case 281: +#line 1127 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_use_caps_for_id:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_use_caps_for_id:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->use_caps_bits_for_id = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3445 "util/configparser.c" /* yacc.c:1646 */ break; - case 218: -/* Line 1792 of yacc.c */ -#line 890 "./util/configparser.y" + case 282: +#line 1137 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_caps_whitelist:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->caps_whitelist, (yyvsp[(2) - (2)].str))) + OUTYY(("P(server_caps_whitelist:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->caps_whitelist, (yyvsp[0].str))) yyerror("out of memory"); } +#line 3455 "util/configparser.c" /* yacc.c:1646 */ break; - case 219: -/* Line 1792 of yacc.c */ -#line 897 "./util/configparser.y" + case 283: +#line 1144 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_private_address:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->private_address, (yyvsp[(2) - (2)].str))) + OUTYY(("P(server_private_address:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->private_address, (yyvsp[0].str))) yyerror("out of memory"); } +#line 3465 "util/configparser.c" /* yacc.c:1646 */ break; - case 220: -/* Line 1792 of yacc.c */ -#line 904 "./util/configparser.y" + case 284: +#line 1151 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_private_domain:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->private_domain, (yyvsp[(2) - (2)].str))) + OUTYY(("P(server_private_domain:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->private_domain, (yyvsp[0].str))) yyerror("out of memory"); } +#line 3475 "util/configparser.c" /* yacc.c:1646 */ break; - case 221: -/* Line 1792 of yacc.c */ -#line 911 "./util/configparser.y" + case 285: +#line 1158 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_prefetch:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_prefetch:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->prefetch = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->prefetch = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3487 "util/configparser.c" /* yacc.c:1646 */ break; - case 222: -/* Line 1792 of yacc.c */ -#line 920 "./util/configparser.y" + case 286: +#line 1167 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_prefetch_key:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_prefetch_key:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->prefetch_key = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->prefetch_key = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3499 "util/configparser.c" /* yacc.c:1646 */ break; - case 223: -/* Line 1792 of yacc.c */ -#line 929 "./util/configparser.y" + case 287: +#line 1176 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_unwanted_reply_threshold:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_unwanted_reply_threshold:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->unwanted_threshold = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->unwanted_threshold = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3511 "util/configparser.c" /* yacc.c:1646 */ break; - case 224: -/* Line 1792 of yacc.c */ -#line 938 "./util/configparser.y" + case 288: +#line 1185 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_do_not_query_address:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->donotqueryaddrs, (yyvsp[(2) - (2)].str))) + OUTYY(("P(server_do_not_query_address:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->donotqueryaddrs, (yyvsp[0].str))) yyerror("out of memory"); } +#line 3521 "util/configparser.c" /* yacc.c:1646 */ break; - case 225: -/* Line 1792 of yacc.c */ -#line 945 "./util/configparser.y" + case 289: +#line 1192 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_do_not_query_localhost:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_do_not_query_localhost:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->donotquery_localhost = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3534 "util/configparser.c" /* yacc.c:1646 */ break; - case 226: -/* Line 1792 of yacc.c */ -#line 955 "./util/configparser.y" - { - OUTYY(("P(server_access_control:%s %s)\n", (yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str))); - if(strcmp((yyvsp[(3) - (3)].str), "deny")!=0 && strcmp((yyvsp[(3) - (3)].str), "refuse")!=0 && - strcmp((yyvsp[(3) - (3)].str), "deny_non_local")!=0 && - strcmp((yyvsp[(3) - (3)].str), "refuse_non_local")!=0 && - strcmp((yyvsp[(3) - (3)].str), "allow")!=0 && - strcmp((yyvsp[(3) - (3)].str), "allow_snoop")!=0) { + case 290: +#line 1202 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_access_control:%s %s)\n", (yyvsp[-1].str), (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "deny")!=0 && strcmp((yyvsp[0].str), "refuse")!=0 && + strcmp((yyvsp[0].str), "deny_non_local")!=0 && + strcmp((yyvsp[0].str), "refuse_non_local")!=0 && + strcmp((yyvsp[0].str), "allow")!=0 && + strcmp((yyvsp[0].str), "allow_snoop")!=0) { yyerror("expected deny, refuse, deny_non_local, " "refuse_non_local, allow or allow_snoop " "in access control action"); } else { - if(!cfg_str2list_insert(&cfg_parser->cfg->acls, (yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str))) + if(!cfg_str2list_insert(&cfg_parser->cfg->acls, (yyvsp[-1].str), (yyvsp[0].str))) fatal_exit("out of memory adding acl"); } } +#line 3554 "util/configparser.c" /* yacc.c:1646 */ break; - case 227: -/* Line 1792 of yacc.c */ -#line 972 "./util/configparser.y" + case 291: +#line 1219 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_module_conf:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_module_conf:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->module_conf); - cfg_parser->cfg->module_conf = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->module_conf = (yyvsp[0].str); } +#line 3564 "util/configparser.c" /* yacc.c:1646 */ break; - case 228: -/* Line 1792 of yacc.c */ -#line 979 "./util/configparser.y" + case 292: +#line 1226 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_val_override_date:%s)\n", (yyvsp[(2) - (2)].str))); - if(strlen((yyvsp[(2) - (2)].str)) == 0 || strcmp((yyvsp[(2) - (2)].str), "0") == 0) { + OUTYY(("P(server_val_override_date:%s)\n", (yyvsp[0].str))); + if(*(yyvsp[0].str) == '\0' || strcmp((yyvsp[0].str), "0") == 0) { cfg_parser->cfg->val_date_override = 0; - } else if(strlen((yyvsp[(2) - (2)].str)) == 14) { + } else if(strlen((yyvsp[0].str)) == 14) { cfg_parser->cfg->val_date_override = - cfg_convert_timeval((yyvsp[(2) - (2)].str)); + cfg_convert_timeval((yyvsp[0].str)); if(!cfg_parser->cfg->val_date_override) yyerror("bad date/time specification"); } else { - if(atoi((yyvsp[(2) - (2)].str)) == 0) + if(atoi((yyvsp[0].str)) == 0) yyerror("number expected"); - cfg_parser->cfg->val_date_override = atoi((yyvsp[(2) - (2)].str)); + cfg_parser->cfg->val_date_override = atoi((yyvsp[0].str)); } - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 3585 "util/configparser.c" /* yacc.c:1646 */ break; - case 229: -/* Line 1792 of yacc.c */ -#line 997 "./util/configparser.y" + case 293: +#line 1244 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_val_sig_skew_min:%s)\n", (yyvsp[(2) - (2)].str))); - if(strlen((yyvsp[(2) - (2)].str)) == 0 || strcmp((yyvsp[(2) - (2)].str), "0") == 0) { + OUTYY(("P(server_val_sig_skew_min:%s)\n", (yyvsp[0].str))); + if(*(yyvsp[0].str) == '\0' || strcmp((yyvsp[0].str), "0") == 0) { cfg_parser->cfg->val_sig_skew_min = 0; } else { - cfg_parser->cfg->val_sig_skew_min = atoi((yyvsp[(2) - (2)].str)); + cfg_parser->cfg->val_sig_skew_min = atoi((yyvsp[0].str)); if(!cfg_parser->cfg->val_sig_skew_min) yyerror("number expected"); } - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 3601 "util/configparser.c" /* yacc.c:1646 */ break; - case 230: -/* Line 1792 of yacc.c */ -#line 1010 "./util/configparser.y" + case 294: +#line 1257 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_val_sig_skew_max:%s)\n", (yyvsp[(2) - (2)].str))); - if(strlen((yyvsp[(2) - (2)].str)) == 0 || strcmp((yyvsp[(2) - (2)].str), "0") == 0) { + OUTYY(("P(server_val_sig_skew_max:%s)\n", (yyvsp[0].str))); + if(*(yyvsp[0].str) == '\0' || strcmp((yyvsp[0].str), "0") == 0) { cfg_parser->cfg->val_sig_skew_max = 0; } else { - cfg_parser->cfg->val_sig_skew_max = atoi((yyvsp[(2) - (2)].str)); + cfg_parser->cfg->val_sig_skew_max = atoi((yyvsp[0].str)); if(!cfg_parser->cfg->val_sig_skew_max) yyerror("number expected"); } - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 3617 "util/configparser.c" /* yacc.c:1646 */ break; - case 231: -/* Line 1792 of yacc.c */ -#line 1023 "./util/configparser.y" + case 295: +#line 1270 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_cache_max_ttl:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_cache_max_ttl:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->max_ttl = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->max_ttl = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3629 "util/configparser.c" /* yacc.c:1646 */ break; - case 232: -/* Line 1792 of yacc.c */ -#line 1032 "./util/configparser.y" + case 296: +#line 1279 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_cache_max_negative_ttl:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_cache_max_negative_ttl:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->max_negative_ttl = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->max_negative_ttl = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3641 "util/configparser.c" /* yacc.c:1646 */ break; - case 233: -/* Line 1792 of yacc.c */ -#line 1041 "./util/configparser.y" + case 297: +#line 1288 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_cache_min_ttl:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_cache_min_ttl:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->min_ttl = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->min_ttl = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3653 "util/configparser.c" /* yacc.c:1646 */ break; - case 234: -/* Line 1792 of yacc.c */ -#line 1050 "./util/configparser.y" + case 298: +#line 1297 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_bogus_ttl:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_bogus_ttl:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->bogus_ttl = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->bogus_ttl = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3665 "util/configparser.c" /* yacc.c:1646 */ break; - case 235: -/* Line 1792 of yacc.c */ -#line 1059 "./util/configparser.y" + case 299: +#line 1306 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_val_clean_additional:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_val_clean_additional:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->val_clean_additional = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3678 "util/configparser.c" /* yacc.c:1646 */ break; - case 236: -/* Line 1792 of yacc.c */ -#line 1069 "./util/configparser.y" + case 300: +#line 1316 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_val_permissive_mode:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_val_permissive_mode:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->val_permissive_mode = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3691 "util/configparser.c" /* yacc.c:1646 */ break; - case 237: -/* Line 1792 of yacc.c */ -#line 1079 "./util/configparser.y" + case 301: +#line 1326 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_ignore_cd_flag:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_ignore_cd_flag:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->ignore_cd = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->ignore_cd = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3703 "util/configparser.c" /* yacc.c:1646 */ break; - case 238: -/* Line 1792 of yacc.c */ -#line 1088 "./util/configparser.y" + case 302: +#line 1335 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_val_log_level:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_serve_expired:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->serve_expired = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 3715 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 303: +#line 1344 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_fake_dsa:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); +#ifdef HAVE_SSL + else fake_dsa = (strcmp((yyvsp[0].str), "yes")==0); + if(fake_dsa) + log_warn("test option fake_dsa is enabled"); +#endif + free((yyvsp[0].str)); + } +#line 3731 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 304: +#line 1357 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_fake_sha1:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); +#ifdef HAVE_SSL + else fake_sha1 = (strcmp((yyvsp[0].str), "yes")==0); + if(fake_sha1) + log_warn("test option fake_sha1 is enabled"); +#endif + free((yyvsp[0].str)); + } +#line 3747 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 305: +#line 1370 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_val_log_level:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->val_log_level = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->val_log_level = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3759 "util/configparser.c" /* yacc.c:1646 */ break; - case 239: -/* Line 1792 of yacc.c */ -#line 1097 "./util/configparser.y" + case 306: +#line 1379 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_val_nsec3_keysize_iterations:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_val_nsec3_keysize_iterations:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->val_nsec3_key_iterations); - cfg_parser->cfg->val_nsec3_key_iterations = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->val_nsec3_key_iterations = (yyvsp[0].str); } +#line 3769 "util/configparser.c" /* yacc.c:1646 */ break; - case 240: -/* Line 1792 of yacc.c */ -#line 1104 "./util/configparser.y" + case 307: +#line 1386 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_add_holddown:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_add_holddown:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->add_holddown = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->add_holddown = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3781 "util/configparser.c" /* yacc.c:1646 */ break; - case 241: -/* Line 1792 of yacc.c */ -#line 1113 "./util/configparser.y" + case 308: +#line 1395 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_del_holddown:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_del_holddown:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->del_holddown = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->del_holddown = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3793 "util/configparser.c" /* yacc.c:1646 */ break; - case 242: -/* Line 1792 of yacc.c */ -#line 1122 "./util/configparser.y" + case 309: +#line 1404 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_keep_missing:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_keep_missing:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->keep_missing = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->keep_missing = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3805 "util/configparser.c" /* yacc.c:1646 */ break; - case 243: -/* Line 1792 of yacc.c */ -#line 1131 "./util/configparser.y" + case 310: +#line 1413 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_permit_small_holddown:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_permit_small_holddown:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->permit_small_holddown = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3818 "util/configparser.c" /* yacc.c:1646 */ break; - case 244: -/* Line 1792 of yacc.c */ -#line 1140 "./util/configparser.y" + case 311: +#line 1422 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_key_cache_size:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_parse_memsize((yyvsp[(2) - (2)].str), &cfg_parser->cfg->key_cache_size)) + OUTYY(("P(server_key_cache_size:%s)\n", (yyvsp[0].str))); + if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->key_cache_size)) yyerror("memory size expected"); - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 3829 "util/configparser.c" /* yacc.c:1646 */ break; - case 245: -/* Line 1792 of yacc.c */ -#line 1148 "./util/configparser.y" + case 312: +#line 1430 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_key_cache_slabs:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0) + OUTYY(("P(server_key_cache_slabs:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) yyerror("number expected"); else { - cfg_parser->cfg->key_cache_slabs = atoi((yyvsp[(2) - (2)].str)); + cfg_parser->cfg->key_cache_slabs = atoi((yyvsp[0].str)); if(!is_pow2(cfg_parser->cfg->key_cache_slabs)) yyerror("must be a power of 2"); } - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 3845 "util/configparser.c" /* yacc.c:1646 */ break; - case 246: -/* Line 1792 of yacc.c */ -#line 1161 "./util/configparser.y" + case 313: +#line 1443 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_neg_cache_size:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_parse_memsize((yyvsp[(2) - (2)].str), &cfg_parser->cfg->neg_cache_size)) + OUTYY(("P(server_neg_cache_size:%s)\n", (yyvsp[0].str))); + if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->neg_cache_size)) yyerror("memory size expected"); - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 3856 "util/configparser.c" /* yacc.c:1646 */ break; - case 247: -/* Line 1792 of yacc.c */ -#line 1169 "./util/configparser.y" - { - OUTYY(("P(server_local_zone:%s %s)\n", (yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str))); - if(strcmp((yyvsp[(3) - (3)].str), "static")!=0 && strcmp((yyvsp[(3) - (3)].str), "deny")!=0 && - strcmp((yyvsp[(3) - (3)].str), "refuse")!=0 && strcmp((yyvsp[(3) - (3)].str), "redirect")!=0 && - strcmp((yyvsp[(3) - (3)].str), "transparent")!=0 && strcmp((yyvsp[(3) - (3)].str), "nodefault")!=0 - && strcmp((yyvsp[(3) - (3)].str), "typetransparent")!=0 && - strcmp((yyvsp[(3) - (3)].str), "inform")!=0 && strcmp((yyvsp[(3) - (3)].str), "inform_deny")!=0) + case 314: +#line 1451 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_local_zone:%s %s)\n", (yyvsp[-1].str), (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "static")!=0 && strcmp((yyvsp[0].str), "deny")!=0 && + strcmp((yyvsp[0].str), "refuse")!=0 && strcmp((yyvsp[0].str), "redirect")!=0 && + strcmp((yyvsp[0].str), "transparent")!=0 && strcmp((yyvsp[0].str), "nodefault")!=0 + && strcmp((yyvsp[0].str), "typetransparent")!=0 + && strcmp((yyvsp[0].str), "always_transparent")!=0 + && strcmp((yyvsp[0].str), "always_refuse")!=0 + && strcmp((yyvsp[0].str), "always_nxdomain")!=0 + && strcmp((yyvsp[0].str), "inform")!=0 && strcmp((yyvsp[0].str), "inform_deny")!=0) yyerror("local-zone type: expected static, deny, " "refuse, redirect, transparent, " - "typetransparent, inform, inform_deny " - "or nodefault"); - else if(strcmp((yyvsp[(3) - (3)].str), "nodefault")==0) { + "typetransparent, inform, inform_deny, " + "always_transparent, always_refuse, " + "always_nxdomain or nodefault"); + else if(strcmp((yyvsp[0].str), "nodefault")==0) { if(!cfg_strlist_insert(&cfg_parser->cfg-> - local_zones_nodefault, (yyvsp[(2) - (3)].str))) + local_zones_nodefault, (yyvsp[-1].str))) fatal_exit("out of memory adding local-zone"); - free((yyvsp[(3) - (3)].str)); + free((yyvsp[0].str)); } else { if(!cfg_str2list_insert(&cfg_parser->cfg->local_zones, - (yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str))) + (yyvsp[-1].str), (yyvsp[0].str))) fatal_exit("out of memory adding local-zone"); } } +#line 3887 "util/configparser.c" /* yacc.c:1646 */ break; - case 248: -/* Line 1792 of yacc.c */ -#line 1193 "./util/configparser.y" + case 315: +#line 1479 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_local_data:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->local_data, (yyvsp[(2) - (2)].str))) + OUTYY(("P(server_local_data:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->local_data, (yyvsp[0].str))) fatal_exit("out of memory adding local-data"); } +#line 3897 "util/configparser.c" /* yacc.c:1646 */ break; - case 249: -/* Line 1792 of yacc.c */ -#line 1200 "./util/configparser.y" + case 316: +#line 1486 "util/configparser.y" /* yacc.c:1646 */ { char* ptr; - OUTYY(("P(server_local_data_ptr:%s)\n", (yyvsp[(2) - (2)].str))); - ptr = cfg_ptr_reverse((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + OUTYY(("P(server_local_data_ptr:%s)\n", (yyvsp[0].str))); + ptr = cfg_ptr_reverse((yyvsp[0].str)); + free((yyvsp[0].str)); if(ptr) { if(!cfg_strlist_insert(&cfg_parser->cfg-> local_data, ptr)) @@ -3602,525 +3911,977 @@ yyreduce: yyerror("local-data-ptr could not be reversed"); } } +#line 3915 "util/configparser.c" /* yacc.c:1646 */ break; - case 250: -/* Line 1792 of yacc.c */ -#line 1215 "./util/configparser.y" + case 317: +#line 1501 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_minimal_responses:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_minimal_responses:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->minimal_responses = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3928 "util/configparser.c" /* yacc.c:1646 */ break; - case 251: -/* Line 1792 of yacc.c */ -#line 1225 "./util/configparser.y" + case 318: +#line 1511 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_rrset_roundrobin:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_rrset_roundrobin:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->rrset_roundrobin = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3941 "util/configparser.c" /* yacc.c:1646 */ break; - case 252: -/* Line 1792 of yacc.c */ -#line 1235 "./util/configparser.y" + case 319: +#line 1521 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_max_udp_size:%s)\n", (yyvsp[(2) - (2)].str))); - cfg_parser->cfg->max_udp_size = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + OUTYY(("P(server_max_udp_size:%s)\n", (yyvsp[0].str))); + cfg_parser->cfg->max_udp_size = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 3951 "util/configparser.c" /* yacc.c:1646 */ break; - case 253: -/* Line 1792 of yacc.c */ -#line 1242 "./util/configparser.y" + case 320: +#line 1528 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(dns64_prefix:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(dns64_prefix:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->dns64_prefix); - cfg_parser->cfg->dns64_prefix = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->dns64_prefix = (yyvsp[0].str); } +#line 3961 "util/configparser.c" /* yacc.c:1646 */ break; - case 254: -/* Line 1792 of yacc.c */ -#line 1249 "./util/configparser.y" + case 321: +#line 1535 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_dns64_synthall:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_dns64_synthall:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->dns64_synthall = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->dns64_synthall = (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 3973 "util/configparser.c" /* yacc.c:1646 */ break; - case 255: -/* Line 1792 of yacc.c */ -#line 1258 "./util/configparser.y" + case 322: +#line 1544 "util/configparser.y" /* yacc.c:1646 */ + { + char* p, *s = (yyvsp[0].str); + OUTYY(("P(server_define_tag:%s)\n", (yyvsp[0].str))); + while((p=strsep(&s, " \t\n")) != NULL) { + if(*p) { + if(!config_add_tag(cfg_parser->cfg, p)) + yyerror("could not define-tag, " + "out of memory"); + } + } + free((yyvsp[0].str)); + } +#line 3990 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 323: +#line 1558 "util/configparser.y" /* yacc.c:1646 */ + { + size_t len = 0; + uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, (yyvsp[0].str), + &len); + free((yyvsp[0].str)); + OUTYY(("P(server_local_zone_tag:%s)\n", (yyvsp[-1].str))); + if(!bitlist) + yyerror("could not parse tags, (define-tag them first)"); + if(bitlist) { + if(!cfg_strbytelist_insert( + &cfg_parser->cfg->local_zone_tags, + (yyvsp[-1].str), bitlist, len)) { + yyerror("out of memory"); + free((yyvsp[-1].str)); + } + } + } +#line 4012 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 324: +#line 1577 "util/configparser.y" /* yacc.c:1646 */ + { + size_t len = 0; + uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, (yyvsp[0].str), + &len); + free((yyvsp[0].str)); + OUTYY(("P(server_access_control_tag:%s)\n", (yyvsp[-1].str))); + if(!bitlist) + yyerror("could not parse tags, (define-tag them first)"); + if(bitlist) { + if(!cfg_strbytelist_insert( + &cfg_parser->cfg->acl_tags, + (yyvsp[-1].str), bitlist, len)) { + yyerror("out of memory"); + free((yyvsp[-1].str)); + } + } + } +#line 4034 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 325: +#line 1596 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_access_control_tag_action:%s %s %s)\n", (yyvsp[-2].str), (yyvsp[-1].str), (yyvsp[0].str))); + if(!cfg_str3list_insert(&cfg_parser->cfg->acl_tag_actions, + (yyvsp[-2].str), (yyvsp[-1].str), (yyvsp[0].str))) { + yyerror("out of memory"); + free((yyvsp[-2].str)); + free((yyvsp[-1].str)); + free((yyvsp[0].str)); + } + } +#line 4049 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 326: +#line 1608 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_access_control_tag_data:%s %s %s)\n", (yyvsp[-2].str), (yyvsp[-1].str), (yyvsp[0].str))); + if(!cfg_str3list_insert(&cfg_parser->cfg->acl_tag_datas, + (yyvsp[-2].str), (yyvsp[-1].str), (yyvsp[0].str))) { + yyerror("out of memory"); + free((yyvsp[-2].str)); + free((yyvsp[-1].str)); + free((yyvsp[0].str)); + } + } +#line 4064 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 327: +#line 1620 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_local_zone_override:%s %s %s)\n", (yyvsp[-2].str), (yyvsp[-1].str), (yyvsp[0].str))); + if(!cfg_str3list_insert(&cfg_parser->cfg->local_zone_overrides, + (yyvsp[-2].str), (yyvsp[-1].str), (yyvsp[0].str))) { + yyerror("out of memory"); + free((yyvsp[-2].str)); + free((yyvsp[-1].str)); + free((yyvsp[0].str)); + } + } +#line 4079 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 328: +#line 1632 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_access_control_view:%s %s)\n", (yyvsp[-1].str), (yyvsp[0].str))); + if(!cfg_str2list_insert(&cfg_parser->cfg->acl_view, + (yyvsp[-1].str), (yyvsp[0].str))) { + yyerror("out of memory"); + free((yyvsp[-1].str)); + free((yyvsp[0].str)); + } + } +#line 4093 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 329: +#line 1643 "util/configparser.y" /* yacc.c:1646 */ + { + size_t len = 0; + uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, (yyvsp[0].str), + &len); + free((yyvsp[0].str)); + OUTYY(("P(response_ip_tag:%s)\n", (yyvsp[-1].str))); + if(!bitlist) + yyerror("could not parse tags, (define-tag them first)"); + if(bitlist) { + if(!cfg_strbytelist_insert( + &cfg_parser->cfg->respip_tags, + (yyvsp[-1].str), bitlist, len)) { + yyerror("out of memory"); + free((yyvsp[-1].str)); + } + } + } +#line 4115 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 330: +#line 1662 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_ratelimit:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_ip_ratelimit:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->ratelimit = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->ip_ratelimit = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 4127 "util/configparser.c" /* yacc.c:1646 */ break; - case 256: -/* Line 1792 of yacc.c */ -#line 1267 "./util/configparser.y" + case 331: +#line 1672 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_ratelimit:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) + yyerror("number expected"); + else cfg_parser->cfg->ratelimit = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); + } +#line 4139 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 332: +#line 1681 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_ip_ratelimit_size:%s)\n", (yyvsp[0].str))); + if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->ip_ratelimit_size)) + yyerror("memory size expected"); + free((yyvsp[0].str)); + } +#line 4150 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 333: +#line 1689 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_ratelimit_size:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_parse_memsize((yyvsp[(2) - (2)].str), &cfg_parser->cfg->ratelimit_size)) + OUTYY(("P(server_ratelimit_size:%s)\n", (yyvsp[0].str))); + if(!cfg_parse_memsize((yyvsp[0].str), &cfg_parser->cfg->ratelimit_size)) yyerror("memory size expected"); - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 4161 "util/configparser.c" /* yacc.c:1646 */ break; - case 257: -/* Line 1792 of yacc.c */ -#line 1275 "./util/configparser.y" + case 334: +#line 1697 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_ip_ratelimit_slabs:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) + yyerror("number expected"); + else { + cfg_parser->cfg->ip_ratelimit_slabs = atoi((yyvsp[0].str)); + if(!is_pow2(cfg_parser->cfg->ip_ratelimit_slabs)) + yyerror("must be a power of 2"); + } + free((yyvsp[0].str)); + } +#line 4177 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 335: +#line 1710 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_ratelimit_slabs:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0) + OUTYY(("P(server_ratelimit_slabs:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) yyerror("number expected"); else { - cfg_parser->cfg->ratelimit_slabs = atoi((yyvsp[(2) - (2)].str)); + cfg_parser->cfg->ratelimit_slabs = atoi((yyvsp[0].str)); if(!is_pow2(cfg_parser->cfg->ratelimit_slabs)) yyerror("must be a power of 2"); } - free((yyvsp[(2) - (2)].str)); + free((yyvsp[0].str)); } +#line 4193 "util/configparser.c" /* yacc.c:1646 */ break; - case 258: -/* Line 1792 of yacc.c */ -#line 1288 "./util/configparser.y" + case 336: +#line 1723 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_ratelimit_for_domain:%s %s)\n", (yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str))); - if(atoi((yyvsp[(3) - (3)].str)) == 0 && strcmp((yyvsp[(3) - (3)].str), "0") != 0) { + OUTYY(("P(server_ratelimit_for_domain:%s %s)\n", (yyvsp[-1].str), (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) { yyerror("number expected"); } else { if(!cfg_str2list_insert(&cfg_parser->cfg-> - ratelimit_for_domain, (yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str))) + ratelimit_for_domain, (yyvsp[-1].str), (yyvsp[0].str))) fatal_exit("out of memory adding " "ratelimit-for-domain"); } } +#line 4209 "util/configparser.c" /* yacc.c:1646 */ break; - case 259: -/* Line 1792 of yacc.c */ -#line 1301 "./util/configparser.y" + case 337: +#line 1736 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_ratelimit_below_domain:%s %s)\n", (yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str))); - if(atoi((yyvsp[(3) - (3)].str)) == 0 && strcmp((yyvsp[(3) - (3)].str), "0") != 0) { + OUTYY(("P(server_ratelimit_below_domain:%s %s)\n", (yyvsp[-1].str), (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) { yyerror("number expected"); } else { if(!cfg_str2list_insert(&cfg_parser->cfg-> - ratelimit_below_domain, (yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str))) + ratelimit_below_domain, (yyvsp[-1].str), (yyvsp[0].str))) fatal_exit("out of memory adding " "ratelimit-below-domain"); } } +#line 4225 "util/configparser.c" /* yacc.c:1646 */ break; - case 260: -/* Line 1792 of yacc.c */ -#line 1314 "./util/configparser.y" + case 338: +#line 1749 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_ratelimit_factor:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0 && strcmp((yyvsp[(2) - (2)].str), "0") != 0) + OUTYY(("P(server_ip_ratelimit_factor:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) + yyerror("number expected"); + else cfg_parser->cfg->ip_ratelimit_factor = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); + } +#line 4237 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 339: +#line 1758 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_ratelimit_factor:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0 && strcmp((yyvsp[0].str), "0") != 0) yyerror("number expected"); - else cfg_parser->cfg->ratelimit_factor = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->ratelimit_factor = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 4249 "util/configparser.c" /* yacc.c:1646 */ break; - case 261: -/* Line 1792 of yacc.c */ -#line 1323 "./util/configparser.y" + case 340: +#line 1767 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(server_qname_minimisation:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(server_qname_minimisation:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->qname_minimisation = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 4262 "util/configparser.c" /* yacc.c:1646 */ break; - case 262: -/* Line 1792 of yacc.c */ -#line 1333 "./util/configparser.y" + case 341: +#line 1777 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(name:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(server_qname_minimisation_strict:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->qname_minimisation_strict = + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 4275 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 342: +#line 1787 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(name:%s)\n", (yyvsp[0].str))); if(cfg_parser->cfg->stubs->name) yyerror("stub name override, there must be one name " "for one stub-zone"); free(cfg_parser->cfg->stubs->name); - cfg_parser->cfg->stubs->name = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->stubs->name = (yyvsp[0].str); } +#line 4288 "util/configparser.c" /* yacc.c:1646 */ break; - case 263: -/* Line 1792 of yacc.c */ -#line 1343 "./util/configparser.y" + case 343: +#line 1797 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(stub-host:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->hosts, (yyvsp[(2) - (2)].str))) + OUTYY(("P(stub-host:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->hosts, (yyvsp[0].str))) yyerror("out of memory"); } +#line 4298 "util/configparser.c" /* yacc.c:1646 */ break; - case 264: -/* Line 1792 of yacc.c */ -#line 1350 "./util/configparser.y" + case 344: +#line 1804 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(stub-addr:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->addrs, (yyvsp[(2) - (2)].str))) + OUTYY(("P(stub-addr:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->stubs->addrs, (yyvsp[0].str))) yyerror("out of memory"); } +#line 4308 "util/configparser.c" /* yacc.c:1646 */ break; - case 265: -/* Line 1792 of yacc.c */ -#line 1357 "./util/configparser.y" + case 345: +#line 1811 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(stub-first:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(stub-first:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->stubs->isfirst=(strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->stubs->isfirst=(strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 4320 "util/configparser.c" /* yacc.c:1646 */ break; - case 266: -/* Line 1792 of yacc.c */ -#line 1366 "./util/configparser.y" + case 346: +#line 1820 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(stub-ssl-upstream:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->stubs->ssl_upstream = + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 4333 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 347: +#line 1830 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(stub-prime:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(stub-prime:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->stubs->isprime = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 4346 "util/configparser.c" /* yacc.c:1646 */ break; - case 267: -/* Line 1792 of yacc.c */ -#line 1376 "./util/configparser.y" + case 348: +#line 1840 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(name:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(name:%s)\n", (yyvsp[0].str))); if(cfg_parser->cfg->forwards->name) yyerror("forward name override, there must be one " "name for one forward-zone"); free(cfg_parser->cfg->forwards->name); - cfg_parser->cfg->forwards->name = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->forwards->name = (yyvsp[0].str); } +#line 4359 "util/configparser.c" /* yacc.c:1646 */ break; - case 268: -/* Line 1792 of yacc.c */ -#line 1386 "./util/configparser.y" + case 349: +#line 1850 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(forward-host:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->forwards->hosts, (yyvsp[(2) - (2)].str))) + OUTYY(("P(forward-host:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->forwards->hosts, (yyvsp[0].str))) yyerror("out of memory"); } +#line 4369 "util/configparser.c" /* yacc.c:1646 */ break; - case 269: -/* Line 1792 of yacc.c */ -#line 1393 "./util/configparser.y" + case 350: +#line 1857 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(forward-addr:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->forwards->addrs, (yyvsp[(2) - (2)].str))) + OUTYY(("P(forward-addr:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->forwards->addrs, (yyvsp[0].str))) yyerror("out of memory"); } +#line 4379 "util/configparser.c" /* yacc.c:1646 */ break; - case 270: -/* Line 1792 of yacc.c */ -#line 1400 "./util/configparser.y" + case 351: +#line 1864 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(forward-first:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(forward-first:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->forwards->isfirst=(strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->forwards->isfirst=(strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 4391 "util/configparser.c" /* yacc.c:1646 */ break; - case 271: -/* Line 1792 of yacc.c */ -#line 1409 "./util/configparser.y" + case 352: +#line 1873 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(forward-ssl-upstream:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->forwards->ssl_upstream = + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 4404 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 353: +#line 1883 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(name:%s)\n", (yyvsp[0].str))); + if(cfg_parser->cfg->views->name) + yyerror("view name override, there must be one " + "name for one view"); + free(cfg_parser->cfg->views->name); + cfg_parser->cfg->views->name = (yyvsp[0].str); + } +#line 4417 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 354: +#line 1893 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(view_local_zone:%s %s)\n", (yyvsp[-1].str), (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "static")!=0 && strcmp((yyvsp[0].str), "deny")!=0 && + strcmp((yyvsp[0].str), "refuse")!=0 && strcmp((yyvsp[0].str), "redirect")!=0 && + strcmp((yyvsp[0].str), "transparent")!=0 && strcmp((yyvsp[0].str), "nodefault")!=0 + && strcmp((yyvsp[0].str), "typetransparent")!=0 + && strcmp((yyvsp[0].str), "always_transparent")!=0 + && strcmp((yyvsp[0].str), "always_refuse")!=0 + && strcmp((yyvsp[0].str), "always_nxdomain")!=0 + && strcmp((yyvsp[0].str), "inform")!=0 && strcmp((yyvsp[0].str), "inform_deny")!=0) + yyerror("local-zone type: expected static, deny, " + "refuse, redirect, transparent, " + "typetransparent, inform, inform_deny, " + "always_transparent, always_refuse, " + "always_nxdomain or nodefault"); + else if(strcmp((yyvsp[0].str), "nodefault")==0) { + if(!cfg_strlist_insert(&cfg_parser->cfg->views-> + local_zones_nodefault, (yyvsp[-1].str))) + fatal_exit("out of memory adding local-zone"); + free((yyvsp[0].str)); + } else { + if(!cfg_str2list_insert( + &cfg_parser->cfg->views->local_zones, + (yyvsp[-1].str), (yyvsp[0].str))) + fatal_exit("out of memory adding local-zone"); + } + } +#line 4449 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 355: +#line 1922 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(view_response_ip:%s %s)\n", (yyvsp[-1].str), (yyvsp[0].str))); + validate_respip_action((yyvsp[0].str)); + if(!cfg_str2list_insert( + &cfg_parser->cfg->views->respip_actions, (yyvsp[-1].str), (yyvsp[0].str))) + fatal_exit("out of memory adding per-view " + "response-ip action"); + } +#line 4462 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 356: +#line 1932 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(view_response_ip_data:%s)\n", (yyvsp[-1].str))); + if(!cfg_str2list_insert( + &cfg_parser->cfg->views->respip_data, (yyvsp[-1].str), (yyvsp[0].str))) + fatal_exit("out of memory adding response-ip-data"); + } +#line 4473 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 357: +#line 1940 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(view_local_data:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->views->local_data, (yyvsp[0].str))) { + fatal_exit("out of memory adding local-data"); + free((yyvsp[0].str)); + } + } +#line 4485 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 358: +#line 1949 "util/configparser.y" /* yacc.c:1646 */ + { + char* ptr; + OUTYY(("P(view_local_data_ptr:%s)\n", (yyvsp[0].str))); + ptr = cfg_ptr_reverse((yyvsp[0].str)); + free((yyvsp[0].str)); + if(ptr) { + if(!cfg_strlist_insert(&cfg_parser->cfg->views-> + local_data, ptr)) + fatal_exit("out of memory adding local-data"); + } else { + yyerror("local-data-ptr could not be reversed"); + } + } +#line 4503 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 359: +#line 1964 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(view-first:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->views->isfirst=(strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 4515 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 360: +#line 1973 "util/configparser.y" /* yacc.c:1646 */ { OUTYY(("\nP(remote-control:)\n")); } +#line 4523 "util/configparser.c" /* yacc.c:1646 */ break; - case 282: -/* Line 1792 of yacc.c */ -#line 1420 "./util/configparser.y" + case 371: +#line 1984 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(control_enable:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(control_enable:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->remote_control_enable = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 4536 "util/configparser.c" /* yacc.c:1646 */ break; - case 283: -/* Line 1792 of yacc.c */ -#line 1430 "./util/configparser.y" + case 372: +#line 1994 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(control_port:%s)\n", (yyvsp[(2) - (2)].str))); - if(atoi((yyvsp[(2) - (2)].str)) == 0) + OUTYY(("P(control_port:%s)\n", (yyvsp[0].str))); + if(atoi((yyvsp[0].str)) == 0) yyerror("control port number expected"); - else cfg_parser->cfg->control_port = atoi((yyvsp[(2) - (2)].str)); - free((yyvsp[(2) - (2)].str)); + else cfg_parser->cfg->control_port = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); } +#line 4548 "util/configparser.c" /* yacc.c:1646 */ break; - case 284: -/* Line 1792 of yacc.c */ -#line 1439 "./util/configparser.y" + case 373: +#line 2003 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(control_interface:%s)\n", (yyvsp[(2) - (2)].str))); - if(!cfg_strlist_insert(&cfg_parser->cfg->control_ifs, (yyvsp[(2) - (2)].str))) + OUTYY(("P(control_interface:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->control_ifs, (yyvsp[0].str))) yyerror("out of memory"); } +#line 4558 "util/configparser.c" /* yacc.c:1646 */ break; - case 285: -/* Line 1792 of yacc.c */ -#line 1446 "./util/configparser.y" + case 374: +#line 2010 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(control_use_cert:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(control_use_cert:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->remote_control_use_cert = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); - free((yyvsp[(2) - (2)].str)); + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); } +#line 4571 "util/configparser.c" /* yacc.c:1646 */ break; - case 286: -/* Line 1792 of yacc.c */ -#line 1456 "./util/configparser.y" + case 375: +#line 2020 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(rc_server_key_file:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(rc_server_key_file:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->server_key_file); - cfg_parser->cfg->server_key_file = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->server_key_file = (yyvsp[0].str); } +#line 4581 "util/configparser.c" /* yacc.c:1646 */ break; - case 287: -/* Line 1792 of yacc.c */ -#line 1463 "./util/configparser.y" + case 376: +#line 2027 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(rc_server_cert_file:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(rc_server_cert_file:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->server_cert_file); - cfg_parser->cfg->server_cert_file = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->server_cert_file = (yyvsp[0].str); } +#line 4591 "util/configparser.c" /* yacc.c:1646 */ break; - case 288: -/* Line 1792 of yacc.c */ -#line 1470 "./util/configparser.y" + case 377: +#line 2034 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(rc_control_key_file:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(rc_control_key_file:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->control_key_file); - cfg_parser->cfg->control_key_file = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->control_key_file = (yyvsp[0].str); } +#line 4601 "util/configparser.c" /* yacc.c:1646 */ break; - case 289: -/* Line 1792 of yacc.c */ -#line 1477 "./util/configparser.y" + case 378: +#line 2041 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(rc_control_cert_file:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(rc_control_cert_file:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->control_cert_file); - cfg_parser->cfg->control_cert_file = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->control_cert_file = (yyvsp[0].str); } +#line 4611 "util/configparser.c" /* yacc.c:1646 */ break; - case 290: -/* Line 1792 of yacc.c */ -#line 1484 "./util/configparser.y" + case 379: +#line 2048 "util/configparser.y" /* yacc.c:1646 */ { OUTYY(("\nP(dnstap:)\n")); } +#line 4619 "util/configparser.c" /* yacc.c:1646 */ break; - case 305: -/* Line 1792 of yacc.c */ -#line 1501 "./util/configparser.y" + case 394: +#line 2065 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(dt_dnstap_enable:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(dt_dnstap_enable:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->dnstap = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); + else cfg_parser->cfg->dnstap = (strcmp((yyvsp[0].str), "yes")==0); } +#line 4630 "util/configparser.c" /* yacc.c:1646 */ break; - case 306: -/* Line 1792 of yacc.c */ -#line 1509 "./util/configparser.y" + case 395: +#line 2073 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(dt_dnstap_socket_path:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(dt_dnstap_socket_path:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->dnstap_socket_path); - cfg_parser->cfg->dnstap_socket_path = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->dnstap_socket_path = (yyvsp[0].str); } +#line 4640 "util/configparser.c" /* yacc.c:1646 */ break; - case 307: -/* Line 1792 of yacc.c */ -#line 1516 "./util/configparser.y" + case 396: +#line 2080 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(dt_dnstap_send_identity:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(dt_dnstap_send_identity:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->dnstap_send_identity = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); + else cfg_parser->cfg->dnstap_send_identity = (strcmp((yyvsp[0].str), "yes")==0); } +#line 4651 "util/configparser.c" /* yacc.c:1646 */ break; - case 308: -/* Line 1792 of yacc.c */ -#line 1524 "./util/configparser.y" + case 397: +#line 2088 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(dt_dnstap_send_version:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(dt_dnstap_send_version:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); - else cfg_parser->cfg->dnstap_send_version = (strcmp((yyvsp[(2) - (2)].str), "yes")==0); + else cfg_parser->cfg->dnstap_send_version = (strcmp((yyvsp[0].str), "yes")==0); } +#line 4662 "util/configparser.c" /* yacc.c:1646 */ break; - case 309: -/* Line 1792 of yacc.c */ -#line 1532 "./util/configparser.y" + case 398: +#line 2096 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(dt_dnstap_identity:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(dt_dnstap_identity:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->dnstap_identity); - cfg_parser->cfg->dnstap_identity = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->dnstap_identity = (yyvsp[0].str); } +#line 4672 "util/configparser.c" /* yacc.c:1646 */ break; - case 310: -/* Line 1792 of yacc.c */ -#line 1539 "./util/configparser.y" + case 399: +#line 2103 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(dt_dnstap_version:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(dt_dnstap_version:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->dnstap_version); - cfg_parser->cfg->dnstap_version = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->dnstap_version = (yyvsp[0].str); } +#line 4682 "util/configparser.c" /* yacc.c:1646 */ break; - case 311: -/* Line 1792 of yacc.c */ -#line 1546 "./util/configparser.y" + case 400: +#line 2110 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(dt_dnstap_log_resolver_query_messages:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(dt_dnstap_log_resolver_query_messages:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->dnstap_log_resolver_query_messages = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); + (strcmp((yyvsp[0].str), "yes")==0); } +#line 4694 "util/configparser.c" /* yacc.c:1646 */ break; - case 312: -/* Line 1792 of yacc.c */ -#line 1555 "./util/configparser.y" + case 401: +#line 2119 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(dt_dnstap_log_resolver_response_messages:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(dt_dnstap_log_resolver_response_messages:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->dnstap_log_resolver_response_messages = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); + (strcmp((yyvsp[0].str), "yes")==0); } +#line 4706 "util/configparser.c" /* yacc.c:1646 */ break; - case 313: -/* Line 1792 of yacc.c */ -#line 1564 "./util/configparser.y" + case 402: +#line 2128 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(dt_dnstap_log_client_query_messages:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(dt_dnstap_log_client_query_messages:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->dnstap_log_client_query_messages = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); + (strcmp((yyvsp[0].str), "yes")==0); } +#line 4718 "util/configparser.c" /* yacc.c:1646 */ break; - case 314: -/* Line 1792 of yacc.c */ -#line 1573 "./util/configparser.y" + case 403: +#line 2137 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(dt_dnstap_log_client_response_messages:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(dt_dnstap_log_client_response_messages:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->dnstap_log_client_response_messages = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); + (strcmp((yyvsp[0].str), "yes")==0); } +#line 4730 "util/configparser.c" /* yacc.c:1646 */ break; - case 315: -/* Line 1792 of yacc.c */ -#line 1582 "./util/configparser.y" + case 404: +#line 2146 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(dt_dnstap_log_forwarder_query_messages:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(dt_dnstap_log_forwarder_query_messages:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->dnstap_log_forwarder_query_messages = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); + (strcmp((yyvsp[0].str), "yes")==0); } +#line 4742 "util/configparser.c" /* yacc.c:1646 */ break; - case 316: -/* Line 1792 of yacc.c */ -#line 1591 "./util/configparser.y" + case 405: +#line 2155 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(dt_dnstap_log_forwarder_response_messages:%s)\n", (yyvsp[(2) - (2)].str))); - if(strcmp((yyvsp[(2) - (2)].str), "yes") != 0 && strcmp((yyvsp[(2) - (2)].str), "no") != 0) + OUTYY(("P(dt_dnstap_log_forwarder_response_messages:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) yyerror("expected yes or no."); else cfg_parser->cfg->dnstap_log_forwarder_response_messages = - (strcmp((yyvsp[(2) - (2)].str), "yes")==0); + (strcmp((yyvsp[0].str), "yes")==0); } +#line 4754 "util/configparser.c" /* yacc.c:1646 */ break; - case 317: -/* Line 1792 of yacc.c */ -#line 1600 "./util/configparser.y" + case 406: +#line 2164 "util/configparser.y" /* yacc.c:1646 */ { OUTYY(("\nP(python:)\n")); } +#line 4762 "util/configparser.c" /* yacc.c:1646 */ break; - case 321: -/* Line 1792 of yacc.c */ -#line 1609 "./util/configparser.y" + case 410: +#line 2173 "util/configparser.y" /* yacc.c:1646 */ { - OUTYY(("P(python-script:%s)\n", (yyvsp[(2) - (2)].str))); + OUTYY(("P(python-script:%s)\n", (yyvsp[0].str))); free(cfg_parser->cfg->python_script); - cfg_parser->cfg->python_script = (yyvsp[(2) - (2)].str); + cfg_parser->cfg->python_script = (yyvsp[0].str); + } +#line 4772 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 411: +#line 2179 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(disable_dnssec_lame_check:%s)\n", (yyvsp[0].str))); + if (strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->disable_dnssec_lame_check = + (strcmp((yyvsp[0].str), "yes")==0); + free((yyvsp[0].str)); + } +#line 4785 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 412: +#line 2189 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_log_identity:%s)\n", (yyvsp[0].str))); + free(cfg_parser->cfg->log_identity); + cfg_parser->cfg->log_identity = (yyvsp[0].str); + } +#line 4795 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 413: +#line 2196 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_response_ip:%s %s)\n", (yyvsp[-1].str), (yyvsp[0].str))); + validate_respip_action((yyvsp[0].str)); + if(!cfg_str2list_insert(&cfg_parser->cfg->respip_actions, + (yyvsp[-1].str), (yyvsp[0].str))) + fatal_exit("out of memory adding response-ip"); + } +#line 4807 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 414: +#line 2205 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(server_response_ip_data:%s)\n", (yyvsp[-1].str))); + if(!cfg_str2list_insert(&cfg_parser->cfg->respip_data, + (yyvsp[-1].str), (yyvsp[0].str))) + fatal_exit("out of memory adding response-ip-data"); + } +#line 4818 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 415: +#line 2213 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("\nP(dnscrypt:)\n")); + OUTYY(("\nP(dnscrypt:)\n")); + } +#line 4827 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 423: +#line 2225 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(dnsc_dnscrypt_enable:%s)\n", (yyvsp[0].str))); + if(strcmp((yyvsp[0].str), "yes") != 0 && strcmp((yyvsp[0].str), "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->dnscrypt = (strcmp((yyvsp[0].str), "yes")==0); } +#line 4838 "util/configparser.c" /* yacc.c:1646 */ break; + case 424: +#line 2234 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(dnsc_dnscrypt_port:%s)\n", (yyvsp[0].str))); -/* Line 1792 of yacc.c */ -#line 4124 "util/configparser.c" + if(atoi((yyvsp[0].str)) == 0) + yyerror("port number expected"); + else cfg_parser->cfg->dnscrypt_port = atoi((yyvsp[0].str)); + free((yyvsp[0].str)); + } +#line 4851 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 425: +#line 2244 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(dnsc_dnscrypt_provider:%s)\n", (yyvsp[0].str))); + free(cfg_parser->cfg->dnscrypt_provider); + cfg_parser->cfg->dnscrypt_provider = (yyvsp[0].str); + } +#line 4861 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 426: +#line 2251 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(dnsc_dnscrypt_provider_cert:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->dnscrypt_provider_cert, (yyvsp[0].str))) + fatal_exit("out of memory adding dnscrypt-provider-cert"); + } +#line 4871 "util/configparser.c" /* yacc.c:1646 */ + break; + + case 427: +#line 2258 "util/configparser.y" /* yacc.c:1646 */ + { + OUTYY(("P(dnsc_dnscrypt_secret_key:%s)\n", (yyvsp[0].str))); + if(!cfg_strlist_insert(&cfg_parser->cfg->dnscrypt_secret_key, (yyvsp[0].str))) + fatal_exit("out of memory adding dnscrypt-secret-key"); + } +#line 4881 "util/configparser.c" /* yacc.c:1646 */ + break; + + +#line 4885 "util/configparser.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4142,7 +4903,7 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -4157,9 +4918,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -4210,20 +4971,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -4242,7 +5003,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -4255,29 +5016,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -4328,14 +5089,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -4346,13 +5107,25 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - -/* Line 2055 of yacc.c */ -#line 1614 "./util/configparser.y" +#line 2264 "util/configparser.y" /* yacc.c:1906 */ /* parse helper routines could be here */ +static void +validate_respip_action(const char* action) +{ + if(strcmp(action, "deny")!=0 && + strcmp(action, "redirect")!=0 && + strcmp(action, "inform")!=0 && + strcmp(action, "inform_deny")!=0 && + strcmp(action, "always_transparent")!=0 && + strcmp(action, "always_refuse")!=0 && + strcmp(action, "always_nxdomain")!=0) + { + yyerror("response-ip action: expected deny, redirect, " + "inform, inform_deny, always_transparent, " + "always_refuse or always_nxdomain"); + } +} diff --git a/external/unbound/util/configparser.h b/external/unbound/util/configparser.h index 53e5adcb6..937754cfe 100644 --- a/external/unbound/util/configparser.h +++ b/external/unbound/util/configparser.h @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ @@ -26,13 +26,13 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ #ifndef YY_YY_UTIL_CONFIGPARSER_H_INCLUDED # define YY_YY_UTIL_CONFIGPARSER_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -40,173 +40,217 @@ extern int yydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - SPACE = 258, - LETTER = 259, - NEWLINE = 260, - COMMENT = 261, - COLON = 262, - ANY = 263, - ZONESTR = 264, - STRING_ARG = 265, - VAR_SERVER = 266, - VAR_VERBOSITY = 267, - VAR_NUM_THREADS = 268, - VAR_PORT = 269, - VAR_OUTGOING_RANGE = 270, - VAR_INTERFACE = 271, - VAR_DO_IP4 = 272, - VAR_DO_IP6 = 273, - VAR_DO_UDP = 274, - VAR_DO_TCP = 275, - VAR_CHROOT = 276, - VAR_USERNAME = 277, - VAR_DIRECTORY = 278, - VAR_LOGFILE = 279, - VAR_PIDFILE = 280, - VAR_MSG_CACHE_SIZE = 281, - VAR_MSG_CACHE_SLABS = 282, - VAR_NUM_QUERIES_PER_THREAD = 283, - VAR_RRSET_CACHE_SIZE = 284, - VAR_RRSET_CACHE_SLABS = 285, - VAR_OUTGOING_NUM_TCP = 286, - VAR_INFRA_HOST_TTL = 287, - VAR_INFRA_LAME_TTL = 288, - VAR_INFRA_CACHE_SLABS = 289, - VAR_INFRA_CACHE_NUMHOSTS = 290, - VAR_INFRA_CACHE_LAME_SIZE = 291, - VAR_NAME = 292, - VAR_STUB_ZONE = 293, - VAR_STUB_HOST = 294, - VAR_STUB_ADDR = 295, - VAR_TARGET_FETCH_POLICY = 296, - VAR_HARDEN_SHORT_BUFSIZE = 297, - VAR_HARDEN_LARGE_QUERIES = 298, - VAR_FORWARD_ZONE = 299, - VAR_FORWARD_HOST = 300, - VAR_FORWARD_ADDR = 301, - VAR_DO_NOT_QUERY_ADDRESS = 302, - VAR_HIDE_IDENTITY = 303, - VAR_HIDE_VERSION = 304, - VAR_IDENTITY = 305, - VAR_VERSION = 306, - VAR_HARDEN_GLUE = 307, - VAR_MODULE_CONF = 308, - VAR_TRUST_ANCHOR_FILE = 309, - VAR_TRUST_ANCHOR = 310, - VAR_VAL_OVERRIDE_DATE = 311, - VAR_BOGUS_TTL = 312, - VAR_VAL_CLEAN_ADDITIONAL = 313, - VAR_VAL_PERMISSIVE_MODE = 314, - VAR_INCOMING_NUM_TCP = 315, - VAR_MSG_BUFFER_SIZE = 316, - VAR_KEY_CACHE_SIZE = 317, - VAR_KEY_CACHE_SLABS = 318, - VAR_TRUSTED_KEYS_FILE = 319, - VAR_VAL_NSEC3_KEYSIZE_ITERATIONS = 320, - VAR_USE_SYSLOG = 321, - VAR_OUTGOING_INTERFACE = 322, - VAR_ROOT_HINTS = 323, - VAR_DO_NOT_QUERY_LOCALHOST = 324, - VAR_CACHE_MAX_TTL = 325, - VAR_HARDEN_DNSSEC_STRIPPED = 326, - VAR_ACCESS_CONTROL = 327, - VAR_LOCAL_ZONE = 328, - VAR_LOCAL_DATA = 329, - VAR_INTERFACE_AUTOMATIC = 330, - VAR_STATISTICS_INTERVAL = 331, - VAR_DO_DAEMONIZE = 332, - VAR_USE_CAPS_FOR_ID = 333, - VAR_STATISTICS_CUMULATIVE = 334, - VAR_OUTGOING_PORT_PERMIT = 335, - VAR_OUTGOING_PORT_AVOID = 336, - VAR_DLV_ANCHOR_FILE = 337, - VAR_DLV_ANCHOR = 338, - VAR_NEG_CACHE_SIZE = 339, - VAR_HARDEN_REFERRAL_PATH = 340, - VAR_PRIVATE_ADDRESS = 341, - VAR_PRIVATE_DOMAIN = 342, - VAR_REMOTE_CONTROL = 343, - VAR_CONTROL_ENABLE = 344, - VAR_CONTROL_INTERFACE = 345, - VAR_CONTROL_PORT = 346, - VAR_SERVER_KEY_FILE = 347, - VAR_SERVER_CERT_FILE = 348, - VAR_CONTROL_KEY_FILE = 349, - VAR_CONTROL_CERT_FILE = 350, - VAR_CONTROL_USE_CERT = 351, - VAR_EXTENDED_STATISTICS = 352, - VAR_LOCAL_DATA_PTR = 353, - VAR_JOSTLE_TIMEOUT = 354, - VAR_STUB_PRIME = 355, - VAR_UNWANTED_REPLY_THRESHOLD = 356, - VAR_LOG_TIME_ASCII = 357, - VAR_DOMAIN_INSECURE = 358, - VAR_PYTHON = 359, - VAR_PYTHON_SCRIPT = 360, - VAR_VAL_SIG_SKEW_MIN = 361, - VAR_VAL_SIG_SKEW_MAX = 362, - VAR_CACHE_MIN_TTL = 363, - VAR_VAL_LOG_LEVEL = 364, - VAR_AUTO_TRUST_ANCHOR_FILE = 365, - VAR_KEEP_MISSING = 366, - VAR_ADD_HOLDDOWN = 367, - VAR_DEL_HOLDDOWN = 368, - VAR_SO_RCVBUF = 369, - VAR_EDNS_BUFFER_SIZE = 370, - VAR_PREFETCH = 371, - VAR_PREFETCH_KEY = 372, - VAR_SO_SNDBUF = 373, - VAR_SO_REUSEPORT = 374, - VAR_HARDEN_BELOW_NXDOMAIN = 375, - VAR_IGNORE_CD_FLAG = 376, - VAR_LOG_QUERIES = 377, - VAR_TCP_UPSTREAM = 378, - VAR_SSL_UPSTREAM = 379, - VAR_SSL_SERVICE_KEY = 380, - VAR_SSL_SERVICE_PEM = 381, - VAR_SSL_PORT = 382, - VAR_FORWARD_FIRST = 383, - VAR_STUB_FIRST = 384, - VAR_MINIMAL_RESPONSES = 385, - VAR_RRSET_ROUNDROBIN = 386, - VAR_MAX_UDP_SIZE = 387, - VAR_DELAY_CLOSE = 388, - VAR_UNBLOCK_LAN_ZONES = 389, - VAR_INFRA_CACHE_MIN_RTT = 390, - VAR_DNS64_PREFIX = 391, - VAR_DNS64_SYNTHALL = 392, - VAR_DNSTAP = 393, - VAR_DNSTAP_ENABLE = 394, - VAR_DNSTAP_SOCKET_PATH = 395, - VAR_DNSTAP_SEND_IDENTITY = 396, - VAR_DNSTAP_SEND_VERSION = 397, - VAR_DNSTAP_IDENTITY = 398, - VAR_DNSTAP_VERSION = 399, - VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES = 400, - VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES = 401, - VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES = 402, - VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES = 403, - VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES = 404, - VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES = 405, - VAR_HARDEN_ALGO_DOWNGRADE = 406, - VAR_IP_TRANSPARENT = 407, - VAR_RATELIMIT = 408, - VAR_RATELIMIT_SLABS = 409, - VAR_RATELIMIT_SIZE = 410, - VAR_RATELIMIT_FOR_DOMAIN = 411, - VAR_RATELIMIT_BELOW_DOMAIN = 412, - VAR_RATELIMIT_FACTOR = 413, - VAR_CAPS_WHITELIST = 414, - VAR_CACHE_MAX_NEGATIVE_TTL = 415, - VAR_PERMIT_SMALL_HOLDDOWN = 416, - VAR_QNAME_MINIMISATION = 417 - }; + enum yytokentype + { + SPACE = 258, + LETTER = 259, + NEWLINE = 260, + COMMENT = 261, + COLON = 262, + ANY = 263, + ZONESTR = 264, + STRING_ARG = 265, + VAR_SERVER = 266, + VAR_VERBOSITY = 267, + VAR_NUM_THREADS = 268, + VAR_PORT = 269, + VAR_OUTGOING_RANGE = 270, + VAR_INTERFACE = 271, + VAR_DO_IP4 = 272, + VAR_DO_IP6 = 273, + VAR_PREFER_IP6 = 274, + VAR_DO_UDP = 275, + VAR_DO_TCP = 276, + VAR_TCP_MSS = 277, + VAR_OUTGOING_TCP_MSS = 278, + VAR_CHROOT = 279, + VAR_USERNAME = 280, + VAR_DIRECTORY = 281, + VAR_LOGFILE = 282, + VAR_PIDFILE = 283, + VAR_MSG_CACHE_SIZE = 284, + VAR_MSG_CACHE_SLABS = 285, + VAR_NUM_QUERIES_PER_THREAD = 286, + VAR_RRSET_CACHE_SIZE = 287, + VAR_RRSET_CACHE_SLABS = 288, + VAR_OUTGOING_NUM_TCP = 289, + VAR_INFRA_HOST_TTL = 290, + VAR_INFRA_LAME_TTL = 291, + VAR_INFRA_CACHE_SLABS = 292, + VAR_INFRA_CACHE_NUMHOSTS = 293, + VAR_INFRA_CACHE_LAME_SIZE = 294, + VAR_NAME = 295, + VAR_STUB_ZONE = 296, + VAR_STUB_HOST = 297, + VAR_STUB_ADDR = 298, + VAR_TARGET_FETCH_POLICY = 299, + VAR_HARDEN_SHORT_BUFSIZE = 300, + VAR_HARDEN_LARGE_QUERIES = 301, + VAR_FORWARD_ZONE = 302, + VAR_FORWARD_HOST = 303, + VAR_FORWARD_ADDR = 304, + VAR_DO_NOT_QUERY_ADDRESS = 305, + VAR_HIDE_IDENTITY = 306, + VAR_HIDE_VERSION = 307, + VAR_IDENTITY = 308, + VAR_VERSION = 309, + VAR_HARDEN_GLUE = 310, + VAR_MODULE_CONF = 311, + VAR_TRUST_ANCHOR_FILE = 312, + VAR_TRUST_ANCHOR = 313, + VAR_VAL_OVERRIDE_DATE = 314, + VAR_BOGUS_TTL = 315, + VAR_VAL_CLEAN_ADDITIONAL = 316, + VAR_VAL_PERMISSIVE_MODE = 317, + VAR_INCOMING_NUM_TCP = 318, + VAR_MSG_BUFFER_SIZE = 319, + VAR_KEY_CACHE_SIZE = 320, + VAR_KEY_CACHE_SLABS = 321, + VAR_TRUSTED_KEYS_FILE = 322, + VAR_VAL_NSEC3_KEYSIZE_ITERATIONS = 323, + VAR_USE_SYSLOG = 324, + VAR_OUTGOING_INTERFACE = 325, + VAR_ROOT_HINTS = 326, + VAR_DO_NOT_QUERY_LOCALHOST = 327, + VAR_CACHE_MAX_TTL = 328, + VAR_HARDEN_DNSSEC_STRIPPED = 329, + VAR_ACCESS_CONTROL = 330, + VAR_LOCAL_ZONE = 331, + VAR_LOCAL_DATA = 332, + VAR_INTERFACE_AUTOMATIC = 333, + VAR_STATISTICS_INTERVAL = 334, + VAR_DO_DAEMONIZE = 335, + VAR_USE_CAPS_FOR_ID = 336, + VAR_STATISTICS_CUMULATIVE = 337, + VAR_OUTGOING_PORT_PERMIT = 338, + VAR_OUTGOING_PORT_AVOID = 339, + VAR_DLV_ANCHOR_FILE = 340, + VAR_DLV_ANCHOR = 341, + VAR_NEG_CACHE_SIZE = 342, + VAR_HARDEN_REFERRAL_PATH = 343, + VAR_PRIVATE_ADDRESS = 344, + VAR_PRIVATE_DOMAIN = 345, + VAR_REMOTE_CONTROL = 346, + VAR_CONTROL_ENABLE = 347, + VAR_CONTROL_INTERFACE = 348, + VAR_CONTROL_PORT = 349, + VAR_SERVER_KEY_FILE = 350, + VAR_SERVER_CERT_FILE = 351, + VAR_CONTROL_KEY_FILE = 352, + VAR_CONTROL_CERT_FILE = 353, + VAR_CONTROL_USE_CERT = 354, + VAR_EXTENDED_STATISTICS = 355, + VAR_LOCAL_DATA_PTR = 356, + VAR_JOSTLE_TIMEOUT = 357, + VAR_STUB_PRIME = 358, + VAR_UNWANTED_REPLY_THRESHOLD = 359, + VAR_LOG_TIME_ASCII = 360, + VAR_DOMAIN_INSECURE = 361, + VAR_PYTHON = 362, + VAR_PYTHON_SCRIPT = 363, + VAR_VAL_SIG_SKEW_MIN = 364, + VAR_VAL_SIG_SKEW_MAX = 365, + VAR_CACHE_MIN_TTL = 366, + VAR_VAL_LOG_LEVEL = 367, + VAR_AUTO_TRUST_ANCHOR_FILE = 368, + VAR_KEEP_MISSING = 369, + VAR_ADD_HOLDDOWN = 370, + VAR_DEL_HOLDDOWN = 371, + VAR_SO_RCVBUF = 372, + VAR_EDNS_BUFFER_SIZE = 373, + VAR_PREFETCH = 374, + VAR_PREFETCH_KEY = 375, + VAR_SO_SNDBUF = 376, + VAR_SO_REUSEPORT = 377, + VAR_HARDEN_BELOW_NXDOMAIN = 378, + VAR_IGNORE_CD_FLAG = 379, + VAR_LOG_QUERIES = 380, + VAR_LOG_REPLIES = 381, + VAR_TCP_UPSTREAM = 382, + VAR_SSL_UPSTREAM = 383, + VAR_SSL_SERVICE_KEY = 384, + VAR_SSL_SERVICE_PEM = 385, + VAR_SSL_PORT = 386, + VAR_FORWARD_FIRST = 387, + VAR_STUB_SSL_UPSTREAM = 388, + VAR_FORWARD_SSL_UPSTREAM = 389, + VAR_STUB_FIRST = 390, + VAR_MINIMAL_RESPONSES = 391, + VAR_RRSET_ROUNDROBIN = 392, + VAR_MAX_UDP_SIZE = 393, + VAR_DELAY_CLOSE = 394, + VAR_UNBLOCK_LAN_ZONES = 395, + VAR_INSECURE_LAN_ZONES = 396, + VAR_INFRA_CACHE_MIN_RTT = 397, + VAR_DNS64_PREFIX = 398, + VAR_DNS64_SYNTHALL = 399, + VAR_DNSTAP = 400, + VAR_DNSTAP_ENABLE = 401, + VAR_DNSTAP_SOCKET_PATH = 402, + VAR_DNSTAP_SEND_IDENTITY = 403, + VAR_DNSTAP_SEND_VERSION = 404, + VAR_DNSTAP_IDENTITY = 405, + VAR_DNSTAP_VERSION = 406, + VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES = 407, + VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES = 408, + VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES = 409, + VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES = 410, + VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES = 411, + VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES = 412, + VAR_RESPONSE_IP_TAG = 413, + VAR_RESPONSE_IP = 414, + VAR_RESPONSE_IP_DATA = 415, + VAR_HARDEN_ALGO_DOWNGRADE = 416, + VAR_IP_TRANSPARENT = 417, + VAR_DISABLE_DNSSEC_LAME_CHECK = 418, + VAR_IP_RATELIMIT = 419, + VAR_IP_RATELIMIT_SLABS = 420, + VAR_IP_RATELIMIT_SIZE = 421, + VAR_RATELIMIT = 422, + VAR_RATELIMIT_SLABS = 423, + VAR_RATELIMIT_SIZE = 424, + VAR_RATELIMIT_FOR_DOMAIN = 425, + VAR_RATELIMIT_BELOW_DOMAIN = 426, + VAR_IP_RATELIMIT_FACTOR = 427, + VAR_RATELIMIT_FACTOR = 428, + VAR_SEND_CLIENT_SUBNET = 429, + VAR_CLIENT_SUBNET_ALWAYS_FORWARD = 430, + VAR_CLIENT_SUBNET_OPCODE = 431, + VAR_MAX_CLIENT_SUBNET_IPV4 = 432, + VAR_MAX_CLIENT_SUBNET_IPV6 = 433, + VAR_CAPS_WHITELIST = 434, + VAR_CACHE_MAX_NEGATIVE_TTL = 435, + VAR_PERMIT_SMALL_HOLDDOWN = 436, + VAR_QNAME_MINIMISATION = 437, + VAR_QNAME_MINIMISATION_STRICT = 438, + VAR_IP_FREEBIND = 439, + VAR_DEFINE_TAG = 440, + VAR_LOCAL_ZONE_TAG = 441, + VAR_ACCESS_CONTROL_TAG = 442, + VAR_LOCAL_ZONE_OVERRIDE = 443, + VAR_ACCESS_CONTROL_TAG_ACTION = 444, + VAR_ACCESS_CONTROL_TAG_DATA = 445, + VAR_VIEW = 446, + VAR_ACCESS_CONTROL_VIEW = 447, + VAR_VIEW_FIRST = 448, + VAR_SERVE_EXPIRED = 449, + VAR_FAKE_DSA = 450, + VAR_FAKE_SHA1 = 451, + VAR_LOG_IDENTITY = 452, + VAR_HIDE_TRUSTANCHOR = 453, + VAR_USE_SYSTEMD = 454, + VAR_SHM_ENABLE = 455, + VAR_SHM_KEY = 456, + VAR_DNSCRYPT = 457, + VAR_DNSCRYPT_ENABLE = 458, + VAR_DNSCRYPT_PORT = 459, + VAR_DNSCRYPT_PROVIDER = 460, + VAR_DNSCRYPT_SECRET_KEY = 461, + VAR_DNSCRYPT_PROVIDER_CERT = 462 + }; #endif /* Tokens. */ #define SPACE 258 @@ -225,184 +269,216 @@ extern int yydebug; #define VAR_INTERFACE 271 #define VAR_DO_IP4 272 #define VAR_DO_IP6 273 -#define VAR_DO_UDP 274 -#define VAR_DO_TCP 275 -#define VAR_CHROOT 276 -#define VAR_USERNAME 277 -#define VAR_DIRECTORY 278 -#define VAR_LOGFILE 279 -#define VAR_PIDFILE 280 -#define VAR_MSG_CACHE_SIZE 281 -#define VAR_MSG_CACHE_SLABS 282 -#define VAR_NUM_QUERIES_PER_THREAD 283 -#define VAR_RRSET_CACHE_SIZE 284 -#define VAR_RRSET_CACHE_SLABS 285 -#define VAR_OUTGOING_NUM_TCP 286 -#define VAR_INFRA_HOST_TTL 287 -#define VAR_INFRA_LAME_TTL 288 -#define VAR_INFRA_CACHE_SLABS 289 -#define VAR_INFRA_CACHE_NUMHOSTS 290 -#define VAR_INFRA_CACHE_LAME_SIZE 291 -#define VAR_NAME 292 -#define VAR_STUB_ZONE 293 -#define VAR_STUB_HOST 294 -#define VAR_STUB_ADDR 295 -#define VAR_TARGET_FETCH_POLICY 296 -#define VAR_HARDEN_SHORT_BUFSIZE 297 -#define VAR_HARDEN_LARGE_QUERIES 298 -#define VAR_FORWARD_ZONE 299 -#define VAR_FORWARD_HOST 300 -#define VAR_FORWARD_ADDR 301 -#define VAR_DO_NOT_QUERY_ADDRESS 302 -#define VAR_HIDE_IDENTITY 303 -#define VAR_HIDE_VERSION 304 -#define VAR_IDENTITY 305 -#define VAR_VERSION 306 -#define VAR_HARDEN_GLUE 307 -#define VAR_MODULE_CONF 308 -#define VAR_TRUST_ANCHOR_FILE 309 -#define VAR_TRUST_ANCHOR 310 -#define VAR_VAL_OVERRIDE_DATE 311 -#define VAR_BOGUS_TTL 312 -#define VAR_VAL_CLEAN_ADDITIONAL 313 -#define VAR_VAL_PERMISSIVE_MODE 314 -#define VAR_INCOMING_NUM_TCP 315 -#define VAR_MSG_BUFFER_SIZE 316 -#define VAR_KEY_CACHE_SIZE 317 -#define VAR_KEY_CACHE_SLABS 318 -#define VAR_TRUSTED_KEYS_FILE 319 -#define VAR_VAL_NSEC3_KEYSIZE_ITERATIONS 320 -#define VAR_USE_SYSLOG 321 -#define VAR_OUTGOING_INTERFACE 322 -#define VAR_ROOT_HINTS 323 -#define VAR_DO_NOT_QUERY_LOCALHOST 324 -#define VAR_CACHE_MAX_TTL 325 -#define VAR_HARDEN_DNSSEC_STRIPPED 326 -#define VAR_ACCESS_CONTROL 327 -#define VAR_LOCAL_ZONE 328 -#define VAR_LOCAL_DATA 329 -#define VAR_INTERFACE_AUTOMATIC 330 -#define VAR_STATISTICS_INTERVAL 331 -#define VAR_DO_DAEMONIZE 332 -#define VAR_USE_CAPS_FOR_ID 333 -#define VAR_STATISTICS_CUMULATIVE 334 -#define VAR_OUTGOING_PORT_PERMIT 335 -#define VAR_OUTGOING_PORT_AVOID 336 -#define VAR_DLV_ANCHOR_FILE 337 -#define VAR_DLV_ANCHOR 338 -#define VAR_NEG_CACHE_SIZE 339 -#define VAR_HARDEN_REFERRAL_PATH 340 -#define VAR_PRIVATE_ADDRESS 341 -#define VAR_PRIVATE_DOMAIN 342 -#define VAR_REMOTE_CONTROL 343 -#define VAR_CONTROL_ENABLE 344 -#define VAR_CONTROL_INTERFACE 345 -#define VAR_CONTROL_PORT 346 -#define VAR_SERVER_KEY_FILE 347 -#define VAR_SERVER_CERT_FILE 348 -#define VAR_CONTROL_KEY_FILE 349 -#define VAR_CONTROL_CERT_FILE 350 -#define VAR_CONTROL_USE_CERT 351 -#define VAR_EXTENDED_STATISTICS 352 -#define VAR_LOCAL_DATA_PTR 353 -#define VAR_JOSTLE_TIMEOUT 354 -#define VAR_STUB_PRIME 355 -#define VAR_UNWANTED_REPLY_THRESHOLD 356 -#define VAR_LOG_TIME_ASCII 357 -#define VAR_DOMAIN_INSECURE 358 -#define VAR_PYTHON 359 -#define VAR_PYTHON_SCRIPT 360 -#define VAR_VAL_SIG_SKEW_MIN 361 -#define VAR_VAL_SIG_SKEW_MAX 362 -#define VAR_CACHE_MIN_TTL 363 -#define VAR_VAL_LOG_LEVEL 364 -#define VAR_AUTO_TRUST_ANCHOR_FILE 365 -#define VAR_KEEP_MISSING 366 -#define VAR_ADD_HOLDDOWN 367 -#define VAR_DEL_HOLDDOWN 368 -#define VAR_SO_RCVBUF 369 -#define VAR_EDNS_BUFFER_SIZE 370 -#define VAR_PREFETCH 371 -#define VAR_PREFETCH_KEY 372 -#define VAR_SO_SNDBUF 373 -#define VAR_SO_REUSEPORT 374 -#define VAR_HARDEN_BELOW_NXDOMAIN 375 -#define VAR_IGNORE_CD_FLAG 376 -#define VAR_LOG_QUERIES 377 -#define VAR_TCP_UPSTREAM 378 -#define VAR_SSL_UPSTREAM 379 -#define VAR_SSL_SERVICE_KEY 380 -#define VAR_SSL_SERVICE_PEM 381 -#define VAR_SSL_PORT 382 -#define VAR_FORWARD_FIRST 383 -#define VAR_STUB_FIRST 384 -#define VAR_MINIMAL_RESPONSES 385 -#define VAR_RRSET_ROUNDROBIN 386 -#define VAR_MAX_UDP_SIZE 387 -#define VAR_DELAY_CLOSE 388 -#define VAR_UNBLOCK_LAN_ZONES 389 -#define VAR_INFRA_CACHE_MIN_RTT 390 -#define VAR_DNS64_PREFIX 391 -#define VAR_DNS64_SYNTHALL 392 -#define VAR_DNSTAP 393 -#define VAR_DNSTAP_ENABLE 394 -#define VAR_DNSTAP_SOCKET_PATH 395 -#define VAR_DNSTAP_SEND_IDENTITY 396 -#define VAR_DNSTAP_SEND_VERSION 397 -#define VAR_DNSTAP_IDENTITY 398 -#define VAR_DNSTAP_VERSION 399 -#define VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES 400 -#define VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES 401 -#define VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES 402 -#define VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES 403 -#define VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES 404 -#define VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES 405 -#define VAR_HARDEN_ALGO_DOWNGRADE 406 -#define VAR_IP_TRANSPARENT 407 -#define VAR_RATELIMIT 408 -#define VAR_RATELIMIT_SLABS 409 -#define VAR_RATELIMIT_SIZE 410 -#define VAR_RATELIMIT_FOR_DOMAIN 411 -#define VAR_RATELIMIT_BELOW_DOMAIN 412 -#define VAR_RATELIMIT_FACTOR 413 -#define VAR_CAPS_WHITELIST 414 -#define VAR_CACHE_MAX_NEGATIVE_TTL 415 -#define VAR_PERMIT_SMALL_HOLDDOWN 416 -#define VAR_QNAME_MINIMISATION 417 - - +#define VAR_PREFER_IP6 274 +#define VAR_DO_UDP 275 +#define VAR_DO_TCP 276 +#define VAR_TCP_MSS 277 +#define VAR_OUTGOING_TCP_MSS 278 +#define VAR_CHROOT 279 +#define VAR_USERNAME 280 +#define VAR_DIRECTORY 281 +#define VAR_LOGFILE 282 +#define VAR_PIDFILE 283 +#define VAR_MSG_CACHE_SIZE 284 +#define VAR_MSG_CACHE_SLABS 285 +#define VAR_NUM_QUERIES_PER_THREAD 286 +#define VAR_RRSET_CACHE_SIZE 287 +#define VAR_RRSET_CACHE_SLABS 288 +#define VAR_OUTGOING_NUM_TCP 289 +#define VAR_INFRA_HOST_TTL 290 +#define VAR_INFRA_LAME_TTL 291 +#define VAR_INFRA_CACHE_SLABS 292 +#define VAR_INFRA_CACHE_NUMHOSTS 293 +#define VAR_INFRA_CACHE_LAME_SIZE 294 +#define VAR_NAME 295 +#define VAR_STUB_ZONE 296 +#define VAR_STUB_HOST 297 +#define VAR_STUB_ADDR 298 +#define VAR_TARGET_FETCH_POLICY 299 +#define VAR_HARDEN_SHORT_BUFSIZE 300 +#define VAR_HARDEN_LARGE_QUERIES 301 +#define VAR_FORWARD_ZONE 302 +#define VAR_FORWARD_HOST 303 +#define VAR_FORWARD_ADDR 304 +#define VAR_DO_NOT_QUERY_ADDRESS 305 +#define VAR_HIDE_IDENTITY 306 +#define VAR_HIDE_VERSION 307 +#define VAR_IDENTITY 308 +#define VAR_VERSION 309 +#define VAR_HARDEN_GLUE 310 +#define VAR_MODULE_CONF 311 +#define VAR_TRUST_ANCHOR_FILE 312 +#define VAR_TRUST_ANCHOR 313 +#define VAR_VAL_OVERRIDE_DATE 314 +#define VAR_BOGUS_TTL 315 +#define VAR_VAL_CLEAN_ADDITIONAL 316 +#define VAR_VAL_PERMISSIVE_MODE 317 +#define VAR_INCOMING_NUM_TCP 318 +#define VAR_MSG_BUFFER_SIZE 319 +#define VAR_KEY_CACHE_SIZE 320 +#define VAR_KEY_CACHE_SLABS 321 +#define VAR_TRUSTED_KEYS_FILE 322 +#define VAR_VAL_NSEC3_KEYSIZE_ITERATIONS 323 +#define VAR_USE_SYSLOG 324 +#define VAR_OUTGOING_INTERFACE 325 +#define VAR_ROOT_HINTS 326 +#define VAR_DO_NOT_QUERY_LOCALHOST 327 +#define VAR_CACHE_MAX_TTL 328 +#define VAR_HARDEN_DNSSEC_STRIPPED 329 +#define VAR_ACCESS_CONTROL 330 +#define VAR_LOCAL_ZONE 331 +#define VAR_LOCAL_DATA 332 +#define VAR_INTERFACE_AUTOMATIC 333 +#define VAR_STATISTICS_INTERVAL 334 +#define VAR_DO_DAEMONIZE 335 +#define VAR_USE_CAPS_FOR_ID 336 +#define VAR_STATISTICS_CUMULATIVE 337 +#define VAR_OUTGOING_PORT_PERMIT 338 +#define VAR_OUTGOING_PORT_AVOID 339 +#define VAR_DLV_ANCHOR_FILE 340 +#define VAR_DLV_ANCHOR 341 +#define VAR_NEG_CACHE_SIZE 342 +#define VAR_HARDEN_REFERRAL_PATH 343 +#define VAR_PRIVATE_ADDRESS 344 +#define VAR_PRIVATE_DOMAIN 345 +#define VAR_REMOTE_CONTROL 346 +#define VAR_CONTROL_ENABLE 347 +#define VAR_CONTROL_INTERFACE 348 +#define VAR_CONTROL_PORT 349 +#define VAR_SERVER_KEY_FILE 350 +#define VAR_SERVER_CERT_FILE 351 +#define VAR_CONTROL_KEY_FILE 352 +#define VAR_CONTROL_CERT_FILE 353 +#define VAR_CONTROL_USE_CERT 354 +#define VAR_EXTENDED_STATISTICS 355 +#define VAR_LOCAL_DATA_PTR 356 +#define VAR_JOSTLE_TIMEOUT 357 +#define VAR_STUB_PRIME 358 +#define VAR_UNWANTED_REPLY_THRESHOLD 359 +#define VAR_LOG_TIME_ASCII 360 +#define VAR_DOMAIN_INSECURE 361 +#define VAR_PYTHON 362 +#define VAR_PYTHON_SCRIPT 363 +#define VAR_VAL_SIG_SKEW_MIN 364 +#define VAR_VAL_SIG_SKEW_MAX 365 +#define VAR_CACHE_MIN_TTL 366 +#define VAR_VAL_LOG_LEVEL 367 +#define VAR_AUTO_TRUST_ANCHOR_FILE 368 +#define VAR_KEEP_MISSING 369 +#define VAR_ADD_HOLDDOWN 370 +#define VAR_DEL_HOLDDOWN 371 +#define VAR_SO_RCVBUF 372 +#define VAR_EDNS_BUFFER_SIZE 373 +#define VAR_PREFETCH 374 +#define VAR_PREFETCH_KEY 375 +#define VAR_SO_SNDBUF 376 +#define VAR_SO_REUSEPORT 377 +#define VAR_HARDEN_BELOW_NXDOMAIN 378 +#define VAR_IGNORE_CD_FLAG 379 +#define VAR_LOG_QUERIES 380 +#define VAR_LOG_REPLIES 381 +#define VAR_TCP_UPSTREAM 382 +#define VAR_SSL_UPSTREAM 383 +#define VAR_SSL_SERVICE_KEY 384 +#define VAR_SSL_SERVICE_PEM 385 +#define VAR_SSL_PORT 386 +#define VAR_FORWARD_FIRST 387 +#define VAR_STUB_SSL_UPSTREAM 388 +#define VAR_FORWARD_SSL_UPSTREAM 389 +#define VAR_STUB_FIRST 390 +#define VAR_MINIMAL_RESPONSES 391 +#define VAR_RRSET_ROUNDROBIN 392 +#define VAR_MAX_UDP_SIZE 393 +#define VAR_DELAY_CLOSE 394 +#define VAR_UNBLOCK_LAN_ZONES 395 +#define VAR_INSECURE_LAN_ZONES 396 +#define VAR_INFRA_CACHE_MIN_RTT 397 +#define VAR_DNS64_PREFIX 398 +#define VAR_DNS64_SYNTHALL 399 +#define VAR_DNSTAP 400 +#define VAR_DNSTAP_ENABLE 401 +#define VAR_DNSTAP_SOCKET_PATH 402 +#define VAR_DNSTAP_SEND_IDENTITY 403 +#define VAR_DNSTAP_SEND_VERSION 404 +#define VAR_DNSTAP_IDENTITY 405 +#define VAR_DNSTAP_VERSION 406 +#define VAR_DNSTAP_LOG_RESOLVER_QUERY_MESSAGES 407 +#define VAR_DNSTAP_LOG_RESOLVER_RESPONSE_MESSAGES 408 +#define VAR_DNSTAP_LOG_CLIENT_QUERY_MESSAGES 409 +#define VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES 410 +#define VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES 411 +#define VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES 412 +#define VAR_RESPONSE_IP_TAG 413 +#define VAR_RESPONSE_IP 414 +#define VAR_RESPONSE_IP_DATA 415 +#define VAR_HARDEN_ALGO_DOWNGRADE 416 +#define VAR_IP_TRANSPARENT 417 +#define VAR_DISABLE_DNSSEC_LAME_CHECK 418 +#define VAR_IP_RATELIMIT 419 +#define VAR_IP_RATELIMIT_SLABS 420 +#define VAR_IP_RATELIMIT_SIZE 421 +#define VAR_RATELIMIT 422 +#define VAR_RATELIMIT_SLABS 423 +#define VAR_RATELIMIT_SIZE 424 +#define VAR_RATELIMIT_FOR_DOMAIN 425 +#define VAR_RATELIMIT_BELOW_DOMAIN 426 +#define VAR_IP_RATELIMIT_FACTOR 427 +#define VAR_RATELIMIT_FACTOR 428 +#define VAR_SEND_CLIENT_SUBNET 429 +#define VAR_CLIENT_SUBNET_ALWAYS_FORWARD 430 +#define VAR_CLIENT_SUBNET_OPCODE 431 +#define VAR_MAX_CLIENT_SUBNET_IPV4 432 +#define VAR_MAX_CLIENT_SUBNET_IPV6 433 +#define VAR_CAPS_WHITELIST 434 +#define VAR_CACHE_MAX_NEGATIVE_TTL 435 +#define VAR_PERMIT_SMALL_HOLDDOWN 436 +#define VAR_QNAME_MINIMISATION 437 +#define VAR_QNAME_MINIMISATION_STRICT 438 +#define VAR_IP_FREEBIND 439 +#define VAR_DEFINE_TAG 440 +#define VAR_LOCAL_ZONE_TAG 441 +#define VAR_ACCESS_CONTROL_TAG 442 +#define VAR_LOCAL_ZONE_OVERRIDE 443 +#define VAR_ACCESS_CONTROL_TAG_ACTION 444 +#define VAR_ACCESS_CONTROL_TAG_DATA 445 +#define VAR_VIEW 446 +#define VAR_ACCESS_CONTROL_VIEW 447 +#define VAR_VIEW_FIRST 448 +#define VAR_SERVE_EXPIRED 449 +#define VAR_FAKE_DSA 450 +#define VAR_FAKE_SHA1 451 +#define VAR_LOG_IDENTITY 452 +#define VAR_HIDE_TRUSTANCHOR 453 +#define VAR_USE_SYSTEMD 454 +#define VAR_SHM_ENABLE 455 +#define VAR_SHM_KEY 456 +#define VAR_DNSCRYPT 457 +#define VAR_DNSCRYPT_ENABLE 458 +#define VAR_DNSCRYPT_PORT 459 +#define VAR_DNSCRYPT_PROVIDER 460 +#define VAR_DNSCRYPT_SECRET_KEY 461 +#define VAR_DNSCRYPT_PROVIDER_CERT 462 +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 2058 of yacc.c */ -#line 64 "./util/configparser.y" +#line 66 "util/configparser.y" /* yacc.c:1909 */ char* str; +#line 472 "util/configparser.h" /* yacc.c:1909 */ +}; -/* Line 2058 of yacc.c */ -#line 386 "util/configparser.h" -} YYSTYPE; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE yylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_YY_UTIL_CONFIGPARSER_H_INCLUDED */ diff --git a/external/unbound/util/configparser.y b/external/unbound/util/configparser.y index abc0bb0d7..4a04367f4 100644 --- a/external/unbound/util/configparser.y +++ b/external/unbound/util/configparser.y @@ -51,6 +51,8 @@ int ub_c_lex(void); void ub_c_error(const char *message); +static void validate_respip_action(const char* action); + /* these need to be global, otherwise they cannot be used inside yacc */ extern struct config_parser_state* cfg_parser; @@ -69,7 +71,8 @@ extern struct config_parser_state* cfg_parser; %token <str> STRING_ARG %token VAR_SERVER VAR_VERBOSITY VAR_NUM_THREADS VAR_PORT %token VAR_OUTGOING_RANGE VAR_INTERFACE -%token VAR_DO_IP4 VAR_DO_IP6 VAR_DO_UDP VAR_DO_TCP +%token VAR_DO_IP4 VAR_DO_IP6 VAR_PREFER_IP6 VAR_DO_UDP VAR_DO_TCP +%token VAR_TCP_MSS VAR_OUTGOING_TCP_MSS %token VAR_CHROOT VAR_USERNAME VAR_DIRECTORY VAR_LOGFILE VAR_PIDFILE %token VAR_MSG_CACHE_SIZE VAR_MSG_CACHE_SLABS VAR_NUM_QUERIES_PER_THREAD %token VAR_RRSET_CACHE_SIZE VAR_RRSET_CACHE_SLABS VAR_OUTGOING_NUM_TCP @@ -103,10 +106,13 @@ extern struct config_parser_state* cfg_parser; %token VAR_AUTO_TRUST_ANCHOR_FILE VAR_KEEP_MISSING VAR_ADD_HOLDDOWN %token VAR_DEL_HOLDDOWN VAR_SO_RCVBUF VAR_EDNS_BUFFER_SIZE VAR_PREFETCH %token VAR_PREFETCH_KEY VAR_SO_SNDBUF VAR_SO_REUSEPORT VAR_HARDEN_BELOW_NXDOMAIN -%token VAR_IGNORE_CD_FLAG VAR_LOG_QUERIES VAR_TCP_UPSTREAM VAR_SSL_UPSTREAM +%token VAR_IGNORE_CD_FLAG VAR_LOG_QUERIES VAR_LOG_REPLIES +%token VAR_TCP_UPSTREAM VAR_SSL_UPSTREAM %token VAR_SSL_SERVICE_KEY VAR_SSL_SERVICE_PEM VAR_SSL_PORT VAR_FORWARD_FIRST +%token VAR_STUB_SSL_UPSTREAM VAR_FORWARD_SSL_UPSTREAM %token VAR_STUB_FIRST VAR_MINIMAL_RESPONSES VAR_RRSET_ROUNDROBIN -%token VAR_MAX_UDP_SIZE VAR_DELAY_CLOSE VAR_UNBLOCK_LAN_ZONES +%token VAR_MAX_UDP_SIZE VAR_DELAY_CLOSE +%token VAR_UNBLOCK_LAN_ZONES VAR_INSECURE_LAN_ZONES %token VAR_INFRA_CACHE_MIN_RTT %token VAR_DNS64_PREFIX VAR_DNS64_SYNTHALL %token VAR_DNSTAP VAR_DNSTAP_ENABLE VAR_DNSTAP_SOCKET_PATH @@ -118,17 +124,34 @@ extern struct config_parser_state* cfg_parser; %token VAR_DNSTAP_LOG_CLIENT_RESPONSE_MESSAGES %token VAR_DNSTAP_LOG_FORWARDER_QUERY_MESSAGES %token VAR_DNSTAP_LOG_FORWARDER_RESPONSE_MESSAGES +%token VAR_RESPONSE_IP_TAG VAR_RESPONSE_IP VAR_RESPONSE_IP_DATA %token VAR_HARDEN_ALGO_DOWNGRADE VAR_IP_TRANSPARENT +%token VAR_DISABLE_DNSSEC_LAME_CHECK +%token VAR_IP_RATELIMIT VAR_IP_RATELIMIT_SLABS VAR_IP_RATELIMIT_SIZE %token VAR_RATELIMIT VAR_RATELIMIT_SLABS VAR_RATELIMIT_SIZE -%token VAR_RATELIMIT_FOR_DOMAIN VAR_RATELIMIT_BELOW_DOMAIN VAR_RATELIMIT_FACTOR +%token VAR_RATELIMIT_FOR_DOMAIN VAR_RATELIMIT_BELOW_DOMAIN +%token VAR_IP_RATELIMIT_FACTOR VAR_RATELIMIT_FACTOR +%token VAR_SEND_CLIENT_SUBNET VAR_CLIENT_SUBNET_ALWAYS_FORWARD +%token VAR_CLIENT_SUBNET_OPCODE +%token VAR_MAX_CLIENT_SUBNET_IPV4 VAR_MAX_CLIENT_SUBNET_IPV6 %token VAR_CAPS_WHITELIST VAR_CACHE_MAX_NEGATIVE_TTL VAR_PERMIT_SMALL_HOLDDOWN -%token VAR_QNAME_MINIMISATION +%token VAR_QNAME_MINIMISATION VAR_QNAME_MINIMISATION_STRICT VAR_IP_FREEBIND +%token VAR_DEFINE_TAG VAR_LOCAL_ZONE_TAG VAR_ACCESS_CONTROL_TAG +%token VAR_LOCAL_ZONE_OVERRIDE VAR_ACCESS_CONTROL_TAG_ACTION +%token VAR_ACCESS_CONTROL_TAG_DATA VAR_VIEW VAR_ACCESS_CONTROL_VIEW +%token VAR_VIEW_FIRST VAR_SERVE_EXPIRED VAR_FAKE_DSA VAR_FAKE_SHA1 +%token VAR_LOG_IDENTITY VAR_HIDE_TRUSTANCHOR +%token VAR_USE_SYSTEMD VAR_SHM_ENABLE VAR_SHM_KEY +%token VAR_DNSCRYPT VAR_DNSCRYPT_ENABLE VAR_DNSCRYPT_PORT VAR_DNSCRYPT_PROVIDER +%token VAR_DNSCRYPT_SECRET_KEY VAR_DNSCRYPT_PROVIDER_CERT %% toplevelvars: /* empty */ | toplevelvars toplevelvar ; toplevelvar: serverstart contents_server | stubstart contents_stub | forwardstart contents_forward | pythonstart contents_py | - rcstart contents_rc | dtstart contents_dt + rcstart contents_rc | dtstart contents_dt | viewstart + contents_view | + dnscstart contents_dnsc ; /* server: declaration */ @@ -141,7 +164,9 @@ contents_server: contents_server content_server | ; content_server: server_num_threads | server_verbosity | server_port | server_outgoing_range | server_do_ip4 | - server_do_ip6 | server_do_udp | server_do_tcp | + server_do_ip6 | server_prefer_ip6 | + server_do_udp | server_do_tcp | + server_tcp_mss | server_outgoing_tcp_mss | server_interface | server_chroot | server_username | server_directory | server_logfile | server_pidfile | server_msg_cache_size | server_msg_cache_slabs | @@ -177,17 +202,33 @@ content_server: server_num_threads | server_verbosity | server_port | server_del_holddown | server_keep_missing | server_so_rcvbuf | server_edns_buffer_size | server_prefetch | server_prefetch_key | server_so_sndbuf | server_harden_below_nxdomain | server_ignore_cd_flag | - server_log_queries | server_tcp_upstream | server_ssl_upstream | + server_log_queries | server_log_replies | server_tcp_upstream | server_ssl_upstream | server_ssl_service_key | server_ssl_service_pem | server_ssl_port | server_minimal_responses | server_rrset_roundrobin | server_max_udp_size | - server_so_reuseport | server_delay_close | server_unblock_lan_zones | + server_so_reuseport | server_delay_close | + server_unblock_lan_zones | server_insecure_lan_zones | server_dns64_prefix | server_dns64_synthall | server_infra_cache_min_rtt | server_harden_algo_downgrade | - server_ip_transparent | server_ratelimit | server_ratelimit_slabs | - server_ratelimit_size | server_ratelimit_for_domain | + server_ip_transparent | server_ip_ratelimit | server_ratelimit | + server_ip_ratelimit_slabs | server_ratelimit_slabs | + server_ip_ratelimit_size | server_ratelimit_size | + server_ratelimit_for_domain | server_ratelimit_below_domain | server_ratelimit_factor | + server_ip_ratelimit_factor | server_send_client_subnet | + server_client_subnet_always_forward | + server_client_subnet_opcode | + server_max_client_subnet_ipv4 | server_max_client_subnet_ipv6 | server_caps_whitelist | server_cache_max_negative_ttl | - server_permit_small_holddown | server_qname_minimisation + server_permit_small_holddown | server_qname_minimisation | + server_ip_freebind | server_define_tag | server_local_zone_tag | + server_disable_dnssec_lame_check | server_access_control_tag | + server_local_zone_override | server_access_control_tag_action | + server_access_control_tag_data | server_access_control_view | + server_qname_minimisation_strict | server_serve_expired | + server_fake_dsa | server_log_identity | server_use_systemd | + server_response_ip_tag | server_response_ip | server_response_ip_data | + server_shm_enable | server_shm_key | server_fake_sha1 | + server_hide_trustanchor ; stubstart: VAR_STUB_ZONE { @@ -203,7 +244,8 @@ stubstart: VAR_STUB_ZONE ; contents_stub: contents_stub content_stub | ; -content_stub: stub_name | stub_host | stub_addr | stub_prime | stub_first +content_stub: stub_name | stub_host | stub_addr | stub_prime | stub_first | + stub_ssl_upstream ; forwardstart: VAR_FORWARD_ZONE { @@ -219,7 +261,27 @@ forwardstart: VAR_FORWARD_ZONE ; contents_forward: contents_forward content_forward | ; -content_forward: forward_name | forward_host | forward_addr | forward_first +content_forward: forward_name | forward_host | forward_addr | forward_first | + forward_ssl_upstream + ; +viewstart: VAR_VIEW + { + struct config_view* s; + OUTYY(("\nP(view:)\n")); + s = (struct config_view*)calloc(1, sizeof(struct config_view)); + if(s) { + s->next = cfg_parser->cfg->views; + if(s->next && !s->next->name) + yyerror("view without name"); + cfg_parser->cfg->views = s; + } else + yyerror("out of memory"); + } + ; +contents_view: contents_view content_view + | ; +content_view: view_name | view_local_zone | view_local_data | view_first | + view_response_ip | view_response_ip_data | view_local_data_ptr ; server_num_threads: VAR_NUM_THREADS STRING_ARG { @@ -268,6 +330,26 @@ server_extended_statistics: VAR_EXTENDED_STATISTICS STRING_ARG free($2); } ; +server_shm_enable: VAR_SHM_ENABLE STRING_ARG + { + OUTYY(("P(server_shm_enable:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->shm_enable = (strcmp($2, "yes")==0); + free($2); + } + ; +server_shm_key: VAR_SHM_KEY STRING_ARG + { + OUTYY(("P(server_shm_key:%s)\n", $2)); + if(strcmp($2, "") == 0 || strcmp($2, "0") == 0) + cfg_parser->cfg->shm_key = 0; + else if(atoi($2) == 0) + yyerror("number expected"); + else cfg_parser->cfg->shm_key = atoi($2); + free($2); + } + ; server_port: VAR_PORT STRING_ARG { OUTYY(("P(server_port:%s)\n", $2)); @@ -277,6 +359,78 @@ server_port: VAR_PORT STRING_ARG free($2); } ; +server_send_client_subnet: VAR_SEND_CLIENT_SUBNET STRING_ARG + { + #ifdef CLIENT_SUBNET + OUTYY(("P(server_send_client_subnet:%s)\n", $2)); + if(!cfg_strlist_insert(&cfg_parser->cfg->client_subnet, $2)) + fatal_exit("out of memory adding client-subnet"); + #else + OUTYY(("P(Compiled without edns subnet option, ignoring)\n")); + #endif + } + ; +server_client_subnet_always_forward: + VAR_CLIENT_SUBNET_ALWAYS_FORWARD STRING_ARG + { + #ifdef CLIENT_SUBNET + OUTYY(("P(server_client_subnet_always_forward:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else + cfg_parser->cfg->client_subnet_always_forward = + (strcmp($2, "yes")==0); + #else + OUTYY(("P(Compiled without edns subnet option, ignoring)\n")); + #endif + free($2); + } + ; +server_client_subnet_opcode: VAR_CLIENT_SUBNET_OPCODE STRING_ARG + { + #ifdef CLIENT_SUBNET + OUTYY(("P(client_subnet_opcode:%s)\n", $2)); + OUTYY(("P(Depricated option, ignoring)\n")); + #else + OUTYY(("P(Compiled without edns subnet option, ignoring)\n")); + #endif + free($2); + } + ; +server_max_client_subnet_ipv4: VAR_MAX_CLIENT_SUBNET_IPV4 STRING_ARG + { + #ifdef CLIENT_SUBNET + OUTYY(("P(max_client_subnet_ipv4:%s)\n", $2)); + if(atoi($2) == 0 && strcmp($2, "0") != 0) + yyerror("IPv4 subnet length expected"); + else if (atoi($2) > 32) + cfg_parser->cfg->max_client_subnet_ipv4 = 32; + else if (atoi($2) < 0) + cfg_parser->cfg->max_client_subnet_ipv4 = 0; + else cfg_parser->cfg->max_client_subnet_ipv4 = (uint8_t)atoi($2); + #else + OUTYY(("P(Compiled without edns subnet option, ignoring)\n")); + #endif + free($2); + } + ; +server_max_client_subnet_ipv6: VAR_MAX_CLIENT_SUBNET_IPV6 STRING_ARG + { + #ifdef CLIENT_SUBNET + OUTYY(("P(max_client_subnet_ipv6:%s)\n", $2)); + if(atoi($2) == 0 && strcmp($2, "0") != 0) + yyerror("Ipv6 subnet length expected"); + else if (atoi($2) > 128) + cfg_parser->cfg->max_client_subnet_ipv6 = 128; + else if (atoi($2) < 0) + cfg_parser->cfg->max_client_subnet_ipv6 = 0; + else cfg_parser->cfg->max_client_subnet_ipv6 = (uint8_t)atoi($2); + #else + OUTYY(("P(Compiled without edns subnet option, ignoring)\n")); + #endif + free($2); + } + ; server_interface: VAR_INTERFACE STRING_ARG { OUTYY(("P(server_interface:%s)\n", $2)); @@ -395,6 +549,33 @@ server_do_tcp: VAR_DO_TCP STRING_ARG free($2); } ; +server_prefer_ip6: VAR_PREFER_IP6 STRING_ARG + { + OUTYY(("P(server_prefer_ip6:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->prefer_ip6 = (strcmp($2, "yes")==0); + free($2); + } + ; +server_tcp_mss: VAR_TCP_MSS STRING_ARG + { + OUTYY(("P(server_tcp_mss:%s)\n", $2)); + if(atoi($2) == 0 && strcmp($2, "0") != 0) + yyerror("number expected"); + else cfg_parser->cfg->tcp_mss = atoi($2); + free($2); + } + ; +server_outgoing_tcp_mss: VAR_OUTGOING_TCP_MSS STRING_ARG + { + OUTYY(("P(server_outgoing_tcp_mss:%s)\n", $2)); + if(atoi($2) == 0 && strcmp($2, "0") != 0) + yyerror("number expected"); + else cfg_parser->cfg->outgoing_tcp_mss = atoi($2); + free($2); + } + ; server_tcp_upstream: VAR_TCP_UPSTREAM STRING_ARG { OUTYY(("P(server_tcp_upstream:%s)\n", $2)); @@ -436,6 +617,15 @@ server_ssl_port: VAR_SSL_PORT STRING_ARG free($2); } ; +server_use_systemd: VAR_USE_SYSTEMD STRING_ARG + { + OUTYY(("P(server_use_systemd:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->use_systemd = (strcmp($2, "yes")==0); + free($2); + } + ; server_do_daemonize: VAR_DO_DAEMONIZE STRING_ARG { OUTYY(("P(server_do_daemonize:%s)\n", $2)); @@ -477,6 +667,15 @@ server_log_queries: VAR_LOG_QUERIES STRING_ARG free($2); } ; +server_log_replies: VAR_LOG_REPLIES STRING_ARG + { + OUTYY(("P(server_log_replies:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->log_replies = (strcmp($2, "yes")==0); + free($2); + } + ; server_chroot: VAR_CHROOT STRING_ARG { OUTYY(("P(server_chroot:%s)\n", $2)); @@ -496,6 +695,25 @@ server_directory: VAR_DIRECTORY STRING_ARG OUTYY(("P(server_directory:%s)\n", $2)); free(cfg_parser->cfg->directory); cfg_parser->cfg->directory = $2; + /* change there right away for includes relative to this */ + if($2[0]) { + char* d; +#ifdef UB_ON_WINDOWS + w_config_adjust_directory(cfg_parser->cfg); +#endif + d = cfg_parser->cfg->directory; + /* adjust directory if we have already chroot, + * like, we reread after sighup */ + if(cfg_parser->chroot && cfg_parser->chroot[0] && + strncmp(d, cfg_parser->chroot, strlen( + cfg_parser->chroot)) == 0) + d += strlen(cfg_parser->chroot); + if(d[0]) { + if(chdir(d)) + log_err("cannot chdir to directory: %s (%s)", + d, strerror(errno)); + } + } } ; server_logfile: VAR_LOGFILE STRING_ARG @@ -590,6 +808,15 @@ server_hide_version: VAR_HIDE_VERSION STRING_ARG free($2); } ; +server_hide_trustanchor: VAR_HIDE_TRUSTANCHOR STRING_ARG + { + OUTYY(("P(server_hide_trustanchor:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->hide_trustanchor = (strcmp($2, "yes")==0); + free($2); + } + ; server_identity: VAR_IDENTITY STRING_ARG { OUTYY(("P(server_identity:%s)\n", $2)); @@ -640,6 +867,16 @@ server_ip_transparent: VAR_IP_TRANSPARENT STRING_ARG free($2); } ; +server_ip_freebind: VAR_IP_FREEBIND STRING_ARG + { + OUTYY(("P(server_ip_freebind:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->ip_freebind = + (strcmp($2, "yes")==0); + free($2); + } + ; server_edns_buffer_size: VAR_EDNS_BUFFER_SIZE STRING_ARG { OUTYY(("P(server_edns_buffer_size:%s)\n", $2)); @@ -722,6 +959,16 @@ server_unblock_lan_zones: VAR_UNBLOCK_LAN_ZONES STRING_ARG free($2); } ; +server_insecure_lan_zones: VAR_INSECURE_LAN_ZONES STRING_ARG + { + OUTYY(("P(server_insecure_lan_zones:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->insecure_lan_zones = + (strcmp($2, "yes")==0); + free($2); + } + ; server_rrset_cache_size: VAR_RRSET_CACHE_SIZE STRING_ARG { OUTYY(("P(server_rrset_cache_size:%s)\n", $2)); @@ -978,7 +1225,7 @@ server_module_conf: VAR_MODULE_CONF STRING_ARG server_val_override_date: VAR_VAL_OVERRIDE_DATE STRING_ARG { OUTYY(("P(server_val_override_date:%s)\n", $2)); - if(strlen($2) == 0 || strcmp($2, "0") == 0) { + if(*$2 == '\0' || strcmp($2, "0") == 0) { cfg_parser->cfg->val_date_override = 0; } else if(strlen($2) == 14) { cfg_parser->cfg->val_date_override = @@ -996,7 +1243,7 @@ server_val_override_date: VAR_VAL_OVERRIDE_DATE STRING_ARG server_val_sig_skew_min: VAR_VAL_SIG_SKEW_MIN STRING_ARG { OUTYY(("P(server_val_sig_skew_min:%s)\n", $2)); - if(strlen($2) == 0 || strcmp($2, "0") == 0) { + if(*$2 == '\0' || strcmp($2, "0") == 0) { cfg_parser->cfg->val_sig_skew_min = 0; } else { cfg_parser->cfg->val_sig_skew_min = atoi($2); @@ -1009,7 +1256,7 @@ server_val_sig_skew_min: VAR_VAL_SIG_SKEW_MIN STRING_ARG server_val_sig_skew_max: VAR_VAL_SIG_SKEW_MAX STRING_ARG { OUTYY(("P(server_val_sig_skew_max:%s)\n", $2)); - if(strlen($2) == 0 || strcmp($2, "0") == 0) { + if(*$2 == '\0' || strcmp($2, "0") == 0) { cfg_parser->cfg->val_sig_skew_max = 0; } else { cfg_parser->cfg->val_sig_skew_max = atoi($2); @@ -1084,6 +1331,41 @@ server_ignore_cd_flag: VAR_IGNORE_CD_FLAG STRING_ARG free($2); } ; +server_serve_expired: VAR_SERVE_EXPIRED STRING_ARG + { + OUTYY(("P(server_serve_expired:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->serve_expired = (strcmp($2, "yes")==0); + free($2); + } + ; +server_fake_dsa: VAR_FAKE_DSA STRING_ARG + { + OUTYY(("P(server_fake_dsa:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); +#ifdef HAVE_SSL + else fake_dsa = (strcmp($2, "yes")==0); + if(fake_dsa) + log_warn("test option fake_dsa is enabled"); +#endif + free($2); + } + ; +server_fake_sha1: VAR_FAKE_SHA1 STRING_ARG + { + OUTYY(("P(server_fake_sha1:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); +#ifdef HAVE_SSL + else fake_sha1 = (strcmp($2, "yes")==0); + if(fake_sha1) + log_warn("test option fake_sha1 is enabled"); +#endif + free($2); + } + ; server_val_log_level: VAR_VAL_LOG_LEVEL STRING_ARG { OUTYY(("P(server_val_log_level:%s)\n", $2)); @@ -1171,12 +1453,16 @@ server_local_zone: VAR_LOCAL_ZONE STRING_ARG STRING_ARG if(strcmp($3, "static")!=0 && strcmp($3, "deny")!=0 && strcmp($3, "refuse")!=0 && strcmp($3, "redirect")!=0 && strcmp($3, "transparent")!=0 && strcmp($3, "nodefault")!=0 - && strcmp($3, "typetransparent")!=0 && - strcmp($3, "inform")!=0 && strcmp($3, "inform_deny")!=0) + && strcmp($3, "typetransparent")!=0 + && strcmp($3, "always_transparent")!=0 + && strcmp($3, "always_refuse")!=0 + && strcmp($3, "always_nxdomain")!=0 + && strcmp($3, "inform")!=0 && strcmp($3, "inform_deny")!=0) yyerror("local-zone type: expected static, deny, " "refuse, redirect, transparent, " - "typetransparent, inform, inform_deny " - "or nodefault"); + "typetransparent, inform, inform_deny, " + "always_transparent, always_refuse, " + "always_nxdomain or nodefault"); else if(strcmp($3, "nodefault")==0) { if(!cfg_strlist_insert(&cfg_parser->cfg-> local_zones_nodefault, $2)) @@ -1254,6 +1540,134 @@ server_dns64_synthall: VAR_DNS64_SYNTHALL STRING_ARG free($2); } ; +server_define_tag: VAR_DEFINE_TAG STRING_ARG + { + char* p, *s = $2; + OUTYY(("P(server_define_tag:%s)\n", $2)); + while((p=strsep(&s, " \t\n")) != NULL) { + if(*p) { + if(!config_add_tag(cfg_parser->cfg, p)) + yyerror("could not define-tag, " + "out of memory"); + } + } + free($2); + } + ; +server_local_zone_tag: VAR_LOCAL_ZONE_TAG STRING_ARG STRING_ARG + { + size_t len = 0; + uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, $3, + &len); + free($3); + OUTYY(("P(server_local_zone_tag:%s)\n", $2)); + if(!bitlist) + yyerror("could not parse tags, (define-tag them first)"); + if(bitlist) { + if(!cfg_strbytelist_insert( + &cfg_parser->cfg->local_zone_tags, + $2, bitlist, len)) { + yyerror("out of memory"); + free($2); + } + } + } + ; +server_access_control_tag: VAR_ACCESS_CONTROL_TAG STRING_ARG STRING_ARG + { + size_t len = 0; + uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, $3, + &len); + free($3); + OUTYY(("P(server_access_control_tag:%s)\n", $2)); + if(!bitlist) + yyerror("could not parse tags, (define-tag them first)"); + if(bitlist) { + if(!cfg_strbytelist_insert( + &cfg_parser->cfg->acl_tags, + $2, bitlist, len)) { + yyerror("out of memory"); + free($2); + } + } + } + ; +server_access_control_tag_action: VAR_ACCESS_CONTROL_TAG_ACTION STRING_ARG STRING_ARG STRING_ARG + { + OUTYY(("P(server_access_control_tag_action:%s %s %s)\n", $2, $3, $4)); + if(!cfg_str3list_insert(&cfg_parser->cfg->acl_tag_actions, + $2, $3, $4)) { + yyerror("out of memory"); + free($2); + free($3); + free($4); + } + } + ; +server_access_control_tag_data: VAR_ACCESS_CONTROL_TAG_DATA STRING_ARG STRING_ARG STRING_ARG + { + OUTYY(("P(server_access_control_tag_data:%s %s %s)\n", $2, $3, $4)); + if(!cfg_str3list_insert(&cfg_parser->cfg->acl_tag_datas, + $2, $3, $4)) { + yyerror("out of memory"); + free($2); + free($3); + free($4); + } + } + ; +server_local_zone_override: VAR_LOCAL_ZONE_OVERRIDE STRING_ARG STRING_ARG STRING_ARG + { + OUTYY(("P(server_local_zone_override:%s %s %s)\n", $2, $3, $4)); + if(!cfg_str3list_insert(&cfg_parser->cfg->local_zone_overrides, + $2, $3, $4)) { + yyerror("out of memory"); + free($2); + free($3); + free($4); + } + } + ; +server_access_control_view: VAR_ACCESS_CONTROL_VIEW STRING_ARG STRING_ARG + { + OUTYY(("P(server_access_control_view:%s %s)\n", $2, $3)); + if(!cfg_str2list_insert(&cfg_parser->cfg->acl_view, + $2, $3)) { + yyerror("out of memory"); + free($2); + free($3); + } + } + ; +server_response_ip_tag: VAR_RESPONSE_IP_TAG STRING_ARG STRING_ARG + { + size_t len = 0; + uint8_t* bitlist = config_parse_taglist(cfg_parser->cfg, $3, + &len); + free($3); + OUTYY(("P(response_ip_tag:%s)\n", $2)); + if(!bitlist) + yyerror("could not parse tags, (define-tag them first)"); + if(bitlist) { + if(!cfg_strbytelist_insert( + &cfg_parser->cfg->respip_tags, + $2, bitlist, len)) { + yyerror("out of memory"); + free($2); + } + } + } + ; +server_ip_ratelimit: VAR_IP_RATELIMIT STRING_ARG + { + OUTYY(("P(server_ip_ratelimit:%s)\n", $2)); + if(atoi($2) == 0 && strcmp($2, "0") != 0) + yyerror("number expected"); + else cfg_parser->cfg->ip_ratelimit = atoi($2); + free($2); + } + ; + server_ratelimit: VAR_RATELIMIT STRING_ARG { OUTYY(("P(server_ratelimit:%s)\n", $2)); @@ -1263,6 +1677,14 @@ server_ratelimit: VAR_RATELIMIT STRING_ARG free($2); } ; +server_ip_ratelimit_size: VAR_IP_RATELIMIT_SIZE STRING_ARG + { + OUTYY(("P(server_ip_ratelimit_size:%s)\n", $2)); + if(!cfg_parse_memsize($2, &cfg_parser->cfg->ip_ratelimit_size)) + yyerror("memory size expected"); + free($2); + } + ; server_ratelimit_size: VAR_RATELIMIT_SIZE STRING_ARG { OUTYY(("P(server_ratelimit_size:%s)\n", $2)); @@ -1271,6 +1693,19 @@ server_ratelimit_size: VAR_RATELIMIT_SIZE STRING_ARG free($2); } ; +server_ip_ratelimit_slabs: VAR_IP_RATELIMIT_SLABS STRING_ARG + { + OUTYY(("P(server_ip_ratelimit_slabs:%s)\n", $2)); + if(atoi($2) == 0) + yyerror("number expected"); + else { + cfg_parser->cfg->ip_ratelimit_slabs = atoi($2); + if(!is_pow2(cfg_parser->cfg->ip_ratelimit_slabs)) + yyerror("must be a power of 2"); + } + free($2); + } + ; server_ratelimit_slabs: VAR_RATELIMIT_SLABS STRING_ARG { OUTYY(("P(server_ratelimit_slabs:%s)\n", $2)); @@ -1310,6 +1745,15 @@ server_ratelimit_below_domain: VAR_RATELIMIT_BELOW_DOMAIN STRING_ARG STRING_ARG } } ; +server_ip_ratelimit_factor: VAR_IP_RATELIMIT_FACTOR STRING_ARG + { + OUTYY(("P(server_ip_ratelimit_factor:%s)\n", $2)); + if(atoi($2) == 0 && strcmp($2, "0") != 0) + yyerror("number expected"); + else cfg_parser->cfg->ip_ratelimit_factor = atoi($2); + free($2); + } + ; server_ratelimit_factor: VAR_RATELIMIT_FACTOR STRING_ARG { OUTYY(("P(server_ratelimit_factor:%s)\n", $2)); @@ -1329,6 +1773,16 @@ server_qname_minimisation: VAR_QNAME_MINIMISATION STRING_ARG free($2); } ; +server_qname_minimisation_strict: VAR_QNAME_MINIMISATION_STRICT STRING_ARG + { + OUTYY(("P(server_qname_minimisation_strict:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->qname_minimisation_strict = + (strcmp($2, "yes")==0); + free($2); + } + ; stub_name: VAR_NAME STRING_ARG { OUTYY(("P(name:%s)\n", $2)); @@ -1362,6 +1816,16 @@ stub_first: VAR_STUB_FIRST STRING_ARG free($2); } ; +stub_ssl_upstream: VAR_STUB_SSL_UPSTREAM STRING_ARG + { + OUTYY(("P(stub-ssl-upstream:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->stubs->ssl_upstream = + (strcmp($2, "yes")==0); + free($2); + } + ; stub_prime: VAR_STUB_PRIME STRING_ARG { OUTYY(("P(stub-prime:%s)\n", $2)); @@ -1405,6 +1869,106 @@ forward_first: VAR_FORWARD_FIRST STRING_ARG free($2); } ; +forward_ssl_upstream: VAR_FORWARD_SSL_UPSTREAM STRING_ARG + { + OUTYY(("P(forward-ssl-upstream:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->forwards->ssl_upstream = + (strcmp($2, "yes")==0); + free($2); + } + ; +view_name: VAR_NAME STRING_ARG + { + OUTYY(("P(name:%s)\n", $2)); + if(cfg_parser->cfg->views->name) + yyerror("view name override, there must be one " + "name for one view"); + free(cfg_parser->cfg->views->name); + cfg_parser->cfg->views->name = $2; + } + ; +view_local_zone: VAR_LOCAL_ZONE STRING_ARG STRING_ARG + { + OUTYY(("P(view_local_zone:%s %s)\n", $2, $3)); + if(strcmp($3, "static")!=0 && strcmp($3, "deny")!=0 && + strcmp($3, "refuse")!=0 && strcmp($3, "redirect")!=0 && + strcmp($3, "transparent")!=0 && strcmp($3, "nodefault")!=0 + && strcmp($3, "typetransparent")!=0 + && strcmp($3, "always_transparent")!=0 + && strcmp($3, "always_refuse")!=0 + && strcmp($3, "always_nxdomain")!=0 + && strcmp($3, "inform")!=0 && strcmp($3, "inform_deny")!=0) + yyerror("local-zone type: expected static, deny, " + "refuse, redirect, transparent, " + "typetransparent, inform, inform_deny, " + "always_transparent, always_refuse, " + "always_nxdomain or nodefault"); + else if(strcmp($3, "nodefault")==0) { + if(!cfg_strlist_insert(&cfg_parser->cfg->views-> + local_zones_nodefault, $2)) + fatal_exit("out of memory adding local-zone"); + free($3); + } else { + if(!cfg_str2list_insert( + &cfg_parser->cfg->views->local_zones, + $2, $3)) + fatal_exit("out of memory adding local-zone"); + } + } + ; +view_response_ip: VAR_RESPONSE_IP STRING_ARG STRING_ARG + { + OUTYY(("P(view_response_ip:%s %s)\n", $2, $3)); + validate_respip_action($3); + if(!cfg_str2list_insert( + &cfg_parser->cfg->views->respip_actions, $2, $3)) + fatal_exit("out of memory adding per-view " + "response-ip action"); + } + ; +view_response_ip_data: VAR_RESPONSE_IP_DATA STRING_ARG STRING_ARG + { + OUTYY(("P(view_response_ip_data:%s)\n", $2)); + if(!cfg_str2list_insert( + &cfg_parser->cfg->views->respip_data, $2, $3)) + fatal_exit("out of memory adding response-ip-data"); + } + ; +view_local_data: VAR_LOCAL_DATA STRING_ARG + { + OUTYY(("P(view_local_data:%s)\n", $2)); + if(!cfg_strlist_insert(&cfg_parser->cfg->views->local_data, $2)) { + fatal_exit("out of memory adding local-data"); + free($2); + } + } + ; +view_local_data_ptr: VAR_LOCAL_DATA_PTR STRING_ARG + { + char* ptr; + OUTYY(("P(view_local_data_ptr:%s)\n", $2)); + ptr = cfg_ptr_reverse($2); + free($2); + if(ptr) { + if(!cfg_strlist_insert(&cfg_parser->cfg->views-> + local_data, ptr)) + fatal_exit("out of memory adding local-data"); + } else { + yyerror("local-data-ptr could not be reversed"); + } + } + ; +view_first: VAR_VIEW_FIRST STRING_ARG + { + OUTYY(("P(view-first:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->views->isfirst=(strcmp($2, "yes")==0); + free($2); + } + ; rcstart: VAR_REMOTE_CONTROL { OUTYY(("\nP(remote-control:)\n")); @@ -1611,6 +2175,108 @@ py_script: VAR_PYTHON_SCRIPT STRING_ARG free(cfg_parser->cfg->python_script); cfg_parser->cfg->python_script = $2; } +server_disable_dnssec_lame_check: VAR_DISABLE_DNSSEC_LAME_CHECK STRING_ARG + { + OUTYY(("P(disable_dnssec_lame_check:%s)\n", $2)); + if (strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->disable_dnssec_lame_check = + (strcmp($2, "yes")==0); + free($2); + } + ; +server_log_identity: VAR_LOG_IDENTITY STRING_ARG + { + OUTYY(("P(server_log_identity:%s)\n", $2)); + free(cfg_parser->cfg->log_identity); + cfg_parser->cfg->log_identity = $2; + } + ; +server_response_ip: VAR_RESPONSE_IP STRING_ARG STRING_ARG + { + OUTYY(("P(server_response_ip:%s %s)\n", $2, $3)); + validate_respip_action($3); + if(!cfg_str2list_insert(&cfg_parser->cfg->respip_actions, + $2, $3)) + fatal_exit("out of memory adding response-ip"); + } + ; +server_response_ip_data: VAR_RESPONSE_IP_DATA STRING_ARG STRING_ARG + { + OUTYY(("P(server_response_ip_data:%s)\n", $2)); + if(!cfg_str2list_insert(&cfg_parser->cfg->respip_data, + $2, $3)) + fatal_exit("out of memory adding response-ip-data"); + } + ; +dnscstart: VAR_DNSCRYPT + { + OUTYY(("\nP(dnscrypt:)\n")); + OUTYY(("\nP(dnscrypt:)\n")); + } + ; +contents_dnsc: contents_dnsc content_dnsc + | ; +content_dnsc: + dnsc_dnscrypt_enable | dnsc_dnscrypt_port | dnsc_dnscrypt_provider | + dnsc_dnscrypt_secret_key | dnsc_dnscrypt_provider_cert + ; +dnsc_dnscrypt_enable: VAR_DNSCRYPT_ENABLE STRING_ARG + { + OUTYY(("P(dnsc_dnscrypt_enable:%s)\n", $2)); + if(strcmp($2, "yes") != 0 && strcmp($2, "no") != 0) + yyerror("expected yes or no."); + else cfg_parser->cfg->dnscrypt = (strcmp($2, "yes")==0); + } + ; + +dnsc_dnscrypt_port: VAR_DNSCRYPT_PORT STRING_ARG + { + OUTYY(("P(dnsc_dnscrypt_port:%s)\n", $2)); + + if(atoi($2) == 0) + yyerror("port number expected"); + else cfg_parser->cfg->dnscrypt_port = atoi($2); + free($2); + } + ; +dnsc_dnscrypt_provider: VAR_DNSCRYPT_PROVIDER STRING_ARG + { + OUTYY(("P(dnsc_dnscrypt_provider:%s)\n", $2)); + free(cfg_parser->cfg->dnscrypt_provider); + cfg_parser->cfg->dnscrypt_provider = $2; + } + ; +dnsc_dnscrypt_provider_cert: VAR_DNSCRYPT_PROVIDER_CERT STRING_ARG + { + OUTYY(("P(dnsc_dnscrypt_provider_cert:%s)\n", $2)); + if(!cfg_strlist_insert(&cfg_parser->cfg->dnscrypt_provider_cert, $2)) + fatal_exit("out of memory adding dnscrypt-provider-cert"); + } + ; +dnsc_dnscrypt_secret_key: VAR_DNSCRYPT_SECRET_KEY STRING_ARG + { + OUTYY(("P(dnsc_dnscrypt_secret_key:%s)\n", $2)); + if(!cfg_strlist_insert(&cfg_parser->cfg->dnscrypt_secret_key, $2)) + fatal_exit("out of memory adding dnscrypt-secret-key"); + } + ; %% /* parse helper routines could be here */ +static void +validate_respip_action(const char* action) +{ + if(strcmp(action, "deny")!=0 && + strcmp(action, "redirect")!=0 && + strcmp(action, "inform")!=0 && + strcmp(action, "inform_deny")!=0 && + strcmp(action, "always_transparent")!=0 && + strcmp(action, "always_refuse")!=0 && + strcmp(action, "always_nxdomain")!=0) + { + yyerror("response-ip action: expected deny, redirect, " + "inform, inform_deny, always_transparent, " + "always_refuse or always_nxdomain"); + } +} diff --git a/external/unbound/util/data/dname.c b/external/unbound/util/data/dname.c index 79bf52ad4..517af2843 100644 --- a/external/unbound/util/data/dname.c +++ b/external/unbound/util/data/dname.c @@ -256,11 +256,13 @@ dname_pkt_compare(sldns_buffer* pkt, uint8_t* d1, uint8_t* d2) log_assert(len1 == len2 && len1 != 0); /* compare labels */ while(len1--) { - if(tolower((unsigned char)*d1++) != tolower((unsigned char)*d2++)) { - if(tolower((unsigned char)d1[-1]) < tolower((unsigned char)d2[-1])) + if(tolower((unsigned char)*d1) != tolower((unsigned char)*d2)) { + if(tolower((unsigned char)*d1) < tolower((unsigned char)*d2)) return -1; return 1; } + d1++; + d2++; } len1 = *d1++; len2 = *d2++; @@ -268,8 +270,8 @@ dname_pkt_compare(sldns_buffer* pkt, uint8_t* d1, uint8_t* d2) return 0; } -hashvalue_t -dname_query_hash(uint8_t* dname, hashvalue_t h) +hashvalue_type +dname_query_hash(uint8_t* dname, hashvalue_type h) { uint8_t labuf[LDNS_MAX_LABELLEN+1]; uint8_t lablen; @@ -281,8 +283,10 @@ dname_query_hash(uint8_t* dname, hashvalue_t h) log_assert(lablen <= LDNS_MAX_LABELLEN); labuf[0] = lablen; i=0; - while(lablen--) - labuf[++i] = (uint8_t)tolower((unsigned char)*dname++); + while(lablen--) { + labuf[++i] = (uint8_t)tolower((unsigned char)*dname); + dname++; + } h = hashlittle(labuf, labuf[0] + 1, h); lablen = *dname++; } @@ -290,8 +294,8 @@ dname_query_hash(uint8_t* dname, hashvalue_t h) return h; } -hashvalue_t -dname_pkt_hash(sldns_buffer* pkt, uint8_t* dname, hashvalue_t h) +hashvalue_type +dname_pkt_hash(sldns_buffer* pkt, uint8_t* dname, hashvalue_type h) { uint8_t labuf[LDNS_MAX_LABELLEN+1]; uint8_t lablen; @@ -309,8 +313,10 @@ dname_pkt_hash(sldns_buffer* pkt, uint8_t* dname, hashvalue_t h) log_assert(lablen <= LDNS_MAX_LABELLEN); labuf[0] = lablen; i=0; - while(lablen--) - labuf[++i] = (uint8_t)tolower((unsigned char)*dname++); + while(lablen--) { + labuf[++i] = (uint8_t)tolower((unsigned char)*dname); + dname++; + } h = hashlittle(labuf, labuf[0] + 1, h); lablen = *dname++; } diff --git a/external/unbound/util/data/dname.h b/external/unbound/util/data/dname.h index ae2fbadc1..53b341bf7 100644 --- a/external/unbound/util/data/dname.h +++ b/external/unbound/util/data/dname.h @@ -127,7 +127,7 @@ int dname_pkt_compare(struct sldns_buffer* pkt, uint8_t* d1, uint8_t* d2); * @param h: initial hash value. * @return: result hash value. */ -hashvalue_t dname_query_hash(uint8_t* dname, hashvalue_t h); +hashvalue_type dname_query_hash(uint8_t* dname, hashvalue_type h); /** * Hash dname, label by label, lowercasing, into hashvalue. @@ -139,7 +139,8 @@ hashvalue_t dname_query_hash(uint8_t* dname, hashvalue_t h); * @return: result hash value. * Result is the same as dname_query_hash, even if compression is used. */ -hashvalue_t dname_pkt_hash(struct sldns_buffer* pkt, uint8_t* dname, hashvalue_t h); +hashvalue_type dname_pkt_hash(struct sldns_buffer* pkt, uint8_t* dname, + hashvalue_type h); /** * Copy over a valid dname and decompress it. diff --git a/external/unbound/util/data/msgencode.c b/external/unbound/util/data/msgencode.c index 43464e9bb..1f72a03b8 100644 --- a/external/unbound/util/data/msgencode.c +++ b/external/unbound/util/data/msgencode.c @@ -48,6 +48,7 @@ #include "util/regional.h" #include "util/net_help.h" #include "sldns/sbuffer.h" +#include "services/localzone.h" /** return code that means the function ran out of memory. negative so it does * not conflict with DNS rcodes. */ @@ -458,6 +459,10 @@ packed_rrset_encode(struct ub_packed_rrset_key* key, sldns_buffer* pkt, owner_labs = dname_count_labels(key->rk.dname); owner_pos = sldns_buffer_position(pkt); + /* For an rrset with a fixed TTL, use the rrset's TTL as given */ + if((key->rk.flags & PACKED_RRSET_FIXEDTTL) != 0) + timenow = 0; + if(do_data) { const sldns_rr_descriptor* c = type_rdata_compressable(key); for(i=0; i<data->count; i++) { @@ -534,7 +539,11 @@ insert_section(struct reply_info* rep, size_t num_rrsets, uint16_t* num_rrs, { int r; size_t i, setstart; - *num_rrs = 0; + /* we now allow this function to be called multiple times for the + * same section, incrementally updating num_rrs. The caller is + * responsible for initializing it (which is the case in the current + * implementation). */ + if(s != LDNS_SECTION_ADDITIONAL) { if(s == LDNS_SECTION_ANSWER && qtype == LDNS_RR_TYPE_ANY) dnssec = 1; /* include all types in ANY answer */ @@ -581,17 +590,20 @@ static int insert_query(struct query_info* qinfo, struct compress_tree_node** tree, sldns_buffer* buffer, struct regional* region) { + uint8_t* qname = qinfo->local_alias ? + qinfo->local_alias->rrset->rk.dname : qinfo->qname; + size_t qname_len = qinfo->local_alias ? + qinfo->local_alias->rrset->rk.dname_len : qinfo->qname_len; if(sldns_buffer_remaining(buffer) < qinfo->qname_len+sizeof(uint16_t)*2) return RETVAL_TRUNC; /* buffer too small */ /* the query is the first name inserted into the tree */ - if(!compress_tree_store(qinfo->qname, - dname_count_labels(qinfo->qname), + if(!compress_tree_store(qname, dname_count_labels(qname), sldns_buffer_position(buffer), region, NULL, tree)) return RETVAL_OUTMEM; - if(sldns_buffer_current(buffer) == qinfo->qname) - sldns_buffer_skip(buffer, (ssize_t)qinfo->qname_len); - else sldns_buffer_write(buffer, qinfo->qname, qinfo->qname_len); + if(sldns_buffer_current(buffer) == qname) + sldns_buffer_skip(buffer, (ssize_t)qname_len); + else sldns_buffer_write(buffer, qname, qname_len); sldns_buffer_write_u16(buffer, qinfo->qtype); sldns_buffer_write_u16(buffer, qinfo->qclass); return RETVAL_OK; @@ -662,6 +674,33 @@ reply_info_encode(struct query_info* qinfo, struct reply_info* rep, * for different roundrobins for sequential id client senders. */ rr_offset = RRSET_ROUNDROBIN?ntohs(id):0; + /* "prepend" any local alias records in the answer section if this + * response is supposed to be authoritative. Currently it should + * be a single CNAME record (sanity-checked in worker_handle_request()) + * but it can be extended if and when we support more variations of + * aliases. */ + if(qinfo->local_alias && (flags & BIT_AA)) { + struct reply_info arep; + time_t timezero = 0; /* to use the 'authoritative' TTL */ + memset(&arep, 0, sizeof(arep)); + arep.flags = rep->flags; + arep.an_numrrsets = 1; + arep.rrset_count = 1; + arep.rrsets = &qinfo->local_alias->rrset; + if((r=insert_section(&arep, 1, &ancount, buffer, 0, + timezero, region, &tree, LDNS_SECTION_ANSWER, + qinfo->qtype, dnssec, rr_offset)) != RETVAL_OK) { + if(r == RETVAL_TRUNC) { + /* create truncated message */ + sldns_buffer_write_u16_at(buffer, 6, ancount); + LDNS_TC_SET(sldns_buffer_begin(buffer)); + sldns_buffer_flip(buffer); + return 1; + } + return 0; + } + } + /* insert answer section */ if((r=insert_section(rep, rep->an_numrrsets, &ancount, buffer, 0, timenow, region, &tree, LDNS_SECTION_ANSWER, qinfo->qtype, @@ -717,16 +756,23 @@ reply_info_encode(struct query_info* qinfo, struct reply_info* rep, uint16_t calc_edns_field_size(struct edns_data* edns) { + size_t rdatalen = 0; + struct edns_option* opt; if(!edns || !edns->edns_present) return 0; - /* domain root '.' + type + class + ttl + rdatalen(=0) */ - return 1 + 2 + 2 + 4 + 2; + for(opt = edns->opt_list; opt; opt = opt->next) { + rdatalen += 4 + opt->opt_len; + } + /* domain root '.' + type + class + ttl + rdatalen */ + return 1 + 2 + 2 + 4 + 2 + rdatalen; } void attach_edns_record(sldns_buffer* pkt, struct edns_data* edns) { size_t len; + size_t rdatapos; + struct edns_option* opt; if(!edns || !edns->edns_present) return; /* inc additional count */ @@ -742,7 +788,18 @@ attach_edns_record(sldns_buffer* pkt, struct edns_data* edns) sldns_buffer_write_u8(pkt, edns->ext_rcode); /* ttl */ sldns_buffer_write_u8(pkt, edns->edns_version); sldns_buffer_write_u16(pkt, edns->bits); + rdatapos = sldns_buffer_position(pkt); sldns_buffer_write_u16(pkt, 0); /* rdatalen */ + /* write rdata */ + for(opt=edns->opt_list; opt; opt=opt->next) { + sldns_buffer_write_u16(pkt, opt->opt_code); + sldns_buffer_write_u16(pkt, opt->opt_len); + if(opt->opt_len != 0) + sldns_buffer_write(pkt, opt->opt_data, opt->opt_len); + } + if(edns->opt_list) + sldns_buffer_write_u16_at(pkt, rdatapos, + sldns_buffer_position(pkt)-rdatapos-2); sldns_buffer_flip(pkt); } @@ -764,6 +821,15 @@ reply_info_answer_encode(struct query_info* qinf, struct reply_info* rep, } if(secure && (dnssec || (qflags&BIT_AD))) flags |= BIT_AD; + /* restore AA bit if we have a local alias and the response can be + * authoritative. Also clear AD bit if set as the local data is the + * primary answer. */ + if(qinf->local_alias && + (FLAGS_GET_RCODE(rep->flags) == LDNS_RCODE_NOERROR || + FLAGS_GET_RCODE(rep->flags) == LDNS_RCODE_NXDOMAIN)) { + flags |= BIT_AA; + flags &= ~BIT_AD; + } log_assert(flags & BIT_QR); /* QR bit must be on in our replies */ if(udpsize < LDNS_HEADER_SIZE) return 0; @@ -789,13 +855,17 @@ void qinfo_query_encode(sldns_buffer* pkt, struct query_info* qinfo) { uint16_t flags = 0; /* QUERY, NOERROR */ + const uint8_t* qname = qinfo->local_alias ? + qinfo->local_alias->rrset->rk.dname : qinfo->qname; + size_t qname_len = qinfo->local_alias ? + qinfo->local_alias->rrset->rk.dname_len : qinfo->qname_len; sldns_buffer_clear(pkt); log_assert(sldns_buffer_remaining(pkt) >= 12+255+4/*max query*/); sldns_buffer_skip(pkt, 2); /* id done later */ sldns_buffer_write_u16(pkt, flags); sldns_buffer_write_u16(pkt, 1); /* query count */ sldns_buffer_write(pkt, "\000\000\000\000\000\000", 6); /* counts */ - sldns_buffer_write(pkt, qinfo->qname, qinfo->qname_len); + sldns_buffer_write(pkt, qname, qname_len); sldns_buffer_write_u16(pkt, qinfo->qtype); sldns_buffer_write_u16(pkt, qinfo->qclass); sldns_buffer_flip(pkt); @@ -820,9 +890,14 @@ error_encode(sldns_buffer* buf, int r, struct query_info* qinfo, sldns_buffer_write(buf, &flags, sizeof(uint16_t)); sldns_buffer_write(buf, &flags, sizeof(uint16_t)); if(qinfo) { - if(sldns_buffer_current(buf) == qinfo->qname) - sldns_buffer_skip(buf, (ssize_t)qinfo->qname_len); - else sldns_buffer_write(buf, qinfo->qname, qinfo->qname_len); + const uint8_t* qname = qinfo->local_alias ? + qinfo->local_alias->rrset->rk.dname : qinfo->qname; + size_t qname_len = qinfo->local_alias ? + qinfo->local_alias->rrset->rk.dname_len : + qinfo->qname_len; + if(sldns_buffer_current(buf) == qname) + sldns_buffer_skip(buf, (ssize_t)qname_len); + else sldns_buffer_write(buf, qname, qname_len); sldns_buffer_write_u16(buf, qinfo->qtype); sldns_buffer_write_u16(buf, qinfo->qclass); } diff --git a/external/unbound/util/data/msgparse.c b/external/unbound/util/data/msgparse.c index 108c9dacb..5381500e1 100644 --- a/external/unbound/util/data/msgparse.c +++ b/external/unbound/util/data/msgparse.c @@ -38,6 +38,7 @@ */ #include "config.h" #include "util/data/msgparse.h" +#include "util/data/msgreply.h" #include "util/data/dname.h" #include "util/data/packed_rrset.h" #include "util/storage/lookup3.h" @@ -70,7 +71,7 @@ smart_compare(sldns_buffer* pkt, uint8_t* dnow, */ static struct rrset_parse* new_rrset(struct msg_parse* msg, uint8_t* dname, size_t dnamelen, - uint16_t type, uint16_t dclass, hashvalue_t hash, + uint16_t type, uint16_t dclass, hashvalue_type hash, uint32_t rrset_flags, sldns_pkt_section section, struct regional* region) { @@ -158,13 +159,13 @@ pkt_rrset_flags(sldns_buffer* pkt, uint16_t type, sldns_pkt_section sec) return f; } -hashvalue_t +hashvalue_type pkt_hash_rrset(sldns_buffer* pkt, uint8_t* dname, uint16_t type, uint16_t dclass, uint32_t rrset_flags) { /* note this MUST be identical to rrset_key_hash in packed_rrset.c */ /* this routine handles compressed names */ - hashvalue_t h = 0xab; + hashvalue_type h = 0xab; h = dname_pkt_hash(pkt, dname, h); h = hashlittle(&type, sizeof(type), h); /* host order */ h = hashlittle(&dclass, sizeof(dclass), h); /* netw order */ @@ -173,25 +174,25 @@ pkt_hash_rrset(sldns_buffer* pkt, uint8_t* dname, uint16_t type, } /** create partial dname hash for rrset hash */ -static hashvalue_t +static hashvalue_type pkt_hash_rrset_first(sldns_buffer* pkt, uint8_t* dname) { /* works together with pkt_hash_rrset_rest */ /* note this MUST be identical to rrset_key_hash in packed_rrset.c */ /* this routine handles compressed names */ - hashvalue_t h = 0xab; + hashvalue_type h = 0xab; h = dname_pkt_hash(pkt, dname, h); return h; } /** create a rrset hash from a partial dname hash */ -static hashvalue_t -pkt_hash_rrset_rest(hashvalue_t dname_h, uint16_t type, uint16_t dclass, +static hashvalue_type +pkt_hash_rrset_rest(hashvalue_type dname_h, uint16_t type, uint16_t dclass, uint32_t rrset_flags) { /* works together with pkt_hash_rrset_first */ /* note this MUST be identical to rrset_key_hash in packed_rrset.c */ - hashvalue_t h; + hashvalue_type h; h = hashlittle(&type, sizeof(type), dname_h); /* host order */ h = hashlittle(&dclass, sizeof(dclass), h); /* netw order */ h = hashlittle(&rrset_flags, sizeof(uint32_t), h); @@ -200,7 +201,7 @@ pkt_hash_rrset_rest(hashvalue_t dname_h, uint16_t type, uint16_t dclass, /** compare rrset_parse with data */ static int -rrset_parse_equals(struct rrset_parse* p, sldns_buffer* pkt, hashvalue_t h, +rrset_parse_equals(struct rrset_parse* p, sldns_buffer* pkt, hashvalue_type h, uint32_t rrset_flags, uint8_t* dname, size_t dnamelen, uint16_t type, uint16_t dclass) { @@ -214,8 +215,8 @@ rrset_parse_equals(struct rrset_parse* p, sldns_buffer* pkt, hashvalue_t h, struct rrset_parse* msgparse_hashtable_lookup(struct msg_parse* msg, sldns_buffer* pkt, - hashvalue_t h, uint32_t rrset_flags, uint8_t* dname, size_t dnamelen, - uint16_t type, uint16_t dclass) + hashvalue_type h, uint32_t rrset_flags, uint8_t* dname, + size_t dnamelen, uint16_t type, uint16_t dclass) { struct rrset_parse* p = msg->hashtable[h & (PARSE_TABLE_SIZE-1)]; while(p) { @@ -387,7 +388,7 @@ change_rrsig_rrset(struct rrset_parse* sigset, struct msg_parse* msg, int hasother, sldns_pkt_section section, struct regional* region) { struct rrset_parse* dataset = sigset; - hashvalue_t hash = pkt_hash_rrset(pkt, sigset->dname, datatype, + hashvalue_type hash = pkt_hash_rrset(pkt, sigset->dname, datatype, sigset->rrset_class, rrset_flags); log_assert( sigset->type == LDNS_RR_TYPE_RRSIG ); log_assert( datatype != LDNS_RR_TYPE_RRSIG ); @@ -454,14 +455,14 @@ change_rrsig_rrset(struct rrset_parse* sigset, struct msg_parse* msg, */ static int find_rrset(struct msg_parse* msg, sldns_buffer* pkt, uint8_t* dname, - size_t dnamelen, uint16_t type, uint16_t dclass, hashvalue_t* hash, + size_t dnamelen, uint16_t type, uint16_t dclass, hashvalue_type* hash, uint32_t* rrset_flags, uint8_t** prev_dname_first, uint8_t** prev_dname_last, size_t* prev_dnamelen, uint16_t* prev_type, uint16_t* prev_dclass, struct rrset_parse** rrset_prev, sldns_pkt_section section, struct regional* region) { - hashvalue_t dname_h = pkt_hash_rrset_first(pkt, dname); + hashvalue_type dname_h = pkt_hash_rrset_first(pkt, dname); uint16_t covtype; if(*rrset_prev) { /* check if equal to previous item */ @@ -823,7 +824,7 @@ parse_section(sldns_buffer* pkt, struct msg_parse* msg, uint16_t type, prev_type = 0; uint16_t dclass, prev_dclass = 0; uint32_t rrset_flags = 0; - hashvalue_t hash = 0; + hashvalue_type hash = 0; struct rrset_parse* rrset = NULL; int r; @@ -933,13 +934,41 @@ parse_packet(sldns_buffer* pkt, struct msg_parse* msg, struct regional* region) return 0; } +/** parse EDNS options from EDNS wireformat rdata */ +static int +parse_edns_options(uint8_t* rdata_ptr, size_t rdata_len, + struct edns_data* edns, struct regional* region) +{ + /* while still more options, and have code+len to read */ + /* ignores partial content (i.e. rdata len 3) */ + while(rdata_len >= 4) { + uint16_t opt_code = sldns_read_uint16(rdata_ptr); + uint16_t opt_len = sldns_read_uint16(rdata_ptr+2); + rdata_ptr += 4; + rdata_len -= 4; + if(opt_len > rdata_len) + break; /* option code partial */ + if(!edns_opt_append(edns, region, opt_code, opt_len, + rdata_ptr)) { + log_err("out of memory"); + return 0; + } + rdata_ptr += opt_len; + rdata_len -= opt_len; + } + return 1; +} + int -parse_extract_edns(struct msg_parse* msg, struct edns_data* edns) +parse_extract_edns(struct msg_parse* msg, struct edns_data* edns, + struct regional* region) { struct rrset_parse* rrset = msg->rrset_first; struct rrset_parse* prev = 0; struct rrset_parse* found = 0; struct rrset_parse* found_prev = 0; + size_t rdata_len; + uint8_t* rdata_ptr; /* since the class encodes the UDP size, we cannot use hash table to * find the EDNS OPT record. Scan the packet. */ while(rrset) { @@ -986,13 +1015,25 @@ parse_extract_edns(struct msg_parse* msg, struct edns_data* edns) edns->edns_version = found->rr_last->ttl_data[1]; edns->bits = sldns_read_uint16(&found->rr_last->ttl_data[2]); edns->udp_size = ntohs(found->rrset_class); - /* ignore rdata and rrsigs */ + edns->opt_list = NULL; + + /* take the options */ + rdata_len = found->rr_first->size; + rdata_ptr = found->rr_first->ttl_data+6; + if(!parse_edns_options(rdata_ptr, rdata_len, edns, region)) + return 0; + + /* ignore rrsigs */ + return 0; } int -parse_edns_from_pkt(sldns_buffer* pkt, struct edns_data* edns) +parse_edns_from_pkt(sldns_buffer* pkt, struct edns_data* edns, + struct regional* region) { + size_t rdata_len; + uint8_t* rdata_ptr; log_assert(LDNS_QDCOUNT(sldns_buffer_begin(pkt)) == 1); log_assert(LDNS_ANCOUNT(sldns_buffer_begin(pkt)) == 0); log_assert(LDNS_NSCOUNT(sldns_buffer_begin(pkt)) == 0); @@ -1017,6 +1058,36 @@ parse_edns_from_pkt(sldns_buffer* pkt, struct edns_data* edns) edns->ext_rcode = sldns_buffer_read_u8(pkt); /* ttl used for bits */ edns->edns_version = sldns_buffer_read_u8(pkt); edns->bits = sldns_buffer_read_u16(pkt); - /* ignore rdata and rrsigs */ + edns->opt_list = NULL; + + /* take the options */ + rdata_len = sldns_buffer_read_u16(pkt); + if(sldns_buffer_remaining(pkt) < rdata_len) + return LDNS_RCODE_FORMERR; + rdata_ptr = sldns_buffer_current(pkt); + if(!parse_edns_options(rdata_ptr, rdata_len, edns, region)) + return LDNS_RCODE_SERVFAIL; + + /* ignore rrsigs */ + return 0; } + +void +log_edns_opt_list(enum verbosity_value level, const char* info_str, + struct edns_option* list) +{ + if(verbosity >= level && list) { + char str[128], *s; + size_t slen; + verbose(level, "%s", info_str); + while(list) { + s = str; + slen = sizeof(str); + (void)sldns_wire2str_edns_option_print(&s, &slen, list->opt_code, + list->opt_data, list->opt_len); + verbose(level, " %s", str); + list = list->next; + } + } +} diff --git a/external/unbound/util/data/msgparse.h b/external/unbound/util/data/msgparse.h index 44497c8ca..e21f8504e 100644 --- a/external/unbound/util/data/msgparse.h +++ b/external/unbound/util/data/msgparse.h @@ -69,6 +69,7 @@ struct sldns_buffer; struct rrset_parse; struct rr_parse; struct regional; +struct edns_option; /** number of buckets in parse rrset hash table. Must be power of 2. */ #define PARSE_TABLE_SIZE 32 @@ -137,7 +138,7 @@ struct rrset_parse { /** next in list of all rrsets */ struct rrset_parse* rrset_all_next; /** hash value of rrset */ - hashvalue_t hash; + hashvalue_type hash; /** which section was it found in: one of * LDNS_SECTION_ANSWER, LDNS_SECTION_AUTHORITY, LDNS_SECTION_ADDITIONAL */ @@ -202,7 +203,8 @@ struct rr_parse { /** * EDNS data storage - * EDNS rdata is ignored. + * rdata is parsed in a list (has accessor functions). allocated in a + * region. */ struct edns_data { /** if EDNS OPT record was present */ @@ -215,6 +217,22 @@ struct edns_data { uint16_t bits; /** UDP reassembly size. */ uint16_t udp_size; + /** rdata element list, or NULL if none */ + struct edns_option* opt_list; +}; + +/** + * EDNS option + */ +struct edns_option { + /** next item in list */ + struct edns_option* next; + /** type of this edns option */ + uint16_t opt_code; + /** length of this edns option (cannot exceed uint16 in encoding) */ + size_t opt_len; + /** data of this edns option; allocated in region, or NULL if len=0 */ + uint8_t* opt_data; }; /** @@ -249,10 +267,12 @@ int parse_packet(struct sldns_buffer* pkt, struct msg_parse* msg, * @param msg: parsed message structure. Modified on exit, if EDNS was present * it is removed from the additional section. * @param edns: the edns data is stored here. Does not have to be initialised. + * @param region: region to alloc results in (edns option contents) * @return: 0 on success. or an RCODE on an error. * RCODE formerr if OPT in wrong section, and so on. */ -int parse_extract_edns(struct msg_parse* msg, struct edns_data* edns); +int parse_extract_edns(struct msg_parse* msg, struct edns_data* edns, + struct regional* region); /** * If EDNS data follows a query section, extract it and initialize edns struct. @@ -260,10 +280,12 @@ int parse_extract_edns(struct msg_parse* msg, struct edns_data* edns); * section. At end, right after EDNS data or no movement if failed. * @param edns: the edns data allocated by the caller. Does not have to be * initialised. + * @param region: region to alloc results in (edns option contents) * @return: 0 on success, or an RCODE on error. * RCODE formerr if OPT is badly formatted and so on. */ -int parse_edns_from_pkt(struct sldns_buffer* pkt, struct edns_data* edns); +int parse_edns_from_pkt(struct sldns_buffer* pkt, struct edns_data* edns, + struct regional* region); /** * Calculate hash value for rrset in packet. @@ -274,8 +296,8 @@ int parse_edns_from_pkt(struct sldns_buffer* pkt, struct edns_data* edns); * @param rrset_flags: rrset flags (same as packed_rrset flags). * @return hash value */ -hashvalue_t pkt_hash_rrset(struct sldns_buffer* pkt, uint8_t* dname, uint16_t type, - uint16_t dclass, uint32_t rrset_flags); +hashvalue_type pkt_hash_rrset(struct sldns_buffer* pkt, uint8_t* dname, + uint16_t type, uint16_t dclass, uint32_t rrset_flags); /** * Lookup in msg hashtable to find a rrset. @@ -290,7 +312,7 @@ hashvalue_t pkt_hash_rrset(struct sldns_buffer* pkt, uint8_t* dname, uint16_t ty * @return NULL or the rrset_parse if found. */ struct rrset_parse* msgparse_hashtable_lookup(struct msg_parse* msg, - struct sldns_buffer* pkt, hashvalue_t h, uint32_t rrset_flags, + struct sldns_buffer* pkt, hashvalue_type h, uint32_t rrset_flags, uint8_t* dname, size_t dnamelen, uint16_t type, uint16_t dclass); /** @@ -300,4 +322,13 @@ struct rrset_parse* msgparse_hashtable_lookup(struct msg_parse* msg, */ void msgparse_bucket_remove(struct msg_parse* msg, struct rrset_parse* rrset); +/** + * Log the edns options in the edns option list. + * @param level: the verbosity level. + * @param info_str: the informational string to be printed before the options. + * @param list: the edns option list. + */ +void log_edns_opt_list(enum verbosity_value level, const char* info_str, + struct edns_option* list); + #endif /* UTIL_DATA_MSGPARSE_H */ diff --git a/external/unbound/util/data/msgreply.c b/external/unbound/util/data/msgreply.c index 06593ffe1..2ce898d7f 100644 --- a/external/unbound/util/data/msgreply.c +++ b/external/unbound/util/data/msgreply.c @@ -52,6 +52,8 @@ #include "util/data/msgencode.h" #include "sldns/sbuffer.h" #include "sldns/wire2str.h" +#include "util/module.h" +#include "util/fptr_wlist.h" /** MAX TTL default for messages and rrsets */ time_t MAX_TTL = 3600 * 24 * 10; /* ten days */ @@ -76,6 +78,7 @@ parse_create_qinfo(sldns_buffer* pkt, struct msg_parse* msg, qinf->qname_len = msg->qname_len; qinf->qtype = msg->qtype; qinf->qclass = msg->qclass; + qinf->local_alias = NULL; return 1; } @@ -130,9 +133,8 @@ parse_create_repinfo(struct msg_parse* msg, struct reply_info** rep, return 1; } -/** allocate (special) rrset keys, return 0 on error */ -static int -repinfo_alloc_rrset_keys(struct reply_info* rep, struct alloc_cache* alloc, +int +reply_info_alloc_rrset_keys(struct reply_info* rep, struct alloc_cache* alloc, struct regional* region) { size_t i; @@ -435,7 +437,7 @@ parse_create_msg(sldns_buffer* pkt, struct msg_parse* msg, return 0; if(!parse_create_repinfo(msg, rep, region)) return 0; - if(!repinfo_alloc_rrset_keys(*rep, alloc, region)) + if(!reply_info_alloc_rrset_keys(*rep, alloc, region)) return 0; if(!parse_copy_decompress(pkt, msg, *rep, region)) return 0; @@ -451,6 +453,7 @@ int reply_info_parse(sldns_buffer* pkt, struct alloc_cache* alloc, int ret; qinf->qname = NULL; + qinf->local_alias = NULL; *rep = NULL; if(!(msg = regional_alloc(region, sizeof(*msg)))) { return LDNS_RCODE_SERVFAIL; @@ -461,7 +464,7 @@ int reply_info_parse(sldns_buffer* pkt, struct alloc_cache* alloc, if((ret = parse_packet(pkt, msg, region)) != 0) { return ret; } - if((ret = parse_extract_edns(msg, edns)) != 0) + if((ret = parse_extract_edns(msg, edns, region)) != 0) return ret; /* parse OK, allocate return structures */ @@ -542,6 +545,7 @@ query_info_parse(struct query_info* m, sldns_buffer* query) return 0; /* need qtype, qclass */ m->qtype = sldns_buffer_read_u16(query); m->qclass = sldns_buffer_read_u16(query); + m->local_alias = NULL; return 1; } @@ -603,10 +607,10 @@ reply_info_delete(void* d, void* ATTR_UNUSED(arg)) free(r); } -hashvalue_t +hashvalue_type query_info_hash(struct query_info *q, uint16_t flags) { - hashvalue_t h = 0xab; + hashvalue_type h = 0xab; h = hashlittle(&q->qtype, sizeof(q->qtype), h); if(q->qtype == LDNS_RR_TYPE_AAAA && (flags&BIT_CD)) h++; @@ -617,7 +621,7 @@ query_info_hash(struct query_info *q, uint16_t flags) struct msgreply_entry* query_info_entrysetup(struct query_info* q, struct reply_info* r, - hashvalue_t h) + hashvalue_type h) { struct msgreply_entry* e = (struct msgreply_entry*)malloc( sizeof(struct msgreply_entry)); @@ -683,7 +687,7 @@ reply_info_copy(struct reply_info* rep, struct alloc_cache* alloc, if(!cp) return NULL; /* allocate ub_key structures special or not */ - if(!repinfo_alloc_rrset_keys(cp, alloc, region)) { + if(!reply_info_alloc_rrset_keys(cp, alloc, region)) { if(!region) reply_info_parsedelete(cp, alloc); return NULL; @@ -814,7 +818,39 @@ log_dns_msg(const char* str, struct query_info* qinfo, struct reply_info* rep) regional_destroy(region); } -void +void +log_reply_info(enum verbosity_value v, struct query_info *qinf, + struct sockaddr_storage *addr, socklen_t addrlen, struct timeval dur, + int cached, struct sldns_buffer *rmsg) +{ + char qname_buf[LDNS_MAX_DOMAINLEN+1]; + char clientip_buf[128]; + char rcode_buf[16]; + char type_buf[16]; + char class_buf[16]; + size_t pktlen; + uint16_t rcode = FLAGS_GET_RCODE(sldns_buffer_read_u16_at(rmsg, 2)); + + if(verbosity < v) + return; + + sldns_wire2str_rcode_buf((int)rcode, rcode_buf, sizeof(rcode_buf)); + addr_to_str(addr, addrlen, clientip_buf, sizeof(clientip_buf)); + if(rcode == LDNS_RCODE_FORMERR) + { + log_info("%s - - - %s - - - ", clientip_buf, rcode_buf); + } else { + dname_str(qinf->qname, qname_buf); + pktlen = sldns_buffer_limit(rmsg); + sldns_wire2str_type_buf(qinf->qtype, type_buf, sizeof(type_buf)); + sldns_wire2str_class_buf(qinf->qclass, class_buf, sizeof(class_buf)); + log_info("%s %s %s %s %s " ARG_LL "d.%6.6d %d %d", + clientip_buf, qname_buf, type_buf, class_buf, + rcode_buf, (long long)dur.tv_sec, (int)dur.tv_usec, cached, (int)pktlen); + } +} + +void log_query_info(enum verbosity_value v, const char* str, struct query_info* qinf) { @@ -857,3 +893,314 @@ reply_all_rrsets_secure(struct reply_info* rep) } return 1; } + +int edns_opt_append(struct edns_data* edns, struct regional* region, + uint16_t code, size_t len, uint8_t* data) +{ + struct edns_option** prevp; + struct edns_option* opt; + + /* allocate new element */ + opt = (struct edns_option*)regional_alloc(region, sizeof(*opt)); + if(!opt) + return 0; + opt->next = NULL; + opt->opt_code = code; + opt->opt_len = len; + opt->opt_data = NULL; + if(len > 0) { + opt->opt_data = regional_alloc_init(region, data, len); + if(!opt->opt_data) + return 0; + } + + /* append at end of list */ + prevp = &edns->opt_list; + while(*prevp != NULL) + prevp = &((*prevp)->next); + *prevp = opt; + return 1; +} + +int edns_opt_list_append(struct edns_option** list, uint16_t code, size_t len, + uint8_t* data, struct regional* region) +{ + struct edns_option** prevp; + struct edns_option* opt; + + /* allocate new element */ + opt = (struct edns_option*)regional_alloc(region, sizeof(*opt)); + if(!opt) + return 0; + opt->next = NULL; + opt->opt_code = code; + opt->opt_len = len; + opt->opt_data = NULL; + if(len > 0) { + opt->opt_data = regional_alloc_init(region, data, len); + if(!opt->opt_data) + return 0; + } + + /* append at end of list */ + prevp = list; + while(*prevp != NULL) { + prevp = &((*prevp)->next); + } + *prevp = opt; + return 1; +} + +int edns_opt_list_remove(struct edns_option** list, uint16_t code) +{ + /* The list should already be allocated in a region. Freeing the + * allocated space in a region is not possible. We just unlink the + * required elements and they will be freed together with the region. */ + + struct edns_option* prev; + struct edns_option* curr; + if(!list || !(*list)) return 0; + + /* Unlink and repoint if the element(s) are first in list */ + while(list && *list && (*list)->opt_code == code) { + *list = (*list)->next; + } + + if(!list || !(*list)) return 1; + /* Unlink elements and reattach the list */ + prev = *list; + curr = (*list)->next; + while(curr != NULL) { + if(curr->opt_code == code) { + prev->next = curr->next; + curr = curr->next; + } else { + prev = curr; + curr = curr->next; + } + } + return 1; +} + +static int inplace_cb_reply_call_generic( + struct inplace_cb* callback_list, enum inplace_cb_list_type type, + struct query_info* qinfo, struct module_qstate* qstate, + struct reply_info* rep, int rcode, struct edns_data* edns, + struct regional* region) +{ + struct inplace_cb* cb; + struct edns_option* opt_list_out = NULL; + if(qstate) + opt_list_out = qstate->edns_opts_front_out; + for(cb=callback_list; cb; cb=cb->next) { + fptr_ok(fptr_whitelist_inplace_cb_reply_generic( + (inplace_cb_reply_func_type*)cb->cb, type)); + (void)(*(inplace_cb_reply_func_type*)cb->cb)(qinfo, qstate, rep, + rcode, edns, &opt_list_out, region, cb->id, cb->cb_arg); + } + edns->opt_list = opt_list_out; + return 1; +} + +int inplace_cb_reply_call(struct module_env* env, struct query_info* qinfo, + struct module_qstate* qstate, struct reply_info* rep, int rcode, + struct edns_data* edns, struct regional* region) +{ + return inplace_cb_reply_call_generic( + env->inplace_cb_lists[inplace_cb_reply], inplace_cb_reply, qinfo, + qstate, rep, rcode, edns, region); +} + +int inplace_cb_reply_cache_call(struct module_env* env, + struct query_info* qinfo, struct module_qstate* qstate, + struct reply_info* rep, int rcode, struct edns_data* edns, + struct regional* region) +{ + return inplace_cb_reply_call_generic( + env->inplace_cb_lists[inplace_cb_reply_cache], inplace_cb_reply_cache, + qinfo, qstate, rep, rcode, edns, region); +} + +int inplace_cb_reply_local_call(struct module_env* env, + struct query_info* qinfo, struct module_qstate* qstate, + struct reply_info* rep, int rcode, struct edns_data* edns, + struct regional* region) +{ + return inplace_cb_reply_call_generic( + env->inplace_cb_lists[inplace_cb_reply_local], inplace_cb_reply_local, + qinfo, qstate, rep, rcode, edns, region); +} + +int inplace_cb_reply_servfail_call(struct module_env* env, + struct query_info* qinfo, struct module_qstate* qstate, + struct reply_info* rep, int rcode, struct edns_data* edns, + struct regional* region) +{ + /* We are going to servfail. Remove any potential edns options. */ + if(qstate) + qstate->edns_opts_front_out = NULL; + return inplace_cb_reply_call_generic( + env->inplace_cb_lists[inplace_cb_reply_servfail], + inplace_cb_reply_servfail, qinfo, qstate, rep, rcode, edns, region); +} + +int inplace_cb_query_call(struct module_env* env, struct query_info* qinfo, + uint16_t flags, struct sockaddr_storage* addr, socklen_t addrlen, + uint8_t* zone, size_t zonelen, struct module_qstate* qstate, + struct regional* region) +{ + struct inplace_cb* cb = env->inplace_cb_lists[inplace_cb_query]; + for(; cb; cb=cb->next) { + fptr_ok(fptr_whitelist_inplace_cb_query( + (inplace_cb_query_func_type*)cb->cb)); + (void)(*(inplace_cb_query_func_type*)cb->cb)(qinfo, flags, + qstate, addr, addrlen, zone, zonelen, region, + cb->id, cb->cb_arg); + } + return 1; +} + +int inplace_cb_edns_back_parsed_call(struct module_env* env, + struct module_qstate* qstate) +{ + struct inplace_cb* cb = + env->inplace_cb_lists[inplace_cb_edns_back_parsed]; + for(; cb; cb=cb->next) { + fptr_ok(fptr_whitelist_inplace_cb_edns_back_parsed( + (inplace_cb_edns_back_parsed_func_type*)cb->cb)); + (void)(*(inplace_cb_edns_back_parsed_func_type*)cb->cb)(qstate, + cb->id, cb->cb_arg); + } + return 1; +} + +int inplace_cb_query_response_call(struct module_env* env, + struct module_qstate* qstate, struct dns_msg* response) { + struct inplace_cb* cb = + env->inplace_cb_lists[inplace_cb_query_response]; + for(; cb; cb=cb->next) { + fptr_ok(fptr_whitelist_inplace_cb_query_response( + (inplace_cb_query_response_func_type*)cb->cb)); + (void)(*(inplace_cb_query_response_func_type*)cb->cb)(qstate, + response, cb->id, cb->cb_arg); + } + return 1; +} + +struct edns_option* edns_opt_copy_region(struct edns_option* list, + struct regional* region) +{ + struct edns_option* result = NULL, *cur = NULL, *s; + while(list) { + /* copy edns option structure */ + s = regional_alloc_init(region, list, sizeof(*list)); + if(!s) return NULL; + s->next = NULL; + + /* copy option data */ + if(s->opt_data) { + s->opt_data = regional_alloc_init(region, s->opt_data, + s->opt_len); + if(!s->opt_data) + return NULL; + } + + /* link into list */ + if(cur) + cur->next = s; + else result = s; + cur = s; + + /* examine next element */ + list = list->next; + } + return result; +} + +int edns_opt_compare(struct edns_option* p, struct edns_option* q) +{ + if(!p && !q) return 0; + if(!p) return -1; + if(!q) return 1; + log_assert(p && q); + if(p->opt_code != q->opt_code) + return (int)q->opt_code - (int)p->opt_code; + if(p->opt_len != q->opt_len) + return (int)q->opt_len - (int)p->opt_len; + if(p->opt_len != 0) + return memcmp(p->opt_data, q->opt_data, p->opt_len); + return 0; +} + +int edns_opt_list_compare(struct edns_option* p, struct edns_option* q) +{ + int r; + while(p && q) { + r = edns_opt_compare(p, q); + if(r != 0) + return r; + p = p->next; + q = q->next; + } + if(p || q) { + /* uneven length lists */ + if(p) return 1; + if(q) return -1; + } + return 0; +} + +void edns_opt_list_free(struct edns_option* list) +{ + struct edns_option* n; + while(list) { + free(list->opt_data); + n = list->next; + free(list); + list = n; + } +} + +struct edns_option* edns_opt_copy_alloc(struct edns_option* list) +{ + struct edns_option* result = NULL, *cur = NULL, *s; + while(list) { + /* copy edns option structure */ + s = memdup(list, sizeof(*list)); + if(!s) { + edns_opt_list_free(result); + return NULL; + } + s->next = NULL; + + /* copy option data */ + if(s->opt_data) { + s->opt_data = memdup(s->opt_data, s->opt_len); + if(!s->opt_data) { + free(s); + edns_opt_list_free(result); + return NULL; + } + } + + /* link into list */ + if(cur) + cur->next = s; + else result = s; + cur = s; + + /* examine next element */ + list = list->next; + } + return result; +} + +struct edns_option* edns_opt_list_find(struct edns_option* list, uint16_t code) +{ + struct edns_option* p; + for(p=list; p; p=p->next) { + if(p->opt_code == code) + return p; + } + return NULL; +} diff --git a/external/unbound/util/data/msgreply.h b/external/unbound/util/data/msgreply.h index 708897950..acbdd3deb 100644 --- a/external/unbound/util/data/msgreply.h +++ b/external/unbound/util/data/msgreply.h @@ -49,8 +49,14 @@ struct alloc_cache; struct iovec; struct regional; struct edns_data; +struct edns_option; +struct inplace_cb; +struct module_qstate; +struct module_env; struct msg_parse; struct rrset_parse; +struct local_rrset; +struct dns_msg; /** calculate the prefetch TTL as 90% of original. Calculation * without numerical overflow (uin32_t) */ @@ -73,6 +79,23 @@ struct query_info { uint16_t qtype; /** qclass, host byte order */ uint16_t qclass; + /** + * Alias local answer(s) for the qname. If 'qname' is an alias defined + * in a local zone, this field will be set to the corresponding local + * RRset when the alias is determined. + * In the initial implementation this can only be a single CNAME RR + * (or NULL), but it could possibly be extended to be a DNAME or a + * chain of aliases. + * Users of this structure are responsible to initialize this field + * to be NULL; otherwise other part of query handling code may be + * confused. + * Users also have to be careful about the lifetime of data. On return + * from local zone lookup, it may point to data derived from + * configuration that may be dynamically invalidated or data allocated + * in an ephemeral regional allocator. A deep copy of the data may + * have to be generated if it has to be kept during iterative + * resolution. */ + struct local_rrset* local_alias; }; /** @@ -82,7 +105,7 @@ struct rrset_ref { /** the key with lock, and ptr to packed data. */ struct ub_packed_rrset_key* key; /** id needed */ - rrset_id_t id; + rrset_id_type id; }; /** @@ -307,7 +330,7 @@ void reply_info_delete(void* d, void* arg); /** calculate hash value of query_info, lowercases the qname, * uses CD flag for AAAA qtype */ -hashvalue_t query_info_hash(struct query_info *q, uint16_t flags); +hashvalue_type query_info_hash(struct query_info *q, uint16_t flags); /** * Setup query info entry @@ -317,7 +340,7 @@ hashvalue_t query_info_hash(struct query_info *q, uint16_t flags); * @return: newly allocated message reply cache item. */ struct msgreply_entry* query_info_entrysetup(struct query_info* q, - struct reply_info* r, hashvalue_t h); + struct reply_info* r, hashvalue_type h); /** * Copy reply_info and all rrsets in it and allocate. @@ -334,6 +357,21 @@ struct reply_info* reply_info_copy(struct reply_info* rep, struct alloc_cache* alloc, struct regional* region); /** + * Allocate (special) rrset keys. + * @param rep: reply info in which the rrset keys to be allocated, rrset[] + * array should have bee allocated with NULL pointers. + * @param alloc: how to allocate rrset keys. + * Not used if region!=NULL, it can be NULL in that case. + * @param region: if this parameter is NULL then the alloc is used. + * otherwise, rrset keys are allocated in this region. + * In a region, no special rrset key structures are needed (not shared). + * and no rrset_ref array in the reply needs to be built up. + * @return 1 on success, 0 on error + */ +int reply_info_alloc_rrset_keys(struct reply_info* rep, + struct alloc_cache* alloc, struct regional* region); + +/** * Copy a parsed rrset into given key, decompressing and allocating rdata. * @param pkt: packet for decompression * @param msg: the parser message (for flags for trust). @@ -425,10 +463,27 @@ struct ub_packed_rrset_key* reply_find_rrset(struct reply_info* rep, * @param qinfo: query section. * @param rep: rest of message. */ -void log_dns_msg(const char* str, struct query_info* qinfo, +void log_dns_msg(const char* str, struct query_info* qinfo, struct reply_info* rep); /** + * Print string with neat domain name, type, class, + * status code from, and size of a query response. + * + * @param v: at what verbosity level to print this. + * @param qinf: query section. + * @param addr: address of the client. + * @param addrlen: length of the client address. + * @param dur: how long it took to complete the query. + * @param cached: whether or not the reply is coming from + * the cache, or an outside network. + * @param rmsg: sldns buffer packet. + */ +void log_reply_info(enum verbosity_value v, struct query_info *qinf, + struct sockaddr_storage *addr, socklen_t addrlen, struct timeval dur, + int cached, struct sldns_buffer *rmsg); + +/** * Print string with neat domain name, type, class from query info. * @param v: at what verbosity level to print this. * @param str: string of message. @@ -437,4 +492,183 @@ void log_dns_msg(const char* str, struct query_info* qinfo, void log_query_info(enum verbosity_value v, const char* str, struct query_info* qinf); +/** + * Append edns option to edns data structure + * @param edns: the edns data structure to append the edns option to. + * @param region: region to allocate the new edns option. + * @param code: the edns option's code. + * @param len: the edns option's length. + * @param data: the edns option's data. + * @return false on failure. + */ +int edns_opt_append(struct edns_data* edns, struct regional* region, + uint16_t code, size_t len, uint8_t* data); + +/** + * Append edns option to edns option list + * @param list: the edns option list to append the edns option to. + * @param code: the edns option's code. + * @param len: the edns option's length. + * @param data: the edns option's data. + * @param region: region to allocate the new edns option. + * @return false on failure. + */ +int edns_opt_list_append(struct edns_option** list, uint16_t code, size_t len, + uint8_t* data, struct regional* region); + +/** + * Remove any option found on the edns option list that matches the code. + * @param list: the list of edns options. + * @param code: the opt code to remove. + * @return true when at least one edns option was removed, false otherwise. + */ +int edns_opt_list_remove(struct edns_option** list, uint16_t code); + +/** + * Find edns option in edns list + * @param list: list of edns options (eg. edns.opt_list) + * @param code: opt code to find. + * @return NULL or the edns_option element. + */ +struct edns_option* edns_opt_list_find(struct edns_option* list, uint16_t code); + +/** + * Call the registered functions in the inplace_cb_reply linked list. + * This function is going to get called while answering with a resolved query. + * @param env: module environment. + * @param qinfo: query info. + * @param qstate: module qstate. + * @param rep: Reply info. Could be NULL. + * @param rcode: return code. + * @param edns: edns data of the reply. + * @param region: region to store data. + * @return false on failure (a callback function returned an error). + */ +int inplace_cb_reply_call(struct module_env* env, struct query_info* qinfo, + struct module_qstate* qstate, struct reply_info* rep, int rcode, + struct edns_data* edns, struct regional* region); + +/** + * Call the registered functions in the inplace_cb_reply_cache linked list. + * This function is going to get called while answering from cache. + * @param env: module environment. + * @param qinfo: query info. + * @param qstate: module qstate. NULL when replying from cache. + * @param rep: Reply info. + * @param rcode: return code. + * @param edns: edns data of the reply. Edns input can be found here. + * @param region: region to store data. + * @return false on failure (a callback function returned an error). + */ +int inplace_cb_reply_cache_call(struct module_env* env, + struct query_info* qinfo, struct module_qstate* qstate, + struct reply_info* rep, int rcode, struct edns_data* edns, + struct regional* region); + +/** + * Call the registered functions in the inplace_cb_reply_local linked list. + * This function is going to get called while answering with local data. + * @param env: module environment. + * @param qinfo: query info. + * @param qstate: module qstate. NULL when replying from cache. + * @param rep: Reply info. + * @param rcode: return code. + * @param edns: edns data of the reply. Edns input can be found here. + * @param region: region to store data. + * @return false on failure (a callback function returned an error). + */ +int inplace_cb_reply_local_call(struct module_env* env, + struct query_info* qinfo, struct module_qstate* qstate, + struct reply_info* rep, int rcode, struct edns_data* edns, + struct regional* region); + +/** + * Call the registered functions in the inplace_cb_reply linked list. + * This function is going to get called while answering with a servfail. + * @param env: module environment. + * @param qinfo: query info. + * @param qstate: module qstate. Contains the edns option lists. Could be NULL. + * @param rep: Reply info. NULL when servfail. + * @param rcode: return code. LDNS_RCODE_SERVFAIL. + * @param edns: edns data of the reply. Edns input can be found here if qstate + * is NULL. + * @param region: region to store data. + * @return false on failure (a callback function returned an error). + */ +int inplace_cb_reply_servfail_call(struct module_env* env, + struct query_info* qinfo, struct module_qstate* qstate, + struct reply_info* rep, int rcode, struct edns_data* edns, + struct regional* region); + +/** + * Call the registered functions in the inplace_cb_query linked list. + * This function is going to get called just before sending a query to a + * nameserver. + * @param env: module environment. + * @param qinfo: query info. + * @param flags: flags of the query. + * @param addr: to which server to send the query. + * @param addrlen: length of addr. + * @param zone: name of the zone of the delegation point. wireformat dname. + * This is the delegation point name for which the server is deemed + * authoritative. + * @param zonelen: length of zone. + * @param qstate: module qstate. + * @param region: region to store data. + * @return false on failure (a callback function returned an error). + */ +int inplace_cb_query_call(struct module_env* env, struct query_info* qinfo, + uint16_t flags, struct sockaddr_storage* addr, socklen_t addrlen, + uint8_t* zone, size_t zonelen, struct module_qstate* qstate, + struct regional* region); + +/** + * Call the registered functions in the inplace_cb_edns_back_parsed linked list. + * This function is going to get called after parsing the EDNS data on the + * reply from a nameserver. + * @param env: module environment. + * @param qstate: module qstate. + * @return false on failure (a callback function returned an error). + */ +int inplace_cb_edns_back_parsed_call(struct module_env* env, + struct module_qstate* qstate); + +/** + * Call the registered functions in the inplace_cb_query_reponse linked list. + * This function is going to get called after receiving a reply from a + * nameserver. + * @param env: module environment. + * @param qstate: module qstate. + * @param response: received response + * @return false on failure (a callback function returned an error). + */ +int inplace_cb_query_response_call(struct module_env* env, + struct module_qstate* qstate, struct dns_msg* response); + +/** + * Copy edns option list allocated to the new region + */ +struct edns_option* edns_opt_copy_region(struct edns_option* list, + struct regional* region); + +/** + * Copy edns option list allocated with malloc + */ +struct edns_option* edns_opt_copy_alloc(struct edns_option* list); + +/** + * Free edns option list allocated with malloc + */ +void edns_opt_list_free(struct edns_option* list); + +/** + * Compare an edns option. (not entire list). Also compares contents. + */ +int edns_opt_compare(struct edns_option* p, struct edns_option* q); + +/** + * Compare edns option lists, also the order and contents of edns-options. + */ +int edns_opt_list_compare(struct edns_option* p, struct edns_option* q); + #endif /* UTIL_DATA_MSGREPLY_H */ diff --git a/external/unbound/util/data/packed_rrset.c b/external/unbound/util/data/packed_rrset.c index 66399085a..9944087cb 100644 --- a/external/unbound/util/data/packed_rrset.c +++ b/external/unbound/util/data/packed_rrset.c @@ -158,14 +158,14 @@ rrsetdata_equal(struct packed_rrset_data* d1, struct packed_rrset_data* d2) return 1; } -hashvalue_t +hashvalue_type rrset_key_hash(struct packed_rrset_key* key) { /* type is hashed in host order */ uint16_t t = ntohs(key->type); /* Note this MUST be identical to pkt_hash_rrset in msgparse.c */ /* this routine does not have a compressed name */ - hashvalue_t h = 0xab; + hashvalue_type h = 0xab; h = dname_query_hash(key->dname, h); h = hashlittle(&t, sizeof(t), h); h = hashlittle(&key->rrset_class, sizeof(uint16_t), h); diff --git a/external/unbound/util/data/packed_rrset.h b/external/unbound/util/data/packed_rrset.h index 6039aef24..28f603d6f 100644 --- a/external/unbound/util/data/packed_rrset.h +++ b/external/unbound/util/data/packed_rrset.h @@ -47,7 +47,7 @@ struct regional; /** type used to uniquely identify rrsets. Cannot be reused without * clearing the cache. */ -typedef uint64_t rrset_id_t; +typedef uint64_t rrset_id_type; /** this rrset is NSEC and is at zone apex (at child side of zonecut) */ #define PACKED_RRSET_NSEC_AT_APEX 0x1 @@ -57,6 +57,10 @@ typedef uint64_t rrset_id_t; * this is set on SOA rrsets in the authority section, to keep its TTL separate * from the SOA in the answer section from a direct SOA query or ANY query. */ #define PACKED_RRSET_SOA_NEG 0x4 +/** This rrset is considered to have a fixed TTL; its TTL doesn't have to be + * updated on encoding in a reply. This flag is not expected to be set in + * cached data. */ +#define PACKED_RRSET_FIXEDTTL 0x80000000 /** number of rrs and rrsets for integer overflow protection. More than * this is not really possible (64K packet has much less RRs and RRsets) in @@ -83,6 +87,7 @@ struct packed_rrset_key { * o PACKED_RRSET_NSEC_AT_APEX * o PACKED_RRSET_PARENT_SIDE * o PACKED_RRSET_SOA_NEG + * o PACKED_RRSET_FIXEDTTL (not supposed to be cached) */ uint32_t flags; /** the rrset type in network format */ @@ -114,7 +119,7 @@ struct ub_packed_rrset_key { * The other values in this struct may only be altered after changing * the id (which needs a writelock on entry.lock). */ - rrset_id_t id; + rrset_id_type id; /** key data: dname, type and class */ struct packed_rrset_key rk; }; @@ -191,6 +196,12 @@ enum sec_status { * RRset data. * * The data is packed, stored contiguously in memory. + * + * It is not always stored contiguously, in that case, an unpacked-packed + * rrset has the arrays separate. A bunch of routines work on that, but + * the packed rrset that is contiguous is for the rrset-cache and the + * cache-response routines in daemon/worker.c. + * * memory layout: * o base struct * o rr_len size_t array @@ -334,7 +345,7 @@ void rrset_data_delete(void* data, void* userdata); * @param key: the rrset key with name, type, class, flags. * @return hash value. */ -hashvalue_t rrset_key_hash(struct packed_rrset_key* key); +hashvalue_type rrset_key_hash(struct packed_rrset_key* key); /** * Fixup pointers in fixed data packed_rrset_data blob. diff --git a/external/unbound/util/fptr_wlist.c b/external/unbound/util/fptr_wlist.c index 1397e9c13..03244a123 100644 --- a/external/unbound/util/fptr_wlist.c +++ b/external/unbound/util/fptr_wlist.c @@ -51,6 +51,7 @@ #include "services/localzone.h" #include "services/cache/infra.h" #include "services/cache/rrset.h" +#include "services/view.h" #include "dns64/dns64.h" #include "iterator/iterator.h" #include "iterator/iter_fwd.h" @@ -74,13 +75,20 @@ #ifdef UB_ON_WINDOWS #include "winrc/win_svc.h" #endif +#include "respip/respip.h" #ifdef WITH_PYTHONMODULE #include "pythonmod/pythonmod.h" #endif +#ifdef USE_CACHEDB +#include "cachedb/cachedb.h" +#endif +#ifdef CLIENT_SUBNET +#include "edns-subnet/subnetmod.h" +#endif int -fptr_whitelist_comm_point(comm_point_callback_t *fptr) +fptr_whitelist_comm_point(comm_point_callback_type *fptr) { if(fptr == &worker_handle_request) return 1; else if(fptr == &outnet_udp_cb) return 1; @@ -90,7 +98,7 @@ fptr_whitelist_comm_point(comm_point_callback_t *fptr) } int -fptr_whitelist_comm_point_raw(comm_point_callback_t *fptr) +fptr_whitelist_comm_point_raw(comm_point_callback_type *fptr) { if(fptr == &tube_handle_listen) return 1; else if(fptr == &tube_handle_write) return 1; @@ -152,7 +160,7 @@ fptr_whitelist_event(void (*fptr)(int, short, void *)) } int -fptr_whitelist_pending_udp(comm_point_callback_t *fptr) +fptr_whitelist_pending_udp(comm_point_callback_type *fptr) { if(fptr == &serviced_udp_callback) return 1; else if(fptr == &worker_handle_reply) return 1; @@ -161,7 +169,7 @@ fptr_whitelist_pending_udp(comm_point_callback_t *fptr) } int -fptr_whitelist_pending_tcp(comm_point_callback_t *fptr) +fptr_whitelist_pending_tcp(comm_point_callback_type *fptr) { if(fptr == &serviced_tcp_callback) return 1; else if(fptr == &worker_handle_reply) return 1; @@ -170,7 +178,7 @@ fptr_whitelist_pending_tcp(comm_point_callback_t *fptr) } int -fptr_whitelist_serviced_query(comm_point_callback_t *fptr) +fptr_whitelist_serviced_query(comm_point_callback_type *fptr) { if(fptr == &worker_handle_service_reply) return 1; else if(fptr == &libworker_handle_service_reply) return 1; @@ -200,47 +208,54 @@ fptr_whitelist_rbtree_cmp(int (*fptr) (const void *, const void *)) else if(fptr == &val_neg_zone_compare) return 1; else if(fptr == &probetree_cmp) return 1; else if(fptr == &replay_var_compare) return 1; + else if(fptr == &view_cmp) return 1; return 0; } int -fptr_whitelist_hash_sizefunc(lruhash_sizefunc_t fptr) +fptr_whitelist_hash_sizefunc(lruhash_sizefunc_type fptr) { if(fptr == &msgreply_sizefunc) return 1; else if(fptr == &ub_rrset_sizefunc) return 1; else if(fptr == &infra_sizefunc) return 1; else if(fptr == &key_entry_sizefunc) return 1; else if(fptr == &rate_sizefunc) return 1; + else if(fptr == &ip_rate_sizefunc) return 1; else if(fptr == &test_slabhash_sizefunc) return 1; +#ifdef CLIENT_SUBNET + else if(fptr == &msg_cache_sizefunc) return 1; +#endif return 0; } int -fptr_whitelist_hash_compfunc(lruhash_compfunc_t fptr) +fptr_whitelist_hash_compfunc(lruhash_compfunc_type fptr) { if(fptr == &query_info_compare) return 1; else if(fptr == &ub_rrset_compare) return 1; else if(fptr == &infra_compfunc) return 1; else if(fptr == &key_entry_compfunc) return 1; else if(fptr == &rate_compfunc) return 1; + else if(fptr == &ip_rate_compfunc) return 1; else if(fptr == &test_slabhash_compfunc) return 1; return 0; } int -fptr_whitelist_hash_delkeyfunc(lruhash_delkeyfunc_t fptr) +fptr_whitelist_hash_delkeyfunc(lruhash_delkeyfunc_type fptr) { if(fptr == &query_entry_delete) return 1; else if(fptr == &ub_rrset_key_delete) return 1; else if(fptr == &infra_delkeyfunc) return 1; else if(fptr == &key_entry_delkeyfunc) return 1; else if(fptr == &rate_delkeyfunc) return 1; + else if(fptr == &ip_rate_delkeyfunc) return 1; else if(fptr == &test_slabhash_delkey) return 1; return 0; } int -fptr_whitelist_hash_deldatafunc(lruhash_deldatafunc_t fptr) +fptr_whitelist_hash_deldatafunc(lruhash_deldatafunc_type fptr) { if(fptr == &reply_info_delete) return 1; else if(fptr == &rrset_data_delete) return 1; @@ -248,11 +263,14 @@ fptr_whitelist_hash_deldatafunc(lruhash_deldatafunc_t fptr) else if(fptr == &key_entry_deldatafunc) return 1; else if(fptr == &rate_deldatafunc) return 1; else if(fptr == &test_slabhash_deldata) return 1; +#ifdef CLIENT_SUBNET + else if(fptr == &subnet_data_delete) return 1; +#endif return 0; } int -fptr_whitelist_hash_markdelfunc(lruhash_markdelfunc_t fptr) +fptr_whitelist_hash_markdelfunc(lruhash_markdelfunc_type fptr) { if(fptr == NULL) return 1; else if(fptr == &rrset_markdel) return 1; @@ -262,11 +280,9 @@ fptr_whitelist_hash_markdelfunc(lruhash_markdelfunc_t fptr) /** whitelist env->send_query callbacks */ int fptr_whitelist_modenv_send_query(struct outbound_entry* (*fptr)( - uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, - uint16_t flags, int dnssec, int want_dnssec, int nocaps, - struct sockaddr_storage* addr, socklen_t addrlen, - uint8_t* zone, size_t zonelen, - struct module_qstate* q)) + struct query_info* qinfo, uint16_t flags, int dnssec, int want_dnssec, + int nocaps, struct sockaddr_storage* addr, socklen_t addrlen, + uint8_t* zone, size_t zonelen, int ssl_upstream, struct module_qstate* q)) { if(fptr == &worker_send_query) return 1; else if(fptr == &libworker_send_query) return 1; @@ -312,9 +328,16 @@ fptr_whitelist_mod_init(int (*fptr)(struct module_env* env, int id)) if(fptr == &iter_init) return 1; else if(fptr == &val_init) return 1; else if(fptr == &dns64_init) return 1; + else if(fptr == &respip_init) return 1; #ifdef WITH_PYTHONMODULE else if(fptr == &pythonmod_init) return 1; #endif +#ifdef USE_CACHEDB + else if(fptr == &cachedb_init) return 1; +#endif +#ifdef CLIENT_SUBNET + else if(fptr == &subnetmod_init) return 1; +#endif return 0; } @@ -324,9 +347,16 @@ fptr_whitelist_mod_deinit(void (*fptr)(struct module_env* env, int id)) if(fptr == &iter_deinit) return 1; else if(fptr == &val_deinit) return 1; else if(fptr == &dns64_deinit) return 1; + else if(fptr == &respip_deinit) return 1; #ifdef WITH_PYTHONMODULE else if(fptr == &pythonmod_deinit) return 1; #endif +#ifdef USE_CACHEDB + else if(fptr == &cachedb_deinit) return 1; +#endif +#ifdef CLIENT_SUBNET + else if(fptr == &subnetmod_deinit) return 1; +#endif return 0; } @@ -337,9 +367,16 @@ fptr_whitelist_mod_operate(void (*fptr)(struct module_qstate* qstate, if(fptr == &iter_operate) return 1; else if(fptr == &val_operate) return 1; else if(fptr == &dns64_operate) return 1; + else if(fptr == &respip_operate) return 1; #ifdef WITH_PYTHONMODULE else if(fptr == &pythonmod_operate) return 1; #endif +#ifdef USE_CACHEDB + else if(fptr == &cachedb_operate) return 1; +#endif +#ifdef CLIENT_SUBNET + else if(fptr == &subnetmod_operate) return 1; +#endif return 0; } @@ -350,9 +387,16 @@ fptr_whitelist_mod_inform_super(void (*fptr)( if(fptr == &iter_inform_super) return 1; else if(fptr == &val_inform_super) return 1; else if(fptr == &dns64_inform_super) return 1; + else if(fptr == &respip_inform_super) return 1; #ifdef WITH_PYTHONMODULE else if(fptr == &pythonmod_inform_super) return 1; #endif +#ifdef USE_CACHEDB + else if(fptr == &cachedb_inform_super) return 1; +#endif +#ifdef CLIENT_SUBNET + else if(fptr == &subnetmod_inform_super) return 1; +#endif return 0; } @@ -363,9 +407,16 @@ fptr_whitelist_mod_clear(void (*fptr)(struct module_qstate* qstate, if(fptr == &iter_clear) return 1; else if(fptr == &val_clear) return 1; else if(fptr == &dns64_clear) return 1; + else if(fptr == &respip_clear) return 1; #ifdef WITH_PYTHONMODULE else if(fptr == &pythonmod_clear) return 1; #endif +#ifdef USE_CACHEDB + else if(fptr == &cachedb_clear) return 1; +#endif +#ifdef CLIENT_SUBNET + else if(fptr == &subnetmod_clear) return 1; +#endif return 0; } @@ -375,9 +426,16 @@ fptr_whitelist_mod_get_mem(size_t (*fptr)(struct module_env* env, int id)) if(fptr == &iter_get_mem) return 1; else if(fptr == &val_get_mem) return 1; else if(fptr == &dns64_get_mem) return 1; + else if(fptr == &respip_get_mem) return 1; #ifdef WITH_PYTHONMODULE else if(fptr == &pythonmod_get_mem) return 1; #endif +#ifdef USE_CACHEDB + else if(fptr == &cachedb_get_mem) return 1; +#endif +#ifdef CLIENT_SUBNET + else if(fptr == &subnetmod_get_mem) return 1; +#endif return 0; } @@ -388,14 +446,14 @@ fptr_whitelist_alloc_cleanup(void (*fptr)(void*)) return 0; } -int fptr_whitelist_tube_listen(tube_callback_t* fptr) +int fptr_whitelist_tube_listen(tube_callback_type* fptr) { if(fptr == &worker_handle_control_cmd) return 1; else if(fptr == &libworker_handle_control_cmd) return 1; return 0; } -int fptr_whitelist_mesh_cb(mesh_cb_func_t fptr) +int fptr_whitelist_mesh_cb(mesh_cb_func_type fptr) { if(fptr == &libworker_fg_done_cb) return 1; else if(fptr == &libworker_bg_done_cb) return 1; @@ -411,3 +469,64 @@ int fptr_whitelist_print_func(void (*fptr)(char*,void*)) else if(fptr == &remote_get_opt_ssl) return 1; return 0; } + +int fptr_whitelist_inplace_cb_reply_generic(inplace_cb_reply_func_type* fptr, + enum inplace_cb_list_type type) +{ +#ifndef WITH_PYTHONMODULE + (void)fptr; +#endif + if(type == inplace_cb_reply) { +#ifdef WITH_PYTHONMODULE + if(fptr == &python_inplace_cb_reply_generic) return 1; +#endif + } else if(type == inplace_cb_reply_cache) { +#ifdef WITH_PYTHONMODULE + if(fptr == &python_inplace_cb_reply_generic) return 1; +#endif + } else if(type == inplace_cb_reply_local) { +#ifdef WITH_PYTHONMODULE + if(fptr == &python_inplace_cb_reply_generic) return 1; +#endif + } else if(type == inplace_cb_reply_servfail) { +#ifdef WITH_PYTHONMODULE + if(fptr == &python_inplace_cb_reply_generic) return 1; +#endif + } + return 0; +} + +int fptr_whitelist_inplace_cb_query(inplace_cb_query_func_type* fptr) +{ +#ifdef CLIENT_SUBNET + if(fptr == &ecs_whitelist_check) + return 1; +#else + (void)fptr; +#endif + return 0; +} + +int fptr_whitelist_inplace_cb_edns_back_parsed( + inplace_cb_edns_back_parsed_func_type* fptr) +{ +#ifdef CLIENT_SUBNET + if(fptr == &ecs_edns_back_parsed) + return 1; +#else + (void)fptr; +#endif + return 0; +} + +int fptr_whitelist_inplace_cb_query_response( + inplace_cb_query_response_func_type* fptr) +{ +#ifdef CLIENT_SUBNET + if(fptr == &ecs_query_response) + return 1; +#else + (void)fptr; +#endif + return 0; +} diff --git a/external/unbound/util/fptr_wlist.h b/external/unbound/util/fptr_wlist.h index 10de5d816..653f8f0e7 100644 --- a/external/unbound/util/fptr_wlist.h +++ b/external/unbound/util/fptr_wlist.h @@ -80,7 +80,7 @@ * @param fptr: function pointer to check. * @return false if not in whitelist. */ -int fptr_whitelist_comm_point(comm_point_callback_t *fptr); +int fptr_whitelist_comm_point(comm_point_callback_type *fptr); /** * Check function pointer whitelist for raw comm_point callback values. @@ -88,7 +88,7 @@ int fptr_whitelist_comm_point(comm_point_callback_t *fptr); * @param fptr: function pointer to check. * @return false if not in whitelist. */ -int fptr_whitelist_comm_point_raw(comm_point_callback_t *fptr); +int fptr_whitelist_comm_point_raw(comm_point_callback_type *fptr); /** * Check function pointer whitelist for comm_timer callback values. @@ -137,7 +137,7 @@ int fptr_whitelist_event(void (*fptr)(int, short, void *)); * @param fptr: function pointer to check. * @return false if not in whitelist. */ -int fptr_whitelist_pending_udp(comm_point_callback_t *fptr); +int fptr_whitelist_pending_udp(comm_point_callback_type *fptr); /** * Check function pointer whitelist for pending tcp callback values. @@ -145,7 +145,7 @@ int fptr_whitelist_pending_udp(comm_point_callback_t *fptr); * @param fptr: function pointer to check. * @return false if not in whitelist. */ -int fptr_whitelist_pending_tcp(comm_point_callback_t *fptr); +int fptr_whitelist_pending_tcp(comm_point_callback_type *fptr); /** * Check function pointer whitelist for serviced query callback values. @@ -153,7 +153,7 @@ int fptr_whitelist_pending_tcp(comm_point_callback_t *fptr); * @param fptr: function pointer to check. * @return false if not in whitelist. */ -int fptr_whitelist_serviced_query(comm_point_callback_t *fptr); +int fptr_whitelist_serviced_query(comm_point_callback_type *fptr); /** * Check function pointer whitelist for rbtree cmp callback values. @@ -169,7 +169,7 @@ int fptr_whitelist_rbtree_cmp(int (*fptr) (const void *, const void *)); * @param fptr: function pointer to check. * @return false if not in whitelist. */ -int fptr_whitelist_hash_sizefunc(lruhash_sizefunc_t fptr); +int fptr_whitelist_hash_sizefunc(lruhash_sizefunc_type fptr); /** * Check function pointer whitelist for lruhash compfunc callback values. @@ -177,7 +177,7 @@ int fptr_whitelist_hash_sizefunc(lruhash_sizefunc_t fptr); * @param fptr: function pointer to check. * @return false if not in whitelist. */ -int fptr_whitelist_hash_compfunc(lruhash_compfunc_t fptr); +int fptr_whitelist_hash_compfunc(lruhash_compfunc_type fptr); /** * Check function pointer whitelist for lruhash delkeyfunc callback values. @@ -185,7 +185,7 @@ int fptr_whitelist_hash_compfunc(lruhash_compfunc_t fptr); * @param fptr: function pointer to check. * @return false if not in whitelist. */ -int fptr_whitelist_hash_delkeyfunc(lruhash_delkeyfunc_t fptr); +int fptr_whitelist_hash_delkeyfunc(lruhash_delkeyfunc_type fptr); /** * Check function pointer whitelist for lruhash deldata callback values. @@ -193,7 +193,7 @@ int fptr_whitelist_hash_delkeyfunc(lruhash_delkeyfunc_t fptr); * @param fptr: function pointer to check. * @return false if not in whitelist. */ -int fptr_whitelist_hash_deldatafunc(lruhash_deldatafunc_t fptr); +int fptr_whitelist_hash_deldatafunc(lruhash_deldatafunc_type fptr); /** * Check function pointer whitelist for lruhash markdel callback values. @@ -201,7 +201,7 @@ int fptr_whitelist_hash_deldatafunc(lruhash_deldatafunc_t fptr); * @param fptr: function pointer to check. * @return false if not in whitelist. */ -int fptr_whitelist_hash_markdelfunc(lruhash_markdelfunc_t fptr); +int fptr_whitelist_hash_markdelfunc(lruhash_markdelfunc_type fptr); /** * Check function pointer whitelist for module_env send_query callback values. @@ -210,11 +210,9 @@ int fptr_whitelist_hash_markdelfunc(lruhash_markdelfunc_t fptr); * @return false if not in whitelist. */ int fptr_whitelist_modenv_send_query(struct outbound_entry* (*fptr)( - uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, - uint16_t flags, int dnssec, int want_dnssec, int nocaps, - struct sockaddr_storage* addr, socklen_t addrlen, - uint8_t* zone, size_t zonelen, - struct module_qstate* q)); + struct query_info* qinfo, uint16_t flags, int dnssec, int want_dnssec, + int nocaps, struct sockaddr_storage* addr, socklen_t addrlen, + uint8_t* zone, size_t zonelen, int ssl_upstream, struct module_qstate* q)); /** * Check function pointer whitelist for module_env detach_subs callback values. @@ -318,7 +316,7 @@ int fptr_whitelist_alloc_cleanup(void (*fptr)(void*)); * @param fptr: function pointer to check. * @return false if not in whitelist. */ -int fptr_whitelist_tube_listen(tube_callback_t* fptr); +int fptr_whitelist_tube_listen(tube_callback_type* fptr); /** * Check function pointer whitelist for mesh state callback values. @@ -326,7 +324,7 @@ int fptr_whitelist_tube_listen(tube_callback_t* fptr); * @param fptr: function pointer to check. * @return false if not in whitelist. */ -int fptr_whitelist_mesh_cb(mesh_cb_func_t fptr); +int fptr_whitelist_mesh_cb(mesh_cb_func_type fptr); /** * Check function pointer whitelist for config_get_option func values. @@ -335,6 +333,40 @@ int fptr_whitelist_mesh_cb(mesh_cb_func_t fptr); */ int fptr_whitelist_print_func(void (*fptr)(char*,void*)); +/** + * Check function pointer whitelist for inplace_cb_reply, + * inplace_cb_reply_cache, inplace_cb_reply_local and inplace_cb_reply_servfail + * func values. + * @param fptr: function pointer to check. + * @param type: the type of the callback function. + * @return false if not in whitelist. + */ +int fptr_whitelist_inplace_cb_reply_generic(inplace_cb_reply_func_type* fptr, + enum inplace_cb_list_type type); + +/** + * Check function pointer whitelist for inplace_cb_query func values. + * @param fptr: function pointer to check. + * @return false if not in whitelist. + */ +int fptr_whitelist_inplace_cb_query(inplace_cb_query_func_type* fptr); + +/** + * Check function pointer whitelist for inplace_cb_edns_back_parsed func values. + * @param fptr: function pointer to check. + * @return false if not in whitelist. + */ +int fptr_whitelist_inplace_cb_edns_back_parsed( + inplace_cb_edns_back_parsed_func_type* fptr); + +/** + * Check function pointer whitelist for inplace_cb_query_response func values. + * @param fptr: function pointer to check. + * @return false if not in whitelist. + */ +int fptr_whitelist_inplace_cb_query_response( + inplace_cb_query_response_func_type* fptr); + /** Due to module breakage by fptr wlist, these test app declarations * are presented here */ /** diff --git a/external/unbound/util/iana_ports.inc b/external/unbound/util/iana_ports.inc index b09a9ad95..2555b2591 100644 --- a/external/unbound/util/iana_ports.inc +++ b/external/unbound/util/iana_ports.inc @@ -661,6 +661,7 @@ 847, 848, 853, +854, 860, 861, 862, @@ -1186,6 +1187,7 @@ 1525, 1526, 1527, +1528, 1529, 1530, 1531, @@ -3775,6 +3777,7 @@ 4188, 4191, 4192, +4197, 4199, 4300, 4301, @@ -3844,6 +3847,8 @@ 4412, 4413, 4416, +4418, +4420, 4425, 4426, 4430, @@ -3904,6 +3909,7 @@ 4599, 4600, 4601, +4621, 4658, 4659, 4660, @@ -3942,6 +3948,7 @@ 4700, 4701, 4702, +4711, 4725, 4726, 4727, @@ -3958,12 +3965,15 @@ 4743, 4744, 4745, +4746, 4747, 4749, 4750, 4751, 4752, 4753, +4754, +4755, 4784, 4785, 4789, @@ -4222,6 +4232,7 @@ 5436, 5437, 5443, +5450, 5453, 5454, 5455, @@ -4446,6 +4457,7 @@ 6446, 6455, 6456, +6464, 6471, 6480, 6481, @@ -4493,6 +4505,7 @@ 6626, 6627, 6628, +6629, 6633, 6634, 6635, @@ -4522,7 +4535,6 @@ 6786, 6787, 6788, -6789, 6790, 6791, 6801, @@ -4562,6 +4574,7 @@ 7013, 7014, 7015, +7016, 7019, 7020, 7021, @@ -4598,6 +4611,7 @@ 7201, 7227, 7235, +7244, 7262, 7272, 7273, @@ -4651,6 +4665,7 @@ 7570, 7574, 7588, +7606, 7624, 7627, 7628, @@ -4718,6 +4733,7 @@ 8002, 8003, 8005, +8006, 8008, 8019, 8020, @@ -4777,9 +4793,12 @@ 8207, 8208, 8230, +8231, +8232, 8243, 8276, 8280, +8282, 8292, 8294, 8300, @@ -4836,6 +4855,7 @@ 8793, 8800, 8804, +8808, 8873, 8880, 8883, @@ -4873,6 +4893,7 @@ 9024, 9025, 9026, +9060, 9080, 9084, 9085, @@ -5199,6 +5220,7 @@ 18463, 18634, 18635, +18668, 18769, 18881, 18888, @@ -5206,6 +5228,7 @@ 19007, 19191, 19194, +19220, 19283, 19315, 19398, @@ -5266,6 +5289,7 @@ 23004, 23005, 23272, +23294, 23333, 23400, 23401, @@ -5335,6 +5359,7 @@ 30260, 30832, 30999, +31016, 31029, 31416, 31457, @@ -5368,12 +5393,14 @@ 34249, 34378, 34379, +34567, 34962, 34963, 34964, 34980, 35001, 35004, +35100, 35355, 36001, 36411, @@ -5415,6 +5442,7 @@ 44900, 45000, 45054, +45514, 45678, 45825, 45966, diff --git a/external/unbound/util/locks.c b/external/unbound/util/locks.c index adfb6c062..b65a02bdc 100644 --- a/external/unbound/util/locks.c +++ b/external/unbound/util/locks.c @@ -110,15 +110,15 @@ void ub_thread_sig_unblock(int sig) * @param arg: user argument to func. */ void -ub_thr_fork_create(ub_thread_t* thr, void* (*func)(void*), void* arg) +ub_thr_fork_create(ub_thread_type* thr, void* (*func)(void*), void* arg) { pid_t pid = fork(); switch(pid) { default: /* main */ - *thr = (ub_thread_t)pid; + *thr = (ub_thread_type)pid; return; case 0: /* child */ - *thr = (ub_thread_t)getpid(); + *thr = (ub_thread_type)getpid(); (void)(*func)(arg); exit(0); case -1: /* error */ @@ -128,10 +128,10 @@ ub_thr_fork_create(ub_thread_t* thr, void* (*func)(void*), void* arg) /** * There is no threading. Wait for a process to terminate. - * Note that ub_thread_t is defined as pid_t. + * Note that ub_thread_type is defined as pid_t. * @param thread: the process id to wait for. */ -void ub_thr_fork_wait(ub_thread_t thread) +void ub_thr_fork_wait(ub_thread_type thread) { int status = 0; if(waitpid((pid_t)thread, &status, 0) == -1) @@ -143,7 +143,7 @@ void ub_thr_fork_wait(ub_thread_t thread) #endif /* !defined(HAVE_PTHREAD) && !defined(HAVE_SOLARIS_THREADS) && !defined(HAVE_WINDOWS_THREADS) */ #ifdef HAVE_SOLARIS_THREADS -void* ub_thread_key_get(ub_thread_key_t key) +void* ub_thread_key_get(ub_thread_key_type key) { void* ret=NULL; LOCKRET(thr_getspecific(key, &ret)); @@ -167,19 +167,19 @@ static void log_win_err(const char* str, DWORD err) LocalFree(buf); } -void lock_basic_init(lock_basic_t* lock) +void lock_basic_init(lock_basic_type* lock) { /* implement own lock, because windows HANDLE as Mutex usage * uses too many handles and would bog down the whole system. */ (void)InterlockedExchange(lock, 0); } -void lock_basic_destroy(lock_basic_t* lock) +void lock_basic_destroy(lock_basic_type* lock) { (void)InterlockedExchange(lock, 0); } -void lock_basic_lock(lock_basic_t* lock) +void lock_basic_lock(lock_basic_type* lock) { LONG wait = 1; /* wait 1 msec at first */ @@ -191,13 +191,13 @@ void lock_basic_lock(lock_basic_t* lock) /* the old value was 0, but we inserted 1, we locked it! */ } -void lock_basic_unlock(lock_basic_t* lock) +void lock_basic_unlock(lock_basic_type* lock) { /* unlock it by inserting the value of 0. xchg for cache coherency. */ (void)InterlockedExchange(lock, 0); } -void ub_thread_key_create(ub_thread_key_t* key, void* f) +void ub_thread_key_create(ub_thread_key_type* key, void* f) { *key = TlsAlloc(); if(*key == TLS_OUT_OF_INDEXES) { @@ -207,14 +207,14 @@ void ub_thread_key_create(ub_thread_key_t* key, void* f) else ub_thread_key_set(*key, f); } -void ub_thread_key_set(ub_thread_key_t key, void* v) +void ub_thread_key_set(ub_thread_key_type key, void* v) { if(!TlsSetValue(key, v)) { log_win_err("TlsSetValue failed", GetLastError()); } } -void* ub_thread_key_get(ub_thread_key_t key) +void* ub_thread_key_get(ub_thread_key_type key) { void* ret = (void*)TlsGetValue(key); if(ret == NULL && GetLastError() != ERROR_SUCCESS) { @@ -223,7 +223,7 @@ void* ub_thread_key_get(ub_thread_key_t key) return ret; } -void ub_thread_create(ub_thread_t* thr, void* (*func)(void*), void* arg) +void ub_thread_create(ub_thread_type* thr, void* (*func)(void*), void* arg) { #ifndef HAVE__BEGINTHREADEX *thr = CreateThread(NULL, /* default security (no inherit handle) */ @@ -233,7 +233,7 @@ void ub_thread_create(ub_thread_t* thr, void* (*func)(void*), void* arg) NULL); /* do not store thread identifier anywhere */ #else /* the beginthreadex routine setups for the C lib; aligns stack */ - *thr=(ub_thread_t)_beginthreadex(NULL, 0, (void*)func, arg, 0, NULL); + *thr=(ub_thread_type)_beginthreadex(NULL, 0, (void*)func, arg, 0, NULL); #endif if(*thr == NULL) { log_win_err("CreateThread failed", GetLastError()); @@ -241,12 +241,12 @@ void ub_thread_create(ub_thread_t* thr, void* (*func)(void*), void* arg) } } -ub_thread_t ub_thread_self(void) +ub_thread_type ub_thread_self(void) { return GetCurrentThread(); } -void ub_thread_join(ub_thread_t thr) +void ub_thread_join(ub_thread_type thr) { DWORD ret = WaitForSingleObject(thr, INFINITE); if(ret == WAIT_FAILED) { diff --git a/external/unbound/util/locks.h b/external/unbound/util/locks.h index 3776912aa..d86ee4923 100644 --- a/external/unbound/util/locks.h +++ b/external/unbound/util/locks.h @@ -95,7 +95,7 @@ /******************* PTHREAD ************************/ /** use pthread mutex for basic lock */ -typedef pthread_mutex_t lock_basic_t; +typedef pthread_mutex_t lock_basic_type; /** small front for pthread init func, NULL is default attrs. */ #define lock_basic_init(lock) LOCKRET(pthread_mutex_init(lock, NULL)) #define lock_basic_destroy(lock) LOCKRET(pthread_mutex_destroy(lock)) @@ -104,7 +104,7 @@ typedef pthread_mutex_t lock_basic_t; #ifndef HAVE_PTHREAD_RWLOCK_T /** in case rwlocks are not supported, use a mutex. */ -typedef pthread_mutex_t lock_rw_t; +typedef pthread_mutex_t lock_rw_type; #define lock_rw_init(lock) LOCKRET(pthread_mutex_init(lock, NULL)) #define lock_rw_destroy(lock) LOCKRET(pthread_mutex_destroy(lock)) #define lock_rw_rdlock(lock) LOCKRET(pthread_mutex_lock(lock)) @@ -112,7 +112,7 @@ typedef pthread_mutex_t lock_rw_t; #define lock_rw_unlock(lock) LOCKRET(pthread_mutex_unlock(lock)) #else /* HAVE_PTHREAD_RWLOCK_T */ /** we use the pthread rwlock */ -typedef pthread_rwlock_t lock_rw_t; +typedef pthread_rwlock_t lock_rw_type; /** small front for pthread init func, NULL is default attrs. */ #define lock_rw_init(lock) LOCKRET(pthread_rwlock_init(lock, NULL)) #define lock_rw_destroy(lock) LOCKRET(pthread_rwlock_destroy(lock)) @@ -123,7 +123,7 @@ typedef pthread_rwlock_t lock_rw_t; #ifndef HAVE_PTHREAD_SPINLOCK_T /** in case spinlocks are not supported, use a mutex. */ -typedef pthread_mutex_t lock_quick_t; +typedef pthread_mutex_t lock_quick_type; /** small front for pthread init func, NULL is default attrs. */ #define lock_quick_init(lock) LOCKRET(pthread_mutex_init(lock, NULL)) #define lock_quick_destroy(lock) LOCKRET(pthread_mutex_destroy(lock)) @@ -132,7 +132,7 @@ typedef pthread_mutex_t lock_quick_t; #else /* HAVE_PTHREAD_SPINLOCK_T */ /** use pthread spinlock for the quick lock */ -typedef pthread_spinlock_t lock_quick_t; +typedef pthread_spinlock_t lock_quick_type; /** * allocate process private since this is available whether * Thread Process-Shared Synchronization is supported or not. @@ -148,14 +148,31 @@ typedef pthread_spinlock_t lock_quick_t; #endif /* HAVE SPINLOCK */ /** Thread creation */ -typedef pthread_t ub_thread_t; -/** Pass where to store tread_t in thr. Use default NULL attributes. */ -#define ub_thread_create(thr, func, arg) LOCKRET(pthread_create(thr, NULL, func, arg)) +typedef pthread_t ub_thread_type; +/** On alpine linux default thread stack size is 80 Kb. See +http://wiki.musl-libc.org/wiki/Functional_differences_from_glibc#Thread_stack_size +This is not enough and cause segfault. Other linux distros have 2 Mb at least. +Wrapper for set up thread stack size */ +#define PTHREADSTACKSIZE 2*1024*1024 +#define PTHREADCREATE(thr, stackrequired, func, arg) do {\ + pthread_attr_t attr; \ + size_t stacksize; \ + LOCKRET(pthread_attr_init(&attr)); \ + LOCKRET(pthread_attr_getstacksize(&attr, &stacksize)); \ + if (stacksize < stackrequired) { \ + LOCKRET(pthread_attr_setstacksize(&attr, stackrequired)); \ + LOCKRET(pthread_create(thr, &attr, func, arg)); \ + LOCKRET(pthread_attr_getstacksize(&attr, &stacksize)); \ + verbose(VERB_ALGO, "Thread stack size set to %u", (unsigned)stacksize); \ + } else {LOCKRET(pthread_create(thr, NULL, func, arg));} \ + } while(0) +/** Use wrapper for set thread stack size on attributes. */ +#define ub_thread_create(thr, func, arg) PTHREADCREATE(thr, PTHREADSTACKSIZE, func, arg) /** get self id. */ #define ub_thread_self() pthread_self() /** wait for another thread to terminate */ #define ub_thread_join(thread) LOCKRET(pthread_join(thread, NULL)) -typedef pthread_key_t ub_thread_key_t; +typedef pthread_key_t ub_thread_key_type; #define ub_thread_key_create(key, f) LOCKRET(pthread_key_create(key, f)) #define ub_thread_key_set(key, v) LOCKRET(pthread_setspecific(key, v)) #define ub_thread_key_get(key) pthread_getspecific(key) @@ -167,7 +184,7 @@ typedef pthread_key_t ub_thread_key_t; #include <synch.h> #include <thread.h> -typedef rwlock_t lock_rw_t; +typedef rwlock_t lock_rw_type; #define lock_rw_init(lock) LOCKRET(rwlock_init(lock, USYNC_THREAD, NULL)) #define lock_rw_destroy(lock) LOCKRET(rwlock_destroy(lock)) #define lock_rw_rdlock(lock) LOCKRET(rw_rdlock(lock)) @@ -175,28 +192,28 @@ typedef rwlock_t lock_rw_t; #define lock_rw_unlock(lock) LOCKRET(rw_unlock(lock)) /** use basic mutex */ -typedef mutex_t lock_basic_t; +typedef mutex_t lock_basic_type; #define lock_basic_init(lock) LOCKRET(mutex_init(lock, USYNC_THREAD, NULL)) #define lock_basic_destroy(lock) LOCKRET(mutex_destroy(lock)) #define lock_basic_lock(lock) LOCKRET(mutex_lock(lock)) #define lock_basic_unlock(lock) LOCKRET(mutex_unlock(lock)) /** No spinlocks in solaris threads API. Use a mutex. */ -typedef mutex_t lock_quick_t; +typedef mutex_t lock_quick_type; #define lock_quick_init(lock) LOCKRET(mutex_init(lock, USYNC_THREAD, NULL)) #define lock_quick_destroy(lock) LOCKRET(mutex_destroy(lock)) #define lock_quick_lock(lock) LOCKRET(mutex_lock(lock)) #define lock_quick_unlock(lock) LOCKRET(mutex_unlock(lock)) /** Thread creation, create a default thread. */ -typedef thread_t ub_thread_t; +typedef thread_t ub_thread_type; #define ub_thread_create(thr, func, arg) LOCKRET(thr_create(NULL, NULL, func, arg, NULL, thr)) #define ub_thread_self() thr_self() #define ub_thread_join(thread) LOCKRET(thr_join(thread, NULL, NULL)) -typedef thread_key_t ub_thread_key_t; +typedef thread_key_t ub_thread_key_type; #define ub_thread_key_create(key, f) LOCKRET(thr_keycreate(key, f)) #define ub_thread_key_set(key, v) LOCKRET(thr_setspecific(key, v)) -void* ub_thread_key_get(ub_thread_key_t key); +void* ub_thread_key_get(ub_thread_key_type key); #else /* we do not HAVE_SOLARIS_THREADS and no PTHREADS */ @@ -205,7 +222,7 @@ void* ub_thread_key_get(ub_thread_key_t key); #include <windows.h> /* Use a mutex */ -typedef LONG lock_rw_t; +typedef LONG lock_rw_type; #define lock_rw_init(lock) lock_basic_init(lock) #define lock_rw_destroy(lock) lock_basic_destroy(lock) #define lock_rw_rdlock(lock) lock_basic_lock(lock) @@ -213,35 +230,35 @@ typedef LONG lock_rw_t; #define lock_rw_unlock(lock) lock_basic_unlock(lock) /** the basic lock is a mutex, implemented opaquely, for error handling. */ -typedef LONG lock_basic_t; -void lock_basic_init(lock_basic_t* lock); -void lock_basic_destroy(lock_basic_t* lock); -void lock_basic_lock(lock_basic_t* lock); -void lock_basic_unlock(lock_basic_t* lock); +typedef LONG lock_basic_type; +void lock_basic_init(lock_basic_type* lock); +void lock_basic_destroy(lock_basic_type* lock); +void lock_basic_lock(lock_basic_type* lock); +void lock_basic_unlock(lock_basic_type* lock); /** on windows no spinlock, use mutex too. */ -typedef LONG lock_quick_t; +typedef LONG lock_quick_type; #define lock_quick_init(lock) lock_basic_init(lock) #define lock_quick_destroy(lock) lock_basic_destroy(lock) #define lock_quick_lock(lock) lock_basic_lock(lock) #define lock_quick_unlock(lock) lock_basic_unlock(lock) /** Thread creation, create a default thread. */ -typedef HANDLE ub_thread_t; -void ub_thread_create(ub_thread_t* thr, void* (*func)(void*), void* arg); -ub_thread_t ub_thread_self(void); -void ub_thread_join(ub_thread_t thr); -typedef DWORD ub_thread_key_t; -void ub_thread_key_create(ub_thread_key_t* key, void* f); -void ub_thread_key_set(ub_thread_key_t key, void* v); -void* ub_thread_key_get(ub_thread_key_t key); +typedef HANDLE ub_thread_type; +void ub_thread_create(ub_thread_type* thr, void* (*func)(void*), void* arg); +ub_thread_type ub_thread_self(void); +void ub_thread_join(ub_thread_type thr); +typedef DWORD ub_thread_key_type; +void ub_thread_key_create(ub_thread_key_type* key, void* f); +void ub_thread_key_set(ub_thread_key_type key, void* v); +void* ub_thread_key_get(ub_thread_key_type key); #else /* we do not HAVE_SOLARIS_THREADS, PTHREADS or WINDOWS_THREADS */ /******************* NO THREADS ************************/ #define THREADS_DISABLED 1 /** In case there is no thread support, define locks to do nothing */ -typedef int lock_rw_t; +typedef int lock_rw_type; #define lock_rw_init(lock) /* nop */ #define lock_rw_destroy(lock) /* nop */ #define lock_rw_rdlock(lock) /* nop */ @@ -249,30 +266,30 @@ typedef int lock_rw_t; #define lock_rw_unlock(lock) /* nop */ /** define locks to do nothing */ -typedef int lock_basic_t; +typedef int lock_basic_type; #define lock_basic_init(lock) /* nop */ #define lock_basic_destroy(lock) /* nop */ #define lock_basic_lock(lock) /* nop */ #define lock_basic_unlock(lock) /* nop */ /** define locks to do nothing */ -typedef int lock_quick_t; +typedef int lock_quick_type; #define lock_quick_init(lock) /* nop */ #define lock_quick_destroy(lock) /* nop */ #define lock_quick_lock(lock) /* nop */ #define lock_quick_unlock(lock) /* nop */ /** Thread creation, threads do not exist */ -typedef pid_t ub_thread_t; +typedef pid_t ub_thread_type; /** ub_thread_create is simulated with fork (extremely heavy threads, * with no shared memory). */ #define ub_thread_create(thr, func, arg) \ ub_thr_fork_create(thr, func, arg) #define ub_thread_self() getpid() #define ub_thread_join(thread) ub_thr_fork_wait(thread) -void ub_thr_fork_wait(ub_thread_t thread); -void ub_thr_fork_create(ub_thread_t* thr, void* (*func)(void*), void* arg); -typedef void* ub_thread_key_t; +void ub_thr_fork_wait(ub_thread_type thread); +void ub_thr_fork_create(ub_thread_type* thr, void* (*func)(void*), void* arg); +typedef void* ub_thread_key_type; #define ub_thread_key_create(key, f) (*(key)) = NULL #define ub_thread_key_set(key, v) (key) = (v) #define ub_thread_key_get(key) (key) diff --git a/external/unbound/util/log.c b/external/unbound/util/log.c index 3ebd12025..439541a7c 100644 --- a/external/unbound/util/log.c +++ b/external/unbound/util/log.c @@ -67,10 +67,10 @@ static FILE* logfile = 0; /** if key has been created */ static int key_created = 0; /** pthread key for thread ids in logfile */ -static ub_thread_key_t logkey; +static ub_thread_key_type logkey; #ifndef THREADS_DISABLED /** pthread mutex to protect FILE* */ -static lock_quick_t log_lock; +static lock_quick_type log_lock; #endif /** the identity of this executable/process */ static const char* ident="unbound"; diff --git a/external/unbound/util/mini_event.c b/external/unbound/util/mini_event.c index 98d15f677..14e9efe47 100644 --- a/external/unbound/util/mini_event.c +++ b/external/unbound/util/mini_event.c @@ -147,7 +147,7 @@ static void handle_timeouts(struct event_base* base, struct timeval* now, wait->tv_sec = (time_t)-1; #endif - while((rbnode_t*)(p = (struct event*)rbtree_first(base->times)) + while((rbnode_type*)(p = (struct event*)rbtree_first(base->times)) !=RBTREE_NULL) { #ifndef S_SPLINT_S if(p->ev_timeout.tv_sec > now->tv_sec || diff --git a/external/unbound/util/mini_event.h b/external/unbound/util/mini_event.h index 1a5bcb445..204894d97 100644 --- a/external/unbound/util/mini_event.h +++ b/external/unbound/util/mini_event.h @@ -96,7 +96,7 @@ struct event_base { /** sorted by timeout (absolute), ptr */ - rbtree_t* times; + rbtree_type* times; /** array of 0 - maxfd of ptr to event for it */ struct event** fds; /** max fd in use */ @@ -128,7 +128,7 @@ struct event_base */ struct event { /** node in timeout rbtree */ - rbnode_t node; + rbnode_type node; /** is event already added */ int added; diff --git a/external/unbound/util/module.c b/external/unbound/util/module.c index 09e276c30..f4b715d14 100644 --- a/external/unbound/util/module.c +++ b/external/unbound/util/module.c @@ -39,6 +39,7 @@ #include "config.h" #include "util/module.h" +#include "sldns/wire2str.h" const char* strextstate(enum module_ext_state s) @@ -69,3 +70,169 @@ strmodulevent(enum module_ev e) } return "bad_event_value"; } + +int +edns_known_options_init(struct module_env* env) +{ + env->edns_known_options_num = 0; + env->edns_known_options = (struct edns_known_option*)calloc( + MAX_KNOWN_EDNS_OPTS, sizeof(struct edns_known_option)); + if(!env->edns_known_options) return 0; + return 1; +} + +void +edns_known_options_delete(struct module_env* env) +{ + free(env->edns_known_options); + env->edns_known_options = NULL; + env->edns_known_options_num = 0; +} + +int +edns_register_option(uint16_t opt_code, int bypass_cache_stage, + int no_aggregation, struct module_env* env) +{ + size_t i; + if(env->worker) { + log_err("invalid edns registration: " + "trying to register option after module init phase"); + return 0; + } + + /** + * Checking if we are full first is faster but it does not provide + * the option to change the flags when the array is full. + * It only impacts unbound initialization, leave it for now. + */ + /* Check if the option is already registered. */ + for(i=0; i<env->edns_known_options_num; i++) + if(env->edns_known_options[i].opt_code == opt_code) + break; + /* If it is not yet registered check if we have space to add a new one. */ + if(i == env->edns_known_options_num) { + if(env->edns_known_options_num >= MAX_KNOWN_EDNS_OPTS) { + log_err("invalid edns registration: maximum options reached"); + return 0; + } + env->edns_known_options_num++; + } + env->edns_known_options[i].opt_code = opt_code; + env->edns_known_options[i].bypass_cache_stage = bypass_cache_stage; + env->edns_known_options[i].no_aggregation = no_aggregation; + return 1; +} + +int +inplace_cb_register(void* cb, enum inplace_cb_list_type type, void* cbarg, + struct module_env* env, int id) +{ + struct inplace_cb* callback; + struct inplace_cb** prevp; + if(env->worker) { + log_err("invalid edns callback registration: " + "trying to register callback after module init phase"); + return 0; + } + + callback = (struct inplace_cb*)calloc(1, sizeof(*callback)); + if(callback == NULL) { + log_err("out of memory during edns callback registration."); + return 0; + } + callback->id = id; + callback->next = NULL; + callback->cb = cb; + callback->cb_arg = cbarg; + + prevp = (struct inplace_cb**) &env->inplace_cb_lists[type]; + /* append at end of list */ + while(*prevp != NULL) + prevp = &((*prevp)->next); + *prevp = callback; + return 1; +} + +void +inplace_cb_delete(struct module_env* env, enum inplace_cb_list_type type, + int id) +{ + struct inplace_cb* temp = env->inplace_cb_lists[type]; + struct inplace_cb* prev = NULL; + + while(temp) { + if(temp->id == id) { + if(!prev) { + env->inplace_cb_lists[type] = temp->next; + free(temp); + temp = env->inplace_cb_lists[type]; + } + else { + prev->next = temp->next; + free(temp); + temp = prev->next; + } + } + else { + prev = temp; + temp = temp->next; + } + } +} + +struct edns_known_option* +edns_option_is_known(uint16_t opt_code, struct module_env* env) +{ + size_t i; + for(i=0; i<env->edns_known_options_num; i++) + if(env->edns_known_options[i].opt_code == opt_code) + return env->edns_known_options + i; + return NULL; +} + +int +edns_bypass_cache_stage(struct edns_option* list, struct module_env* env) +{ + size_t i; + for(; list; list=list->next) + for(i=0; i<env->edns_known_options_num; i++) + if(env->edns_known_options[i].opt_code == list->opt_code && + env->edns_known_options[i].bypass_cache_stage == 1) + return 1; + return 0; +} + +int +unique_mesh_state(struct edns_option* list, struct module_env* env) +{ + size_t i; + if(env->unique_mesh) + return 1; + for(; list; list=list->next) + for(i=0; i<env->edns_known_options_num; i++) + if(env->edns_known_options[i].opt_code == list->opt_code && + env->edns_known_options[i].no_aggregation == 1) + return 1; + return 0; +} + +void +log_edns_known_options(enum verbosity_value level, struct module_env* env) +{ + size_t i; + char str[32], *s; + size_t slen; + if(env->edns_known_options_num > 0 && verbosity >= level) { + verbose(level, "EDNS known options:"); + verbose(level, " Code: Bypass_cache_stage: Aggregate_mesh:"); + for(i=0; i<env->edns_known_options_num; i++) { + s = str; + slen = sizeof(str); + (void)sldns_wire2str_edns_option_code_print(&s, &slen, + env->edns_known_options[i].opt_code); + verbose(level, " %-8.8s %-19s %-15s", str, + env->edns_known_options[i].bypass_cache_stage?"YES":"NO", + env->edns_known_options[i].no_aggregation?"NO":"YES"); + } + } +} diff --git a/external/unbound/util/module.h b/external/unbound/util/module.h index b9dde36e2..82b50ccd7 100644 --- a/external/unbound/util/module.h +++ b/external/unbound/util/module.h @@ -174,9 +174,128 @@ struct val_anchors; struct val_neg_cache; struct iter_forwards; struct iter_hints; +struct respip_set; +struct respip_client_info; +struct respip_addr_info; /** Maximum number of modules in operation */ -#define MAX_MODULE 5 +#define MAX_MODULE 16 + +/** Maximum number of known edns options */ +#define MAX_KNOWN_EDNS_OPTS 256 + +enum inplace_cb_list_type { + /* Inplace callbacks for when a resolved reply is ready to be sent to the + * front.*/ + inplace_cb_reply = 0, + /* Inplace callbacks for when a reply is given from the cache. */ + inplace_cb_reply_cache, + /* Inplace callbacks for when a reply is given with local data + * (or Chaos reply). */ + inplace_cb_reply_local, + /* Inplace callbacks for when the reply is servfail. */ + inplace_cb_reply_servfail, + /* Inplace callbacks for when a query is ready to be sent to the back.*/ + inplace_cb_query, + /* Inplace callback for when a reply is received from the back. */ + inplace_cb_query_response, + /* Inplace callback for when EDNS is parsed on a reply received from the + * back. */ + inplace_cb_edns_back_parsed, + /* Total number of types. Used for array initialization. + * Should always be last. */ + inplace_cb_types_total +}; + + +/** Known edns option. Can be populated during modules' init. */ +struct edns_known_option { + /** type of this edns option */ + uint16_t opt_code; + /** whether the option needs to bypass the cache stage */ + int bypass_cache_stage; + /** whether the option needs mesh aggregation */ + int no_aggregation; +}; + +/** + * Inplace callback list of registered routines to be called. + */ +struct inplace_cb { + /** next in list */ + struct inplace_cb* next; + /** Inplace callback routine */ + void* cb; + void* cb_arg; + /** module id */ + int id; +}; + +/** + * Inplace callback function called before replying. + * Called as func(edns, qstate, opt_list_out, qinfo, reply_info, rcode, + * region, python_callback) + * Where: + * qinfo: the query info. + * qstate: the module state. NULL when calling before the query reaches the + * mesh states. + * rep: reply_info. Could be NULL. + * rcode: the return code. + * edns: the edns_data of the reply. When qstate is NULL, it is also used as + * the edns input. + * opt_list_out: the edns options list for the reply. + * region: region to store data. + * python_callback: only used for registering a python callback function. + */ +typedef int inplace_cb_reply_func_type(struct query_info* qinfo, + struct module_qstate* qstate, struct reply_info* rep, int rcode, + struct edns_data* edns, struct edns_option** opt_list_out, + struct regional* region, int id, void* callback); + +/** + * Inplace callback function called before sending the query to a nameserver. + * Called as func(qinfo, flags, qstate, addr, addrlen, zone, zonelen, region, + * python_callback) + * Where: + * qinfo: query info. + * flags: flags of the query. + * qstate: query state. + * addr: to which server to send the query. + * addrlen: length of addr. + * zone: name of the zone of the delegation point. wireformat dname. + * This is the delegation point name for which the server is deemed + * authoritative. + * zonelen: length of zone. + * region: region to store data. + * python_callback: only used for registering a python callback function. + */ +typedef int inplace_cb_query_func_type(struct query_info* qinfo, uint16_t flags, + struct module_qstate* qstate, struct sockaddr_storage* addr, + socklen_t addrlen, uint8_t* zone, size_t zonelen, struct regional* region, + int id, void* callback); + +/** + * Inplace callback function called after parsing edns on query reply. + * Called as func(qstate, cb_args) + * Where: + * qstate: the query state + * id: module id + * cb_args: argument passed when registering callback. + */ +typedef int inplace_cb_edns_back_parsed_func_type(struct module_qstate* qstate, + int id, void* cb_args); + +/** + * Inplace callback function called after parsing query response. + * Called as func(qstate, id, cb_args) + * Where: + * qstate: the query state + * response: query response + * id: module id + * cb_args: argument passed when registering callback. + */ +typedef int inplace_cb_query_response_func_type(struct module_qstate* qstate, + struct dns_msg* response, int id, void* cb_args); /** * Module environment. @@ -202,10 +321,7 @@ struct module_env { * will cause operate() to be called with event timeout or reply. * The time until a timeout is calculated from roundtrip timing, * several UDP retries are attempted. - * @param qname: query name. (host order) - * @param qnamelen: length in bytes of qname, including trailing 0. - * @param qtype: query type. (host order) - * @param qclass: query class. (host order) + * @param qinfo: query info. * @param flags: host order flags word, with opcode and CD bit. * @param dnssec: if set, EDNS record will have bits set. * If EDNS_DO bit is set, DO bit is set in EDNS records. @@ -218,16 +334,17 @@ struct module_env { * @param addrlen: length of addr. * @param zone: delegation point name. * @param zonelen: length of zone name. + * @param ssl_upstream: use SSL for upstream queries. * @param q: wich query state to reactivate upon return. * @return: false on failure (memory or socket related). no query was * sent. Or returns an outbound entry with qsent and qstate set. * This outbound_entry will be used on later module invocations * that involve this query (timeout, error or reply). */ - struct outbound_entry* (*send_query)(uint8_t* qname, size_t qnamelen, - uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec, - int want_dnssec, int nocaps, struct sockaddr_storage* addr, - socklen_t addrlen, uint8_t* zone, size_t zonelen, + struct outbound_entry* (*send_query)(struct query_info* qinfo, + uint16_t flags, int dnssec, int want_dnssec, int nocaps, + struct sockaddr_storage* addr, socklen_t addrlen, + uint8_t* zone, size_t zonelen, int ssl_upstream, struct module_qstate* q); /** @@ -333,6 +450,20 @@ struct module_env { struct iter_hints* hints; /** module specific data. indexed by module id. */ void* modinfo[MAX_MODULE]; + + /* Shared linked list of inplace callback functions */ + struct inplace_cb* inplace_cb_lists[inplace_cb_types_total]; + + /** + * Shared array of known edns options (size MAX_KNOWN_EDNS_OPTS). + * Filled by edns literate modules during init. + */ + struct edns_known_option* edns_known_options; + /* Number of known edns options */ + size_t edns_known_options_num; + + /* Make every mesh state unique, do not aggregate mesh states. */ + int unique_mesh; }; /** @@ -390,6 +521,8 @@ struct sock_list { struct sockaddr_storage addr; }; +struct respip_action_info; + /** * Module state, per query. */ @@ -431,6 +564,32 @@ struct module_qstate { struct mesh_state* mesh_info; /** how many seconds before expiry is this prefetched (0 if not) */ time_t prefetch_leeway; + + /** incoming edns options from the front end */ + struct edns_option* edns_opts_front_in; + /** outgoing edns options to the back end */ + struct edns_option* edns_opts_back_out; + /** incoming edns options from the back end */ + struct edns_option* edns_opts_back_in; + /** outgoing edns options to the front end */ + struct edns_option* edns_opts_front_out; + /** whether modules should answer from the cache */ + int no_cache_lookup; + /** whether modules should store answer in the cache */ + int no_cache_store; + + /** + * Attributes of clients that share the qstate that may affect IP-based + * actions. + */ + struct respip_client_info* client_info; + + /** Extended result of response-ip action processing, mainly + * for logging purposes. */ + struct respip_action_info* respip_action_info; + + /** whether the reply should be dropped */ + int is_drop; }; /** @@ -520,4 +679,100 @@ const char* strextstate(enum module_ext_state s); */ const char* strmodulevent(enum module_ev e); +/** + * Initialize the edns known options by allocating the required space. + * @param env: the module environment. + * @return false on failure (no memory). + */ +int edns_known_options_init(struct module_env* env); + +/** + * Free the allocated space for the known edns options. + * @param env: the module environment. + */ +void edns_known_options_delete(struct module_env* env); + +/** + * Register a known edns option. Overwrite the flags if it is already + * registered. Used before creating workers to register known edns options. + * @param opt_code: the edns option code. + * @param bypass_cache_stage: whether the option interacts with the cache. + * @param no_aggregation: whether the option implies more specific + * aggregation. + * @param env: the module environment. + * @return true on success, false on failure (registering more options than + * allowed or trying to register after the environment is copied to the + * threads.) + */ +int edns_register_option(uint16_t opt_code, int bypass_cache_stage, + int no_aggregation, struct module_env* env); + +/** + * Register an inplace callback function. + * @param cb: pointer to the callback function. + * @param type: inplace callback type. + * @param cbarg: argument for the callback function, or NULL. + * @param env: the module environment. + * @param id: module id. + * @return true on success, false on failure (out of memory or trying to + * register after the environment is copied to the threads.) + */ +int +inplace_cb_register(void* cb, enum inplace_cb_list_type type, void* cbarg, + struct module_env* env, int id); + +/** + * Delete callback for specified type and module id. + * @param env: the module environment. + * @param type: inplace callback type. + * @param id: module id. + */ +void +inplace_cb_delete(struct module_env* env, enum inplace_cb_list_type type, + int id); + +/** + * Delete all the inplace callback linked lists. + * @param env: the module environment. + */ +void inplace_cb_lists_delete(struct module_env* env); + +/** + * Check if an edns option is known. + * @param opt_code: the edns option code. + * @param env: the module environment. + * @return pointer to registered option if the edns option is known, + * NULL otherwise. + */ +struct edns_known_option* edns_option_is_known(uint16_t opt_code, + struct module_env* env); + +/** + * Check if an edns option needs to bypass the reply from cache stage. + * @param list: the edns options. + * @param env: the module environment. + * @return true if an edns option needs to bypass the cache stage, + * false otherwise. + */ +int edns_bypass_cache_stage(struct edns_option* list, + struct module_env* env); + +/** + * Check if an unique mesh state is required. Might be triggered by EDNS option + * or set for the complete env. + * @param list: the edns options. + * @param env: the module environment. + * @return true if an edns option needs a unique mesh state, + * false otherwise. + */ +int unique_mesh_state(struct edns_option* list, struct module_env* env); + +/** + * Log the known edns options. + * @param level: the desired verbosity level. + * @param env: the module environment. + */ +void log_edns_known_options(enum verbosity_value level, + struct module_env* env); + #endif /* UTIL_MODULE_H */ diff --git a/external/unbound/util/net_help.c b/external/unbound/util/net_help.c index eb03cd0ae..6c0d68e31 100644 --- a/external/unbound/util/net_help.c +++ b/external/unbound/util/net_help.c @@ -783,9 +783,9 @@ void* outgoing_ssl_fd(void* sslctx, int fd) #endif } -#if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) +#if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) && defined(CRYPTO_LOCK) && OPENSSL_VERSION_NUMBER < 0x10100000L /** global lock list for openssl locks */ -static lock_basic_t *ub_openssl_locks = NULL; +static lock_basic_type *ub_openssl_locks = NULL; /** callback that gets thread id for openssl */ static unsigned long @@ -808,10 +808,10 @@ ub_crypto_lock_cb(int mode, int type, const char *ATTR_UNUSED(file), int ub_openssl_lock_init(void) { -#if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) +#if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) && defined(CRYPTO_LOCK) && OPENSSL_VERSION_NUMBER < 0x10100000L int i; - ub_openssl_locks = (lock_basic_t*)reallocarray( - NULL, (size_t)CRYPTO_num_locks(), sizeof(lock_basic_t)); + ub_openssl_locks = (lock_basic_type*)reallocarray( + NULL, (size_t)CRYPTO_num_locks(), sizeof(lock_basic_type)); if(!ub_openssl_locks) return 0; for(i=0; i<CRYPTO_num_locks(); i++) { @@ -825,7 +825,7 @@ int ub_openssl_lock_init(void) void ub_openssl_lock_delete(void) { -#if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) +#if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED) && defined(CRYPTO_LOCK) && OPENSSL_VERSION_NUMBER < 0x10100000L int i; if(!ub_openssl_locks) return; diff --git a/external/unbound/util/netevent.c b/external/unbound/util/netevent.c index 3bb894888..2084cea3e 100644 --- a/external/unbound/util/netevent.c +++ b/external/unbound/util/netevent.c @@ -40,12 +40,14 @@ */ #include "config.h" #include "util/netevent.h" +#include "util/ub_event.h" #include "util/log.h" #include "util/net_help.h" #include "util/fptr_wlist.h" #include "sldns/pkthdr.h" #include "sldns/sbuffer.h" #include "dnstap/dnstap.h" +#include "dnscrypt/dnscrypt.h" #ifdef HAVE_OPENSSL_SSL_H #include <openssl/ssl.h> #endif @@ -56,7 +58,9 @@ /* -------- Start of local definitions -------- */ /** if CMSG_ALIGN is not defined on this platform, a workaround */ #ifndef CMSG_ALIGN -# ifdef _CMSG_DATA_ALIGN +# ifdef __CMSG_ALIGN +# define CMSG_ALIGN(n) __CMSG_ALIGN(n) +# elif defined(CMSG_DATA_ALIGN) # define CMSG_ALIGN _CMSG_DATA_ALIGN # else # define CMSG_ALIGN(len) (((len)+sizeof(long)-1) & ~(sizeof(long)-1)) @@ -77,8 +81,10 @@ # endif #endif -/** The TCP reading or writing query timeout in seconds */ -#define TCP_QUERY_TIMEOUT 120 +/** The TCP reading or writing query timeout in milliseconds */ +#define TCP_QUERY_TIMEOUT 120000 +/** The TCP timeout in msec for fast queries, above half are used */ +#define TCP_QUERY_TIMEOUT_FAST 200 #ifndef NONBLOCKING_IS_BROKEN /** number of UDP reads to perform per read indication from select */ @@ -87,48 +93,29 @@ #define NUM_UDP_PER_SELECT 1 #endif -/* We define libevent structures here to hide the libevent stuff. */ - -#ifdef USE_MINI_EVENT -# ifdef USE_WINSOCK -# include "util/winsock_event.h" -# else -# include "util/mini_event.h" -# endif /* USE_WINSOCK */ -#else /* USE_MINI_EVENT */ - /* we use libevent */ -# ifdef HAVE_EVENT_H -# include <event.h> -# else -# include "event2/event.h" -# include "event2/event_struct.h" -# include "event2/event_compat.h" -# endif -#endif /* USE_MINI_EVENT */ - /** - * The internal event structure for keeping libevent info for the event. + * The internal event structure for keeping ub_event info for the event. * Possibly other structures (list, tree) this is part of. */ struct internal_event { /** the comm base */ struct comm_base* base; - /** libevent event type, alloced here */ - struct event ev; + /** ub_event event type */ + struct ub_event* ev; }; /** * Internal base structure, so that every thread has its own events. */ struct internal_base { - /** libevent event_base type. */ - struct event_base* base; + /** ub_event event_base type. */ + struct ub_event_base* base; /** seconds time pointer points here */ time_t secs; /** timeval with current time */ struct timeval now; /** the event used for slow_accept timeouts */ - struct event slow_accept; + struct ub_event* slow_accept; /** true if slow_accept is enabled */ int slow_accept_enabled; }; @@ -137,10 +124,12 @@ struct internal_base { * Internal timer structure, to store timer event in. */ struct internal_timer { + /** the super struct from which derived */ + struct comm_timer super; /** the comm base */ struct comm_base* base; - /** libevent event type, alloced here */ - struct event ev; + /** ub_event event type */ + struct ub_event* ev; /** is timer enabled */ uint8_t enabled; }; @@ -149,8 +138,8 @@ struct internal_timer { * Internal signal structure, to store signal event in. */ struct internal_signal { - /** libevent event type, alloced here */ - struct event ev; + /** ub_event event type */ + struct ub_event* ev; /** next in signal list */ struct internal_signal* next; }; @@ -158,30 +147,17 @@ struct internal_signal { /** create a tcp handler with a parent */ static struct comm_point* comm_point_create_tcp_handler( struct comm_base *base, struct comm_point* parent, size_t bufsize, - comm_point_callback_t* callback, void* callback_arg); + comm_point_callback_type* callback, void* callback_arg); /* -------- End of local definitions -------- */ -#ifdef USE_MINI_EVENT -/** minievent updates the time when it blocks. */ -#define comm_base_now(x) /* nothing to do */ -#else /* !USE_MINI_EVENT */ -/** fillup the time values in the event base */ -static void -comm_base_now(struct comm_base* b) -{ - if(gettimeofday(&b->eb->now, NULL) < 0) { - log_err("gettimeofday: %s", strerror(errno)); - } - b->eb->secs = (time_t)b->eb->now.tv_sec; -} -#endif /* USE_MINI_EVENT */ - struct comm_base* comm_base_create(int sigs) { struct comm_base* b = (struct comm_base*)calloc(1, sizeof(struct comm_base)); + const char *evnm="event", *evsys="", *evmethod=""; + if(!b) return NULL; b->eb = (struct internal_base*)calloc(1, sizeof(struct internal_base)); @@ -189,55 +165,20 @@ comm_base_create(int sigs) free(b); return NULL; } -#ifdef USE_MINI_EVENT - (void)sigs; - /* use mini event time-sharing feature */ - b->eb->base = event_init(&b->eb->secs, &b->eb->now); -#else -# if defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP) - /* libev */ - if(sigs) - b->eb->base=(struct event_base *)ev_default_loop(EVFLAG_AUTO); - else - b->eb->base=(struct event_base *)ev_loop_new(EVFLAG_AUTO); -# else - (void)sigs; -# ifdef HAVE_EVENT_BASE_NEW - b->eb->base = event_base_new(); -# else - b->eb->base = event_init(); -# endif -# endif -#endif + b->eb->base = ub_default_event_base(sigs, &b->eb->secs, &b->eb->now); if(!b->eb->base) { free(b->eb); free(b); return NULL; } - comm_base_now(b); - /* avoid event_get_method call which causes crashes even when - * not printing, because its result is passed */ - verbose(VERB_ALGO, -#if defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP) - "libev" -#elif defined(USE_MINI_EVENT) - "event " -#else - "libevent " -#endif - "%s uses %s method.", - event_get_version(), -#ifdef HAVE_EVENT_BASE_GET_METHOD - event_base_get_method(b->eb->base) -#else - "not_obtainable" -#endif - ); + ub_comm_base_now(b); + ub_get_event_sys(b->eb->base, &evnm, &evsys, &evmethod); + verbose(VERB_ALGO, "%s %s user %s method.", evnm, evsys, evmethod); return b; } struct comm_base* -comm_base_create_event(struct event_base* base) +comm_base_create_event(struct ub_event_base* base) { struct comm_base* b = (struct comm_base*)calloc(1, sizeof(struct comm_base)); @@ -249,7 +190,7 @@ comm_base_create_event(struct event_base* base) return NULL; } b->eb->base = base; - comm_base_now(b); + ub_comm_base_now(b); return b; } @@ -259,18 +200,12 @@ comm_base_delete(struct comm_base* b) if(!b) return; if(b->eb->slow_accept_enabled) { - if(event_del(&b->eb->slow_accept) != 0) { + if(ub_event_del(b->eb->slow_accept) != 0) { log_err("could not event_del slow_accept"); } + ub_event_free(b->eb->slow_accept); } -#ifdef USE_MINI_EVENT - event_base_free(b->eb->base); -#elif defined(HAVE_EVENT_BASE_FREE) && defined(HAVE_EVENT_BASE_ONCE) - /* only libevent 1.2+ has it, but in 1.2 it is broken - - assertion fails on signal handling ev that is not deleted - in libevent 1.3c (event_base_once appears) this is fixed. */ - event_base_free(b->eb->base); -#endif /* HAVE_EVENT_BASE_FREE and HAVE_EVENT_BASE_ONCE */ + ub_event_base_free(b->eb->base); b->eb->base = NULL; free(b->eb); free(b); @@ -282,9 +217,10 @@ comm_base_delete_no_base(struct comm_base* b) if(!b) return; if(b->eb->slow_accept_enabled) { - if(event_del(&b->eb->slow_accept) != 0) { + if(ub_event_del(b->eb->slow_accept) != 0) { log_err("could not event_del slow_accept"); } + ub_event_free(b->eb->slow_accept); } b->eb->base = NULL; free(b->eb); @@ -302,8 +238,8 @@ void comm_base_dispatch(struct comm_base* b) { int retval; - retval = event_base_dispatch(b->eb->base); - if(retval != 0) { + retval = ub_event_base_dispatch(b->eb->base); + if(retval < 0) { fatal_exit("event_dispatch returned error %d, " "errno is %s", retval, strerror(errno)); } @@ -311,7 +247,7 @@ comm_base_dispatch(struct comm_base* b) void comm_base_exit(struct comm_base* b) { - if(event_base_loopexit(b->eb->base, NULL) != 0) { + if(ub_event_base_loopexit(b->eb->base) != 0) { log_err("Could not loopexit"); } } @@ -324,7 +260,7 @@ void comm_base_set_slow_accept_handlers(struct comm_base* b, b->cb_arg = arg; } -struct event_base* comm_base_internal(struct comm_base* b) +struct ub_event_base* comm_base_internal(struct comm_base* b) { return b->eb->base; } @@ -356,7 +292,12 @@ udp_send_errno_needs_log(struct sockaddr* addr, socklen_t addrlen) #endif /* permission denied is gotten for every send if the * network is disconnected (on some OS), squelch it */ - if(errno == EPERM && verbosity < VERB_DETAIL) + if( ((errno == EPERM) +# ifdef EADDRNOTAVAIL + /* 'Cannot assign requested address' also when disconnected */ + || (errno == EADDRNOTAVAIL) +# endif + ) && verbosity < VERB_DETAIL) return 0; /* squelch errors where people deploy AAAA ::ffff:bla for * authority servers, which we try for intranets. */ @@ -394,6 +335,31 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, sldns_buffer_remaining(packet), 0, addr, addrlen); if(sent == -1) { + /* try again and block, waiting for IO to complete, + * we want to send the answer, and we will wait for + * the ethernet interface buffer to have space. */ +#ifndef USE_WINSOCK + if(errno == EAGAIN || +# ifdef EWOULDBLOCK + errno == EWOULDBLOCK || +# endif + errno == ENOBUFS) { +#else + if(WSAGetLastError() == WSAEINPROGRESS || + WSAGetLastError() == WSAENOBUFS || + WSAGetLastError() == WSAEWOULDBLOCK) { +#endif + int e; + fd_set_block(c->fd); + sent = sendto(c->fd, (void*)sldns_buffer_begin(packet), + sldns_buffer_remaining(packet), 0, + addr, addrlen); + e = errno; + fd_set_nonblock(c->fd); + errno = e; + } + } + if(sent == -1) { if(!udp_send_errno_needs_log(addr, addrlen)) return 0; #ifndef USE_WINSOCK @@ -547,11 +513,40 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet, p_ancil("send_udp over interface", r); sent = sendmsg(c->fd, &msg, 0); if(sent == -1) { + /* try again and block, waiting for IO to complete, + * we want to send the answer, and we will wait for + * the ethernet interface buffer to have space. */ +#ifndef USE_WINSOCK + if(errno == EAGAIN || +# ifdef EWOULDBLOCK + errno == EWOULDBLOCK || +# endif + errno == ENOBUFS) { +#else + if(WSAGetLastError() == WSAEINPROGRESS || + WSAGetLastError() == WSAENOBUFS || + WSAGetLastError() == WSAEWOULDBLOCK) { +#endif + int e; + fd_set_block(c->fd); + sent = sendmsg(c->fd, &msg, 0); + e = errno; + fd_set_nonblock(c->fd); + errno = e; + } + } + if(sent == -1) { if(!udp_send_errno_needs_log(addr, addrlen)) return 0; verbose(VERB_OPS, "sendmsg failed: %s", strerror(errno)); log_addr(VERB_OPS, "remote address is", (struct sockaddr_storage*)addr, addrlen); +#ifdef __NetBSD__ + /* netbsd 7 has IP_PKTINFO for recv but not send */ + if(errno == EINVAL && r->srctype == 4) + log_err("sendmsg: No support for sendmsg(IP_PKTINFO). " + "Please disable interface-automatic"); +#endif return 0; } else if((size_t)sent != sldns_buffer_remaining(packet)) { log_err("sent %d in place of %d bytes", @@ -587,10 +582,10 @@ comm_point_udp_ancil_callback(int fd, short event, void* arg) rep.c = (struct comm_point*)arg; log_assert(rep.c->type == comm_udp); - if(!(event&EV_READ)) + if(!(event&UB_EV_READ)) return; log_assert(rep.c && rep.c->buffer && rep.c->fd == fd); - comm_base_now(rep.c->ev->base); + ub_comm_base_now(rep.c->ev->base); for(i=0; i<NUM_UDP_PER_SELECT; i++) { sldns_buffer_clear(rep.c->buffer); rep.addrlen = (socklen_t)sizeof(rep.addr); @@ -660,7 +655,7 @@ comm_point_udp_ancil_callback(int fd, short event, void* arg) (void)fd; (void)event; (void)arg; - fatal_exit("recvmsg: No support for IPV6_PKTINFO. " + fatal_exit("recvmsg: No support for IPV6_PKTINFO; IP_PKTINFO or IP_RECVDSTADDR. " "Please disable interface-automatic"); #endif /* AF_INET6 && IPV6_PKTINFO && HAVE_RECVMSG */ } @@ -671,14 +666,15 @@ comm_point_udp_callback(int fd, short event, void* arg) struct comm_reply rep; ssize_t rcv; int i; + struct sldns_buffer *buffer; rep.c = (struct comm_point*)arg; log_assert(rep.c->type == comm_udp); - if(!(event&EV_READ)) + if(!(event&UB_EV_READ)) return; log_assert(rep.c && rep.c->buffer && rep.c->fd == fd); - comm_base_now(rep.c->ev->base); + ub_comm_base_now(rep.c->ev->base); for(i=0; i<NUM_UDP_PER_SELECT; i++) { sldns_buffer_clear(rep.c->buffer); rep.addrlen = (socklen_t)sizeof(rep.addr); @@ -707,7 +703,12 @@ comm_point_udp_callback(int fd, short event, void* arg) fptr_ok(fptr_whitelist_comm_point(rep.c->callback)); if((*rep.c->callback)(rep.c, rep.c->cb_arg, NETEVENT_NOERROR, &rep)) { /* send back immediate reply */ - (void)comm_point_send_udp_msg(rep.c, rep.c->buffer, +#ifdef USE_DNSCRYPT + buffer = rep.c->dnscrypt_buffer; +#else + buffer = rep.c->buffer; +#endif + (void)comm_point_send_udp_msg(rep.c, buffer, (struct sockaddr*)&rep.addr, rep.addrlen); } if(rep.c->fd != fd) /* commpoint closed to -1 or reused for @@ -718,14 +719,24 @@ comm_point_udp_callback(int fd, short event, void* arg) /** Use a new tcp handler for new query fd, set to read query */ static void -setup_tcp_handler(struct comm_point* c, int fd) +setup_tcp_handler(struct comm_point* c, int fd, int cur, int max) { log_assert(c->type == comm_tcp); log_assert(c->fd == -1); sldns_buffer_clear(c->buffer); +#ifdef USE_DNSCRYPT + if (c->dnscrypt) + sldns_buffer_clear(c->dnscrypt_buffer); +#endif c->tcp_is_reading = 1; c->tcp_byte_count = 0; - comm_point_start_listening(c, fd, TCP_QUERY_TIMEOUT); + c->tcp_timeout_msec = TCP_QUERY_TIMEOUT; + /* if more than half the tcp handlers are in use, use a shorter + * timeout for this TCP connection, we need to make space for + * other connections to be able to get attention */ + if(cur > max/2) + c->tcp_timeout_msec = TCP_QUERY_TIMEOUT_FAST; + comm_point_start_listening(c, fd, c->tcp_timeout_msec); } void comm_base_handle_slow_accept(int ATTR_UNUSED(fd), @@ -777,16 +788,17 @@ int comm_point_perform_accept(struct comm_point* c, (*b->stop_accept)(b->cb_arg); /* set timeout, no mallocs */ tv.tv_sec = NETEVENT_SLOW_ACCEPT_TIME/1000; - tv.tv_usec = NETEVENT_SLOW_ACCEPT_TIME%1000; - event_set(&b->eb->slow_accept, -1, EV_TIMEOUT, + tv.tv_usec = (NETEVENT_SLOW_ACCEPT_TIME%1000)*1000; + b->eb->slow_accept = ub_event_new(b->eb->base, + -1, UB_EV_TIMEOUT, comm_base_handle_slow_accept, b); - if(event_base_set(b->eb->base, - &b->eb->slow_accept) != 0) { + if(b->eb->slow_accept == NULL) { /* we do not want to log here, because * that would spam the logfiles. * error: "event_base_set failed." */ } - if(event_add(&b->eb->slow_accept, &tv) != 0) { + else if(ub_event_add(b->eb->slow_accept, &tv) + != 0) { /* we do not want to log here, * error: "event_add failed." */ } @@ -800,7 +812,7 @@ int comm_point_perform_accept(struct comm_point* c, WSAGetLastError() == WSAECONNRESET) return -1; if(WSAGetLastError() == WSAEWOULDBLOCK) { - winsock_tcp_wouldblock(&c->ev->ev, EV_READ); + ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_READ); return -1; } log_err_addr("accept failed", wsa_strerror(WSAGetLastError()), @@ -824,14 +836,14 @@ static long win_bio_cb(BIO *b, int oper, const char* ATTR_UNUSED(argp), if( (oper == (BIO_CB_READ|BIO_CB_RETURN) && argl == 0) || (oper == (BIO_CB_GETS|BIO_CB_RETURN) && argl == 0)) { if(WSAGetLastError() == WSAEWOULDBLOCK) - winsock_tcp_wouldblock((struct event*) - BIO_get_callback_arg(b), EV_READ); + ub_winsock_tcp_wouldblock((struct ub_event*) + BIO_get_callback_arg(b), UB_EV_READ); } if( (oper == (BIO_CB_WRITE|BIO_CB_RETURN) && argl == 0) || (oper == (BIO_CB_PUTS|BIO_CB_RETURN) && argl == 0)) { if(WSAGetLastError() == WSAEWOULDBLOCK) - winsock_tcp_wouldblock((struct event*) - BIO_get_callback_arg(b), EV_WRITE); + ub_winsock_tcp_wouldblock((struct ub_event*) + BIO_get_callback_arg(b), UB_EV_WRITE); } /* return original return value */ return retvalue; @@ -844,9 +856,9 @@ comm_point_tcp_win_bio_cb(struct comm_point* c, void* thessl) SSL* ssl = (SSL*)thessl; /* set them both just in case, but usually they are the same BIO */ BIO_set_callback(SSL_get_rbio(ssl), &win_bio_cb); - BIO_set_callback_arg(SSL_get_rbio(ssl), (char*)&c->ev->ev); + BIO_set_callback_arg(SSL_get_rbio(ssl), (char*)c->ev->ev); BIO_set_callback(SSL_get_wbio(ssl), &win_bio_cb); - BIO_set_callback_arg(SSL_get_wbio(ssl), (char*)&c->ev->ev); + BIO_set_callback_arg(SSL_get_wbio(ssl), (char*)c->ev->ev); } #endif @@ -856,11 +868,11 @@ comm_point_tcp_accept_callback(int fd, short event, void* arg) struct comm_point* c = (struct comm_point*)arg, *c_hdl; int new_fd; log_assert(c->type == comm_tcp_accept); - if(!(event & EV_READ)) { + if(!(event & UB_EV_READ)) { log_info("ignoring tcp accept event %d", (int)event); return; } - comm_base_now(c->ev->base); + ub_comm_base_now(c->ev->base); /* find free tcp handler. */ if(!c->tcp_free) { log_warn("accepted too many tcp, connections full"); @@ -869,6 +881,7 @@ comm_point_tcp_accept_callback(int fd, short event, void* arg) /* accept incoming connection. */ c_hdl = c->tcp_free; log_assert(fd != -1); + (void)fd; new_fd = comm_point_perform_accept(c, &c_hdl->repinfo.addr, &c_hdl->repinfo.addrlen); if(new_fd == -1) @@ -893,7 +906,7 @@ comm_point_tcp_accept_callback(int fd, short event, void* arg) /* stop accepting incoming queries for now. */ comm_point_stop_listening(c); } - setup_tcp_handler(c_hdl, new_fd); + setup_tcp_handler(c_hdl, new_fd, c->cur_tcp_count, c->max_tcp_count); } /** Make tcp handler free for next assignment */ @@ -947,7 +960,7 @@ tcp_callback_reader(struct comm_point* c) comm_point_stop_listening(c); fptr_ok(fptr_whitelist_comm_point(c->callback)); if( (*c->callback)(c, c->cb_arg, NETEVENT_NOERROR, &c->repinfo) ) { - comm_point_start_listening(c, -1, TCP_QUERY_TIMEOUT); + comm_point_start_listening(c, -1, c->tcp_timeout_msec); } } @@ -1236,7 +1249,8 @@ comm_point_tcp_handle_read(int fd, struct comm_point* c, int short_ok) if(WSAGetLastError() == WSAEINPROGRESS) return 1; if(WSAGetLastError() == WSAEWOULDBLOCK) { - winsock_tcp_wouldblock(&c->ev->ev, EV_READ); + ub_winsock_tcp_wouldblock(c->ev->ev, + UB_EV_READ); return 1; } log_err_addr("read (in tcp s)", @@ -1281,7 +1295,7 @@ comm_point_tcp_handle_read(int fd, struct comm_point* c, int short_ok) if(WSAGetLastError() == WSAEINPROGRESS) return 1; if(WSAGetLastError() == WSAEWOULDBLOCK) { - winsock_tcp_wouldblock(&c->ev->ev, EV_READ); + ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_READ); return 1; } log_err_addr("read (in tcp r)", @@ -1307,7 +1321,13 @@ static int comm_point_tcp_handle_write(int fd, struct comm_point* c) { ssize_t r; + struct sldns_buffer *buffer; log_assert(c->type == comm_tcp); +#ifdef USE_DNSCRYPT + buffer = c->dnscrypt_buffer; +#else + buffer = c->buffer; +#endif if(c->tcp_is_reading && !c->ssl) return 0; log_assert(fd != -1); @@ -1340,7 +1360,7 @@ comm_point_tcp_handle_write(int fd, struct comm_point* c) if(error == WSAEINPROGRESS) return 1; else if(error == WSAEWOULDBLOCK) { - winsock_tcp_wouldblock(&c->ev->ev, EV_WRITE); + ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_WRITE); return 1; } else if(error != 0 && verbosity < 2) return 0; @@ -1354,14 +1374,67 @@ comm_point_tcp_handle_write(int fd, struct comm_point* c) if(c->ssl) return ssl_handle_it(c); +#ifdef USE_MSG_FASTOPEN + /* Only try this on first use of a connection that uses tfo, + otherwise fall through to normal write */ + /* Also, TFO support on WINDOWS not implemented at the moment */ + if(c->tcp_do_fastopen == 1) { + /* this form of sendmsg() does both a connect() and send() so need to + look for various flavours of error*/ + uint16_t len = htons(sldns_buffer_limit(buffer)); + struct msghdr msg; + struct iovec iov[2]; + c->tcp_do_fastopen = 0; + memset(&msg, 0, sizeof(msg)); + iov[0].iov_base = (uint8_t*)&len + c->tcp_byte_count; + iov[0].iov_len = sizeof(uint16_t) - c->tcp_byte_count; + iov[1].iov_base = sldns_buffer_begin(buffer); + iov[1].iov_len = sldns_buffer_limit(buffer); + log_assert(iov[0].iov_len > 0); + log_assert(iov[1].iov_len > 0); + msg.msg_name = &c->repinfo.addr; + msg.msg_namelen = c->repinfo.addrlen; + msg.msg_iov = iov; + msg.msg_iovlen = 2; + r = sendmsg(fd, &msg, MSG_FASTOPEN); + if (r == -1) { +#if defined(EINPROGRESS) && defined(EWOULDBLOCK) + /* Handshake is underway, maybe because no TFO cookie available. + Come back to write the messsage*/ + if(errno == EINPROGRESS || errno == EWOULDBLOCK) + return 1; +#endif + if(errno == EINTR || errno == EAGAIN) + return 1; + /* Not handling EISCONN here as shouldn't ever hit that case.*/ + if(errno != 0 && verbosity < 2) + return 0; /* silence lots of chatter in the logs */ + else if(errno != 0) + log_err_addr("tcp sendmsg", strerror(errno), + &c->repinfo.addr, c->repinfo.addrlen); + return 0; + } else { + c->tcp_byte_count += r; + if(c->tcp_byte_count < sizeof(uint16_t)) + return 1; + sldns_buffer_set_position(buffer, c->tcp_byte_count - + sizeof(uint16_t)); + if(sldns_buffer_remaining(buffer) == 0) { + tcp_callback_writer(c); + return 1; + } + } + } +#endif /* USE_MSG_FASTOPEN */ + if(c->tcp_byte_count < sizeof(uint16_t)) { - uint16_t len = htons(sldns_buffer_limit(c->buffer)); + uint16_t len = htons(sldns_buffer_limit(buffer)); #ifdef HAVE_WRITEV struct iovec iov[2]; iov[0].iov_base = (uint8_t*)&len + c->tcp_byte_count; iov[0].iov_len = sizeof(uint16_t) - c->tcp_byte_count; - iov[1].iov_base = sldns_buffer_begin(c->buffer); - iov[1].iov_len = sldns_buffer_limit(c->buffer); + iov[1].iov_base = sldns_buffer_begin(buffer); + iov[1].iov_len = sldns_buffer_limit(buffer); log_assert(iov[0].iov_len > 0); log_assert(iov[1].iov_len > 0); r = writev(fd, iov, 2); @@ -1390,7 +1463,8 @@ comm_point_tcp_handle_write(int fd, struct comm_point* c) if(WSAGetLastError() == WSAEINPROGRESS) return 1; if(WSAGetLastError() == WSAEWOULDBLOCK) { - winsock_tcp_wouldblock(&c->ev->ev, EV_WRITE); + ub_winsock_tcp_wouldblock(c->ev->ev, + UB_EV_WRITE); return 1; } log_err_addr("tcp send s", @@ -1402,16 +1476,16 @@ comm_point_tcp_handle_write(int fd, struct comm_point* c) c->tcp_byte_count += r; if(c->tcp_byte_count < sizeof(uint16_t)) return 1; - sldns_buffer_set_position(c->buffer, c->tcp_byte_count - + sldns_buffer_set_position(buffer, c->tcp_byte_count - sizeof(uint16_t)); - if(sldns_buffer_remaining(c->buffer) == 0) { + if(sldns_buffer_remaining(buffer) == 0) { tcp_callback_writer(c); return 1; } } - log_assert(sldns_buffer_remaining(c->buffer) > 0); - r = send(fd, (void*)sldns_buffer_current(c->buffer), - sldns_buffer_remaining(c->buffer), 0); + log_assert(sldns_buffer_remaining(buffer) > 0); + r = send(fd, (void*)sldns_buffer_current(buffer), + sldns_buffer_remaining(buffer), 0); if(r == -1) { #ifndef USE_WINSOCK if(errno == EINTR || errno == EAGAIN) @@ -1422,7 +1496,7 @@ comm_point_tcp_handle_write(int fd, struct comm_point* c) if(WSAGetLastError() == WSAEINPROGRESS) return 1; if(WSAGetLastError() == WSAEWOULDBLOCK) { - winsock_tcp_wouldblock(&c->ev->ev, EV_WRITE); + ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_WRITE); return 1; } log_err_addr("tcp send r", wsa_strerror(WSAGetLastError()), @@ -1430,9 +1504,9 @@ comm_point_tcp_handle_write(int fd, struct comm_point* c) #endif return 0; } - sldns_buffer_skip(c->buffer, r); + sldns_buffer_skip(buffer, r); - if(sldns_buffer_remaining(c->buffer) == 0) { + if(sldns_buffer_remaining(buffer) == 0) { tcp_callback_writer(c); } @@ -1444,9 +1518,23 @@ comm_point_tcp_handle_callback(int fd, short event, void* arg) { struct comm_point* c = (struct comm_point*)arg; log_assert(c->type == comm_tcp); - comm_base_now(c->ev->base); + ub_comm_base_now(c->ev->base); - if(event&EV_READ) { +#ifdef USE_DNSCRYPT + /* Initialize if this is a dnscrypt socket */ + if(c->tcp_parent) { + c->dnscrypt = c->tcp_parent->dnscrypt; + } + if(c->dnscrypt && c->dnscrypt_buffer == c->buffer) { + c->dnscrypt_buffer = sldns_buffer_new(sldns_buffer_capacity(c->buffer)); + if(!c->dnscrypt_buffer) { + log_err("Could not allocate dnscrypt buffer"); + return; + } + } +#endif + + if(event&UB_EV_READ) { if(!comm_point_tcp_handle_read(fd, c, 0)) { reclaim_tcp_handler(c); if(!c->tcp_do_close) { @@ -1458,7 +1546,7 @@ comm_point_tcp_handle_callback(int fd, short event, void* arg) } return; } - if(event&EV_WRITE) { + if(event&UB_EV_WRITE) { if(!comm_point_tcp_handle_write(fd, c)) { reclaim_tcp_handler(c); if(!c->tcp_do_close) { @@ -1470,7 +1558,7 @@ comm_point_tcp_handle_callback(int fd, short event, void* arg) } return; } - if(event&EV_TIMEOUT) { + if(event&UB_EV_TIMEOUT) { verbose(VERB_QUERY, "tcp took too long, dropped"); reclaim_tcp_handler(c); if(!c->tcp_do_close) { @@ -1487,9 +1575,9 @@ void comm_point_local_handle_callback(int fd, short event, void* arg) { struct comm_point* c = (struct comm_point*)arg; log_assert(c->type == comm_local); - comm_base_now(c->ev->base); + ub_comm_base_now(c->ev->base); - if(event&EV_READ) { + if(event&UB_EV_READ) { if(!comm_point_tcp_handle_read(fd, c, 1)) { fptr_ok(fptr_whitelist_comm_point(c->callback)); (void)(*c->callback)(c, c->cb_arg, NETEVENT_CLOSED, @@ -1506,9 +1594,9 @@ void comm_point_raw_handle_callback(int ATTR_UNUSED(fd), struct comm_point* c = (struct comm_point*)arg; int err = NETEVENT_NOERROR; log_assert(c->type == comm_raw); - comm_base_now(c->ev->base); + ub_comm_base_now(c->ev->base); - if(event&EV_TIMEOUT) + if(event&UB_EV_TIMEOUT) err = NETEVENT_TIMEOUT; fptr_ok(fptr_whitelist_comm_point_raw(c->callback)); (void)(*c->callback)(c, c->cb_arg, err, NULL); @@ -1516,7 +1604,7 @@ void comm_point_raw_handle_callback(int ATTR_UNUSED(fd), struct comm_point* comm_point_create_udp(struct comm_base *base, int fd, sldns_buffer* buffer, - comm_point_callback_t* callback, void* callback_arg) + comm_point_callback_type* callback, void* callback_arg) { struct comm_point* c = (struct comm_point*)calloc(1, sizeof(struct comm_point)); @@ -1545,18 +1633,26 @@ comm_point_create_udp(struct comm_base *base, int fd, sldns_buffer* buffer, c->do_not_close = 0; c->tcp_do_toggle_rw = 0; c->tcp_check_nb_connect = 0; +#ifdef USE_MSG_FASTOPEN + c->tcp_do_fastopen = 0; +#endif +#ifdef USE_DNSCRYPT + c->dnscrypt = 0; + c->dnscrypt_buffer = buffer; +#endif c->inuse = 0; c->callback = callback; c->cb_arg = callback_arg; - evbits = EV_READ | EV_PERSIST; - /* libevent stuff */ - event_set(&c->ev->ev, c->fd, evbits, comm_point_udp_callback, c); - if(event_base_set(base->eb->base, &c->ev->ev) != 0) { + evbits = UB_EV_READ | UB_EV_PERSIST; + /* ub_event stuff */ + c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits, + comm_point_udp_callback, c); + if(c->ev->ev == NULL) { log_err("could not baseset udp event"); comm_point_delete(c); return NULL; } - if(fd!=-1 && event_add(&c->ev->ev, c->timeout) != 0 ) { + if(fd!=-1 && ub_event_add(c->ev->ev, c->timeout) != 0 ) { log_err("could not add udp event"); comm_point_delete(c); return NULL; @@ -1567,7 +1663,7 @@ comm_point_create_udp(struct comm_base *base, int fd, sldns_buffer* buffer, struct comm_point* comm_point_create_udp_ancil(struct comm_base *base, int fd, sldns_buffer* buffer, - comm_point_callback_t* callback, void* callback_arg) + comm_point_callback_type* callback, void* callback_arg) { struct comm_point* c = (struct comm_point*)calloc(1, sizeof(struct comm_point)); @@ -1594,20 +1690,28 @@ comm_point_create_udp_ancil(struct comm_base *base, int fd, c->type = comm_udp; c->tcp_do_close = 0; c->do_not_close = 0; +#ifdef USE_DNSCRYPT + c->dnscrypt = 0; + c->dnscrypt_buffer = buffer; +#endif c->inuse = 0; c->tcp_do_toggle_rw = 0; c->tcp_check_nb_connect = 0; +#ifdef USE_MSG_FASTOPEN + c->tcp_do_fastopen = 0; +#endif c->callback = callback; c->cb_arg = callback_arg; - evbits = EV_READ | EV_PERSIST; - /* libevent stuff */ - event_set(&c->ev->ev, c->fd, evbits, comm_point_udp_ancil_callback, c); - if(event_base_set(base->eb->base, &c->ev->ev) != 0) { + evbits = UB_EV_READ | UB_EV_PERSIST; + /* ub_event stuff */ + c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits, + comm_point_udp_ancil_callback, c); + if(c->ev->ev == NULL) { log_err("could not baseset udp event"); comm_point_delete(c); return NULL; } - if(fd!=-1 && event_add(&c->ev->ev, c->timeout) != 0 ) { + if(fd!=-1 && ub_event_add(c->ev->ev, c->timeout) != 0 ) { log_err("could not add udp event"); comm_point_delete(c); return NULL; @@ -1618,7 +1722,7 @@ comm_point_create_udp_ancil(struct comm_base *base, int fd, static struct comm_point* comm_point_create_tcp_handler(struct comm_base *base, struct comm_point* parent, size_t bufsize, - comm_point_callback_t* callback, void* callback_arg) + comm_point_callback_type* callback, void* callback_arg) { struct comm_point* c = (struct comm_point*)calloc(1, sizeof(struct comm_point)); @@ -1658,16 +1762,26 @@ comm_point_create_tcp_handler(struct comm_base *base, c->do_not_close = 0; c->tcp_do_toggle_rw = 1; c->tcp_check_nb_connect = 0; +#ifdef USE_MSG_FASTOPEN + c->tcp_do_fastopen = 0; +#endif +#ifdef USE_DNSCRYPT + c->dnscrypt = 0; + // We don't know just yet if this is a dnscrypt channel. Allocation + // will be done when handling the callback. + c->dnscrypt_buffer = c->buffer; +#endif c->repinfo.c = c; c->callback = callback; c->cb_arg = callback_arg; /* add to parent free list */ c->tcp_free = parent->tcp_free; parent->tcp_free = c; - /* libevent stuff */ - evbits = EV_PERSIST | EV_READ | EV_TIMEOUT; - event_set(&c->ev->ev, c->fd, evbits, comm_point_tcp_handle_callback, c); - if(event_base_set(base->eb->base, &c->ev->ev) != 0) + /* ub_event stuff */ + evbits = UB_EV_PERSIST | UB_EV_READ | UB_EV_TIMEOUT; + c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits, + comm_point_tcp_handle_callback, c); + if(c->ev->ev == NULL) { log_err("could not basetset tcphdl event"); parent->tcp_free = c->tcp_free; @@ -1680,7 +1794,7 @@ comm_point_create_tcp_handler(struct comm_base *base, struct comm_point* comm_point_create_tcp(struct comm_base *base, int fd, int num, size_t bufsize, - comm_point_callback_t* callback, void* callback_arg) + comm_point_callback_type* callback, void* callback_arg) { struct comm_point* c = (struct comm_point*)calloc(1, sizeof(struct comm_point)); @@ -1717,19 +1831,29 @@ comm_point_create_tcp(struct comm_base *base, int fd, int num, size_t bufsize, c->do_not_close = 0; c->tcp_do_toggle_rw = 0; c->tcp_check_nb_connect = 0; +#ifdef USE_MSG_FASTOPEN + c->tcp_do_fastopen = 0; +#endif +#ifdef USE_DNSCRYPT + c->dnscrypt = 0; + c->dnscrypt_buffer = NULL; +#endif c->callback = NULL; c->cb_arg = NULL; - evbits = EV_READ | EV_PERSIST; - /* libevent stuff */ - event_set(&c->ev->ev, c->fd, evbits, comm_point_tcp_accept_callback, c); - if(event_base_set(base->eb->base, &c->ev->ev) != 0 || - event_add(&c->ev->ev, c->timeout) != 0 ) - { + evbits = UB_EV_READ | UB_EV_PERSIST; + /* ub_event stuff */ + c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits, + comm_point_tcp_accept_callback, c); + if(c->ev->ev == NULL) { + log_err("could not baseset tcpacc event"); + comm_point_delete(c); + return NULL; + } + if (ub_event_add(c->ev->ev, c->timeout) != 0) { log_err("could not add tcpacc event"); comm_point_delete(c); return NULL; } - /* now prealloc the tcp handlers */ for(i=0; i<num; i++) { c->tcp_handlers[i] = comm_point_create_tcp_handler(base, @@ -1745,7 +1869,7 @@ comm_point_create_tcp(struct comm_base *base, int fd, int num, size_t bufsize, struct comm_point* comm_point_create_tcp_out(struct comm_base *base, size_t bufsize, - comm_point_callback_t* callback, void* callback_arg) + comm_point_callback_type* callback, void* callback_arg) { struct comm_point* c = (struct comm_point*)calloc(1, sizeof(struct comm_point)); @@ -1779,14 +1903,22 @@ comm_point_create_tcp_out(struct comm_base *base, size_t bufsize, c->do_not_close = 0; c->tcp_do_toggle_rw = 1; c->tcp_check_nb_connect = 1; +#ifdef USE_MSG_FASTOPEN + c->tcp_do_fastopen = 1; +#endif +#ifdef USE_DNSCRYPT + c->dnscrypt = 0; + c->dnscrypt_buffer = c->buffer; +#endif c->repinfo.c = c; c->callback = callback; c->cb_arg = callback_arg; - evbits = EV_PERSIST | EV_WRITE; - event_set(&c->ev->ev, c->fd, evbits, comm_point_tcp_handle_callback, c); - if(event_base_set(base->eb->base, &c->ev->ev) != 0) + evbits = UB_EV_PERSIST | UB_EV_WRITE; + c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits, + comm_point_tcp_handle_callback, c); + if(c->ev->ev == NULL) { - log_err("could not basetset tcpout event"); + log_err("could not baseset tcpout event"); sldns_buffer_free(c->buffer); free(c->ev); free(c); @@ -1798,7 +1930,7 @@ comm_point_create_tcp_out(struct comm_base *base, size_t bufsize, struct comm_point* comm_point_create_local(struct comm_base *base, int fd, size_t bufsize, - comm_point_callback_t* callback, void* callback_arg) + comm_point_callback_type* callback, void* callback_arg) { struct comm_point* c = (struct comm_point*)calloc(1, sizeof(struct comm_point)); @@ -1832,16 +1964,28 @@ comm_point_create_local(struct comm_base *base, int fd, size_t bufsize, c->do_not_close = 1; c->tcp_do_toggle_rw = 0; c->tcp_check_nb_connect = 0; +#ifdef USE_MSG_FASTOPEN + c->tcp_do_fastopen = 0; +#endif +#ifdef USE_DNSCRYPT + c->dnscrypt = 0; + c->dnscrypt_buffer = c->buffer; +#endif c->callback = callback; c->cb_arg = callback_arg; - /* libevent stuff */ - evbits = EV_PERSIST | EV_READ; - event_set(&c->ev->ev, c->fd, evbits, comm_point_local_handle_callback, - c); - if(event_base_set(base->eb->base, &c->ev->ev) != 0 || - event_add(&c->ev->ev, c->timeout) != 0 ) - { + /* ub_event stuff */ + evbits = UB_EV_PERSIST | UB_EV_READ; + c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits, + comm_point_local_handle_callback, c); + if(c->ev->ev == NULL) { + log_err("could not baseset localhdl event"); + free(c->ev); + free(c); + return NULL; + } + if (ub_event_add(c->ev->ev, c->timeout) != 0) { log_err("could not add localhdl event"); + ub_event_free(c->ev->ev); free(c->ev); free(c); return NULL; @@ -1851,7 +1995,7 @@ comm_point_create_local(struct comm_base *base, int fd, size_t bufsize, struct comm_point* comm_point_create_raw(struct comm_base* base, int fd, int writing, - comm_point_callback_t* callback, void* callback_arg) + comm_point_callback_type* callback, void* callback_arg) { struct comm_point* c = (struct comm_point*)calloc(1, sizeof(struct comm_point)); @@ -1880,18 +2024,30 @@ comm_point_create_raw(struct comm_base* base, int fd, int writing, c->do_not_close = 1; c->tcp_do_toggle_rw = 0; c->tcp_check_nb_connect = 0; +#ifdef USE_MSG_FASTOPEN + c->tcp_do_fastopen = 0; +#endif +#ifdef USE_DNSCRYPT + c->dnscrypt = 0; + c->dnscrypt_buffer = c->buffer; +#endif c->callback = callback; c->cb_arg = callback_arg; - /* libevent stuff */ + /* ub_event stuff */ if(writing) - evbits = EV_PERSIST | EV_WRITE; - else evbits = EV_PERSIST | EV_READ; - event_set(&c->ev->ev, c->fd, evbits, comm_point_raw_handle_callback, - c); - if(event_base_set(base->eb->base, &c->ev->ev) != 0 || - event_add(&c->ev->ev, c->timeout) != 0 ) - { + evbits = UB_EV_PERSIST | UB_EV_WRITE; + else evbits = UB_EV_PERSIST | UB_EV_READ; + c->ev->ev = ub_event_new(base->eb->base, c->fd, evbits, + comm_point_raw_handle_callback, c); + if(c->ev->ev == NULL) { + log_err("could not baseset rawhdl event"); + free(c->ev); + free(c); + return NULL; + } + if (ub_event_add(c->ev->ev, c->timeout) != 0) { log_err("could not add rawhdl event"); + ub_event_free(c->ev->ev); free(c->ev); free(c); return NULL; @@ -1905,7 +2061,7 @@ comm_point_close(struct comm_point* c) if(!c) return; if(c->fd != -1) - if(event_del(&c->ev->ev) != 0) { + if(ub_event_del(c->ev->ev) != 0) { log_err("could not event_del on close"); } /* close fd after removing from event lists, or epoll.. is messed up */ @@ -1939,8 +2095,15 @@ comm_point_delete(struct comm_point* c) free(c->tcp_handlers); } free(c->timeout); - if(c->type == comm_tcp || c->type == comm_local) + if(c->type == comm_tcp || c->type == comm_local) { sldns_buffer_free(c->buffer); +#ifdef USE_DNSCRYPT + if(c->dnscrypt && c->dnscrypt_buffer != c->buffer) { + sldns_buffer_free(c->dnscrypt_buffer); + } +#endif + } + ub_event_free(c->ev->ev); free(c->ev); free(c); } @@ -1948,14 +2111,23 @@ comm_point_delete(struct comm_point* c) void comm_point_send_reply(struct comm_reply *repinfo) { + struct sldns_buffer* buffer; log_assert(repinfo && repinfo->c); +#ifdef USE_DNSCRYPT + buffer = repinfo->c->dnscrypt_buffer; + if(!dnsc_handle_uncurved_request(repinfo)) { + return; + } +#else + buffer = repinfo->c->buffer; +#endif if(repinfo->c->type == comm_udp) { if(repinfo->srctype) comm_point_send_udp_msg_if(repinfo->c, - repinfo->c->buffer, (struct sockaddr*)&repinfo->addr, + buffer, (struct sockaddr*)&repinfo->addr, repinfo->addrlen, repinfo); else - comm_point_send_udp_msg(repinfo->c, repinfo->c->buffer, + comm_point_send_udp_msg(repinfo->c, buffer, (struct sockaddr*)&repinfo->addr, repinfo->addrlen); #ifdef USE_DNSTAP if(repinfo->c->dtenv != NULL && @@ -1970,7 +2142,8 @@ comm_point_send_reply(struct comm_reply *repinfo) dt_msg_send_client_response(repinfo->c->tcp_parent->dtenv, &repinfo->addr, repinfo->c->type, repinfo->c->buffer); #endif - comm_point_start_listening(repinfo->c, -1, TCP_QUERY_TIMEOUT); + comm_point_start_listening(repinfo->c, -1, + repinfo->c->tcp_timeout_msec); } } @@ -1990,13 +2163,13 @@ void comm_point_stop_listening(struct comm_point* c) { verbose(VERB_ALGO, "comm point stop listening %d", c->fd); - if(event_del(&c->ev->ev) != 0) { + if(ub_event_del(c->ev->ev) != 0) { log_err("event_del error to stoplisten"); } } void -comm_point_start_listening(struct comm_point* c, int newfd, int sec) +comm_point_start_listening(struct comm_point* c, int newfd, int msec) { verbose(VERB_ALGO, "comm point start listening %d", c->fd==-1?newfd:c->fd); @@ -2004,7 +2177,7 @@ comm_point_start_listening(struct comm_point* c, int newfd, int sec) /* no use to start listening no free slots. */ return; } - if(sec != -1 && sec != 0) { + if(msec != -1 && msec != 0) { if(!c->timeout) { c->timeout = (struct timeval*)malloc(sizeof( struct timeval)); @@ -2013,17 +2186,17 @@ comm_point_start_listening(struct comm_point* c, int newfd, int sec) return; } } - c->ev->ev.ev_events |= EV_TIMEOUT; + ub_event_add_bits(c->ev->ev, UB_EV_TIMEOUT); #ifndef S_SPLINT_S /* splint fails on struct timeval. */ - c->timeout->tv_sec = sec; - c->timeout->tv_usec = 0; + c->timeout->tv_sec = msec/1000; + c->timeout->tv_usec = (msec%1000)*1000; #endif /* S_SPLINT_S */ } if(c->type == comm_tcp) { - c->ev->ev.ev_events &= ~(EV_READ|EV_WRITE); + ub_event_del_bits(c->ev->ev, UB_EV_READ|UB_EV_WRITE); if(c->tcp_is_reading) - c->ev->ev.ev_events |= EV_READ; - else c->ev->ev.ev_events |= EV_WRITE; + ub_event_add_bits(c->ev->ev, UB_EV_READ); + else ub_event_add_bits(c->ev->ev, UB_EV_WRITE); } if(newfd != -1) { if(c->fd != -1) { @@ -2034,9 +2207,9 @@ comm_point_start_listening(struct comm_point* c, int newfd, int sec) #endif } c->fd = newfd; - c->ev->ev.ev_fd = c->fd; + ub_event_set_fd(c->ev->ev, c->fd); } - if(event_add(&c->ev->ev, sec==0?NULL:c->timeout) != 0) { + if(ub_event_add(c->ev->ev, msec==0?NULL:c->timeout) != 0) { log_err("event_add failed. in cpsl."); } } @@ -2044,13 +2217,13 @@ comm_point_start_listening(struct comm_point* c, int newfd, int sec) void comm_point_listen_for_rw(struct comm_point* c, int rd, int wr) { verbose(VERB_ALGO, "comm point listen_for_rw %d %d", c->fd, wr); - if(event_del(&c->ev->ev) != 0) { + if(ub_event_del(c->ev->ev) != 0) { log_err("event_del error to cplf"); } - c->ev->ev.ev_events &= ~(EV_READ|EV_WRITE); - if(rd) c->ev->ev.ev_events |= EV_READ; - if(wr) c->ev->ev.ev_events |= EV_WRITE; - if(event_add(&c->ev->ev, c->timeout) != 0) { + ub_event_del_bits(c->ev->ev, UB_EV_READ|UB_EV_WRITE); + if(rd) ub_event_add_bits(c->ev->ev, UB_EV_READ); + if(wr) ub_event_add_bits(c->ev->ev, UB_EV_WRITE); + if(ub_event_add(c->ev->ev, c->timeout) != 0) { log_err("event_add failed. in cplf."); } } @@ -2063,8 +2236,15 @@ size_t comm_point_get_mem(struct comm_point* c) s = sizeof(*c) + sizeof(*c->ev); if(c->timeout) s += sizeof(*c->timeout); - if(c->type == comm_tcp || c->type == comm_local) + if(c->type == comm_tcp || c->type == comm_local) { s += sizeof(*c->buffer) + sldns_buffer_capacity(c->buffer); +#ifdef USE_DNSCRYPT + s += sizeof(*c->dnscrypt_buffer); + if(c->buffer != c->dnscrypt_buffer) { + s += sldns_buffer_capacity(c->dnscrypt_buffer); + } +#endif + } if(c->type == comm_tcp_accept) { int i; for(i=0; i<c->max_tcp_count; i++) @@ -2076,29 +2256,24 @@ size_t comm_point_get_mem(struct comm_point* c) struct comm_timer* comm_timer_create(struct comm_base* base, void (*cb)(void*), void* cb_arg) { - struct comm_timer *tm = (struct comm_timer*)calloc(1, - sizeof(struct comm_timer)); - if(!tm) - return NULL; - tm->ev_timer = (struct internal_timer*)calloc(1, + struct internal_timer *tm = (struct internal_timer*)calloc(1, sizeof(struct internal_timer)); - if(!tm->ev_timer) { + if(!tm) { log_err("malloc failed"); - free(tm); return NULL; } - tm->ev_timer->base = base; - tm->callback = cb; - tm->cb_arg = cb_arg; - event_set(&tm->ev_timer->ev, -1, EV_TIMEOUT, - comm_timer_callback, tm); - if(event_base_set(base->eb->base, &tm->ev_timer->ev) != 0) { + tm->super.ev_timer = tm; + tm->base = base; + tm->super.callback = cb; + tm->super.cb_arg = cb_arg; + tm->ev = ub_event_new(base->eb->base, -1, UB_EV_TIMEOUT, + comm_timer_callback, &tm->super); + if(tm->ev == NULL) { log_err("timer_create: event_base_set failed."); - free(tm->ev_timer); free(tm); return NULL; } - return tm; + return &tm->super; } void @@ -2106,7 +2281,7 @@ comm_timer_disable(struct comm_timer* timer) { if(!timer) return; - evtimer_del(&timer->ev_timer->ev); + ub_timer_del(timer->ev_timer->ev); timer->ev_timer->enabled = 0; } @@ -2116,12 +2291,8 @@ comm_timer_set(struct comm_timer* timer, struct timeval* tv) log_assert(tv); if(timer->ev_timer->enabled) comm_timer_disable(timer); - event_set(&timer->ev_timer->ev, -1, EV_TIMEOUT, - comm_timer_callback, timer); - if(event_base_set(timer->ev_timer->base->eb->base, - &timer->ev_timer->ev) != 0) - log_err("comm_timer_set: set_base failed."); - if(evtimer_add(&timer->ev_timer->ev, tv) != 0) + if(ub_timer_add(timer->ev_timer->ev, timer->ev_timer->base->eb->base, + comm_timer_callback, timer, tv) != 0) log_err("comm_timer_set: evtimer_add failed."); timer->ev_timer->enabled = 1; } @@ -2132,17 +2303,20 @@ comm_timer_delete(struct comm_timer* timer) if(!timer) return; comm_timer_disable(timer); + /* Free the sub struct timer->ev_timer derived from the super struct timer. + * i.e. assert(timer == timer->ev_timer) + */ + ub_event_free(timer->ev_timer->ev); free(timer->ev_timer); - free(timer); } void comm_timer_callback(int ATTR_UNUSED(fd), short event, void* arg) { struct comm_timer* tm = (struct comm_timer*)arg; - if(!(event&EV_TIMEOUT)) + if(!(event&UB_EV_TIMEOUT)) return; - comm_base_now(tm->ev_timer->base); + ub_comm_base_now(tm->ev_timer->base); tm->ev_timer->enabled = 0; fptr_ok(fptr_whitelist_comm_timer(tm->callback)); (*tm->callback)(tm->cb_arg); @@ -2155,9 +2329,9 @@ comm_timer_is_set(struct comm_timer* timer) } size_t -comm_timer_get_mem(struct comm_timer* timer) +comm_timer_get_mem(struct comm_timer* ATTR_UNUSED(timer)) { - return sizeof(*timer) + sizeof(struct internal_timer); + return sizeof(struct internal_timer); } struct comm_signal* @@ -2181,9 +2355,9 @@ void comm_signal_callback(int sig, short event, void* arg) { struct comm_signal* comsig = (struct comm_signal*)arg; - if(!(event & EV_SIGNAL)) + if(!(event & UB_EV_SIGNAL)) return; - comm_base_now(comsig->base); + ub_comm_base_now(comsig->base); fptr_ok(fptr_whitelist_comm_signal(comsig->callback)); (*comsig->callback)(sig, comsig->cb_arg); } @@ -2199,14 +2373,16 @@ comm_signal_bind(struct comm_signal* comsig, int sig) } log_assert(comsig); /* add signal event */ - signal_set(&entry->ev, sig, comm_signal_callback, comsig); - if(event_base_set(comsig->base->eb->base, &entry->ev) != 0) { - log_err("Could not set signal base"); + entry->ev = ub_signal_new(comsig->base->eb->base, sig, + comm_signal_callback, comsig); + if(entry->ev == NULL) { + log_err("Could not create signal event"); free(entry); return 0; } - if(signal_add(&entry->ev, NULL) != 0) { + if(ub_signal_add(entry->ev, NULL) != 0) { log_err("Could not add signal handler"); + ub_event_free(entry->ev); free(entry); return 0; } @@ -2225,7 +2401,8 @@ comm_signal_delete(struct comm_signal* comsig) p=comsig->ev_signal; while(p) { np = p->next; - signal_del(&p->ev); + ub_signal_del(p->ev); + ub_event_free(p->ev); free(p); p = np; } diff --git a/external/unbound/util/netevent.h b/external/unbound/util/netevent.h index 4b87cdba9..cb8eb86b9 100644 --- a/external/unbound/util/netevent.h +++ b/external/unbound/util/netevent.h @@ -60,18 +60,20 @@ #ifndef NET_EVENT_H #define NET_EVENT_H +#include "dnscrypt/dnscrypt.h" + struct sldns_buffer; struct comm_point; struct comm_reply; -struct event_base; +struct ub_event_base; /* internal event notification data storage structure. */ struct internal_event; struct internal_base; -struct internal_timer; +struct internal_timer; /* A sub struct of the comm_timer super struct */ /** callback from communication point function type */ -typedef int comm_point_callback_t(struct comm_point*, void*, int, +typedef int comm_point_callback_type(struct comm_point*, void*, int, struct comm_reply*); /** to pass no_error to callback function */ @@ -114,6 +116,13 @@ struct comm_reply { socklen_t addrlen; /** return type 0 (none), 4(IP4), 6(IP6) */ int srctype; + /* DnsCrypt context */ +#ifdef USE_DNSCRYPT + uint8_t client_nonce[crypto_box_HALF_NONCEBYTES]; + uint8_t nmkey[crypto_box_BEFORENMBYTES]; + const KeyPair *keypair; + int is_dnscrypted; +#endif /** the return source interface data */ union { #ifdef IPV6_PKTINFO @@ -127,6 +136,8 @@ struct comm_reply { } /** variable with return source data */ pktinfo; + /** max udp size for udp packets */ + size_t max_udp_size; }; /** @@ -225,9 +236,23 @@ struct comm_point { So that when that is done the callback is called. */ int tcp_do_toggle_rw; + /** timeout in msec for TCP wait times for this connection */ + int tcp_timeout_msec; + /** if set, checks for pending error from nonblocking connect() call.*/ int tcp_check_nb_connect; +#ifdef USE_MSG_FASTOPEN + /** used to track if the sendto() call should be done when using TFO. */ + int tcp_do_fastopen; +#endif + +#ifdef USE_DNSCRYPT + /** Is this a dnscrypt channel */ + int dnscrypt; + /** encrypted buffer pointer. Either to perthread, or own buffer or NULL */ + struct sldns_buffer* dnscrypt_buffer; +#endif /** number of queries outstanding on this socket, used by * outside network for udp ports */ int inuse; @@ -256,7 +281,7 @@ struct comm_point { For UDP this is done without changing the commpoint. In TCP it sets write state. */ - comm_point_callback_t* callback; + comm_point_callback_type* callback; /** argument to pass to callback. */ void *cb_arg; }; @@ -265,7 +290,7 @@ struct comm_point { * Structure only for making timeout events. */ struct comm_timer { - /** the internal event stuff */ + /** the internal event stuff (derived) */ struct internal_timer* ev_timer; /** callback function, takes user arg only */ @@ -301,12 +326,12 @@ struct comm_signal { struct comm_base* comm_base_create(int sigs); /** - * Create comm base that uses the given event_base (underlying event - * mechanism pointer). - * @param base: underlying lib event base. + * Create comm base that uses the given ub_event_base (underlying pluggable + * event mechanism pointer). + * @param base: underlying pluggable event base. * @return: the new comm base. NULL on error. */ -struct comm_base* comm_base_create_event(struct event_base* base); +struct comm_base* comm_base_create_event(struct ub_event_base* base); /** * Delete comm base structure but not the underlying lib event base. @@ -357,9 +382,9 @@ void comm_base_set_slow_accept_handlers(struct comm_base* b, /** * Access internal data structure (for util/tube.c on windows) * @param b: comm base - * @return event_base. Could be libevent, or internal event handler. + * @return ub_event_base. */ -struct event_base* comm_base_internal(struct comm_base* b); +struct ub_event_base* comm_base_internal(struct comm_base* b); /** * Create an UDP comm point. Calls malloc. @@ -374,7 +399,7 @@ struct event_base* comm_base_internal(struct comm_base* b); */ struct comm_point* comm_point_create_udp(struct comm_base* base, int fd, struct sldns_buffer* buffer, - comm_point_callback_t* callback, void* callback_arg); + comm_point_callback_type* callback, void* callback_arg); /** * Create an UDP with ancillary data comm point. Calls malloc. @@ -390,7 +415,7 @@ struct comm_point* comm_point_create_udp(struct comm_base* base, */ struct comm_point* comm_point_create_udp_ancil(struct comm_base* base, int fd, struct sldns_buffer* buffer, - comm_point_callback_t* callback, void* callback_arg); + comm_point_callback_type* callback, void* callback_arg); /** * Create a TCP listener comm point. Calls malloc. @@ -411,7 +436,7 @@ struct comm_point* comm_point_create_udp_ancil(struct comm_base* base, */ struct comm_point* comm_point_create_tcp(struct comm_base* base, int fd, int num, size_t bufsize, - comm_point_callback_t* callback, void* callback_arg); + comm_point_callback_type* callback, void* callback_arg); /** * Create an outgoing TCP commpoint. No file descriptor is opened, left at -1. @@ -422,7 +447,7 @@ struct comm_point* comm_point_create_tcp(struct comm_base* base, * @return: the commpoint or NULL on error. */ struct comm_point* comm_point_create_tcp_out(struct comm_base* base, - size_t bufsize, comm_point_callback_t* callback, void* callback_arg); + size_t bufsize, comm_point_callback_type* callback, void* callback_arg); /** * Create commpoint to listen to a local domain file descriptor. @@ -435,7 +460,7 @@ struct comm_point* comm_point_create_tcp_out(struct comm_base* base, */ struct comm_point* comm_point_create_local(struct comm_base* base, int fd, size_t bufsize, - comm_point_callback_t* callback, void* callback_arg); + comm_point_callback_type* callback, void* callback_arg); /** * Create commpoint to listen to a local domain pipe descriptor. @@ -448,7 +473,7 @@ struct comm_point* comm_point_create_local(struct comm_base* base, */ struct comm_point* comm_point_create_raw(struct comm_base* base, int fd, int writing, - comm_point_callback_t* callback, void* callback_arg); + comm_point_callback_type* callback, void* callback_arg); /** * Close a comm point fd. @@ -496,9 +521,10 @@ void comm_point_stop_listening(struct comm_point* c); * Start listening again for input on the comm point. * @param c: commpoint to enable again. * @param newfd: new fd, or -1 to leave fd be. - * @param sec: timeout in seconds, or -1 for no (change to the) timeout. + * @param msec: timeout in milliseconds, or -1 for no (change to the) timeout. + * So seconds*1000. */ -void comm_point_start_listening(struct comm_point* c, int newfd, int sec); +void comm_point_start_listening(struct comm_point* c, int newfd, int msec); /** * Stop listening and start listening again for reading or writing. diff --git a/external/unbound/util/rbtree.c b/external/unbound/util/rbtree.c index ee5446f6c..f031c9a13 100644 --- a/external/unbound/util/rbtree.c +++ b/external/unbound/util/rbtree.c @@ -50,7 +50,7 @@ #define RED 1 /** the NULL node, global alloc */ -rbnode_t rbtree_null_node = { +rbnode_type rbtree_null_node = { RBTREE_NULL, /* Parent. */ RBTREE_NULL, /* Left. */ RBTREE_NULL, /* Right. */ @@ -59,13 +59,14 @@ rbnode_t rbtree_null_node = { }; /** rotate subtree left (to preserve redblack property) */ -static void rbtree_rotate_left(rbtree_t *rbtree, rbnode_t *node); +static void rbtree_rotate_left(rbtree_type *rbtree, rbnode_type *node); /** rotate subtree right (to preserve redblack property) */ -static void rbtree_rotate_right(rbtree_t *rbtree, rbnode_t *node); +static void rbtree_rotate_right(rbtree_type *rbtree, rbnode_type *node); /** Fixup node colours when insert happened */ -static void rbtree_insert_fixup(rbtree_t *rbtree, rbnode_t *node); +static void rbtree_insert_fixup(rbtree_type *rbtree, rbnode_type *node); /** Fixup node colours when delete happened */ -static void rbtree_delete_fixup(rbtree_t* rbtree, rbnode_t* child, rbnode_t* child_parent); +static void rbtree_delete_fixup(rbtree_type* rbtree, rbnode_type* child, + rbnode_type* child_parent); /* * Creates a new red black tree, initializes and returns a pointer to it. @@ -73,13 +74,13 @@ static void rbtree_delete_fixup(rbtree_t* rbtree, rbnode_t* child, rbnode_t* chi * Return NULL on failure. * */ -rbtree_t * +rbtree_type * rbtree_create (int (*cmpf)(const void *, const void *)) { - rbtree_t *rbtree; + rbtree_type *rbtree; /* Allocate memory for it */ - rbtree = (rbtree_t *) malloc(sizeof(rbtree_t)); + rbtree = (rbtree_type *) malloc(sizeof(rbtree_type)); if (!rbtree) { return NULL; } @@ -91,7 +92,7 @@ rbtree_create (int (*cmpf)(const void *, const void *)) } void -rbtree_init(rbtree_t *rbtree, int (*cmpf)(const void *, const void *)) +rbtree_init(rbtree_type *rbtree, int (*cmpf)(const void *, const void *)) { /* Initialize it */ rbtree->root = RBTREE_NULL; @@ -104,9 +105,9 @@ rbtree_init(rbtree_t *rbtree, int (*cmpf)(const void *, const void *)) * */ static void -rbtree_rotate_left(rbtree_t *rbtree, rbnode_t *node) +rbtree_rotate_left(rbtree_type *rbtree, rbnode_type *node) { - rbnode_t *right = node->right; + rbnode_type *right = node->right; node->right = right->left; if (right->left != RBTREE_NULL) right->left->parent = node; @@ -131,9 +132,9 @@ rbtree_rotate_left(rbtree_t *rbtree, rbnode_t *node) * */ static void -rbtree_rotate_right(rbtree_t *rbtree, rbnode_t *node) +rbtree_rotate_right(rbtree_type *rbtree, rbnode_type *node) { - rbnode_t *left = node->left; + rbnode_type *left = node->left; node->left = left->right; if (left->right != RBTREE_NULL) left->right->parent = node; @@ -154,9 +155,9 @@ rbtree_rotate_right(rbtree_t *rbtree, rbnode_t *node) } static void -rbtree_insert_fixup(rbtree_t *rbtree, rbnode_t *node) +rbtree_insert_fixup(rbtree_type *rbtree, rbnode_type *node) { - rbnode_t *uncle; + rbnode_type *uncle; /* While not at the root and need fixing... */ while (node != rbtree->root && node->parent->color == RED) { @@ -223,15 +224,15 @@ rbtree_insert_fixup(rbtree_t *rbtree, rbnode_t *node) * Returns NULL on failure or the pointer to the newly added node * otherwise. */ -rbnode_t * -rbtree_insert (rbtree_t *rbtree, rbnode_t *data) +rbnode_type * +rbtree_insert (rbtree_type *rbtree, rbnode_type *data) { /* XXX Not necessary, but keeps compiler quiet... */ int r = 0; /* We start at the root of the tree */ - rbnode_t *node = rbtree->root; - rbnode_t *parent = RBTREE_NULL; + rbnode_type *node = rbtree->root; + rbnode_type *parent = RBTREE_NULL; fptr_ok(fptr_whitelist_rbtree_cmp(rbtree->cmp)); /* Lets find the new parent... */ @@ -276,10 +277,10 @@ rbtree_insert (rbtree_t *rbtree, rbnode_t *data) * Searches the red black tree, returns the data if key is found or NULL otherwise. * */ -rbnode_t * -rbtree_search (rbtree_t *rbtree, const void *key) +rbnode_type * +rbtree_search (rbtree_type *rbtree, const void *key) { - rbnode_t *node; + rbnode_type *node; if (rbtree_find_less_equal(rbtree, key, &node)) { return node; @@ -295,13 +296,14 @@ static void swap_int8(uint8_t* x, uint8_t* y) } /** helpers for delete: swap node pointers */ -static void swap_np(rbnode_t** x, rbnode_t** y) +static void swap_np(rbnode_type** x, rbnode_type** y) { - rbnode_t* t = *x; *x = *y; *y = t; + rbnode_type* t = *x; *x = *y; *y = t; } /** Update parent pointers of child trees of 'parent' */ -static void change_parent_ptr(rbtree_t* rbtree, rbnode_t* parent, rbnode_t* old, rbnode_t* new) +static void change_parent_ptr(rbtree_type* rbtree, rbnode_type* parent, + rbnode_type* old, rbnode_type* new) { if(parent == RBTREE_NULL) { @@ -315,18 +317,19 @@ static void change_parent_ptr(rbtree_t* rbtree, rbnode_t* parent, rbnode_t* old, if(parent->right == old) parent->right = new; } /** Update parent pointer of a node 'child' */ -static void change_child_ptr(rbnode_t* child, rbnode_t* old, rbnode_t* new) +static void change_child_ptr(rbnode_type* child, rbnode_type* old, + rbnode_type* new) { if(child == RBTREE_NULL) return; log_assert(child->parent == old || child->parent == new); if(child->parent == old) child->parent = new; } -rbnode_t* -rbtree_delete(rbtree_t *rbtree, const void *key) +rbnode_type* +rbtree_delete(rbtree_type *rbtree, const void *key) { - rbnode_t *to_delete; - rbnode_t *child; + rbnode_type *to_delete; + rbnode_type *child; if((to_delete = rbtree_search(rbtree, key)) == 0) return 0; rbtree->count--; @@ -334,11 +337,11 @@ rbtree_delete(rbtree_t *rbtree, const void *key) if(to_delete->left != RBTREE_NULL && to_delete->right != RBTREE_NULL) { /* swap with smallest from right subtree (or largest from left) */ - rbnode_t *smright = to_delete->right; + rbnode_type *smright = to_delete->right; while(smright->left != RBTREE_NULL) smright = smright->left; /* swap the smright and to_delete elements in the tree, - * but the rbnode_t is first part of user data struct + * but the rbnode_type is first part of user data struct * so cannot just swap the keys and data pointers. Instead * readjust the pointers left,right,parent */ @@ -400,9 +403,10 @@ rbtree_delete(rbtree_t *rbtree, const void *key) return to_delete; } -static void rbtree_delete_fixup(rbtree_t* rbtree, rbnode_t* child, rbnode_t* child_parent) +static void rbtree_delete_fixup(rbtree_type* rbtree, rbnode_type* child, + rbnode_type* child_parent) { - rbnode_t* sibling; + rbnode_type* sibling; int go_up = 1; /* determine sibling to the node that is one-black short */ @@ -504,10 +508,11 @@ static void rbtree_delete_fixup(rbtree_t* rbtree, rbnode_t* child, rbnode_t* chi } int -rbtree_find_less_equal(rbtree_t *rbtree, const void *key, rbnode_t **result) +rbtree_find_less_equal(rbtree_type *rbtree, const void *key, + rbnode_type **result) { int r; - rbnode_t *node; + rbnode_type *node; log_assert(result); @@ -540,19 +545,19 @@ rbtree_find_less_equal(rbtree_t *rbtree, const void *key, rbnode_t **result) * Finds the first element in the red black tree * */ -rbnode_t * -rbtree_first (rbtree_t *rbtree) +rbnode_type * +rbtree_first (rbtree_type *rbtree) { - rbnode_t *node; + rbnode_type *node; for (node = rbtree->root; node->left != RBTREE_NULL; node = node->left); return node; } -rbnode_t * -rbtree_last (rbtree_t *rbtree) +rbnode_type * +rbtree_last (rbtree_type *rbtree) { - rbnode_t *node; + rbnode_type *node; for (node = rbtree->root; node->right != RBTREE_NULL; node = node->right); return node; @@ -562,10 +567,10 @@ rbtree_last (rbtree_t *rbtree) * Returns the next node... * */ -rbnode_t * -rbtree_next (rbnode_t *node) +rbnode_type * +rbtree_next (rbnode_type *node) { - rbnode_t *parent; + rbnode_type *parent; if (node->right != RBTREE_NULL) { /* One right, then keep on going left... */ @@ -581,10 +586,10 @@ rbtree_next (rbnode_t *node) return node; } -rbnode_t * -rbtree_previous(rbnode_t *node) +rbnode_type * +rbtree_previous(rbnode_type *node) { - rbnode_t *parent; + rbnode_type *parent; if (node->left != RBTREE_NULL) { /* One left, then keep on going right... */ @@ -602,7 +607,7 @@ rbtree_previous(rbnode_t *node) /** recursive descent traverse */ static void -traverse_post(void (*func)(rbnode_t*, void*), void* arg, rbnode_t* node) +traverse_post(void (*func)(rbnode_type*, void*), void* arg, rbnode_type* node) { if(!node || node == RBTREE_NULL) return; @@ -614,7 +619,8 @@ traverse_post(void (*func)(rbnode_t*, void*), void* arg, rbnode_t* node) } void -traverse_postorder(rbtree_t* tree, void (*func)(rbnode_t*, void*), void* arg) +traverse_postorder(rbtree_type* tree, void (*func)(rbnode_type*, void*), + void* arg) { traverse_post(func, arg, tree->root); } diff --git a/external/unbound/util/rbtree.h b/external/unbound/util/rbtree.h index 50c84bbab..dfcf09ac6 100644 --- a/external/unbound/util/rbtree.h +++ b/external/unbound/util/rbtree.h @@ -45,40 +45,40 @@ /** * This structure must be the first member of the data structure in - * the rbtree. This allows easy casting between an rbnode_t and the + * the rbtree. This allows easy casting between an rbnode_type and the * user data (poor man's inheritance). */ -typedef struct rbnode_t rbnode_t; +typedef struct rbnode_type rbnode_type; /** - * The rbnode_t struct definition. + * The rbnode_type struct definition. */ -struct rbnode_t { +struct rbnode_type { /** parent in rbtree, RBTREE_NULL for root */ - rbnode_t *parent; + rbnode_type *parent; /** left node (smaller items) */ - rbnode_t *left; + rbnode_type *left; /** right node (larger items) */ - rbnode_t *right; + rbnode_type *right; /** pointer to sorting key */ - const void *key; + const void *key; /** colour of this node */ - uint8_t color; + uint8_t color; }; /** The nullpointer, points to empty node */ #define RBTREE_NULL &rbtree_null_node /** the global empty node */ -extern rbnode_t rbtree_null_node; +extern rbnode_type rbtree_null_node; /** An entire red black tree */ -typedef struct rbtree_t rbtree_t; +typedef struct rbtree_type rbtree_type; /** definition for tree struct */ -struct rbtree_t { +struct rbtree_type { /** The root of the red-black tree */ - rbnode_t *root; + rbnode_type *root; /** The number of the nodes in the tree */ - size_t count; + size_t count; /** * Key compare function. <0,0,>0 like strcmp. @@ -92,14 +92,14 @@ struct rbtree_t { * @param cmpf: compare function (like strcmp) takes pointers to two keys. * @return: new tree, empty. */ -rbtree_t *rbtree_create(int (*cmpf)(const void *, const void *)); +rbtree_type *rbtree_create(int (*cmpf)(const void *, const void *)); /** * Init a new tree (malloced by caller) with given key compare function. * @param rbtree: uninitialised memory for new tree, returned empty. * @param cmpf: compare function (like strcmp) takes pointers to two keys. */ -void rbtree_init(rbtree_t *rbtree, int (*cmpf)(const void *, const void *)); +void rbtree_init(rbtree_type *rbtree, int (*cmpf)(const void *, const void *)); /** * Insert data into the tree. @@ -107,7 +107,7 @@ void rbtree_init(rbtree_t *rbtree, int (*cmpf)(const void *, const void *)); * @param data: element to insert. * @return: data ptr or NULL if key already present. */ -rbnode_t *rbtree_insert(rbtree_t *rbtree, rbnode_t *data); +rbnode_type *rbtree_insert(rbtree_type *rbtree, rbnode_type *data); /** * Delete element from tree. @@ -116,7 +116,7 @@ rbnode_t *rbtree_insert(rbtree_t *rbtree, rbnode_t *data); * @return: node that is now unlinked from the tree. User to delete it. * returns 0 if node not present */ -rbnode_t *rbtree_delete(rbtree_t *rbtree, const void *key); +rbnode_type *rbtree_delete(rbtree_type *rbtree, const void *key); /** * Find key in tree. Returns NULL if not found. @@ -124,7 +124,7 @@ rbnode_t *rbtree_delete(rbtree_t *rbtree, const void *key); * @param key: key that must match. * @return: node that fits or NULL. */ -rbnode_t *rbtree_search(rbtree_t *rbtree, const void *key); +rbnode_type *rbtree_search(rbtree_type *rbtree, const void *key); /** * Find, but match does not have to be exact. @@ -135,45 +135,45 @@ rbnode_t *rbtree_search(rbtree_t *rbtree, const void *key); * @return: true if exact match in result. Else result points to <= element, * or NULL if key is smaller than the smallest key. */ -int rbtree_find_less_equal(rbtree_t *rbtree, const void *key, - rbnode_t **result); +int rbtree_find_less_equal(rbtree_type *rbtree, const void *key, + rbnode_type **result); /** * Returns first (smallest) node in the tree * @param rbtree: tree * @return: smallest element or NULL if tree empty. */ -rbnode_t *rbtree_first(rbtree_t *rbtree); +rbnode_type *rbtree_first(rbtree_type *rbtree); /** * Returns last (largest) node in the tree * @param rbtree: tree * @return: largest element or NULL if tree empty. */ -rbnode_t *rbtree_last(rbtree_t *rbtree); +rbnode_type *rbtree_last(rbtree_type *rbtree); /** * Returns next larger node in the tree * @param rbtree: tree * @return: next larger element or NULL if no larger in tree. */ -rbnode_t *rbtree_next(rbnode_t *rbtree); +rbnode_type *rbtree_next(rbnode_type *rbtree); /** * Returns previous smaller node in the tree * @param rbtree: tree * @return: previous smaller element or NULL if no previous in tree. */ -rbnode_t *rbtree_previous(rbnode_t *rbtree); +rbnode_type *rbtree_previous(rbnode_type *rbtree); /** - * Call with node=variable of struct* with rbnode_t as first element. + * Call with node=variable of struct* with rbnode_type as first element. * with type is the type of a pointer to that struct. */ #define RBTREE_FOR(node, type, rbtree) \ for(node=(type)rbtree_first(rbtree); \ - (rbnode_t*)node != RBTREE_NULL; \ - node = (type)rbtree_next((rbnode_t*)node)) + (rbnode_type*)node != RBTREE_NULL; \ + node = (type)rbtree_next((rbnode_type*)node)) /** * Call function for all elements in the redblack tree, such that @@ -186,7 +186,7 @@ rbnode_t *rbtree_previous(rbnode_t *rbtree); * The function must not alter the rbtree. * @param arg: user argument. */ -void traverse_postorder(rbtree_t* tree, void (*func)(rbnode_t*, void*), +void traverse_postorder(rbtree_type* tree, void (*func)(rbnode_type*, void*), void* arg); #endif /* UTIL_RBTREE_H_ */ diff --git a/external/unbound/util/shm_side/shm_main.c b/external/unbound/util/shm_side/shm_main.c new file mode 100644 index 000000000..cab9aed56 --- /dev/null +++ b/external/unbound/util/shm_side/shm_main.c @@ -0,0 +1,286 @@ +/* + * util/shm_side/shm_main.c - SHM for statistics transport + * + * Copyright (c) 2017, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * + * This file contains functions for the SHM implementation. + */ + +#include "config.h" +#include <ctype.h> +#include <stdarg.h> +#ifdef HAVE_SYS_IPC_H +#include <sys/ipc.h> +#endif +#ifdef HAVE_SYS_SHM_H +#include <sys/shm.h> +#endif +#include <sys/time.h> +#include <errno.h> +#include "shm_main.h" +#include "daemon/daemon.h" +#include "daemon/worker.h" +#include "daemon/stats.h" +#include "services/mesh.h" +#include "services/cache/rrset.h" +#include "services/cache/infra.h" +#include "validator/validator.h" +#include "util/config_file.h" +#include "util/fptr_wlist.h" +#include "util/log.h" + +#ifdef HAVE_SHMGET +/** subtract timers and the values do not overflow or become negative */ +static void +timeval_subtract(struct timeval* d, const struct timeval* end, + const struct timeval* start) +{ +#ifndef S_SPLINT_S + time_t end_usec = end->tv_usec; + d->tv_sec = end->tv_sec - start->tv_sec; + if(end_usec < start->tv_usec) { + end_usec += 1000000; + d->tv_sec--; + } + d->tv_usec = end_usec - start->tv_usec; +#endif +} +#endif /* HAVE_SHMGET */ + +int shm_main_init(struct daemon* daemon) +{ +#ifdef HAVE_SHMGET + struct shm_stat_info *shm_stat; + size_t shm_size; + + /* sanitize */ + if(!daemon) + return 0; + if(!daemon->cfg->shm_enable) + return 1; + if(daemon->cfg->stat_interval == 0) + log_warn("shm-enable is yes but statistics-interval is 0"); + + /* Statistics to maintain the number of thread + total */ + shm_size = (sizeof(struct stats_info) * (daemon->num + 1)); + + /* Allocation of needed memory */ + daemon->shm_info = (struct shm_main_info*)calloc(1, shm_size); + + /* Sanitize */ + if(!daemon->shm_info) { + log_err("shm fail: malloc failure"); + return 0; + } + + daemon->shm_info->key = daemon->cfg->shm_key; + + /* Check for previous create SHM */ + daemon->shm_info->id_ctl = shmget(daemon->shm_info->key, sizeof(int), SHM_R); + daemon->shm_info->id_arr = shmget(daemon->shm_info->key + 1, sizeof(int), SHM_R); + + /* Destroy previous SHM */ + if (daemon->shm_info->id_ctl >= 0) + shmctl(daemon->shm_info->id_ctl, IPC_RMID, NULL); + + /* Destroy previous SHM */ + if (daemon->shm_info->id_arr >= 0) + shmctl(daemon->shm_info->id_arr, IPC_RMID, NULL); + + /* SHM: Create the segment */ + daemon->shm_info->id_ctl = shmget(daemon->shm_info->key, sizeof(struct shm_stat_info), IPC_CREAT | 0666); + + if (daemon->shm_info->id_ctl < 0) + { + log_err("SHM failed(id_ctl) cannot shmget(key %d) %s", + daemon->shm_info->key, strerror(errno)); + + /* Just release memory unused */ + free(daemon->shm_info); + + return 0; + } + + daemon->shm_info->id_arr = shmget(daemon->shm_info->key + 1, shm_size, IPC_CREAT | 0666); + + if (daemon->shm_info->id_arr < 0) + { + log_err("SHM failed(id_arr) cannot shmget(key %d + 1) %s", + daemon->shm_info->key, strerror(errno)); + + /* Just release memory unused */ + free(daemon->shm_info); + + return 0; + } + + /* SHM: attach the segment */ + daemon->shm_info->ptr_ctl = (struct shm_stat_info*) + shmat(daemon->shm_info->id_ctl, NULL, 0); + if(daemon->shm_info->ptr_ctl == (void *) -1) { + log_err("SHM failed(ctl) cannot shmat(%d) %s", + daemon->shm_info->id_ctl, strerror(errno)); + + /* Just release memory unused */ + free(daemon->shm_info); + + return 0; + } + + daemon->shm_info->ptr_arr = (struct stats_info*) + shmat(daemon->shm_info->id_arr, NULL, 0); + + if (daemon->shm_info->ptr_arr == (void *) -1) + { + log_err("SHM failed(arr) cannot shmat(%d) %s", + daemon->shm_info->id_arr, strerror(errno)); + + /* Just release memory unused */ + free(daemon->shm_info); + + return 0; + } + + /* Zero fill SHM to stand clean while is not filled by other events */ + memset(daemon->shm_info->ptr_ctl, 0, sizeof(struct shm_stat_info)); + memset(daemon->shm_info->ptr_arr, 0, shm_size); + + shm_stat = daemon->shm_info->ptr_ctl; + shm_stat->num_threads = daemon->num; + +#else + (void)daemon; +#endif /* HAVE_SHMGET */ + return 1; +} + +void shm_main_shutdown(struct daemon* daemon) +{ +#ifdef HAVE_SHMGET + /* web are OK, just disabled */ + if(!daemon->cfg->shm_enable) + return; + + verbose(VERB_DETAIL, "SHM shutdown - KEY [%d] - ID CTL [%d] ARR [%d] - PTR CTL [%p] ARR [%p]", + daemon->shm_info->key, daemon->shm_info->id_ctl, daemon->shm_info->id_arr, daemon->shm_info->ptr_ctl, daemon->shm_info->ptr_arr); + + /* Destroy previous SHM */ + if (daemon->shm_info->id_ctl >= 0) + shmctl(daemon->shm_info->id_ctl, IPC_RMID, NULL); + + if (daemon->shm_info->id_arr >= 0) + shmctl(daemon->shm_info->id_arr, IPC_RMID, NULL); + + if (daemon->shm_info->ptr_ctl) + shmdt(daemon->shm_info->ptr_ctl); + + if (daemon->shm_info->ptr_arr) + shmdt(daemon->shm_info->ptr_arr); + +#else + (void)daemon; +#endif /* HAVE_SHMGET */ +} + +void shm_main_run(struct worker *worker) +{ +#ifdef HAVE_SHMGET + struct shm_stat_info *shm_stat; + struct stats_info *stat_total; + struct stats_info *stat_info; + int modstack; + int offset; + + verbose(VERB_DETAIL, "SHM run - worker [%d] - daemon [%p] - timenow(%u) - timeboot(%u)", + worker->thread_num, worker->daemon, (unsigned)worker->env.now_tv->tv_sec, (unsigned)worker->daemon->time_boot.tv_sec); + + offset = worker->thread_num + 1; + stat_total = worker->daemon->shm_info->ptr_arr; + stat_info = worker->daemon->shm_info->ptr_arr + offset; + + /* Copy data to the current position */ + server_stats_compile(worker, stat_info, 0); + + /* First thread, zero fill total, and copy general info */ + if (worker->thread_num == 0) { + + /* Copy data to the current position */ + memset(stat_total, 0, sizeof(struct stats_info)); + + /* Point to data into SHM */ + shm_stat = worker->daemon->shm_info->ptr_ctl; + shm_stat->time.now = *worker->env.now_tv; + + timeval_subtract(&shm_stat->time.up, &shm_stat->time.now, &worker->daemon->time_boot); + timeval_subtract(&shm_stat->time.elapsed, &shm_stat->time.now, &worker->daemon->time_last_stat); + + shm_stat->mem.msg = slabhash_get_mem(worker->env.msg_cache); + shm_stat->mem.rrset = slabhash_get_mem(&worker->env.rrset_cache->table); + shm_stat->mem.val = 0; + shm_stat->mem.iter = 0; + + modstack = modstack_find(&worker->env.mesh->mods, "validator"); + if(modstack != -1) { + fptr_ok(fptr_whitelist_mod_get_mem(worker->env.mesh->mods.mod[modstack]->get_mem)); + shm_stat->mem.val = (*worker->env.mesh->mods.mod[modstack]->get_mem)(&worker->env, modstack); + } + modstack = modstack_find(&worker->env.mesh->mods, "iterator"); + if(modstack != -1) { + fptr_ok(fptr_whitelist_mod_get_mem(worker->env.mesh->mods.mod[modstack]->get_mem)); + shm_stat->mem.iter = (*worker->env.mesh->mods.mod[modstack]->get_mem)(&worker->env, modstack); + } + /* subnet mem value is available in shm, also when not enabled, + * to make the struct easier to memmap by other applications, + * independent of the configuration of unbound */ + shm_stat->mem.subnet = 0; +#ifdef CLIENT_SUBNET + modstack = modstack_find(&worker->env.mesh->mods, "subnet"); + if(modstack != -1) { + fptr_ok(fptr_whitelist_mod_get_mem(worker->env.mesh->mods.mod[modstack]->get_mem)); + shm_stat->mem.subnet = (*worker->env.mesh->mods.mod[modstack]->get_mem)(&worker->env, modstack); + } +#endif + } + + server_stats_add(stat_total, stat_info); + + /* print the thread statistics */ + stat_total->mesh_time_median /= (double)worker->daemon->num; + +#else + (void)worker; +#endif /* HAVE_SHMGET */ +} diff --git a/external/unbound/util/shm_side/shm_main.h b/external/unbound/util/shm_side/shm_main.h new file mode 100644 index 000000000..8e4f4d051 --- /dev/null +++ b/external/unbound/util/shm_side/shm_main.h @@ -0,0 +1,86 @@ +/* + * util/shm_side/shm_main.h - control the shared memory for unbound. + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * + * This file contains functions for the SHM side. + */ + +#ifndef UTIL_SHM_SIDE_MAIN_H +#define UTIL_SHM_SIDE_MAIN_H +struct daemon; +struct worker; + +/** Some global statistics that are not in struct stats_info, + * this struct is shared on a shm segment */ +struct shm_stat_info { + + int num_threads; + + struct { + struct timeval now; + struct timeval up; + struct timeval elapsed; + } time; + + struct { + size_t msg; + size_t rrset; + size_t val; + size_t iter; + size_t subnet; + } mem; +}; + +/** + * The SHM info. + */ +struct shm_main_info { + /** stats_info array, shared memory segment. + * [0] is totals, [1..thread_num] are per-thread stats */ + struct stats_info* ptr_arr; + /** the global stats block, shared memory segment */ + struct shm_stat_info* ptr_ctl; + int key; + int id_ctl; + int id_arr; +}; + +int shm_main_init(struct daemon* daemon); +void shm_main_shutdown(struct daemon* daemon); +void shm_main_run(struct worker *worker); + +#endif /* UTIL_SHM_SIDE_MAIN_H */ diff --git a/external/unbound/util/storage/dnstree.c b/external/unbound/util/storage/dnstree.c index 0df490ee5..190369d85 100644 --- a/external/unbound/util/storage/dnstree.c +++ b/external/unbound/util/storage/dnstree.c @@ -71,17 +71,17 @@ int addr_tree_compare(const void* k1, const void* k2) return 0; } -void name_tree_init(rbtree_t* tree) +void name_tree_init(rbtree_type* tree) { rbtree_init(tree, &name_tree_compare); } -void addr_tree_init(rbtree_t* tree) +void addr_tree_init(rbtree_type* tree) { rbtree_init(tree, &addr_tree_compare); } -int name_tree_insert(rbtree_t* tree, struct name_tree_node* node, +int name_tree_insert(rbtree_type* tree, struct name_tree_node* node, uint8_t* name, size_t len, int labs, uint16_t dclass) { node->node.key = node; @@ -93,7 +93,7 @@ int name_tree_insert(rbtree_t* tree, struct name_tree_node* node, return rbtree_insert(tree, &node->node) != NULL; } -int addr_tree_insert(rbtree_t* tree, struct addr_tree_node* node, +int addr_tree_insert(rbtree_type* tree, struct addr_tree_node* node, struct sockaddr_storage* addr, socklen_t addrlen, int net) { node->node.key = node; @@ -104,7 +104,7 @@ int addr_tree_insert(rbtree_t* tree, struct addr_tree_node* node, return rbtree_insert(tree, &node->node) != NULL; } -void addr_tree_init_parents(rbtree_t* tree) +void addr_tree_init_parents(rbtree_type* tree) { struct addr_tree_node* node, *prev = NULL, *p; int m; @@ -130,7 +130,7 @@ void addr_tree_init_parents(rbtree_t* tree) } } -void name_tree_init_parents(rbtree_t* tree) +void name_tree_init_parents(rbtree_type* tree) { struct name_tree_node* node, *prev = NULL, *p; int m; @@ -156,7 +156,7 @@ void name_tree_init_parents(rbtree_t* tree) } } -struct name_tree_node* name_tree_find(rbtree_t* tree, uint8_t* name, +struct name_tree_node* name_tree_find(rbtree_type* tree, uint8_t* name, size_t len, int labs, uint16_t dclass) { struct name_tree_node key; @@ -168,10 +168,10 @@ struct name_tree_node* name_tree_find(rbtree_t* tree, uint8_t* name, return (struct name_tree_node*)rbtree_search(tree, &key); } -struct name_tree_node* name_tree_lookup(rbtree_t* tree, uint8_t* name, +struct name_tree_node* name_tree_lookup(rbtree_type* tree, uint8_t* name, size_t len, int labs, uint16_t dclass) { - rbnode_t* res = NULL; + rbnode_type* res = NULL; struct name_tree_node *result; struct name_tree_node key; key.node.key = &key; @@ -200,10 +200,10 @@ struct name_tree_node* name_tree_lookup(rbtree_t* tree, uint8_t* name, return result; } -struct addr_tree_node* addr_tree_lookup(rbtree_t* tree, +struct addr_tree_node* addr_tree_lookup(rbtree_type* tree, struct sockaddr_storage* addr, socklen_t addrlen) { - rbnode_t* res = NULL; + rbnode_type* res = NULL; struct addr_tree_node* result; struct addr_tree_node key; key.node.key = &key; @@ -231,11 +231,24 @@ struct addr_tree_node* addr_tree_lookup(rbtree_t* tree, return result; } +struct addr_tree_node* addr_tree_find(rbtree_type* tree, + struct sockaddr_storage* addr, socklen_t addrlen, int net) +{ + rbnode_type* res = NULL; + struct addr_tree_node key; + key.node.key = &key; + memcpy(&key.addr, addr, addrlen); + key.addrlen = addrlen; + key.net = net; + res = rbtree_search(tree, &key); + return (struct addr_tree_node*)res; +} + int -name_tree_next_root(rbtree_t* tree, uint16_t* dclass) +name_tree_next_root(rbtree_type* tree, uint16_t* dclass) { struct name_tree_node key; - rbnode_t* n; + rbnode_type* n; struct name_tree_node* p; if(*dclass == 0) { /* first root item is first item in tree */ diff --git a/external/unbound/util/storage/dnstree.h b/external/unbound/util/storage/dnstree.h index ec8189100..782644b63 100644 --- a/external/unbound/util/storage/dnstree.h +++ b/external/unbound/util/storage/dnstree.h @@ -49,12 +49,12 @@ * This is not sorted canonically, but fast. * This can be looked up to obtain a closest encloser parent name. * - * The tree itself is a rbtree_t. + * The tree itself is a rbtree_type. * This is the element node put as first entry in the client structure. */ struct name_tree_node { /** rbtree node, key is this struct : dclass and name */ - rbnode_t node; + rbnode_type node; /** parent in tree */ struct name_tree_node* parent; /** name in uncompressed wireformat */ @@ -71,12 +71,12 @@ struct name_tree_node { * Tree of IP addresses. Sorted first by protocol, then by bits. * This can be looked up to obtain the enclosing subnet. * - * The tree itself is a rbtree_t. + * The tree itself is a rbtree_type. * This is the element node put as first entry in the client structure. */ struct addr_tree_node { /** rbtree node, key is this struct : proto and subnet */ - rbnode_t node; + rbnode_type node; /** parent in tree */ struct addr_tree_node* parent; /** address */ @@ -91,7 +91,7 @@ struct addr_tree_node { * Init a name tree to be empty * @param tree: to init. */ -void name_tree_init(rbtree_t* tree); +void name_tree_init(rbtree_type* tree); /** * insert element into name tree. @@ -105,7 +105,7 @@ void name_tree_init(rbtree_t* tree); * @param dclass: class of name * @return false on error (duplicate element). */ -int name_tree_insert(rbtree_t* tree, struct name_tree_node* node, +int name_tree_insert(rbtree_type* tree, struct name_tree_node* node, uint8_t* name, size_t len, int labs, uint16_t dclass); /** @@ -113,7 +113,7 @@ int name_tree_insert(rbtree_t* tree, struct name_tree_node* node, * Should be performed after insertions are done, before lookups * @param tree: name tree */ -void name_tree_init_parents(rbtree_t* tree); +void name_tree_init_parents(rbtree_type* tree); /** * Lookup exact match in name tree @@ -124,7 +124,7 @@ void name_tree_init_parents(rbtree_t* tree); * @param dclass: class of name * @return node or NULL if not found. */ -struct name_tree_node* name_tree_find(rbtree_t* tree, uint8_t* name, +struct name_tree_node* name_tree_find(rbtree_type* tree, uint8_t* name, size_t len, int labs, uint16_t dclass); /** @@ -136,7 +136,7 @@ struct name_tree_node* name_tree_find(rbtree_t* tree, uint8_t* name, * @param dclass: class of name * @return closest enclosing node (could be equal) or NULL if not found. */ -struct name_tree_node* name_tree_lookup(rbtree_t* tree, uint8_t* name, +struct name_tree_node* name_tree_lookup(rbtree_type* tree, uint8_t* name, size_t len, int labs, uint16_t dclass); /** @@ -145,13 +145,13 @@ struct name_tree_node* name_tree_lookup(rbtree_t* tree, uint8_t* name, * @param dclass: the class to look for next (or higher). * @return false if no classes found, true means class put into c. */ -int name_tree_next_root(rbtree_t* tree, uint16_t* dclass); +int name_tree_next_root(rbtree_type* tree, uint16_t* dclass); /** * Init addr tree to be empty. * @param tree: to init. */ -void addr_tree_init(rbtree_t* tree); +void addr_tree_init(rbtree_type* tree); /** * insert element into addr tree. @@ -163,7 +163,7 @@ void addr_tree_init(rbtree_t* tree); * @param net: size of subnet. * @return false on error (duplicate element). */ -int addr_tree_insert(rbtree_t* tree, struct addr_tree_node* node, +int addr_tree_insert(rbtree_type* tree, struct addr_tree_node* node, struct sockaddr_storage* addr, socklen_t addrlen, int net); /** @@ -171,7 +171,7 @@ int addr_tree_insert(rbtree_t* tree, struct addr_tree_node* node, * Should be performed after insertions are done, before lookups * @param tree: addr tree */ -void addr_tree_init_parents(rbtree_t* tree); +void addr_tree_init_parents(rbtree_type* tree); /** * Lookup closest encloser in addr tree. @@ -180,9 +180,20 @@ void addr_tree_init_parents(rbtree_t* tree); * @param addrlen: length of addr * @return closest enclosing node (could be equal) or NULL if not found. */ -struct addr_tree_node* addr_tree_lookup(rbtree_t* tree, +struct addr_tree_node* addr_tree_lookup(rbtree_type* tree, struct sockaddr_storage* addr, socklen_t addrlen); +/** + * Find element in addr tree. (search a netblock, not a match for an address) + * @param tree: addr tree + * @param addr: netblock to lookup. + * @param addrlen: length of addr + * @param net: size of subnet + * @return addr tree element, or NULL if not found. + */ +struct addr_tree_node* addr_tree_find(rbtree_type* tree, + struct sockaddr_storage* addr, socklen_t addrlen, int net); + /** compare name tree nodes */ int name_tree_compare(const void* k1, const void* k2); diff --git a/external/unbound/util/storage/lookup3.c b/external/unbound/util/storage/lookup3.c index ddcb56e74..e9b05af37 100644 --- a/external/unbound/util/storage/lookup3.c +++ b/external/unbound/util/storage/lookup3.c @@ -820,7 +820,7 @@ uint32_t hashbig( const void *key, size_t length, uint32_t initval) #ifdef SELF_TEST /* used for timings */ -void driver1() +void driver1(void) { uint8_t buf[256]; uint32_t i; @@ -842,7 +842,7 @@ void driver1() #define HASHLEN 1 #define MAXPAIR 60 #define MAXLEN 70 -void driver2() +void driver2(void) { uint8_t qa[MAXLEN+1], qb[MAXLEN+2], *a = &qa[0], *b = &qb[1]; uint32_t c[HASHSTATE], d[HASHSTATE], i=0, j=0, k, l, m=0, z; @@ -912,7 +912,7 @@ void driver2() } /* Check for reading beyond the end of the buffer and alignment problems */ -void driver3() +void driver3(void) { uint8_t buf[MAXLEN+20], *b; uint32_t len; @@ -1003,7 +1003,7 @@ void driver3() } /* check for problems with nulls */ - void driver4() + void driver4(void) { uint8_t buf[1]; uint32_t h,i,state[HASHSTATE]; @@ -1020,7 +1020,7 @@ void driver3() } -int main() +int main(void) { driver1(); /* test that the key is hashed: used for timings */ driver2(); /* test that whole key is hashed thoroughly */ diff --git a/external/unbound/util/storage/lruhash.c b/external/unbound/util/storage/lruhash.c index 2c987a2e5..0003ff491 100644 --- a/external/unbound/util/storage/lruhash.c +++ b/external/unbound/util/storage/lruhash.c @@ -59,9 +59,10 @@ bin_init(struct lruhash_bin* array, size_t size) } struct lruhash* -lruhash_create(size_t start_size, size_t maxmem, lruhash_sizefunc_t sizefunc, - lruhash_compfunc_t compfunc, lruhash_delkeyfunc_t delkeyfunc, - lruhash_deldatafunc_t deldatafunc, void* arg) +lruhash_create(size_t start_size, size_t maxmem, + lruhash_sizefunc_type sizefunc, lruhash_compfunc_type compfunc, + lruhash_delkeyfunc_type delkeyfunc, + lruhash_deldatafunc_type deldatafunc, void* arg) { struct lruhash* table = (struct lruhash*)calloc(1, sizeof(struct lruhash)); @@ -215,7 +216,7 @@ reclaim_space(struct lruhash* table, struct lruhash_entry** list) struct lruhash_entry* bin_find_entry(struct lruhash* table, - struct lruhash_bin* bin, hashvalue_t hash, void* key) + struct lruhash_bin* bin, hashvalue_type hash, void* key) { struct lruhash_entry* p = bin->overflow_list; while(p) { @@ -296,7 +297,7 @@ lru_touch(struct lruhash* table, struct lruhash_entry* entry) } void -lruhash_insert(struct lruhash* table, hashvalue_t hash, +lruhash_insert(struct lruhash* table, hashvalue_type hash, struct lruhash_entry* entry, void* data, void* cb_arg) { struct lruhash_bin* bin; @@ -352,7 +353,7 @@ lruhash_insert(struct lruhash* table, hashvalue_t hash, } struct lruhash_entry* -lruhash_lookup(struct lruhash* table, hashvalue_t hash, void* key, int wr) +lruhash_lookup(struct lruhash* table, hashvalue_type hash, void* key, int wr) { struct lruhash_entry* entry; struct lruhash_bin* bin; @@ -374,7 +375,7 @@ lruhash_lookup(struct lruhash* table, hashvalue_t hash, void* key, int wr) } void -lruhash_remove(struct lruhash* table, hashvalue_t hash, void* key) +lruhash_remove(struct lruhash* table, hashvalue_type hash, void* key) { struct lruhash_entry* entry; struct lruhash_bin* bin; @@ -512,7 +513,7 @@ lruhash_get_mem(struct lruhash* table) } void -lruhash_setmarkdel(struct lruhash* table, lruhash_markdelfunc_t md) +lruhash_setmarkdel(struct lruhash* table, lruhash_markdelfunc_type md) { lock_quick_lock(&table->lock); table->markdelfunc = md; @@ -542,3 +543,89 @@ lruhash_traverse(struct lruhash* h, int wr, } lock_quick_unlock(&h->lock); } + +/* + * Demote: the opposite of touch, move an entry to the bottom + * of the LRU pile. + */ + +void +lru_demote(struct lruhash* table, struct lruhash_entry* entry) +{ + log_assert(table && entry); + if (entry == table->lru_end) + return; /* nothing to do */ + /* remove from current lru position */ + lru_remove(table, entry); + /* add at end */ + entry->lru_next = NULL; + entry->lru_prev = table->lru_end; + + if (table->lru_end == NULL) + { + table->lru_start = entry; + } + else + { + table->lru_end->lru_next = entry; + } + table->lru_end = entry; +} + +struct lruhash_entry* +lruhash_insert_or_retrieve(struct lruhash* table, hashvalue_type hash, + struct lruhash_entry* entry, void* data, void* cb_arg) +{ + struct lruhash_bin* bin; + struct lruhash_entry* found, *reclaimlist = NULL; + size_t need_size; + fptr_ok(fptr_whitelist_hash_sizefunc(table->sizefunc)); + fptr_ok(fptr_whitelist_hash_delkeyfunc(table->delkeyfunc)); + fptr_ok(fptr_whitelist_hash_deldatafunc(table->deldatafunc)); + fptr_ok(fptr_whitelist_hash_compfunc(table->compfunc)); + fptr_ok(fptr_whitelist_hash_markdelfunc(table->markdelfunc)); + need_size = table->sizefunc(entry->key, data); + if (cb_arg == NULL) cb_arg = table->cb_arg; + + /* find bin */ + lock_quick_lock(&table->lock); + bin = &table->array[hash & table->size_mask]; + lock_quick_lock(&bin->lock); + + /* see if entry exists already */ + if ((found = bin_find_entry(table, bin, hash, entry->key)) != NULL) { + /* if so: keep the existing data - acquire a writelock */ + lock_rw_wrlock(&found->lock); + } + else + { + /* if not: add to bin */ + entry->overflow_next = bin->overflow_list; + bin->overflow_list = entry; + lru_front(table, entry); + table->num++; + table->space_used += need_size; + /* return the entry that was presented, and lock it */ + found = entry; + lock_rw_wrlock(&found->lock); + } + lock_quick_unlock(&bin->lock); + if (table->space_used > table->space_max) + reclaim_space(table, &reclaimlist); + if (table->num >= table->size) + table_grow(table); + lock_quick_unlock(&table->lock); + + /* finish reclaim if any (outside of critical region) */ + while (reclaimlist) { + struct lruhash_entry* n = reclaimlist->overflow_next; + void* d = reclaimlist->data; + (*table->delkeyfunc)(reclaimlist->key, cb_arg); + (*table->deldatafunc)(d, cb_arg); + reclaimlist = n; + } + + /* return the entry that was selected */ + return found; +} + diff --git a/external/unbound/util/storage/lruhash.h b/external/unbound/util/storage/lruhash.h index 30377d8e7..4759b5001 100644 --- a/external/unbound/util/storage/lruhash.h +++ b/external/unbound/util/storage/lruhash.h @@ -116,7 +116,7 @@ struct lruhash_entry; #define HASH_DEFAULT_MAXMEM 4*1024*1024 /* bytes */ /** the type of a hash value */ -typedef uint32_t hashvalue_t; +typedef uint32_t hashvalue_type; /** * Type of function that calculates the size of an entry. @@ -124,39 +124,39 @@ typedef uint32_t hashvalue_t; * Keys that are identical must also calculate to the same size. * size = func(key, data). */ -typedef size_t (*lruhash_sizefunc_t)(void*, void*); +typedef size_t (*lruhash_sizefunc_type)(void*, void*); /** type of function that compares two keys. return 0 if equal. */ -typedef int (*lruhash_compfunc_t)(void*, void*); +typedef int (*lruhash_compfunc_type)(void*, void*); /** old keys are deleted. * The RRset type has to revoke its ID number, markdel() is used first. * This function is called: func(key, userarg) */ -typedef void (*lruhash_delkeyfunc_t)(void*, void*); +typedef void (*lruhash_delkeyfunc_type)(void*, void*); /** old data is deleted. This function is called: func(data, userarg). */ -typedef void (*lruhash_deldatafunc_t)(void*, void*); +typedef void (*lruhash_deldatafunc_type)(void*, void*); /** mark a key as pending to be deleted (and not to be used by anyone). * called: func(key) */ -typedef void (*lruhash_markdelfunc_t)(void*); +typedef void (*lruhash_markdelfunc_type)(void*); /** * Hash table that keeps LRU list of entries. */ struct lruhash { /** lock for exclusive access, to the lookup array */ - lock_quick_t lock; + lock_quick_type lock; /** the size function for entries in this table */ - lruhash_sizefunc_t sizefunc; + lruhash_sizefunc_type sizefunc; /** the compare function for entries in this table. */ - lruhash_compfunc_t compfunc; + lruhash_compfunc_type compfunc; /** how to delete keys. */ - lruhash_delkeyfunc_t delkeyfunc; + lruhash_delkeyfunc_type delkeyfunc; /** how to delete data. */ - lruhash_deldatafunc_t deldatafunc; + lruhash_deldatafunc_type deldatafunc; /** how to mark a key pending deletion */ - lruhash_markdelfunc_t markdelfunc; + lruhash_markdelfunc_type markdelfunc; /** user argument for user functions */ void* cb_arg; @@ -188,7 +188,7 @@ struct lruhash_bin { * Lock for exclusive access to the linked list * This lock makes deletion of items safe in this overflow list. */ - lock_quick_t lock; + lock_quick_type lock; /** linked list of overflow entries */ struct lruhash_entry* overflow_list; }; @@ -207,7 +207,7 @@ struct lruhash_entry { * Even with a writelock, you cannot change hash and key. * You need to delete it to change hash or key. */ - lock_rw_t lock; + lock_rw_type lock; /** next entry in overflow chain. Covered by hashlock and binlock. */ struct lruhash_entry* overflow_next; /** next entry in lru chain. covered by hashlock. */ @@ -215,7 +215,7 @@ struct lruhash_entry { /** prev entry in lru chain. covered by hashlock. */ struct lruhash_entry* lru_prev; /** hash value of the key. It may not change, until entry deleted. */ - hashvalue_t hash; + hashvalue_type hash; /** key */ void* key; /** data */ @@ -236,9 +236,9 @@ struct lruhash_entry { * @return: new hash table or NULL on malloc failure. */ struct lruhash* lruhash_create(size_t start_size, size_t maxmem, - lruhash_sizefunc_t sizefunc, lruhash_compfunc_t compfunc, - lruhash_delkeyfunc_t delkeyfunc, lruhash_deldatafunc_t deldatafunc, - void* arg); + lruhash_sizefunc_type sizefunc, lruhash_compfunc_type compfunc, + lruhash_delkeyfunc_type delkeyfunc, + lruhash_deldatafunc_type deldatafunc, void* arg); /** * Delete hash table. Entries are all deleted. @@ -269,7 +269,7 @@ void lruhash_clear(struct lruhash* table); * @param data: the data. * @param cb_override: if not null overrides the cb_arg for the deletefunc. */ -void lruhash_insert(struct lruhash* table, hashvalue_t hash, +void lruhash_insert(struct lruhash* table, hashvalue_type hash, struct lruhash_entry* entry, void* data, void* cb_override); /** @@ -285,8 +285,8 @@ void lruhash_insert(struct lruhash* table, hashvalue_t hash, * @return: pointer to the entry or NULL. The entry is locked. * The user must unlock the entry when done. */ -struct lruhash_entry* lruhash_lookup(struct lruhash* table, hashvalue_t hash, - void* key, int wr); +struct lruhash_entry* lruhash_lookup(struct lruhash* table, + hashvalue_type hash, void* key, int wr); /** * Touch entry, so it becomes the most recently used in the LRU list. @@ -299,7 +299,39 @@ void lru_touch(struct lruhash* table, struct lruhash_entry* entry); /** * Set the markdelfunction (or NULL) */ -void lruhash_setmarkdel(struct lruhash* table, lruhash_markdelfunc_t md); +void lruhash_setmarkdel(struct lruhash* table, lruhash_markdelfunc_type md); + +/************************* getdns functions ************************/ +/*** these are used by getdns only and not by unbound. ***/ + +/** + * Demote entry, so it becomes the least recently used in the LRU list. + * Caller must hold hash table lock. The entry must be inserted already. + * @param table: hash table. + * @param entry: entry to make last in LRU. + */ +void lru_demote(struct lruhash* table, struct lruhash_entry* entry); + +/** + * Insert a new element into the hashtable, or retrieve the corresponding + * element of it exits. + * + * If key is already present data pointer in that entry is kept. + * If it is not present, a new entry is created. In that case, + * the space calculation function is called with the key, data. + * If necessary the least recently used entries are deleted to make space. + * If necessary the hash array is grown up. + * + * @param table: hash table. + * @param hash: hash value. User calculates the hash. + * @param entry: identifies the entry. + * @param data: the data. + * @param cb_arg: if not null overrides the cb_arg for the deletefunc. + * @return: pointer to the existing entry if the key was already present, + * or to the entry argument if it was not. + */ +struct lruhash_entry* lruhash_insert_or_retrieve(struct lruhash* table, hashvalue_type hash, + struct lruhash_entry* entry, void* data, void* cb_arg); /************************* Internal functions ************************/ /*** these are only exposed for unit tests. ***/ @@ -311,7 +343,7 @@ void lruhash_setmarkdel(struct lruhash* table, lruhash_markdelfunc_t md); * @param hash: hash of key. * @param key: what to look for. */ -void lruhash_remove(struct lruhash* table, hashvalue_t hash, void* key); +void lruhash_remove(struct lruhash* table, hashvalue_type hash, void* key); /** init the hash bins for the table */ void bin_init(struct lruhash_bin* array, size_t size); @@ -328,7 +360,7 @@ void bin_delete(struct lruhash* table, struct lruhash_bin* bin); * @return: the entry or NULL if not found. */ struct lruhash_entry* bin_find_entry(struct lruhash* table, - struct lruhash_bin* bin, hashvalue_t hash, void* key); + struct lruhash_bin* bin, hashvalue_type hash, void* key); /** * Remove entry from bin overflow chain. diff --git a/external/unbound/util/storage/slabhash.c b/external/unbound/util/storage/slabhash.c index 0618b4c72..ae63b9772 100644 --- a/external/unbound/util/storage/slabhash.c +++ b/external/unbound/util/storage/slabhash.c @@ -46,9 +46,9 @@ #include "util/storage/slabhash.h" struct slabhash* slabhash_create(size_t numtables, size_t start_size, - size_t maxmem, lruhash_sizefunc_t sizefunc, - lruhash_compfunc_t compfunc, lruhash_delkeyfunc_t delkeyfunc, - lruhash_deldatafunc_t deldatafunc, void* arg) + size_t maxmem, lruhash_sizefunc_type sizefunc, + lruhash_compfunc_type compfunc, lruhash_delkeyfunc_type delkeyfunc, + lruhash_deldatafunc_type deldatafunc, void* arg) { size_t i; struct slabhash* sl = (struct slabhash*)calloc(1, @@ -108,24 +108,24 @@ void slabhash_clear(struct slabhash* sl) /** helper routine to calculate the slabhash index */ static unsigned int -slab_idx(struct slabhash* sl, hashvalue_t hash) +slab_idx(struct slabhash* sl, hashvalue_type hash) { return ((hash & sl->mask) >> sl->shift); } -void slabhash_insert(struct slabhash* sl, hashvalue_t hash, +void slabhash_insert(struct slabhash* sl, hashvalue_type hash, struct lruhash_entry* entry, void* data, void* arg) { lruhash_insert(sl->array[slab_idx(sl, hash)], hash, entry, data, arg); } struct lruhash_entry* slabhash_lookup(struct slabhash* sl, - hashvalue_t hash, void* key, int wr) + hashvalue_type hash, void* key, int wr) { return lruhash_lookup(sl->array[slab_idx(sl, hash)], hash, key, wr); } -void slabhash_remove(struct slabhash* sl, hashvalue_t hash, void* key) +void slabhash_remove(struct slabhash* sl, hashvalue_type hash, void* key) { lruhash_remove(sl->array[slab_idx(sl, hash)], hash, key); } @@ -163,7 +163,7 @@ size_t slabhash_get_mem(struct slabhash* sl) return total; } -struct lruhash* slabhash_gettable(struct slabhash* sl, hashvalue_t hash) +struct lruhash* slabhash_gettable(struct slabhash* sl, hashvalue_type hash) { return sl->array[slab_idx(sl, hash)]; } @@ -202,7 +202,7 @@ void test_slabhash_deldata(void* data, void* ATTR_UNUSED(arg)) deldata((struct slabhash_testdata*)data); } -void slabhash_setmarkdel(struct slabhash* sl, lruhash_markdelfunc_t md) +void slabhash_setmarkdel(struct slabhash* sl, lruhash_markdelfunc_type md) { size_t i; for(i=0; i<sl->size; i++) { diff --git a/external/unbound/util/storage/slabhash.h b/external/unbound/util/storage/slabhash.h index 031a9da0f..d00983fc1 100644 --- a/external/unbound/util/storage/slabhash.h +++ b/external/unbound/util/storage/slabhash.h @@ -80,9 +80,9 @@ struct slabhash { * @return: new hash table or NULL on malloc failure. */ struct slabhash* slabhash_create(size_t numtables, size_t start_size, - size_t maxmem, lruhash_sizefunc_t sizefunc, - lruhash_compfunc_t compfunc, lruhash_delkeyfunc_t delkeyfunc, - lruhash_deldatafunc_t deldatafunc, void* arg); + size_t maxmem, lruhash_sizefunc_type sizefunc, + lruhash_compfunc_type compfunc, lruhash_delkeyfunc_type delkeyfunc, + lruhash_deldatafunc_type deldatafunc, void* arg); /** * Delete hash table. Entries are all deleted. @@ -109,7 +109,7 @@ void slabhash_clear(struct slabhash* table); * @param data: the data. * @param cb_override: if not NULL overrides the cb_arg for deletfunc. */ -void slabhash_insert(struct slabhash* table, hashvalue_t hash, +void slabhash_insert(struct slabhash* table, hashvalue_type hash, struct lruhash_entry* entry, void* data, void* cb_override); /** @@ -126,7 +126,7 @@ void slabhash_insert(struct slabhash* table, hashvalue_t hash, * The user must unlock the entry when done. */ struct lruhash_entry* slabhash_lookup(struct slabhash* table, - hashvalue_t hash, void* key, int wr); + hashvalue_type hash, void* key, int wr); /** * Remove entry from hashtable. Does nothing if not found in hashtable. @@ -135,7 +135,7 @@ struct lruhash_entry* slabhash_lookup(struct slabhash* table, * @param hash: hash of key. * @param key: what to look for. */ -void slabhash_remove(struct slabhash* table, hashvalue_t hash, void* key); +void slabhash_remove(struct slabhash* table, hashvalue_type hash, void* key); /** * Output debug info to the log as to state of the hash table. @@ -165,14 +165,14 @@ size_t slabhash_get_mem(struct slabhash* table); * @param hash: hash value. * @return the lru hash table. */ -struct lruhash* slabhash_gettable(struct slabhash* table, hashvalue_t hash); +struct lruhash* slabhash_gettable(struct slabhash* table, hashvalue_type hash); /** * Set markdel function * @param table: slabbed hash table. * @param md: markdel function ptr. */ -void slabhash_setmarkdel(struct slabhash* table, lruhash_markdelfunc_t md); +void slabhash_setmarkdel(struct slabhash* table, lruhash_markdelfunc_type md); /** * Traverse a slabhash. diff --git a/external/unbound/util/tube.c b/external/unbound/util/tube.c index 053547438..f42d22cb3 100644 --- a/external/unbound/util/tube.c +++ b/external/unbound/util/tube.c @@ -44,6 +44,7 @@ #include "util/net_help.h" #include "util/netevent.h" #include "util/fptr_wlist.h" +#include "util/ub_event.h" #ifndef USE_WINSOCK /* on unix */ @@ -303,6 +304,8 @@ int tube_write_msg(struct tube* tube, uint8_t* buf, uint32_t len, d = r; while(d != (ssize_t)sizeof(len)) { if((r=write(fd, ((char*)&len)+d, sizeof(len)-d)) == -1) { + if(errno == EAGAIN) + continue; /* temporarily unavail: try again*/ log_err("tube msg write failed: %s", strerror(errno)); (void)fd_set_nonblock(fd); return 0; @@ -312,6 +315,8 @@ int tube_write_msg(struct tube* tube, uint8_t* buf, uint32_t len, d = 0; while(d != (ssize_t)len) { if((r=write(fd, buf+d, len-d)) == -1) { + if(errno == EAGAIN) + continue; /* temporarily unavail: try again*/ log_err("tube msg write failed: %s", strerror(errno)); (void)fd_set_nonblock(fd); return 0; @@ -421,7 +426,7 @@ int tube_read_fd(struct tube* tube) } int tube_setup_bg_listen(struct tube* tube, struct comm_base* base, - tube_callback_t* cb, void* arg) + tube_callback_type* cb, void* arg) { tube->listen_cb = cb; tube->listen_arg = arg; @@ -537,7 +542,7 @@ void tube_close_write(struct tube* ATTR_UNUSED(tube)) void tube_remove_bg_listen(struct tube* tube) { verbose(VERB_ALGO, "tube remove_bg_listen"); - winsock_unregister_wsaevent(&tube->ev_listen); + ub_winsock_unregister_wsaevent(tube->ev_listen); } void tube_remove_bg_write(struct tube* tube) @@ -662,14 +667,15 @@ tube_handle_write(struct comm_point* ATTR_UNUSED(c), void* ATTR_UNUSED(arg), } int tube_setup_bg_listen(struct tube* tube, struct comm_base* base, - tube_callback_t* cb, void* arg) + tube_callback_type* cb, void* arg) { tube->listen_cb = cb; tube->listen_arg = arg; if(!comm_base_internal(base)) return 1; /* ignore when no comm base - testing */ - return winsock_register_wsaevent(comm_base_internal(base), - &tube->ev_listen, tube->event, &tube_handle_signal, tube); + tube->ev_listen = ub_winsock_register_wsaevent( + comm_base_internal(base), tube->event, &tube_handle_signal, tube); + return tube->ev_listen ? 1 : 0; } int tube_setup_bg_write(struct tube* ATTR_UNUSED(tube), diff --git a/external/unbound/util/tube.h b/external/unbound/util/tube.h index 6cc60502b..5b1fdb8e8 100644 --- a/external/unbound/util/tube.h +++ b/external/unbound/util/tube.h @@ -48,7 +48,6 @@ struct tube; struct tube_res_list; #ifdef USE_WINSOCK #include "util/locks.h" -#include "util/winsock_event.h" #endif /** @@ -56,7 +55,7 @@ struct tube_res_list; * void mycallback(tube, msg, len, error, user_argument); * if error is true (NETEVENT_*), msg is probably NULL. */ -typedef void tube_callback_t(struct tube*, uint8_t*, size_t, int, void*); +typedef void tube_callback_type(struct tube*, uint8_t*, size_t, int, void*); /** * A pipe @@ -71,7 +70,7 @@ struct tube { /** listen commpoint */ struct comm_point* listen_com; /** listen callback */ - tube_callback_t* listen_cb; + tube_callback_type* listen_cb; /** listen callback user arg */ void* listen_arg; /** are we currently reading a command, 0 if not, else bytecount */ @@ -93,16 +92,16 @@ struct tube { #else /* USE_WINSOCK */ /** listen callback */ - tube_callback_t* listen_cb; + tube_callback_type* listen_cb; /** listen callback user arg */ void* listen_arg; /** the windows sockets event (signaled if items in pipe) */ WSAEVENT event; /** winsock event storage when registered with event base */ - struct event ev_listen; + struct ub_event* ev_listen; /** lock on the list of outstanding items */ - lock_basic_t res_lock; + lock_basic_type res_lock; /** list of outstanding results on pipe */ struct tube_res_list* res_list; /** last in list */ @@ -223,7 +222,7 @@ int tube_read_fd(struct tube* tube); * @return true if successful, false on error. */ int tube_setup_bg_listen(struct tube* tube, struct comm_base* base, - tube_callback_t* cb, void* arg); + tube_callback_type* cb, void* arg); /** * Remove bg listen setup from event base. diff --git a/external/unbound/util/ub_event.c b/external/unbound/util/ub_event.c new file mode 100644 index 000000000..3b92be1a3 --- /dev/null +++ b/external/unbound/util/ub_event.c @@ -0,0 +1,444 @@ +/* + * util/ub_event.c - directly call libevent (compatability) functions + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * + * This file contains and implementation for the indirection layer for pluggable + * events that transparently passes it either directly to libevent, or calls + * the libevent compatibility layer functions. + */ +#include "config.h" +#include <sys/time.h> +#include "util/ub_event.h" +#include "util/log.h" +#include "util/netevent.h" +#include "util/tube.h" + +/* We define libevent structures here to hide the libevent stuff. */ + +#ifdef USE_MINI_EVENT +# ifdef USE_WINSOCK +# include "util/winsock_event.h" +# else +# include "util/mini_event.h" +# endif /* USE_WINSOCK */ +#else /* USE_MINI_EVENT */ + /* we use libevent */ +# ifdef HAVE_EVENT_H +# include <event.h> +# else +# include "event2/event.h" +# include "event2/event_struct.h" +# include "event2/event_compat.h" +# endif +#endif /* USE_MINI_EVENT */ + +#if UB_EV_TIMEOUT != EV_TIMEOUT || UB_EV_READ != EV_READ || \ + UB_EV_WRITE != EV_WRITE || UB_EV_SIGNAL != EV_SIGNAL || \ + UB_EV_PERSIST != EV_PERSIST +/* Only necessary for libev */ +# define NATIVE_BITS(b) ( \ + (((b) & UB_EV_TIMEOUT) ? EV_TIMEOUT : 0) \ + | (((b) & UB_EV_READ ) ? EV_READ : 0) \ + | (((b) & UB_EV_WRITE ) ? EV_WRITE : 0) \ + | (((b) & UB_EV_SIGNAL ) ? EV_SIGNAL : 0) \ + | (((b) & UB_EV_PERSIST) ? EV_PERSIST : 0)) + +# define UB_EV_BITS(b) ( \ + (((b) & EV_TIMEOUT) ? UB_EV_TIMEOUT : 0) \ + | (((b) & EV_READ ) ? UB_EV_READ : 0) \ + | (((b) & EV_WRITE ) ? UB_EV_WRITE : 0) \ + | (((b) & EV_SIGNAL ) ? UB_EV_SIGNAL : 0) \ + | (((b) & EV_PERSIST) ? UB_EV_PERSIST : 0)) + +# define UB_EV_BITS_CB(C) void my_ ## C (int fd, short bits, void *arg) \ + { (C)(fd, UB_EV_BITS(bits), arg); } + +UB_EV_BITS_CB(comm_point_udp_callback); +UB_EV_BITS_CB(comm_point_udp_ancil_callback) +UB_EV_BITS_CB(comm_point_tcp_accept_callback) +UB_EV_BITS_CB(comm_point_tcp_handle_callback) +UB_EV_BITS_CB(comm_timer_callback) +UB_EV_BITS_CB(comm_signal_callback) +UB_EV_BITS_CB(comm_point_local_handle_callback) +UB_EV_BITS_CB(comm_point_raw_handle_callback) +UB_EV_BITS_CB(tube_handle_signal) +UB_EV_BITS_CB(comm_base_handle_slow_accept) + +static void (*NATIVE_BITS_CB(void (*cb)(int, short, void*)))(int, short, void*) +{ + if(cb == comm_point_udp_callback) + return my_comm_point_udp_callback; + else if(cb == comm_point_udp_ancil_callback) + return my_comm_point_udp_ancil_callback; + else if(cb == comm_point_tcp_accept_callback) + return my_comm_point_tcp_accept_callback; + else if(cb == comm_point_tcp_handle_callback) + return my_comm_point_tcp_handle_callback; + else if(cb == comm_timer_callback) + return my_comm_timer_callback; + else if(cb == comm_signal_callback) + return my_comm_signal_callback; + else if(cb == comm_point_local_handle_callback) + return my_comm_point_local_handle_callback; + else if(cb == comm_point_raw_handle_callback) + return my_comm_point_raw_handle_callback; + else if(cb == tube_handle_signal) + return my_tube_handle_signal; + else if(cb == comm_base_handle_slow_accept) + return my_comm_base_handle_slow_accept; + else + return NULL; +} +#else +# define NATIVE_BITS(b) (b) +# define NATIVE_BITS_CB(c) (c) +#endif + +#ifndef EVFLAG_AUTO +#define EVFLAG_AUTO 0 +#endif + +#define AS_EVENT_BASE(x) ((struct event_base*)x) +#define AS_UB_EVENT_BASE(x) ((struct ub_event_base*)x) +#define AS_EVENT(x) ((struct event*)x) +#define AS_UB_EVENT(x) ((struct ub_event*)x) + +const char* ub_event_get_version(void) +{ + return event_get_version(); +} + +#if (defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)) && defined(EVBACKEND_SELECT) +static const char* ub_ev_backend2str(int b) +{ + switch(b) { + case EVBACKEND_SELECT: return "select"; + case EVBACKEND_POLL: return "poll"; + case EVBACKEND_EPOLL: return "epoll"; + case EVBACKEND_KQUEUE: return "kqueue"; + case EVBACKEND_DEVPOLL: return "devpoll"; + case EVBACKEND_PORT: return "evport"; + } + return "unknown"; +} +#endif + +void +ub_get_event_sys(struct ub_event_base* base, const char** n, const char** s, + const char** m) +{ +#ifdef USE_WINSOCK + (void)base; + *n = "event"; + *s = "winsock"; + *m = "WSAWaitForMultipleEvents"; +#elif defined(USE_MINI_EVENT) + (void)base; + *n = "mini-event"; + *s = "internal"; + *m = "select"; +#else + struct event_base* b = AS_EVENT_BASE(base); + *s = event_get_version(); +# if defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP) + *n = "libev"; + if (!b) + b = (struct event_base*)ev_default_loop(EVFLAG_AUTO); +# ifdef EVBACKEND_SELECT + *m = ub_ev_backend2str(ev_backend((struct ev_loop*)b)); +# else + *m = "not obtainable"; +# endif +# elif defined(HAVE_EVENT_BASE_GET_METHOD) + *n = "libevent"; + if (!b) + b = event_base_new(); + *m = event_base_get_method(b); +# else + *n = "unknown"; + *m = "not obtainable"; + (void)b; +# endif +# ifdef HAVE_EVENT_BASE_FREE + if (b && b != AS_EVENT_BASE(base)) + event_base_free(b); +# endif +#endif +} + +struct ub_event_base* +ub_default_event_base(int sigs, time_t* time_secs, struct timeval* time_tv) +{ + void* base; + + (void)base; +#ifdef USE_MINI_EVENT + (void)sigs; + /* use mini event time-sharing feature */ + base = event_init(time_secs, time_tv); +#else + (void)time_secs; + (void)time_tv; +# if defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP) + /* libev */ + if(sigs) + base = ev_default_loop(EVFLAG_AUTO); + else + base = ev_loop_new(EVFLAG_AUTO); +# else + (void)sigs; +# ifdef HAVE_EVENT_BASE_NEW + base = event_base_new(); +# else + base = event_init(); +# endif +# endif +#endif + return (struct ub_event_base*)base; +} + +struct ub_event_base * +ub_libevent_event_base(struct event_base* libevent_base) +{ +#ifdef USE_MINI_EVENT + (void)libevent_base; + return NULL; +#else + return AS_UB_EVENT_BASE(libevent_base); +#endif +} + +struct event_base * +ub_libevent_get_event_base(struct ub_event_base* base) +{ +#ifdef USE_MINI_EVENT + (void)base; + return NULL; +#else + return AS_EVENT_BASE(base); +#endif +} + +void +ub_event_base_free(struct ub_event_base* base) +{ +#ifdef USE_MINI_EVENT + event_base_free(AS_EVENT_BASE(base)); +#elif defined(HAVE_EVENT_BASE_FREE) && defined(HAVE_EVENT_BASE_ONCE) + /* only libevent 1.2+ has it, but in 1.2 it is broken - + assertion fails on signal handling ev that is not deleted + in libevent 1.3c (event_base_once appears) this is fixed. */ + event_base_free(AS_EVENT_BASE(base)); +#else + (void)base; +#endif /* HAVE_EVENT_BASE_FREE and HAVE_EVENT_BASE_ONCE */ +} + +int +ub_event_base_dispatch(struct ub_event_base* base) +{ + return event_base_dispatch(AS_EVENT_BASE(base)); +} + +int +ub_event_base_loopexit(struct ub_event_base* base) +{ + return event_base_loopexit(AS_EVENT_BASE(base), NULL); +} + +struct ub_event* +ub_event_new(struct ub_event_base* base, int fd, short bits, + void (*cb)(int, short, void*), void* arg) +{ + struct event *ev = (struct event*)calloc(1, sizeof(struct event)); + + if (!ev) + return NULL; + + event_set(ev, fd, NATIVE_BITS(bits), NATIVE_BITS_CB(cb), arg); + if (event_base_set(AS_EVENT_BASE(base), ev) != 0) { + free(ev); + return NULL; + } + return AS_UB_EVENT(ev); +} + +struct ub_event* +ub_signal_new(struct ub_event_base* base, int fd, + void (*cb)(int, short, void*), void* arg) +{ + struct event *ev = (struct event*)calloc(1, sizeof(struct event)); + + if (!ev) + return NULL; + + signal_set(ev, fd, NATIVE_BITS_CB(cb), arg); + if (event_base_set(AS_EVENT_BASE(base), ev) != 0) { + free(ev); + return NULL; + } + return AS_UB_EVENT(ev); +} + +struct ub_event* +ub_winsock_register_wsaevent(struct ub_event_base* base, void* wsaevent, + void (*cb)(int, short, void*), void* arg) +{ +#if defined(USE_MINI_EVENT) && defined(USE_WINSOCK) + struct event *ev = (struct event*)calloc(1, sizeof(struct event)); + + if (!ev) + return NULL; + + if (winsock_register_wsaevent(AS_EVENT_BASE(base), ev, wsaevent, cb, + arg)) + return AS_UB_EVENT(ev); + free(ev); + return NULL; +#else + (void)base; + (void)wsaevent; + (void)cb; + (void)arg; + return NULL; +#endif +} + +void +ub_event_add_bits(struct ub_event* ev, short bits) +{ + AS_EVENT(ev)->ev_events |= NATIVE_BITS(bits); +} + +void +ub_event_del_bits(struct ub_event* ev, short bits) +{ + AS_EVENT(ev)->ev_events &= ~NATIVE_BITS(bits); +} + +void +ub_event_set_fd(struct ub_event* ev, int fd) +{ + AS_EVENT(ev)->ev_fd = fd; +} + +void +ub_event_free(struct ub_event* ev) +{ + if (ev) + free(AS_EVENT(ev)); +} + +int +ub_event_add(struct ub_event* ev, struct timeval* tv) +{ + return event_add(AS_EVENT(ev), tv); +} + +int +ub_event_del(struct ub_event* ev) +{ + return event_del(AS_EVENT(ev)); +} + +int +ub_timer_add(struct ub_event* ev, struct ub_event_base* base, + void (*cb)(int, short, void*), void* arg, struct timeval* tv) +{ + event_set(AS_EVENT(ev), -1, EV_TIMEOUT, NATIVE_BITS_CB(cb), arg); + if (event_base_set(AS_EVENT_BASE(base), AS_EVENT(ev)) != 0) + return -1; + return evtimer_add(AS_EVENT(ev), tv); +} + +int +ub_timer_del(struct ub_event* ev) +{ + return evtimer_del(AS_EVENT(ev)); +} + +int +ub_signal_add(struct ub_event* ev, struct timeval* tv) +{ + return signal_add(AS_EVENT(ev), tv); +} + +int +ub_signal_del(struct ub_event* ev) +{ + return signal_del(AS_EVENT(ev)); +} + +void +ub_winsock_unregister_wsaevent(struct ub_event* ev) +{ +#if defined(USE_MINI_EVENT) && defined(USE_WINSOCK) + winsock_unregister_wsaevent(AS_EVENT(ev)); + free(AS_EVENT(ev)); +#else + (void)ev; +#endif +} + +void +ub_winsock_tcp_wouldblock(struct ub_event* ev, int eventbits) +{ +#if defined(USE_MINI_EVENT) && defined(USE_WINSOCK) + winsock_tcp_wouldblock(AS_EVENT(ev), NATIVE_BITS(eventbits)); +#else + (void)ev; + (void)eventbits; +#endif +} + +void ub_comm_base_now(struct comm_base* cb) +{ + #ifdef USE_MINI_EVENT +/** minievent updates the time when it blocks. */ + (void)cb; /* nothing to do */ +#else /* !USE_MINI_EVENT */ +/** fillup the time values in the event base */ + time_t *tt; + struct timeval *tv; + comm_base_timept(cb, &tt, &tv); + if(gettimeofday(tv, NULL) < 0) { + log_err("gettimeofday: %s", strerror(errno)); + } + *tt = tv->tv_sec; +#endif /* USE_MINI_EVENT */ +} + diff --git a/external/unbound/util/ub_event.h b/external/unbound/util/ub_event.h new file mode 100644 index 000000000..9739e6d83 --- /dev/null +++ b/external/unbound/util/ub_event.h @@ -0,0 +1,127 @@ +/* + * util/ub_event.h - indirection layer for pluggable events + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * + * This file contains prototypes for event loop functions. + * + */ + +#ifndef UB_EVENT_H +#define UB_EVENT_H + +struct ub_event_base; +struct ub_event; +struct comm_base; +struct event_base; + +/** event timeout */ +#define UB_EV_TIMEOUT 0x01 +/** event fd readable */ +#define UB_EV_READ 0x02 +/** event fd writable */ +#define UB_EV_WRITE 0x04 +/** event signal */ +#define UB_EV_SIGNAL 0x08 +/** event must persist */ +#define UB_EV_PERSIST 0x10 + +/** Returns event-base type. Could be "mini-event", "winsock-event" for the + * daemon compile, and will be "pluggable-event<PACKAGE_VERSION>" for + * libunbound. + */ +const char* ub_event_get_version(void); +/** Return the name, system and method for the pluggable event base */ +void ub_get_event_sys(struct ub_event_base*, const char** n, const char** s, + const char** m); +/** Return a default event base. In the deamon thess will be the only event + * bases used. + */ +struct ub_event_base* ub_default_event_base(int, time_t*, struct timeval*); +/** Return an ub_event_base constructed for the given libevent event base */ +struct ub_event_base* ub_libevent_event_base(struct event_base*); +/** Return the libevent base underlying the given ub_event_base. Will return + * NULL when the ub_event_base does not have an underlying libevent event base + */ +struct event_base* ub_libevent_get_event_base(struct ub_event_base*); +/** Free event base. Free events yourself */ +void ub_event_base_free(struct ub_event_base*); +/** Run the event base */ +int ub_event_base_dispatch(struct ub_event_base*); +/** exit that loop */ +int ub_event_base_loopexit(struct ub_event_base*); + +/** Create a new ub_event for the event base */ +struct ub_event* ub_event_new(struct ub_event_base*, + int fd, short bits, void (*cb)(int, short, void*), void* arg); +/** Create a new ub_event signal for the event base */ +struct ub_event* ub_signal_new(struct ub_event_base*, int fd, + void (*cb)(int, short, void*), void* arg); +/** Create a new ub_event associated with the wsaevent for the event base */ +struct ub_event* ub_winsock_register_wsaevent(struct ub_event_base*, + void* wsaevent, void (*cb)(int, short, void*), void* arg); + +/** Add event bits for this event to fire on */ +void ub_event_add_bits(struct ub_event*, short bits); + /** Configure the event so it will not longer fire on given bits */ +void ub_event_del_bits(struct ub_event*, short bits); +/** Change or set the file descriptor on the event */ +void ub_event_set_fd(struct ub_event*, int fd); +/** free the event */ +void ub_event_free(struct ub_event*); +/** Activate the event. The given timeval is an timeout value. */ +int ub_event_add(struct ub_event*, struct timeval*); +/** Deactivate the event */ +int ub_event_del(struct ub_event*); +/** Reconfigure and activate a timeout event */ +int ub_timer_add(struct ub_event*, struct ub_event_base*, + void (*cb)(int, short, void*), void* arg, struct timeval*); +/** Deactivate the timeout event */ +int ub_timer_del(struct ub_event*); +/** Activate a signal event */ +int ub_signal_add(struct ub_event*, struct timeval*); +/** Deactivate a signal event */ +int ub_signal_del(struct ub_event*); +/** Free a with a wsaevent associated event */ +void ub_winsock_unregister_wsaevent(struct ub_event* ev); +/** Signal the eventloop when a TCP windows socket will block on next read + * or write (given by the eventbits) + */ +void ub_winsock_tcp_wouldblock(struct ub_event*, int bits); +/** Equip the comm_base with the current time */ +void ub_comm_base_now(struct comm_base* cb); + +#endif /* UB_EVENT_H */ diff --git a/external/unbound/util/ub_event_pluggable.c b/external/unbound/util/ub_event_pluggable.c new file mode 100644 index 000000000..4a9451263 --- /dev/null +++ b/external/unbound/util/ub_event_pluggable.c @@ -0,0 +1,692 @@ +/* + * util/ub_event_pluggable.c - call registered pluggable event functions + * + * Copyright (c) 2007, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the NLNET LABS nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * \file + * + * This file contains an implementation for the indirection layer for pluggable + * events that calls the registered pluggable event loop. It also defines a + * default pluggable event loop based on the default libevent (compatibility) + * functions. + */ +#include "config.h" +#include <sys/time.h> +#include "util/ub_event.h" +#include "libunbound/unbound-event.h" +#include "util/netevent.h" +#include "util/log.h" +#include "util/fptr_wlist.h" + +/* We define libevent structures here to hide the libevent stuff. */ + +#ifdef USE_MINI_EVENT +# ifdef USE_WINSOCK +# include "util/winsock_event.h" +# else +# include "util/mini_event.h" +# endif /* USE_WINSOCK */ +#else /* USE_MINI_EVENT */ + /* we use libevent */ +# ifdef HAVE_EVENT_H +# include <event.h> +# else +# include "event2/event.h" +# include "event2/event_struct.h" +# include "event2/event_compat.h" +# endif +#endif /* USE_MINI_EVENT */ + +#if UB_EV_TIMEOUT != EV_TIMEOUT || UB_EV_READ != EV_READ || \ + UB_EV_WRITE != EV_WRITE || UB_EV_SIGNAL != EV_SIGNAL || \ + UB_EV_PERSIST != EV_PERSIST +/* Only necessary for libev */ +# define NATIVE_BITS(b) ( \ + (((b) & UB_EV_TIMEOUT) ? EV_TIMEOUT : 0) \ + | (((b) & UB_EV_READ ) ? EV_READ : 0) \ + | (((b) & UB_EV_WRITE ) ? EV_WRITE : 0) \ + | (((b) & UB_EV_SIGNAL ) ? EV_SIGNAL : 0) \ + | (((b) & UB_EV_PERSIST) ? EV_PERSIST : 0)) + +# define UB_EV_BITS(b) ( \ + (((b) & EV_TIMEOUT) ? UB_EV_TIMEOUT : 0) \ + | (((b) & EV_READ ) ? UB_EV_READ : 0) \ + | (((b) & EV_WRITE ) ? UB_EV_WRITE : 0) \ + | (((b) & EV_SIGNAL ) ? UB_EV_SIGNAL : 0) \ + | (((b) & EV_PERSIST) ? UB_EV_PERSIST : 0)) + +# define UB_EV_BITS_CB(C) void my_ ## C (int fd, short bits, void *arg) \ + { (C)(fd, UB_EV_BITS(bits), arg); } + +UB_EV_BITS_CB(comm_point_udp_callback); +UB_EV_BITS_CB(comm_point_udp_ancil_callback) +UB_EV_BITS_CB(comm_point_tcp_accept_callback) +UB_EV_BITS_CB(comm_point_tcp_handle_callback) +UB_EV_BITS_CB(comm_timer_callback) +UB_EV_BITS_CB(comm_signal_callback) +UB_EV_BITS_CB(comm_point_local_handle_callback) +UB_EV_BITS_CB(comm_point_raw_handle_callback) +UB_EV_BITS_CB(tube_handle_signal) +UB_EV_BITS_CB(comm_base_handle_slow_accept) + +static void (*NATIVE_BITS_CB(void (*cb)(int, short, void*)))(int, short, void*) +{ + if(cb == comm_point_udp_callback) + return my_comm_point_udp_callback; + else if(cb == comm_point_udp_ancil_callback) + return my_comm_point_udp_ancil_callback; + else if(cb == comm_point_tcp_accept_callback) + return my_comm_point_tcp_accept_callback; + else if(cb == comm_point_tcp_handle_callback) + return my_comm_point_tcp_handle_callback; + else if(cb == comm_timer_callback) + return my_comm_timer_callback; + else if(cb == comm_signal_callback) + return my_comm_signal_callback; + else if(cb == comm_point_local_handle_callback) + return my_comm_point_local_handle_callback; + else if(cb == comm_point_raw_handle_callback) + return my_comm_point_raw_handle_callback; + else if(cb == tube_handle_signal) + return my_tube_handle_signal; + else if(cb == comm_base_handle_slow_accept) + return my_comm_base_handle_slow_accept; + else + return NULL; +} +#else +# define NATIVE_BITS(b) (b) +# define NATIVE_BITS_CB(c) (c) +#endif + +#ifndef EVFLAG_AUTO +#define EVFLAG_AUTO 0 +#endif + +struct my_event_base { + struct ub_event_base super; + struct event_base* base; +}; + +struct my_event { + struct ub_event super; + struct event ev; +}; + +#define AS_MY_EVENT_BASE(x) ((struct my_event_base*)x) +#define AS_MY_EVENT(x) ((struct my_event*)x) + +const char* ub_event_get_version(void) +{ + return "pluggable-event"PACKAGE_VERSION; +} + +static void +my_event_add_bits(struct ub_event* ev, short bits) +{ + AS_MY_EVENT(ev)->ev.ev_events |= NATIVE_BITS(bits); +} + +static void +my_event_del_bits(struct ub_event* ev, short bits) +{ + AS_MY_EVENT(ev)->ev.ev_events &= ~NATIVE_BITS(bits); +} + +static void +my_event_set_fd(struct ub_event* ev, int fd) +{ + AS_MY_EVENT(ev)->ev.ev_fd = fd; +} + +static void +my_event_free(struct ub_event* ev) +{ + free(AS_MY_EVENT(ev)); +} + +static int +my_event_add(struct ub_event* ev, struct timeval* tv) +{ + return event_add(&AS_MY_EVENT(ev)->ev, tv); +} + +static int +my_event_del(struct ub_event* ev) +{ + return event_del(&AS_MY_EVENT(ev)->ev); +} + +static int +my_timer_add(struct ub_event* ev, struct ub_event_base* base, + void (*cb)(int, short, void*), void* arg, struct timeval* tv) +{ + event_set(&AS_MY_EVENT(ev)->ev, -1, EV_TIMEOUT,NATIVE_BITS_CB(cb),arg); + if (event_base_set(AS_MY_EVENT_BASE(base)->base, &AS_MY_EVENT(ev)->ev) + != 0) + return -1; + return evtimer_add(&AS_MY_EVENT(ev)->ev, tv); +} + +static int +my_timer_del(struct ub_event* ev) +{ + return evtimer_del(&AS_MY_EVENT(ev)->ev); +} + +static int +my_signal_add(struct ub_event* ev, struct timeval* tv) +{ + return signal_add(&AS_MY_EVENT(ev)->ev, tv); +} + +static int +my_signal_del(struct ub_event* ev) +{ + return signal_del(&AS_MY_EVENT(ev)->ev); +} + +static void +my_winsock_unregister_wsaevent(struct ub_event* ev) +{ +#if defined(USE_MINI_EVENT) && defined(USE_WINSOCK) + winsock_unregister_wsaevent(&AS_MY_EVENT(ev)->ev); + free(AS_MY_EVENT(ev)); +#else + (void)ev; +#endif +} + +static void +my_winsock_tcp_wouldblock(struct ub_event* ev, int eventbits) +{ +#if defined(USE_MINI_EVENT) && defined(USE_WINSOCK) + winsock_tcp_wouldblock(&AS_MY_EVENT(ev)->ev, NATIVE_BITS(eventbits)); +#else + (void)ev; + (void)eventbits; +#endif +} + +static struct ub_event_vmt default_event_vmt = { + my_event_add_bits, my_event_del_bits, my_event_set_fd, + my_event_free, my_event_add, my_event_del, + my_timer_add, my_timer_del, my_signal_add, my_signal_del, + my_winsock_unregister_wsaevent, my_winsock_tcp_wouldblock +}; + +static void +my_event_base_free(struct ub_event_base* base) +{ +#ifdef USE_MINI_EVENT + event_base_free(AS_MY_EVENT_BASE(base)->base); +#elif defined(HAVE_EVENT_BASE_FREE) && defined(HAVE_EVENT_BASE_ONCE) + /* only libevent 1.2+ has it, but in 1.2 it is broken - + assertion fails on signal handling ev that is not deleted + in libevent 1.3c (event_base_once appears) this is fixed. */ + event_base_free(AS_MY_EVENT_BASE(base)->base); +#endif /* HAVE_EVENT_BASE_FREE and HAVE_EVENT_BASE_ONCE */ + free(AS_MY_EVENT_BASE(base)); +} + +static int +my_event_base_dispatch(struct ub_event_base* base) +{ + return event_base_dispatch(AS_MY_EVENT_BASE(base)->base); +} + +static int +my_event_base_loopexit(struct ub_event_base* base, struct timeval* tv) +{ + return event_base_loopexit(AS_MY_EVENT_BASE(base)->base, tv); +} + +static struct ub_event* +my_event_new(struct ub_event_base* base, int fd, short bits, + void (*cb)(int, short, void*), void* arg) +{ + struct my_event *my_ev = (struct my_event*)calloc(1, + sizeof(struct my_event)); + + if (!my_ev) + return NULL; + + event_set(&my_ev->ev, fd, NATIVE_BITS(bits), NATIVE_BITS_CB(cb), arg); + if (event_base_set(AS_MY_EVENT_BASE(base)->base, &my_ev->ev) != 0) { + free(my_ev); + return NULL; + } + my_ev->super.magic = UB_EVENT_MAGIC; + my_ev->super.vmt = &default_event_vmt; + return &my_ev->super; +} + +static struct ub_event* +my_signal_new(struct ub_event_base* base, int fd, + void (*cb)(int, short, void*), void* arg) +{ + struct my_event *my_ev = (struct my_event*)calloc(1, + sizeof(struct my_event)); + + if (!my_ev) + return NULL; + + signal_set(&my_ev->ev, fd, NATIVE_BITS_CB(cb), arg); + if (event_base_set(AS_MY_EVENT_BASE(base)->base, &my_ev->ev) != 0) { + free(my_ev); + return NULL; + } + my_ev->super.magic = UB_EVENT_MAGIC; + my_ev->super.vmt = &default_event_vmt; + return &my_ev->super; +} + +static struct ub_event* +my_winsock_register_wsaevent(struct ub_event_base* base, void* wsaevent, + void (*cb)(int, short, void*), void* arg) +{ +#if defined(USE_MINI_EVENT) && defined(USE_WINSOCK) + struct my_event *my_ev = (struct my_event*)calloc(1, + sizeof(struct my_event)); + + if (!my_ev) + return NULL; + + if (!winsock_register_wsaevent(AS_MY_EVENT_BASE(base)->base, + &my_ev->ev, wsaevent, cb, arg)) { + free(my_ev); + return NULL; + + } + my_ev->super.magic = UB_EVENT_MAGIC; + my_ev->super.vmt = &default_event_vmt; + return &my_ev->super; +#else + (void)base; + (void)wsaevent; + (void)cb; + (void)arg; + return NULL; +#endif +} + +static struct ub_event_base_vmt default_event_base_vmt = { + my_event_base_free, my_event_base_dispatch, + my_event_base_loopexit, my_event_new, my_signal_new, + my_winsock_register_wsaevent +}; + +struct ub_event_base* +ub_default_event_base(int sigs, time_t* time_secs, struct timeval* time_tv) +{ + struct my_event_base* my_base = (struct my_event_base*)calloc(1, + sizeof(struct my_event_base)); + + if (!my_base) + return NULL; + +#ifdef USE_MINI_EVENT + (void)sigs; + /* use mini event time-sharing feature */ + my_base->base = event_init(time_secs, time_tv); +#else + (void)time_secs; + (void)time_tv; +# if defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP) + /* libev */ + if(sigs) + my_base->base = (struct event_base*)ev_default_loop(EVFLAG_AUTO); + else + my_base->base = (struct event_base*)ev_loop_new(EVFLAG_AUTO); +# else + (void)sigs; +# ifdef HAVE_EVENT_BASE_NEW + my_base->base = event_base_new(); +# else + my_base->base = event_init(); +# endif +# endif +#endif + if (!my_base->base) { + free(my_base); + return NULL; + } + my_base->super.magic = UB_EVENT_MAGIC; + my_base->super.vmt = &default_event_base_vmt; + return &my_base->super; +} + +struct ub_event_base* +ub_libevent_event_base(struct event_base* base) +{ +#ifdef USE_MINI_EVENT + (void)base; + return NULL; +#else + struct my_event_base* my_base = (struct my_event_base*)calloc(1, + sizeof(struct my_event_base)); + + if (!my_base) + return NULL; + my_base->super.magic = UB_EVENT_MAGIC; + my_base->super.vmt = &default_event_base_vmt; + my_base->base = base; + return &my_base->super; +#endif +} + +struct event_base* +ub_libevent_get_event_base(struct ub_event_base* base) +{ +#ifndef USE_MINI_EVENT + if (base->vmt == &default_event_base_vmt) + return AS_MY_EVENT_BASE(base)->base; +#else + (void)base; +#endif + return NULL; +} + +#if (defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)) && defined(EVBACKEND_SELECT) +static const char* ub_ev_backend2str_pluggable(int b) +{ + switch(b) { + case EVBACKEND_SELECT: return "select"; + case EVBACKEND_POLL: return "poll"; + case EVBACKEND_EPOLL: return "epoll"; + case EVBACKEND_KQUEUE: return "kqueue"; + case EVBACKEND_DEVPOLL: return "devpoll"; + case EVBACKEND_PORT: return "evport"; + } + return "unknown"; +} +#endif + +void +ub_get_event_sys(struct ub_event_base* ub_base, const char** n, const char** s, + const char** m) +{ +#ifdef USE_WINSOCK + (void)ub_base; + *n = "pluggable-event"; + *s = "winsock"; + *m = "WSAWaitForMultipleEvents"; +#elif defined(USE_MINI_EVENT) + (void)ub_base; + *n = "pluggable-event"; + *s = "internal"; + *m = "select"; +#else + struct event_base* b = ub_libevent_get_event_base(ub_base); + /* This function is only called from comm_base_create, so + * ub_base is guaranteed to exist and to be the default + * event base. + */ + assert(b); + *n = "pluggable-event"; + *s = event_get_version(); +# if defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP) + *n = "pluggable-libev"; +# ifdef EVBACKEND_SELECT + *m = ub_ev_backend2str_pluggable(ev_backend((struct ev_loop*)b)); +# else + *m = "not obtainable"; +# endif +# elif defined(HAVE_EVENT_BASE_GET_METHOD) + *n = "pluggable-libevent"; + *m = event_base_get_method(b); +# else + *m = "not obtainable"; +# endif +#endif +} + +void +ub_event_base_free(struct ub_event_base* base) +{ + if (base && base->magic == UB_EVENT_MAGIC) { + fptr_ok(base->vmt != &default_event_base_vmt || + base->vmt->free == my_event_base_free); + (*base->vmt->free)(base); + } +} + +int +ub_event_base_dispatch(struct ub_event_base* base) +{ + if (base->magic == UB_EVENT_MAGIC) { + fptr_ok(base->vmt != &default_event_base_vmt || + base->vmt->dispatch == my_event_base_dispatch); + return (*base->vmt->dispatch)(base); + } + return -1; +} + +int +ub_event_base_loopexit(struct ub_event_base* base) +{ + if (base->magic == UB_EVENT_MAGIC) { + fptr_ok(base->vmt != &default_event_base_vmt || + base->vmt->loopexit == my_event_base_loopexit); + return (*base->vmt->loopexit)(base, NULL); + } + return -1; +} + +struct ub_event* +ub_event_new(struct ub_event_base* base, int fd, short bits, + void (*cb)(int, short, void*), void* arg) +{ + if (base->magic == UB_EVENT_MAGIC) { + fptr_ok(base->vmt != &default_event_base_vmt || + base->vmt->new_event == my_event_new); + return (*base->vmt->new_event)(base, fd, bits, cb, arg); + } + return NULL; +} + +struct ub_event* +ub_signal_new(struct ub_event_base* base, int fd, + void (*cb)(int, short, void*), void* arg) +{ + if (base->magic == UB_EVENT_MAGIC) { + fptr_ok(base->vmt != &default_event_base_vmt || + base->vmt->new_signal == my_signal_new); + return (*base->vmt->new_signal)(base, fd, cb, arg); + } + return NULL; +} + +struct ub_event* +ub_winsock_register_wsaevent(struct ub_event_base* base, void* wsaevent, + void (*cb)(int, short, void*), void* arg) +{ + if (base->magic == UB_EVENT_MAGIC) { + fptr_ok(base->vmt != &default_event_base_vmt || + base->vmt->winsock_register_wsaevent == + my_winsock_register_wsaevent); + return (*base->vmt->winsock_register_wsaevent)(base, wsaevent, cb, arg); + } + return NULL; +} + +void +ub_event_add_bits(struct ub_event* ev, short bits) +{ + if (ev->magic == UB_EVENT_MAGIC) { + fptr_ok(ev->vmt != &default_event_vmt || + ev->vmt->add_bits == my_event_add_bits); + (*ev->vmt->add_bits)(ev, bits); + } +} + +void +ub_event_del_bits(struct ub_event* ev, short bits) +{ + if (ev->magic == UB_EVENT_MAGIC) { + fptr_ok(ev->vmt != &default_event_vmt || + ev->vmt->del_bits == my_event_del_bits); + (*ev->vmt->del_bits)(ev, bits); + } +} + +void +ub_event_set_fd(struct ub_event* ev, int fd) +{ + if (ev->magic == UB_EVENT_MAGIC) { + fptr_ok(ev->vmt != &default_event_vmt || + ev->vmt->set_fd == my_event_set_fd); + (*ev->vmt->set_fd)(ev, fd); + } +} + +void +ub_event_free(struct ub_event* ev) +{ + if (ev && ev->magic == UB_EVENT_MAGIC) { + fptr_ok(ev->vmt != &default_event_vmt || + ev->vmt->free == my_event_free); + (*ev->vmt->free)(ev); + } +} + +int +ub_event_add(struct ub_event* ev, struct timeval* tv) +{ + if (ev->magic == UB_EVENT_MAGIC) { + fptr_ok(ev->vmt != &default_event_vmt || + ev->vmt->add == my_event_add); + return (*ev->vmt->add)(ev, tv); + } + return -1; +} + +int +ub_event_del(struct ub_event* ev) +{ + if (ev && ev->magic == UB_EVENT_MAGIC) { + fptr_ok(ev->vmt != &default_event_vmt || + ev->vmt->del == my_event_del); + return (*ev->vmt->del)(ev); + } + return -1; +} + +int +ub_timer_add(struct ub_event* ev, struct ub_event_base* base, + void (*cb)(int, short, void*), void* arg, struct timeval* tv) +{ + if (ev->magic == UB_EVENT_MAGIC) { + fptr_ok(ev->vmt != &default_event_vmt || + ev->vmt->add_timer == my_timer_add); + return (*ev->vmt->add_timer)(ev, base, cb, arg, tv); + } + return -1; +} + +int +ub_timer_del(struct ub_event* ev) +{ + if (ev && ev->magic == UB_EVENT_MAGIC) { + fptr_ok(ev->vmt != &default_event_vmt || + ev->vmt->del_timer == my_timer_del); + return (*ev->vmt->del_timer)(ev); + } + return -1; +} + +int +ub_signal_add(struct ub_event* ev, struct timeval* tv) +{ + if (ev->magic == UB_EVENT_MAGIC) { + fptr_ok(ev->vmt != &default_event_vmt || + ev->vmt->add_signal == my_signal_add); + return (*ev->vmt->add_signal)(ev, tv); + } + return -1; +} + +int +ub_signal_del(struct ub_event* ev) +{ + if (ev && ev->magic == UB_EVENT_MAGIC) { + fptr_ok(ev->vmt != &default_event_vmt || + ev->vmt->del_signal == my_signal_del); + return (*ev->vmt->del_signal)(ev); + } + return -1; +} + +void +ub_winsock_unregister_wsaevent(struct ub_event* ev) +{ + if (ev && ev->magic == UB_EVENT_MAGIC) { + fptr_ok(ev->vmt != &default_event_vmt || + ev->vmt->winsock_unregister_wsaevent == + my_winsock_unregister_wsaevent); + (*ev->vmt->winsock_unregister_wsaevent)(ev); + } +} + +void +ub_winsock_tcp_wouldblock(struct ub_event* ev, int eventbits) +{ + if (ev->magic == UB_EVENT_MAGIC) { + fptr_ok(ev->vmt != &default_event_vmt || + ev->vmt->winsock_tcp_wouldblock == + my_winsock_tcp_wouldblock); + (*ev->vmt->winsock_tcp_wouldblock)(ev, eventbits); + } +} + +void ub_comm_base_now(struct comm_base* cb) +{ + time_t *tt; + struct timeval *tv; + +#ifdef USE_MINI_EVENT +/** minievent updates the time when it blocks. */ + if (comm_base_internal(cb)->magic == UB_EVENT_MAGIC && + comm_base_internal(cb)->vmt == &default_event_base_vmt) + return; /* Actually using mini event, so do not set time */ +#endif /* USE_MINI_EVENT */ + +/** fillup the time values in the event base */ + comm_base_timept(cb, &tt, &tv); + if(gettimeofday(tv, NULL) < 0) { + log_err("gettimeofday: %s", strerror(errno)); + } + *tt = tv->tv_sec; +} + diff --git a/external/unbound/util/winsock_event.c b/external/unbound/util/winsock_event.c index 40b79821a..63d98796d 100644 --- a/external/unbound/util/winsock_event.c +++ b/external/unbound/util/winsock_event.c @@ -169,7 +169,7 @@ static void handle_timeouts(struct event_base* base, struct timeval* now, #endif verbose(VERB_CLIENT, "winsock_event handle_timeouts"); - while((rbnode_t*)(p = (struct event*)rbtree_first(base->times)) + while((rbnode_type*)(p = (struct event*)rbtree_first(base->times)) !=RBTREE_NULL) { #ifndef S_SPLINT_S if(p->ev_timeout.tv_sec > now->tv_sec || @@ -262,8 +262,9 @@ static int handle_select(struct event_base* base, struct timeval* wait) break; /* sanity check */ } log_assert(numwait <= WSA_MAXIMUM_WAIT_EVENTS); - verbose(VERB_CLIENT, "winsock_event bmax=%d numwait=%d wait=%x " - "timeout=%d", base->max, numwait, (int)wait, (int)timeout); + verbose(VERB_CLIENT, "winsock_event bmax=%d numwait=%d wait=%s " + "timeout=%d", base->max, numwait, (wait?"<wait>":"<null>"), + (int)timeout); /* do the wait */ if(numwait == 0) { diff --git a/external/unbound/util/winsock_event.h b/external/unbound/util/winsock_event.h index d386a699f..d6dafac8c 100644 --- a/external/unbound/util/winsock_event.h +++ b/external/unbound/util/winsock_event.h @@ -132,7 +132,7 @@ struct event_base { /** sorted by timeout (absolute), ptr */ - rbtree_t* times; + rbtree_type* times; /** array (first part in use) of handles to work on */ struct event** items; /** number of items in use in array */ @@ -169,7 +169,7 @@ struct event_base */ struct event { /** node in timeout rbtree */ - rbnode_t node; + rbnode_type node; /** is event already added */ int added; |