xref: /netbsd-src/external/bsd/nsd/dist/configparser.c (revision d16b7486a53dcb8072b60ec6fcb4373a2d0c27b7)
1 /* A Bison parser, made by GNU Bison 3.7.6.  */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5    Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6    Inc.
7 
8    This program is free software: you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation, either version 3 of the License, or
11    (at your option) any later version.
12 
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17 
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
20 
21 /* As a special exception, you may create a larger work that contains
22    part or all of the Bison parser skeleton and distribute that work
23    under terms of your choice, so long as that work isn't itself a
24    parser generator using the skeleton or a modified version thereof
25    as a parser skeleton.  Alternatively, if you modify or redistribute
26    the parser skeleton itself, you may (at your option) remove this
27    special exception, which will cause the skeleton and the resulting
28    Bison output files to be licensed under the GNU General Public
29    License without this special exception.
30 
31    This special exception was added by the Free Software Foundation in
32    version 2.2 of Bison.  */
33 
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35    simplifying the original so-called "semantic" parser.  */
36 
37 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38    especially those whose name start with YY_ or yy_.  They are
39    private implementation details that can be changed or removed.  */
40 
41 /* All symbols defined below should begin with yy or YY, to avoid
42    infringing on user name space.  This should be done even for local
43    variables, as they might otherwise be expanded by user macros.
44    There are some unavoidable exceptions within include files to
45    define necessary library symbols; they are noted "INFRINGES ON
46    USER NAME SPACE" below.  */
47 
48 /* Identify Bison output, and Bison version.  */
49 #define YYBISON 30706
50 
51 /* Bison version string.  */
52 #define YYBISON_VERSION "3.7.6"
53 
54 /* Skeleton name.  */
55 #define YYSKELETON_NAME "yacc.c"
56 
57 /* Pure parsers.  */
58 #define YYPURE 0
59 
60 /* Push parsers.  */
61 #define YYPUSH 0
62 
63 /* Pull parsers.  */
64 #define YYPULL 1
65 
66 
67 /* Substitute the variable and function names.  */
68 #define yyparse         c_parse
69 #define yylex           c_lex
70 #define yyerror         c_error
71 #define yydebug         c_debug
72 #define yynerrs         c_nerrs
73 #define yylval          c_lval
74 #define yychar          c_char
75 
76 /* First part of user prologue.  */
77 #line 10 "configparser.y"
78 
79 #include "config.h"
80 
81 #include <assert.h>
82 #include <errno.h>
83 #include <stdio.h>
84 #include <string.h>
85 
86 #include "options.h"
87 #include "util.h"
88 #include "dname.h"
89 #include "tsig.h"
90 #include "rrl.h"
91 
92 int yylex(void);
93 
94 #ifdef __cplusplus
95 extern "C"
96 #endif
97 
98 /* these need to be global, otherwise they cannot be used inside yacc */
99 extern config_parser_state_type *cfg_parser;
100 
101 static void append_acl(struct acl_options **list, struct acl_options *acl);
102 static void add_to_last_acl(struct acl_options **list, char *ac);
103 static int parse_boolean(const char *str, int *bln);
104 static int parse_expire_expr(const char *str, long long *num, uint8_t *expr);
105 static int parse_number(const char *str, long long *num);
106 static int parse_range(const char *str, long long *low, long long *high);
107 
108 struct component {
109 	struct component *next;
110 	char *str;
111 };
112 
113 
114 #line 115 "configparser.c"
115 
116 # ifndef YY_CAST
117 #  ifdef __cplusplus
118 #   define YY_CAST(Type, Val) static_cast<Type> (Val)
119 #   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
120 #  else
121 #   define YY_CAST(Type, Val) ((Type) (Val))
122 #   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
123 #  endif
124 # endif
125 # ifndef YY_NULLPTR
126 #  if defined __cplusplus
127 #   if 201103L <= __cplusplus
128 #    define YY_NULLPTR nullptr
129 #   else
130 #    define YY_NULLPTR 0
131 #   endif
132 #  else
133 #   define YY_NULLPTR ((void*)0)
134 #  endif
135 # endif
136 
137 #include "configparser.h"
138 /* Symbol kind.  */
139 enum yysymbol_kind_t
140 {
141   YYSYMBOL_YYEMPTY = -2,
142   YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
143   YYSYMBOL_YYerror = 1,                    /* error  */
144   YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
145   YYSYMBOL_STRING = 3,                     /* STRING  */
146   YYSYMBOL_VAR_SERVER = 4,                 /* VAR_SERVER  */
147   YYSYMBOL_VAR_SERVER_COUNT = 5,           /* VAR_SERVER_COUNT  */
148   YYSYMBOL_VAR_IP_ADDRESS = 6,             /* VAR_IP_ADDRESS  */
149   YYSYMBOL_VAR_IP_TRANSPARENT = 7,         /* VAR_IP_TRANSPARENT  */
150   YYSYMBOL_VAR_IP_FREEBIND = 8,            /* VAR_IP_FREEBIND  */
151   YYSYMBOL_VAR_REUSEPORT = 9,              /* VAR_REUSEPORT  */
152   YYSYMBOL_VAR_SEND_BUFFER_SIZE = 10,      /* VAR_SEND_BUFFER_SIZE  */
153   YYSYMBOL_VAR_RECEIVE_BUFFER_SIZE = 11,   /* VAR_RECEIVE_BUFFER_SIZE  */
154   YYSYMBOL_VAR_DEBUG_MODE = 12,            /* VAR_DEBUG_MODE  */
155   YYSYMBOL_VAR_IP4_ONLY = 13,              /* VAR_IP4_ONLY  */
156   YYSYMBOL_VAR_IP6_ONLY = 14,              /* VAR_IP6_ONLY  */
157   YYSYMBOL_VAR_DO_IP4 = 15,                /* VAR_DO_IP4  */
158   YYSYMBOL_VAR_DO_IP6 = 16,                /* VAR_DO_IP6  */
159   YYSYMBOL_VAR_PORT = 17,                  /* VAR_PORT  */
160   YYSYMBOL_VAR_USE_SYSTEMD = 18,           /* VAR_USE_SYSTEMD  */
161   YYSYMBOL_VAR_VERBOSITY = 19,             /* VAR_VERBOSITY  */
162   YYSYMBOL_VAR_USERNAME = 20,              /* VAR_USERNAME  */
163   YYSYMBOL_VAR_CHROOT = 21,                /* VAR_CHROOT  */
164   YYSYMBOL_VAR_ZONESDIR = 22,              /* VAR_ZONESDIR  */
165   YYSYMBOL_VAR_ZONELISTFILE = 23,          /* VAR_ZONELISTFILE  */
166   YYSYMBOL_VAR_DATABASE = 24,              /* VAR_DATABASE  */
167   YYSYMBOL_VAR_LOGFILE = 25,               /* VAR_LOGFILE  */
168   YYSYMBOL_VAR_LOG_ONLY_SYSLOG = 26,       /* VAR_LOG_ONLY_SYSLOG  */
169   YYSYMBOL_VAR_PIDFILE = 27,               /* VAR_PIDFILE  */
170   YYSYMBOL_VAR_DIFFFILE = 28,              /* VAR_DIFFFILE  */
171   YYSYMBOL_VAR_XFRDFILE = 29,              /* VAR_XFRDFILE  */
172   YYSYMBOL_VAR_XFRDIR = 30,                /* VAR_XFRDIR  */
173   YYSYMBOL_VAR_HIDE_VERSION = 31,          /* VAR_HIDE_VERSION  */
174   YYSYMBOL_VAR_HIDE_IDENTITY = 32,         /* VAR_HIDE_IDENTITY  */
175   YYSYMBOL_VAR_VERSION = 33,               /* VAR_VERSION  */
176   YYSYMBOL_VAR_IDENTITY = 34,              /* VAR_IDENTITY  */
177   YYSYMBOL_VAR_NSID = 35,                  /* VAR_NSID  */
178   YYSYMBOL_VAR_TCP_COUNT = 36,             /* VAR_TCP_COUNT  */
179   YYSYMBOL_VAR_TCP_REJECT_OVERFLOW = 37,   /* VAR_TCP_REJECT_OVERFLOW  */
180   YYSYMBOL_VAR_TCP_QUERY_COUNT = 38,       /* VAR_TCP_QUERY_COUNT  */
181   YYSYMBOL_VAR_TCP_TIMEOUT = 39,           /* VAR_TCP_TIMEOUT  */
182   YYSYMBOL_VAR_TCP_MSS = 40,               /* VAR_TCP_MSS  */
183   YYSYMBOL_VAR_OUTGOING_TCP_MSS = 41,      /* VAR_OUTGOING_TCP_MSS  */
184   YYSYMBOL_VAR_IPV4_EDNS_SIZE = 42,        /* VAR_IPV4_EDNS_SIZE  */
185   YYSYMBOL_VAR_IPV6_EDNS_SIZE = 43,        /* VAR_IPV6_EDNS_SIZE  */
186   YYSYMBOL_VAR_STATISTICS = 44,            /* VAR_STATISTICS  */
187   YYSYMBOL_VAR_XFRD_RELOAD_TIMEOUT = 45,   /* VAR_XFRD_RELOAD_TIMEOUT  */
188   YYSYMBOL_VAR_LOG_TIME_ASCII = 46,        /* VAR_LOG_TIME_ASCII  */
189   YYSYMBOL_VAR_ROUND_ROBIN = 47,           /* VAR_ROUND_ROBIN  */
190   YYSYMBOL_VAR_MINIMAL_RESPONSES = 48,     /* VAR_MINIMAL_RESPONSES  */
191   YYSYMBOL_VAR_CONFINE_TO_ZONE = 49,       /* VAR_CONFINE_TO_ZONE  */
192   YYSYMBOL_VAR_REFUSE_ANY = 50,            /* VAR_REFUSE_ANY  */
193   YYSYMBOL_VAR_ZONEFILES_CHECK = 51,       /* VAR_ZONEFILES_CHECK  */
194   YYSYMBOL_VAR_ZONEFILES_WRITE = 52,       /* VAR_ZONEFILES_WRITE  */
195   YYSYMBOL_VAR_RRL_SIZE = 53,              /* VAR_RRL_SIZE  */
196   YYSYMBOL_VAR_RRL_RATELIMIT = 54,         /* VAR_RRL_RATELIMIT  */
197   YYSYMBOL_VAR_RRL_SLIP = 55,              /* VAR_RRL_SLIP  */
198   YYSYMBOL_VAR_RRL_IPV4_PREFIX_LENGTH = 56, /* VAR_RRL_IPV4_PREFIX_LENGTH  */
199   YYSYMBOL_VAR_RRL_IPV6_PREFIX_LENGTH = 57, /* VAR_RRL_IPV6_PREFIX_LENGTH  */
200   YYSYMBOL_VAR_RRL_WHITELIST_RATELIMIT = 58, /* VAR_RRL_WHITELIST_RATELIMIT  */
201   YYSYMBOL_VAR_TLS_SERVICE_KEY = 59,       /* VAR_TLS_SERVICE_KEY  */
202   YYSYMBOL_VAR_TLS_SERVICE_PEM = 60,       /* VAR_TLS_SERVICE_PEM  */
203   YYSYMBOL_VAR_TLS_SERVICE_OCSP = 61,      /* VAR_TLS_SERVICE_OCSP  */
204   YYSYMBOL_VAR_TLS_PORT = 62,              /* VAR_TLS_PORT  */
205   YYSYMBOL_VAR_TLS_CERT_BUNDLE = 63,       /* VAR_TLS_CERT_BUNDLE  */
206   YYSYMBOL_VAR_CPU_AFFINITY = 64,          /* VAR_CPU_AFFINITY  */
207   YYSYMBOL_VAR_XFRD_CPU_AFFINITY = 65,     /* VAR_XFRD_CPU_AFFINITY  */
208   YYSYMBOL_VAR_SERVER_CPU_AFFINITY = 66,   /* VAR_SERVER_CPU_AFFINITY  */
209   YYSYMBOL_VAR_DROP_UPDATES = 67,          /* VAR_DROP_UPDATES  */
210   YYSYMBOL_VAR_XFRD_TCP_MAX = 68,          /* VAR_XFRD_TCP_MAX  */
211   YYSYMBOL_VAR_XFRD_TCP_PIPELINE = 69,     /* VAR_XFRD_TCP_PIPELINE  */
212   YYSYMBOL_VAR_DNSTAP = 70,                /* VAR_DNSTAP  */
213   YYSYMBOL_VAR_DNSTAP_ENABLE = 71,         /* VAR_DNSTAP_ENABLE  */
214   YYSYMBOL_VAR_DNSTAP_SOCKET_PATH = 72,    /* VAR_DNSTAP_SOCKET_PATH  */
215   YYSYMBOL_VAR_DNSTAP_SEND_IDENTITY = 73,  /* VAR_DNSTAP_SEND_IDENTITY  */
216   YYSYMBOL_VAR_DNSTAP_SEND_VERSION = 74,   /* VAR_DNSTAP_SEND_VERSION  */
217   YYSYMBOL_VAR_DNSTAP_IDENTITY = 75,       /* VAR_DNSTAP_IDENTITY  */
218   YYSYMBOL_VAR_DNSTAP_VERSION = 76,        /* VAR_DNSTAP_VERSION  */
219   YYSYMBOL_VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES = 77, /* VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES  */
220   YYSYMBOL_VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES = 78, /* VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES  */
221   YYSYMBOL_VAR_REMOTE_CONTROL = 79,        /* VAR_REMOTE_CONTROL  */
222   YYSYMBOL_VAR_CONTROL_ENABLE = 80,        /* VAR_CONTROL_ENABLE  */
223   YYSYMBOL_VAR_CONTROL_INTERFACE = 81,     /* VAR_CONTROL_INTERFACE  */
224   YYSYMBOL_VAR_CONTROL_PORT = 82,          /* VAR_CONTROL_PORT  */
225   YYSYMBOL_VAR_SERVER_KEY_FILE = 83,       /* VAR_SERVER_KEY_FILE  */
226   YYSYMBOL_VAR_SERVER_CERT_FILE = 84,      /* VAR_SERVER_CERT_FILE  */
227   YYSYMBOL_VAR_CONTROL_KEY_FILE = 85,      /* VAR_CONTROL_KEY_FILE  */
228   YYSYMBOL_VAR_CONTROL_CERT_FILE = 86,     /* VAR_CONTROL_CERT_FILE  */
229   YYSYMBOL_VAR_KEY = 87,                   /* VAR_KEY  */
230   YYSYMBOL_VAR_ALGORITHM = 88,             /* VAR_ALGORITHM  */
231   YYSYMBOL_VAR_SECRET = 89,                /* VAR_SECRET  */
232   YYSYMBOL_VAR_TLS_AUTH = 90,              /* VAR_TLS_AUTH  */
233   YYSYMBOL_VAR_TLS_AUTH_DOMAIN_NAME = 91,  /* VAR_TLS_AUTH_DOMAIN_NAME  */
234   YYSYMBOL_VAR_TLS_AUTH_CLIENT_CERT = 92,  /* VAR_TLS_AUTH_CLIENT_CERT  */
235   YYSYMBOL_VAR_TLS_AUTH_CLIENT_KEY = 93,   /* VAR_TLS_AUTH_CLIENT_KEY  */
236   YYSYMBOL_VAR_TLS_AUTH_CLIENT_KEY_PW = 94, /* VAR_TLS_AUTH_CLIENT_KEY_PW  */
237   YYSYMBOL_VAR_PATTERN = 95,               /* VAR_PATTERN  */
238   YYSYMBOL_VAR_NAME = 96,                  /* VAR_NAME  */
239   YYSYMBOL_VAR_ZONEFILE = 97,              /* VAR_ZONEFILE  */
240   YYSYMBOL_VAR_NOTIFY = 98,                /* VAR_NOTIFY  */
241   YYSYMBOL_VAR_PROVIDE_XFR = 99,           /* VAR_PROVIDE_XFR  */
242   YYSYMBOL_VAR_ALLOW_QUERY = 100,          /* VAR_ALLOW_QUERY  */
243   YYSYMBOL_VAR_AXFR = 101,                 /* VAR_AXFR  */
244   YYSYMBOL_VAR_UDP = 102,                  /* VAR_UDP  */
245   YYSYMBOL_VAR_NOTIFY_RETRY = 103,         /* VAR_NOTIFY_RETRY  */
246   YYSYMBOL_VAR_ALLOW_NOTIFY = 104,         /* VAR_ALLOW_NOTIFY  */
247   YYSYMBOL_VAR_REQUEST_XFR = 105,          /* VAR_REQUEST_XFR  */
248   YYSYMBOL_VAR_ALLOW_AXFR_FALLBACK = 106,  /* VAR_ALLOW_AXFR_FALLBACK  */
249   YYSYMBOL_VAR_OUTGOING_INTERFACE = 107,   /* VAR_OUTGOING_INTERFACE  */
250   YYSYMBOL_VAR_ANSWER_COOKIE = 108,        /* VAR_ANSWER_COOKIE  */
251   YYSYMBOL_VAR_COOKIE_SECRET = 109,        /* VAR_COOKIE_SECRET  */
252   YYSYMBOL_VAR_COOKIE_SECRET_FILE = 110,   /* VAR_COOKIE_SECRET_FILE  */
253   YYSYMBOL_VAR_MAX_REFRESH_TIME = 111,     /* VAR_MAX_REFRESH_TIME  */
254   YYSYMBOL_VAR_MIN_REFRESH_TIME = 112,     /* VAR_MIN_REFRESH_TIME  */
255   YYSYMBOL_VAR_MAX_RETRY_TIME = 113,       /* VAR_MAX_RETRY_TIME  */
256   YYSYMBOL_VAR_MIN_RETRY_TIME = 114,       /* VAR_MIN_RETRY_TIME  */
257   YYSYMBOL_VAR_MIN_EXPIRE_TIME = 115,      /* VAR_MIN_EXPIRE_TIME  */
258   YYSYMBOL_VAR_MULTI_MASTER_CHECK = 116,   /* VAR_MULTI_MASTER_CHECK  */
259   YYSYMBOL_VAR_SIZE_LIMIT_XFR = 117,       /* VAR_SIZE_LIMIT_XFR  */
260   YYSYMBOL_VAR_ZONESTATS = 118,            /* VAR_ZONESTATS  */
261   YYSYMBOL_VAR_INCLUDE_PATTERN = 119,      /* VAR_INCLUDE_PATTERN  */
262   YYSYMBOL_VAR_STORE_IXFR = 120,           /* VAR_STORE_IXFR  */
263   YYSYMBOL_VAR_IXFR_SIZE = 121,            /* VAR_IXFR_SIZE  */
264   YYSYMBOL_VAR_IXFR_NUMBER = 122,          /* VAR_IXFR_NUMBER  */
265   YYSYMBOL_VAR_CREATE_IXFR = 123,          /* VAR_CREATE_IXFR  */
266   YYSYMBOL_VAR_ZONE = 124,                 /* VAR_ZONE  */
267   YYSYMBOL_VAR_RRL_WHITELIST = 125,        /* VAR_RRL_WHITELIST  */
268   YYSYMBOL_VAR_SERVERS = 126,              /* VAR_SERVERS  */
269   YYSYMBOL_VAR_BINDTODEVICE = 127,         /* VAR_BINDTODEVICE  */
270   YYSYMBOL_VAR_SETFIB = 128,               /* VAR_SETFIB  */
271   YYSYMBOL_VAR_VERIFY = 129,               /* VAR_VERIFY  */
272   YYSYMBOL_VAR_ENABLE = 130,               /* VAR_ENABLE  */
273   YYSYMBOL_VAR_VERIFY_ZONE = 131,          /* VAR_VERIFY_ZONE  */
274   YYSYMBOL_VAR_VERIFY_ZONES = 132,         /* VAR_VERIFY_ZONES  */
275   YYSYMBOL_VAR_VERIFIER = 133,             /* VAR_VERIFIER  */
276   YYSYMBOL_VAR_VERIFIER_COUNT = 134,       /* VAR_VERIFIER_COUNT  */
277   YYSYMBOL_VAR_VERIFIER_FEED_ZONE = 135,   /* VAR_VERIFIER_FEED_ZONE  */
278   YYSYMBOL_VAR_VERIFIER_TIMEOUT = 136,     /* VAR_VERIFIER_TIMEOUT  */
279   YYSYMBOL_YYACCEPT = 137,                 /* $accept  */
280   YYSYMBOL_blocks = 138,                   /* blocks  */
281   YYSYMBOL_block = 139,                    /* block  */
282   YYSYMBOL_server = 140,                   /* server  */
283   YYSYMBOL_server_block = 141,             /* server_block  */
284   YYSYMBOL_server_option = 142,            /* server_option  */
285   YYSYMBOL_143_1 = 143,                    /* $@1  */
286   YYSYMBOL_socket_options = 144,           /* socket_options  */
287   YYSYMBOL_socket_option = 145,            /* socket_option  */
288   YYSYMBOL_cpus = 146,                     /* cpus  */
289   YYSYMBOL_service_cpu_affinity = 147,     /* service_cpu_affinity  */
290   YYSYMBOL_dnstap = 148,                   /* dnstap  */
291   YYSYMBOL_dnstap_block = 149,             /* dnstap_block  */
292   YYSYMBOL_dnstap_option = 150,            /* dnstap_option  */
293   YYSYMBOL_remote_control = 151,           /* remote_control  */
294   YYSYMBOL_remote_control_block = 152,     /* remote_control_block  */
295   YYSYMBOL_remote_control_option = 153,    /* remote_control_option  */
296   YYSYMBOL_tls_auth = 154,                 /* tls_auth  */
297   YYSYMBOL_155_2 = 155,                    /* $@2  */
298   YYSYMBOL_tls_auth_block = 156,           /* tls_auth_block  */
299   YYSYMBOL_tls_auth_option = 157,          /* tls_auth_option  */
300   YYSYMBOL_key = 158,                      /* key  */
301   YYSYMBOL_159_3 = 159,                    /* $@3  */
302   YYSYMBOL_key_block = 160,                /* key_block  */
303   YYSYMBOL_key_option = 161,               /* key_option  */
304   YYSYMBOL_zone = 162,                     /* zone  */
305   YYSYMBOL_163_4 = 163,                    /* $@4  */
306   YYSYMBOL_zone_block = 164,               /* zone_block  */
307   YYSYMBOL_zone_option = 165,              /* zone_option  */
308   YYSYMBOL_pattern = 166,                  /* pattern  */
309   YYSYMBOL_167_5 = 167,                    /* $@5  */
310   YYSYMBOL_pattern_block = 168,            /* pattern_block  */
311   YYSYMBOL_pattern_option = 169,           /* pattern_option  */
312   YYSYMBOL_pattern_or_zone_option = 170,   /* pattern_or_zone_option  */
313   YYSYMBOL_171_6 = 171,                    /* $@6  */
314   YYSYMBOL_172_7 = 172,                    /* $@7  */
315   YYSYMBOL_verify = 173,                   /* verify  */
316   YYSYMBOL_verify_block = 174,             /* verify_block  */
317   YYSYMBOL_verify_option = 175,            /* verify_option  */
318   YYSYMBOL_command = 176,                  /* command  */
319   YYSYMBOL_arguments = 177,                /* arguments  */
320   YYSYMBOL_ip_address = 178,               /* ip_address  */
321   YYSYMBOL_number = 179,                   /* number  */
322   YYSYMBOL_boolean = 180,                  /* boolean  */
323   YYSYMBOL_tlsauth_option = 181            /* tlsauth_option  */
324 };
325 typedef enum yysymbol_kind_t yysymbol_kind_t;
326 
327 
328 
329 
330 #ifdef short
331 # undef short
332 #endif
333 
334 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
335    <limits.h> and (if available) <stdint.h> are included
336    so that the code can choose integer types of a good width.  */
337 
338 #ifndef __PTRDIFF_MAX__
339 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
340 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
341 #  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
342 #  define YY_STDINT_H
343 # endif
344 #endif
345 
346 /* Narrow types that promote to a signed type and that can represent a
347    signed or unsigned integer of at least N bits.  In tables they can
348    save space and decrease cache pressure.  Promoting to a signed type
349    helps avoid bugs in integer arithmetic.  */
350 
351 #ifdef __INT_LEAST8_MAX__
352 typedef __INT_LEAST8_TYPE__ yytype_int8;
353 #elif defined YY_STDINT_H
354 typedef int_least8_t yytype_int8;
355 #else
356 typedef signed char yytype_int8;
357 #endif
358 
359 #ifdef __INT_LEAST16_MAX__
360 typedef __INT_LEAST16_TYPE__ yytype_int16;
361 #elif defined YY_STDINT_H
362 typedef int_least16_t yytype_int16;
363 #else
364 typedef short yytype_int16;
365 #endif
366 
367 /* Work around bug in HP-UX 11.23, which defines these macros
368    incorrectly for preprocessor constants.  This workaround can likely
369    be removed in 2023, as HPE has promised support for HP-UX 11.23
370    (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
371    <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
372 #ifdef __hpux
373 # undef UINT_LEAST8_MAX
374 # undef UINT_LEAST16_MAX
375 # define UINT_LEAST8_MAX 255
376 # define UINT_LEAST16_MAX 65535
377 #endif
378 
379 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
380 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
381 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
382        && UINT_LEAST8_MAX <= INT_MAX)
383 typedef uint_least8_t yytype_uint8;
384 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
385 typedef unsigned char yytype_uint8;
386 #else
387 typedef short yytype_uint8;
388 #endif
389 
390 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
391 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
392 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
393        && UINT_LEAST16_MAX <= INT_MAX)
394 typedef uint_least16_t yytype_uint16;
395 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
396 typedef unsigned short yytype_uint16;
397 #else
398 typedef int yytype_uint16;
399 #endif
400 
401 #ifndef YYPTRDIFF_T
402 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
403 #  define YYPTRDIFF_T __PTRDIFF_TYPE__
404 #  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
405 # elif defined PTRDIFF_MAX
406 #  ifndef ptrdiff_t
407 #   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
408 #  endif
409 #  define YYPTRDIFF_T ptrdiff_t
410 #  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
411 # else
412 #  define YYPTRDIFF_T long
413 #  define YYPTRDIFF_MAXIMUM LONG_MAX
414 # endif
415 #endif
416 
417 #ifndef YYSIZE_T
418 # ifdef __SIZE_TYPE__
419 #  define YYSIZE_T __SIZE_TYPE__
420 # elif defined size_t
421 #  define YYSIZE_T size_t
422 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
423 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
424 #  define YYSIZE_T size_t
425 # else
426 #  define YYSIZE_T unsigned
427 # endif
428 #endif
429 
430 #define YYSIZE_MAXIMUM                                  \
431   YY_CAST (YYPTRDIFF_T,                                 \
432            (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
433             ? YYPTRDIFF_MAXIMUM                         \
434             : YY_CAST (YYSIZE_T, -1)))
435 
436 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
437 
438 
439 /* Stored state numbers (used for stacks). */
440 typedef yytype_int16 yy_state_t;
441 
442 /* State numbers in computations.  */
443 typedef int yy_state_fast_t;
444 
445 #ifndef YY_
446 # if defined YYENABLE_NLS && YYENABLE_NLS
447 #  if ENABLE_NLS
448 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
449 #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
450 #  endif
451 # endif
452 # ifndef YY_
453 #  define YY_(Msgid) Msgid
454 # endif
455 #endif
456 
457 
458 #ifndef YY_ATTRIBUTE_PURE
459 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
460 #  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
461 # else
462 #  define YY_ATTRIBUTE_PURE
463 # endif
464 #endif
465 
466 #ifndef YY_ATTRIBUTE_UNUSED
467 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
468 #  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
469 # else
470 #  define YY_ATTRIBUTE_UNUSED
471 # endif
472 #endif
473 
474 /* Suppress unused-variable warnings by "using" E.  */
475 #if ! defined lint || defined __GNUC__
476 # define YY_USE(E) ((void) (E))
477 #else
478 # define YY_USE(E) /* empty */
479 #endif
480 
481 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
482 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
483 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
484     _Pragma ("GCC diagnostic push")                                     \
485     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
486     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
487 # define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
488     _Pragma ("GCC diagnostic pop")
489 #else
490 # define YY_INITIAL_VALUE(Value) Value
491 #endif
492 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
493 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
494 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
495 #endif
496 #ifndef YY_INITIAL_VALUE
497 # define YY_INITIAL_VALUE(Value) /* Nothing. */
498 #endif
499 
500 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
501 # define YY_IGNORE_USELESS_CAST_BEGIN                          \
502     _Pragma ("GCC diagnostic push")                            \
503     _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
504 # define YY_IGNORE_USELESS_CAST_END            \
505     _Pragma ("GCC diagnostic pop")
506 #endif
507 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
508 # define YY_IGNORE_USELESS_CAST_BEGIN
509 # define YY_IGNORE_USELESS_CAST_END
510 #endif
511 
512 
513 #define YY_ASSERT(E) ((void) (0 && (E)))
514 
515 #if !defined yyoverflow
516 
517 /* The parser invokes alloca or malloc; define the necessary symbols.  */
518 
519 # ifdef YYSTACK_USE_ALLOCA
520 #  if YYSTACK_USE_ALLOCA
521 #   ifdef __GNUC__
522 #    define YYSTACK_ALLOC __builtin_alloca
523 #   elif defined __BUILTIN_VA_ARG_INCR
524 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
525 #   elif defined _AIX
526 #    define YYSTACK_ALLOC __alloca
527 #   elif defined _MSC_VER
528 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
529 #    define alloca _alloca
530 #   else
531 #    define YYSTACK_ALLOC alloca
532 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
533 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
534       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
535 #     ifndef EXIT_SUCCESS
536 #      define EXIT_SUCCESS 0
537 #     endif
538 #    endif
539 #   endif
540 #  endif
541 # endif
542 
543 # ifdef YYSTACK_ALLOC
544    /* Pacify GCC's 'empty if-body' warning.  */
545 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
546 #  ifndef YYSTACK_ALLOC_MAXIMUM
547     /* The OS might guarantee only one guard page at the bottom of the stack,
548        and a page size can be as small as 4096 bytes.  So we cannot safely
549        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
550        to allow for a few compiler-allocated temporary stack slots.  */
551 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
552 #  endif
553 # else
554 #  define YYSTACK_ALLOC YYMALLOC
555 #  define YYSTACK_FREE YYFREE
556 #  ifndef YYSTACK_ALLOC_MAXIMUM
557 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
558 #  endif
559 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
560        && ! ((defined YYMALLOC || defined malloc) \
561              && (defined YYFREE || defined free)))
562 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
563 #   ifndef EXIT_SUCCESS
564 #    define EXIT_SUCCESS 0
565 #   endif
566 #  endif
567 #  ifndef YYMALLOC
568 #   define YYMALLOC malloc
569 #   if ! defined malloc && ! defined EXIT_SUCCESS
570 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
571 #   endif
572 #  endif
573 #  ifndef YYFREE
574 #   define YYFREE free
575 #   if ! defined free && ! defined EXIT_SUCCESS
576 void free (void *); /* INFRINGES ON USER NAME SPACE */
577 #   endif
578 #  endif
579 # endif
580 #endif /* !defined yyoverflow */
581 
582 #if (! defined yyoverflow \
583      && (! defined __cplusplus \
584          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
585 
586 /* A type that is properly aligned for any stack member.  */
587 union yyalloc
588 {
589   yy_state_t yyss_alloc;
590   YYSTYPE yyvs_alloc;
591 };
592 
593 /* The size of the maximum gap between one aligned stack and the next.  */
594 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
595 
596 /* The size of an array large to enough to hold all stacks, each with
597    N elements.  */
598 # define YYSTACK_BYTES(N) \
599      ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
600       + YYSTACK_GAP_MAXIMUM)
601 
602 # define YYCOPY_NEEDED 1
603 
604 /* Relocate STACK from its old location to the new one.  The
605    local variables YYSIZE and YYSTACKSIZE give the old and new number of
606    elements in the stack, and YYPTR gives the new location of the
607    stack.  Advance YYPTR to a properly aligned location for the next
608    stack.  */
609 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
610     do                                                                  \
611       {                                                                 \
612         YYPTRDIFF_T yynewbytes;                                         \
613         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
614         Stack = &yyptr->Stack_alloc;                                    \
615         yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
616         yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
617       }                                                                 \
618     while (0)
619 
620 #endif
621 
622 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
623 /* Copy COUNT objects from SRC to DST.  The source and destination do
624    not overlap.  */
625 # ifndef YYCOPY
626 #  if defined __GNUC__ && 1 < __GNUC__
627 #   define YYCOPY(Dst, Src, Count) \
628       __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
629 #  else
630 #   define YYCOPY(Dst, Src, Count)              \
631       do                                        \
632         {                                       \
633           YYPTRDIFF_T yyi;                      \
634           for (yyi = 0; yyi < (Count); yyi++)   \
635             (Dst)[yyi] = (Src)[yyi];            \
636         }                                       \
637       while (0)
638 #  endif
639 # endif
640 #endif /* !YYCOPY_NEEDED */
641 
642 /* YYFINAL -- State number of the termination state.  */
643 #define YYFINAL  2
644 /* YYLAST -- Last index in YYTABLE.  */
645 #define YYLAST   451
646 
647 /* YYNTOKENS -- Number of terminals.  */
648 #define YYNTOKENS  137
649 /* YYNNTS -- Number of nonterminals.  */
650 #define YYNNTS  45
651 /* YYNRULES -- Number of rules.  */
652 #define YYNRULES  190
653 /* YYNSTATES -- Number of states.  */
654 #define YYNSTATES  330
655 
656 /* YYMAXUTOK -- Last valid token kind.  */
657 #define YYMAXUTOK   391
658 
659 
660 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
661    as returned by yylex, with out-of-bounds checking.  */
662 #define YYTRANSLATE(YYX)                                \
663   (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
664    ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
665    : YYSYMBOL_YYUNDEF)
666 
667 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
668    as returned by yylex.  */
669 static const yytype_uint8 yytranslate[] =
670 {
671        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
672        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
673        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
674        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
675        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
676        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
677        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
678        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
679        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
680        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
681        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
682        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
683        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
684        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
685        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
686        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
687        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
688        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
689        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
690        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
691        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
692        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
693        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
694        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
695        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
696        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
697        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
698       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
699       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
700       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
701       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
702       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
703       65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
704       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
705       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
706       95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
707      105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
708      115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
709      125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
710      135,   136
711 };
712 
713 #if YYDEBUG
714   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
715 static const yytype_int16 yyrline[] =
716 {
717        0,   220,   220,   222,   225,   226,   227,   228,   229,   230,
718      231,   232,   235,   238,   238,   242,   241,   258,   266,   268,
719      270,   272,   274,   276,   278,   280,   282,   284,   286,   288,
720      290,   292,   301,   303,   305,   335,   337,   339,   347,   349,
721      351,   353,   355,   357,   359,   361,   363,   370,   372,   374,
722      376,   378,   380,   382,   384,   386,   388,   390,   392,   402,
723      408,   414,   424,   434,   440,   442,   444,   449,   454,   459,
724      461,   463,   465,   467,   469,   476,   478,   480,   482,   484,
725      486,   488,   492,   522,   523,   526,   553,   555,   560,   561,
726      595,   597,   608,   611,   611,   614,   616,   618,   620,   622,
727      624,   626,   628,   633,   636,   636,   639,   641,   651,   659,
728      661,   663,   665,   671,   670,   692,   692,   695,   706,   710,
729      714,   718,   726,   725,   750,   750,   753,   765,   773,   792,
730      791,   816,   816,   819,   832,   836,   835,   852,   852,   855,
731      862,   865,   871,   873,   875,   883,   885,   888,   887,   899,
732      898,   910,   920,   925,   934,   939,   944,   949,   954,   959,
733      964,   969,   974,   979,   991,   996,  1001,  1006,  1011,  1013,
734     1015,  1017,  1021,  1024,  1024,  1027,  1029,  1039,  1046,  1048,
735     1050,  1052,  1054,  1058,  1078,  1079,  1097,  1107,  1116,  1124,
736     1125
737 };
738 #endif
739 
740 /** Accessing symbol of state STATE.  */
741 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
742 
743 #if YYDEBUG || 0
744 /* The user-facing name of the symbol whose (internal) number is
745    YYSYMBOL.  No bounds checking.  */
746 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
747 
748 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
749    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
750 static const char *const yytname[] =
751 {
752   "\"end of file\"", "error", "\"invalid token\"", "STRING", "VAR_SERVER",
753   "VAR_SERVER_COUNT", "VAR_IP_ADDRESS", "VAR_IP_TRANSPARENT",
754   "VAR_IP_FREEBIND", "VAR_REUSEPORT", "VAR_SEND_BUFFER_SIZE",
755   "VAR_RECEIVE_BUFFER_SIZE", "VAR_DEBUG_MODE", "VAR_IP4_ONLY",
756   "VAR_IP6_ONLY", "VAR_DO_IP4", "VAR_DO_IP6", "VAR_PORT",
757   "VAR_USE_SYSTEMD", "VAR_VERBOSITY", "VAR_USERNAME", "VAR_CHROOT",
758   "VAR_ZONESDIR", "VAR_ZONELISTFILE", "VAR_DATABASE", "VAR_LOGFILE",
759   "VAR_LOG_ONLY_SYSLOG", "VAR_PIDFILE", "VAR_DIFFFILE", "VAR_XFRDFILE",
760   "VAR_XFRDIR", "VAR_HIDE_VERSION", "VAR_HIDE_IDENTITY", "VAR_VERSION",
761   "VAR_IDENTITY", "VAR_NSID", "VAR_TCP_COUNT", "VAR_TCP_REJECT_OVERFLOW",
762   "VAR_TCP_QUERY_COUNT", "VAR_TCP_TIMEOUT", "VAR_TCP_MSS",
763   "VAR_OUTGOING_TCP_MSS", "VAR_IPV4_EDNS_SIZE", "VAR_IPV6_EDNS_SIZE",
764   "VAR_STATISTICS", "VAR_XFRD_RELOAD_TIMEOUT", "VAR_LOG_TIME_ASCII",
765   "VAR_ROUND_ROBIN", "VAR_MINIMAL_RESPONSES", "VAR_CONFINE_TO_ZONE",
766   "VAR_REFUSE_ANY", "VAR_ZONEFILES_CHECK", "VAR_ZONEFILES_WRITE",
767   "VAR_RRL_SIZE", "VAR_RRL_RATELIMIT", "VAR_RRL_SLIP",
768   "VAR_RRL_IPV4_PREFIX_LENGTH", "VAR_RRL_IPV6_PREFIX_LENGTH",
769   "VAR_RRL_WHITELIST_RATELIMIT", "VAR_TLS_SERVICE_KEY",
770   "VAR_TLS_SERVICE_PEM", "VAR_TLS_SERVICE_OCSP", "VAR_TLS_PORT",
771   "VAR_TLS_CERT_BUNDLE", "VAR_CPU_AFFINITY", "VAR_XFRD_CPU_AFFINITY",
772   "VAR_SERVER_CPU_AFFINITY", "VAR_DROP_UPDATES", "VAR_XFRD_TCP_MAX",
773   "VAR_XFRD_TCP_PIPELINE", "VAR_DNSTAP", "VAR_DNSTAP_ENABLE",
774   "VAR_DNSTAP_SOCKET_PATH", "VAR_DNSTAP_SEND_IDENTITY",
775   "VAR_DNSTAP_SEND_VERSION", "VAR_DNSTAP_IDENTITY", "VAR_DNSTAP_VERSION",
776   "VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES",
777   "VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES", "VAR_REMOTE_CONTROL",
778   "VAR_CONTROL_ENABLE", "VAR_CONTROL_INTERFACE", "VAR_CONTROL_PORT",
779   "VAR_SERVER_KEY_FILE", "VAR_SERVER_CERT_FILE", "VAR_CONTROL_KEY_FILE",
780   "VAR_CONTROL_CERT_FILE", "VAR_KEY", "VAR_ALGORITHM", "VAR_SECRET",
781   "VAR_TLS_AUTH", "VAR_TLS_AUTH_DOMAIN_NAME", "VAR_TLS_AUTH_CLIENT_CERT",
782   "VAR_TLS_AUTH_CLIENT_KEY", "VAR_TLS_AUTH_CLIENT_KEY_PW", "VAR_PATTERN",
783   "VAR_NAME", "VAR_ZONEFILE", "VAR_NOTIFY", "VAR_PROVIDE_XFR",
784   "VAR_ALLOW_QUERY", "VAR_AXFR", "VAR_UDP", "VAR_NOTIFY_RETRY",
785   "VAR_ALLOW_NOTIFY", "VAR_REQUEST_XFR", "VAR_ALLOW_AXFR_FALLBACK",
786   "VAR_OUTGOING_INTERFACE", "VAR_ANSWER_COOKIE", "VAR_COOKIE_SECRET",
787   "VAR_COOKIE_SECRET_FILE", "VAR_MAX_REFRESH_TIME", "VAR_MIN_REFRESH_TIME",
788   "VAR_MAX_RETRY_TIME", "VAR_MIN_RETRY_TIME", "VAR_MIN_EXPIRE_TIME",
789   "VAR_MULTI_MASTER_CHECK", "VAR_SIZE_LIMIT_XFR", "VAR_ZONESTATS",
790   "VAR_INCLUDE_PATTERN", "VAR_STORE_IXFR", "VAR_IXFR_SIZE",
791   "VAR_IXFR_NUMBER", "VAR_CREATE_IXFR", "VAR_ZONE", "VAR_RRL_WHITELIST",
792   "VAR_SERVERS", "VAR_BINDTODEVICE", "VAR_SETFIB", "VAR_VERIFY",
793   "VAR_ENABLE", "VAR_VERIFY_ZONE", "VAR_VERIFY_ZONES", "VAR_VERIFIER",
794   "VAR_VERIFIER_COUNT", "VAR_VERIFIER_FEED_ZONE", "VAR_VERIFIER_TIMEOUT",
795   "$accept", "blocks", "block", "server", "server_block", "server_option",
796   "$@1", "socket_options", "socket_option", "cpus", "service_cpu_affinity",
797   "dnstap", "dnstap_block", "dnstap_option", "remote_control",
798   "remote_control_block", "remote_control_option", "tls_auth", "$@2",
799   "tls_auth_block", "tls_auth_option", "key", "$@3", "key_block",
800   "key_option", "zone", "$@4", "zone_block", "zone_option", "pattern",
801   "$@5", "pattern_block", "pattern_option", "pattern_or_zone_option",
802   "$@6", "$@7", "verify", "verify_block", "verify_option", "command",
803   "arguments", "ip_address", "number", "boolean", "tlsauth_option", YY_NULLPTR
804 };
805 
806 static const char *
807 yysymbol_name (yysymbol_kind_t yysymbol)
808 {
809   return yytname[yysymbol];
810 }
811 #endif
812 
813 #ifdef YYPRINT
814 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
815    (internal) symbol number NUM (which must be that of a token).  */
816 static const yytype_int16 yytoknum[] =
817 {
818        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
819      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
820      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
821      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
822      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
823      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
824      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
825      325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
826      335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
827      345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
828      355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
829      365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
830      375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
831      385,   386,   387,   388,   389,   390,   391
832 };
833 #endif
834 
835 #define YYPACT_NINF (-161)
836 
837 #define yypact_value_is_default(Yyn) \
838   ((Yyn) == YYPACT_NINF)
839 
840 #define YYTABLE_NINF (-1)
841 
842 #define yytable_value_is_error(Yyn) \
843   0
844 
845   /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
846      STATE-NUM.  */
847 static const yytype_int16 yypact[] =
848 {
849     -161,    53,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
850     -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
851      335,   -41,   -36,  -161,  -161,  -161,  -161,     3,     0,     9,
852       13,    13,    13,     0,     0,    13,    13,    13,    13,    13,
853        0,    13,     0,    14,    16,    18,    25,    48,    49,    13,
854       55,    57,    61,    62,    13,    13,    63,    65,    68,     0,
855       13,     0,     0,     0,     0,     0,     0,     0,     0,    13,
856       13,    13,    13,    13,    13,     0,     0,     0,     0,     0,
857        0,     0,    69,    72,    74,     0,    75,  -161,  -161,  -161,
858       13,     0,     0,    13,    76,    78,  -161,     0,    13,    89,
859       13,    13,    90,    92,    13,    13,  -161,    13,     9,     0,
860      100,   101,   102,   104,  -161,   -74,    23,   176,   315,     9,
861        0,    13,    13,   105,     0,    13,     0,  -161,  -161,  -161,
862     -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
863     -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
864     -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
865     -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
866     -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
867     -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
868      108,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
869     -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
870     -161,  -161,  -161,   117,   118,   119,  -161,   121,   122,   123,
871      124,   125,  -161,   126,   128,   131,   139,   141,     0,   143,
872        8,    13,   146,     0,     0,     0,     0,   147,    13,     0,
873      148,   149,    13,     0,     0,    13,   150,    13,   105,    13,
874        0,  -161,  -161,   151,  -161,  -161,  -161,  -161,  -161,  -161,
875     -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
876     -161,  -161,  -161,  -161,  -161,  -161,  -161,   152,   153,   154,
877     -161,   155,   156,   157,   158,  -161,  -161,  -161,  -161,  -161,
878     -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
879     -161,  -161,  -161,  -161,  -161,  -161,   159,  -101,  -161,  -161,
880     -161,  -161,  -161,   160,   161,  -161,   162,    13,     0,  -161,
881      163,  -161,  -161,  -161,  -161,  -161,  -161,  -161,   163,  -161
882 };
883 
884   /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
885      Performed when YYTABLE does not specify something else to do.  Zero
886      means the default is an error.  */
887 static const yytype_uint8 yydefact[] =
888 {
889        2,     0,     1,    14,    94,   105,   122,   113,   135,   129,
890      174,     3,     4,     5,     6,     8,     7,    10,     9,    11,
891       12,    92,   103,   125,   116,   138,   132,   172,     0,     0,
892        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
893        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
894        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
895        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
896        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
897        0,     0,     0,     0,     0,     0,     0,    88,    90,    91,
898        0,     0,     0,     0,     0,     0,    13,     0,     0,     0,
899        0,     0,     0,     0,     0,     0,    93,     0,     0,     0,
900        0,     0,     0,     0,   104,   123,   114,   136,   130,     0,
901        0,     0,     0,     0,     0,     0,     0,   173,   187,    17,
902      186,    15,   188,    18,    19,    47,    20,    21,    22,    27,
903       28,    29,    30,    46,    23,    57,    50,    49,    51,    52,
904       31,    35,    36,    45,    53,    54,    55,    24,    25,    33,
905       32,    34,    37,    38,    39,    40,    41,    42,    43,    44,
906       48,    56,    66,    67,    68,    69,    70,    64,    65,    58,
907       59,    60,    61,    62,    63,    71,    73,    72,    74,    75,
908       81,    26,    79,    80,    76,    77,    78,    82,    95,    96,
909       97,    98,    99,   100,   101,   102,   106,   107,   108,   109,
910      110,   111,   112,     0,     0,     0,   124,     0,     0,     0,
911        0,     0,   115,     0,     0,     0,     0,     0,     0,     0,
912        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
913        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
914        0,   137,   140,     0,   131,   134,   176,   177,   175,   178,
915      184,   179,   180,   182,   181,    83,    89,   127,   128,   126,
916      118,   119,   120,   121,   117,   139,   142,     0,     0,     0,
917      158,     0,     0,     0,     0,   157,   156,   159,   160,   161,
918      162,   163,   145,   144,   143,   146,   164,   165,   166,   167,
919      141,   168,   169,   170,   171,   133,   183,    16,   153,   154,
920      155,   152,   147,     0,     0,   185,     0,     0,     0,    84,
921      189,   149,   151,    85,    86,    87,   190,   148,   189,   150
922 };
923 
924   /* YYPGOTO[NTERM-NUM].  */
925 static const yytype_int16 yypgoto[] =
926 {
927     -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
928     -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
929     -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,  -161,
930     -161,  -161,  -161,   -62,  -161,  -161,  -161,  -161,  -161,   -81,
931     -161,  -106,    21,   -31,  -160
932 };
933 
934   /* YYDEFGOTO[NTERM-NUM].  */
935 static const yytype_int16 yydefgoto[] =
936 {
937        0,     1,    11,    12,    20,    96,   265,   307,   319,   190,
938       97,    13,    21,   106,    14,    22,   114,    15,    24,   116,
939      222,    16,    23,   115,   216,    17,    26,   118,   254,    18,
940       25,   117,   251,   252,   320,   328,    19,    27,   127,   261,
941      306,   131,   129,   133,   327
942 };
943 
944   /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
945      positive, shift that token.  If negative, reduce the rule whose
946      number is the opposite.  If YYTABLE_NINF, syntax error.  */
947 static const yytype_int16 yytable[] =
948 {
949      134,   135,   207,   128,   138,   139,   140,   141,   142,   119,
950      144,   282,   130,   256,   213,   214,   132,   146,   152,   147,
951      120,   148,   215,   157,   158,   316,   317,   318,   149,   163,
952       98,    99,   100,   101,   102,   103,   104,   105,   172,   173,
953      174,   175,   176,   177,   107,   108,   109,   110,   111,   112,
954      113,   150,   151,     2,   136,   137,   255,     3,   153,   191,
955      154,   143,   194,   145,   155,   156,   159,   198,   160,   200,
956      201,   161,   185,   204,   205,   186,   206,   187,   189,   195,
957      162,   196,   164,   165,   166,   167,   168,   169,   170,   171,
958      258,   259,   199,   202,   263,   203,   178,   179,   180,   181,
959      182,   183,   184,   209,   210,   211,   188,   212,   260,   283,
960      284,   266,   192,   193,   217,   218,   219,   220,   197,   221,
961      267,   268,   269,     4,   270,   271,   272,   273,   274,   275,
962      208,   276,     5,   121,   277,   122,   123,   124,   125,   126,
963        6,   257,   278,     7,   279,   262,   281,   264,     8,   286,
964      291,   294,   295,   300,   305,   308,   309,   310,   311,   312,
965      313,   314,   315,   321,   322,   323,   326,   302,   329,     0,
966        0,     0,     0,     0,     0,     0,     0,     9,     0,     0,
967        0,     0,    10,     0,     0,     0,     0,     0,     0,     0,
968        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
969      285,     0,     0,     0,     0,     0,     0,   292,     0,     0,
970        0,   296,     0,     0,   299,     0,   301,     0,   303,     0,
971        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
972        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
973        0,     0,     0,     0,     0,     0,     0,     0,     0,   280,
974        0,     0,     0,     0,   287,   288,   289,   290,     0,     0,
975      293,     0,     0,     0,   297,   298,     0,     0,     0,     0,
976        0,   304,   223,   224,   225,   226,   227,     0,     0,   228,
977      229,   230,   231,   232,     0,     0,   324,   233,   234,   235,
978      236,   237,   238,   239,   240,   241,   242,   243,   244,   245,
979        0,   246,     0,     0,     0,     0,     0,   247,     0,   248,
980        0,   249,   250,     0,     0,     0,     0,     0,     0,     0,
981        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
982        0,     0,     0,     0,     0,     0,     0,     0,     0,   325,
983       28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
984       38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
985       48,    49,    50,    51,    52,    53,    54,    55,    56,    57,
986       58,    59,    60,    61,    62,    63,    64,    65,    66,    67,
987       68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
988       78,    79,    80,    81,    82,    83,    84,    85,    86,    87,
989       88,    89,    90,    91,    92,     0,     0,     0,     0,     0,
990        0,   253,   224,   225,   226,   227,     0,     0,   228,   229,
991      230,   231,   232,     0,     0,     0,   233,   234,   235,   236,
992      237,   238,   239,   240,   241,   242,   243,   244,   245,     0,
993      246,     0,     0,    93,    94,    95,   247,     0,   248,     0,
994      249,   250
995 };
996 
997 static const yytype_int16 yycheck[] =
998 {
999       31,    32,   108,     3,    35,    36,    37,    38,    39,     6,
1000       41,     3,     3,   119,    88,    89,     3,     3,    49,     3,
1001       17,     3,    96,    54,    55,   126,   127,   128,     3,    60,
1002       71,    72,    73,    74,    75,    76,    77,    78,    69,    70,
1003       71,    72,    73,    74,    80,    81,    82,    83,    84,    85,
1004       86,     3,     3,     0,    33,    34,   118,     4,     3,    90,
1005        3,    40,    93,    42,     3,     3,     3,    98,     3,   100,
1006      101,     3,     3,   104,   105,     3,   107,     3,     3,     3,
1007       59,     3,    61,    62,    63,    64,    65,    66,    67,    68,
1008      121,   122,     3,     3,   125,     3,    75,    76,    77,    78,
1009       79,    80,    81,     3,     3,     3,    85,     3,     3,   101,
1010      102,     3,    91,    92,    91,    92,    93,    94,    97,    96,
1011        3,     3,     3,    70,     3,     3,     3,     3,     3,     3,
1012      109,     3,    79,   130,     3,   132,   133,   134,   135,   136,
1013       87,   120,     3,    90,     3,   124,     3,   126,    95,     3,
1014        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1015        3,     3,     3,     3,     3,     3,     3,   248,   328,    -1,
1016       -1,    -1,    -1,    -1,    -1,    -1,    -1,   124,    -1,    -1,
1017       -1,    -1,   129,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1018       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1019      231,    -1,    -1,    -1,    -1,    -1,    -1,   238,    -1,    -1,
1020       -1,   242,    -1,    -1,   245,    -1,   247,    -1,   249,    -1,
1021       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1022       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1023       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   228,
1024       -1,    -1,    -1,    -1,   233,   234,   235,   236,    -1,    -1,
1025      239,    -1,    -1,    -1,   243,   244,    -1,    -1,    -1,    -1,
1026       -1,   250,    96,    97,    98,    99,   100,    -1,    -1,   103,
1027      104,   105,   106,   107,    -1,    -1,   317,   111,   112,   113,
1028      114,   115,   116,   117,   118,   119,   120,   121,   122,   123,
1029       -1,   125,    -1,    -1,    -1,    -1,    -1,   131,    -1,   133,
1030       -1,   135,   136,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1031       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1032       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   318,
1033        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
1034       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
1035       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
1036       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
1037       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
1038       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
1039       65,    66,    67,    68,    69,    -1,    -1,    -1,    -1,    -1,
1040       -1,    96,    97,    98,    99,   100,    -1,    -1,   103,   104,
1041      105,   106,   107,    -1,    -1,    -1,   111,   112,   113,   114,
1042      115,   116,   117,   118,   119,   120,   121,   122,   123,    -1,
1043      125,    -1,    -1,   108,   109,   110,   131,    -1,   133,    -1,
1044      135,   136
1045 };
1046 
1047   /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1048      symbol of state STATE-NUM.  */
1049 static const yytype_uint8 yystos[] =
1050 {
1051        0,   138,     0,     4,    70,    79,    87,    90,    95,   124,
1052      129,   139,   140,   148,   151,   154,   158,   162,   166,   173,
1053      141,   149,   152,   159,   155,   167,   163,   174,     5,     6,
1054        7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
1055       17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
1056       27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
1057       37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
1058       47,    48,    49,    50,    51,    52,    53,    54,    55,    56,
1059       57,    58,    59,    60,    61,    62,    63,    64,    65,    66,
1060       67,    68,    69,   108,   109,   110,   142,   147,    71,    72,
1061       73,    74,    75,    76,    77,    78,   150,    80,    81,    82,
1062       83,    84,    85,    86,   153,   160,   156,   168,   164,     6,
1063       17,   130,   132,   133,   134,   135,   136,   175,     3,   179,
1064        3,   178,     3,   180,   180,   180,   179,   179,   180,   180,
1065      180,   180,   180,   179,   180,   179,     3,     3,     3,     3,
1066        3,     3,   180,     3,     3,     3,     3,   180,   180,     3,
1067        3,     3,   179,   180,   179,   179,   179,   179,   179,   179,
1068      179,   179,   180,   180,   180,   180,   180,   180,   179,   179,
1069      179,   179,   179,   179,   179,     3,     3,     3,   179,     3,
1070      146,   180,   179,   179,   180,     3,     3,   179,   180,     3,
1071      180,   180,     3,     3,   180,   180,   180,   178,   179,     3,
1072        3,     3,     3,    88,    89,    96,   161,    91,    92,    93,
1073       94,    96,   157,    96,    97,    98,    99,   100,   103,   104,
1074      105,   106,   107,   111,   112,   113,   114,   115,   116,   117,
1075      118,   119,   120,   121,   122,   123,   125,   131,   133,   135,
1076      136,   169,   170,    96,   165,   170,   178,   179,   180,   180,
1077        3,   176,   179,   180,   179,   143,     3,     3,     3,     3,
1078        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1079      179,     3,     3,   101,   102,   180,     3,   179,   179,   179,
1080      179,     3,   180,   179,     3,     3,   180,   179,   179,   180,
1081        3,   180,   176,   180,   179,     3,   177,   144,     3,     3,
1082        3,     3,     3,     3,     3,     3,   126,   127,   128,   145,
1083      171,     3,     3,     3,   180,   179,     3,   181,   172,   181
1084 };
1085 
1086   /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
1087 static const yytype_uint8 yyr1[] =
1088 {
1089        0,   137,   138,   138,   139,   139,   139,   139,   139,   139,
1090      139,   139,   140,   141,   141,   143,   142,   142,   142,   142,
1091      142,   142,   142,   142,   142,   142,   142,   142,   142,   142,
1092      142,   142,   142,   142,   142,   142,   142,   142,   142,   142,
1093      142,   142,   142,   142,   142,   142,   142,   142,   142,   142,
1094      142,   142,   142,   142,   142,   142,   142,   142,   142,   142,
1095      142,   142,   142,   142,   142,   142,   142,   142,   142,   142,
1096      142,   142,   142,   142,   142,   142,   142,   142,   142,   142,
1097      142,   142,   142,   144,   144,   145,   145,   145,   146,   146,
1098      147,   147,   148,   149,   149,   150,   150,   150,   150,   150,
1099      150,   150,   150,   151,   152,   152,   153,   153,   153,   153,
1100      153,   153,   153,   155,   154,   156,   156,   157,   157,   157,
1101      157,   157,   159,   158,   160,   160,   161,   161,   161,   163,
1102      162,   164,   164,   165,   165,   167,   166,   168,   168,   169,
1103      169,   170,   170,   170,   170,   170,   170,   171,   170,   172,
1104      170,   170,   170,   170,   170,   170,   170,   170,   170,   170,
1105      170,   170,   170,   170,   170,   170,   170,   170,   170,   170,
1106      170,   170,   173,   174,   174,   175,   175,   175,   175,   175,
1107      175,   175,   175,   176,   177,   177,   178,   179,   180,   181,
1108      181
1109 };
1110 
1111   /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
1112 static const yytype_int8 yyr2[] =
1113 {
1114        0,     2,     0,     2,     1,     1,     1,     1,     1,     1,
1115        1,     1,     2,     2,     0,     0,     4,     2,     2,     2,
1116        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1117        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1118        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1119        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1120        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1121        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1122        2,     2,     2,     0,     2,     2,     2,     2,     0,     2,
1123        1,     1,     2,     2,     0,     2,     2,     2,     2,     2,
1124        2,     2,     2,     2,     2,     0,     2,     2,     2,     2,
1125        2,     2,     2,     0,     3,     2,     0,     2,     2,     2,
1126        2,     2,     0,     3,     2,     0,     2,     2,     2,     0,
1127        3,     2,     0,     2,     1,     0,     3,     2,     0,     2,
1128        1,     2,     2,     2,     2,     2,     2,     0,     5,     0,
1129        6,     4,     3,     3,     3,     3,     2,     2,     2,     2,
1130        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1131        2,     2,     2,     2,     0,     2,     2,     2,     2,     2,
1132        2,     2,     2,     2,     0,     2,     1,     1,     1,     0,
1133        1
1134 };
1135 
1136 
1137 enum { YYENOMEM = -2 };
1138 
1139 #define yyerrok         (yyerrstatus = 0)
1140 #define yyclearin       (yychar = YYEMPTY)
1141 
1142 #define YYACCEPT        goto yyacceptlab
1143 #define YYABORT         goto yyabortlab
1144 #define YYERROR         goto yyerrorlab
1145 
1146 
1147 #define YYRECOVERING()  (!!yyerrstatus)
1148 
1149 #define YYBACKUP(Token, Value)                                    \
1150   do                                                              \
1151     if (yychar == YYEMPTY)                                        \
1152       {                                                           \
1153         yychar = (Token);                                         \
1154         yylval = (Value);                                         \
1155         YYPOPSTACK (yylen);                                       \
1156         yystate = *yyssp;                                         \
1157         goto yybackup;                                            \
1158       }                                                           \
1159     else                                                          \
1160       {                                                           \
1161         yyerror (YY_("syntax error: cannot back up")); \
1162         YYERROR;                                                  \
1163       }                                                           \
1164   while (0)
1165 
1166 /* Backward compatibility with an undocumented macro.
1167    Use YYerror or YYUNDEF. */
1168 #define YYERRCODE YYUNDEF
1169 
1170 
1171 /* Enable debugging if requested.  */
1172 #if YYDEBUG
1173 
1174 # ifndef YYFPRINTF
1175 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1176 #  define YYFPRINTF fprintf
1177 # endif
1178 
1179 # define YYDPRINTF(Args)                        \
1180 do {                                            \
1181   if (yydebug)                                  \
1182     YYFPRINTF Args;                             \
1183 } while (0)
1184 
1185 /* This macro is provided for backward compatibility. */
1186 # ifndef YY_LOCATION_PRINT
1187 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1188 # endif
1189 
1190 
1191 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
1192 do {                                                                      \
1193   if (yydebug)                                                            \
1194     {                                                                     \
1195       YYFPRINTF (stderr, "%s ", Title);                                   \
1196       yy_symbol_print (stderr,                                            \
1197                   Kind, Value); \
1198       YYFPRINTF (stderr, "\n");                                           \
1199     }                                                                     \
1200 } while (0)
1201 
1202 
1203 /*-----------------------------------.
1204 | Print this symbol's value on YYO.  |
1205 `-----------------------------------*/
1206 
1207 static void
1208 yy_symbol_value_print (FILE *yyo,
1209                        yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
1210 {
1211   FILE *yyoutput = yyo;
1212   YY_USE (yyoutput);
1213   if (!yyvaluep)
1214     return;
1215 # ifdef YYPRINT
1216   if (yykind < YYNTOKENS)
1217     YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
1218 # endif
1219   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1220   YY_USE (yykind);
1221   YY_IGNORE_MAYBE_UNINITIALIZED_END
1222 }
1223 
1224 
1225 /*---------------------------.
1226 | Print this symbol on YYO.  |
1227 `---------------------------*/
1228 
1229 static void
1230 yy_symbol_print (FILE *yyo,
1231                  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
1232 {
1233   YYFPRINTF (yyo, "%s %s (",
1234              yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1235 
1236   yy_symbol_value_print (yyo, yykind, yyvaluep);
1237   YYFPRINTF (yyo, ")");
1238 }
1239 
1240 /*------------------------------------------------------------------.
1241 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1242 | TOP (included).                                                   |
1243 `------------------------------------------------------------------*/
1244 
1245 static void
1246 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1247 {
1248   YYFPRINTF (stderr, "Stack now");
1249   for (; yybottom <= yytop; yybottom++)
1250     {
1251       int yybot = *yybottom;
1252       YYFPRINTF (stderr, " %d", yybot);
1253     }
1254   YYFPRINTF (stderr, "\n");
1255 }
1256 
1257 # define YY_STACK_PRINT(Bottom, Top)                            \
1258 do {                                                            \
1259   if (yydebug)                                                  \
1260     yy_stack_print ((Bottom), (Top));                           \
1261 } while (0)
1262 
1263 
1264 /*------------------------------------------------.
1265 | Report that the YYRULE is going to be reduced.  |
1266 `------------------------------------------------*/
1267 
1268 static void
1269 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1270                  int yyrule)
1271 {
1272   int yylno = yyrline[yyrule];
1273   int yynrhs = yyr2[yyrule];
1274   int yyi;
1275   YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1276              yyrule - 1, yylno);
1277   /* The symbols being reduced.  */
1278   for (yyi = 0; yyi < yynrhs; yyi++)
1279     {
1280       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1281       yy_symbol_print (stderr,
1282                        YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1283                        &yyvsp[(yyi + 1) - (yynrhs)]);
1284       YYFPRINTF (stderr, "\n");
1285     }
1286 }
1287 
1288 # define YY_REDUCE_PRINT(Rule)          \
1289 do {                                    \
1290   if (yydebug)                          \
1291     yy_reduce_print (yyssp, yyvsp, Rule); \
1292 } while (0)
1293 
1294 /* Nonzero means print parse trace.  It is left uninitialized so that
1295    multiple parsers can coexist.  */
1296 int yydebug;
1297 #else /* !YYDEBUG */
1298 # define YYDPRINTF(Args) ((void) 0)
1299 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1300 # define YY_STACK_PRINT(Bottom, Top)
1301 # define YY_REDUCE_PRINT(Rule)
1302 #endif /* !YYDEBUG */
1303 
1304 
1305 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1306 #ifndef YYINITDEPTH
1307 # define YYINITDEPTH 200
1308 #endif
1309 
1310 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1311    if the built-in stack extension method is used).
1312 
1313    Do not make this value too large; the results are undefined if
1314    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1315    evaluated with infinite-precision integer arithmetic.  */
1316 
1317 #ifndef YYMAXDEPTH
1318 # define YYMAXDEPTH 10000
1319 #endif
1320 
1321 
1322 
1323 
1324 
1325 
1326 /*-----------------------------------------------.
1327 | Release the memory associated to this symbol.  |
1328 `-----------------------------------------------*/
1329 
1330 static void
1331 yydestruct (const char *yymsg,
1332             yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
1333 {
1334   YY_USE (yyvaluep);
1335   if (!yymsg)
1336     yymsg = "Deleting";
1337   YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1338 
1339   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1340   YY_USE (yykind);
1341   YY_IGNORE_MAYBE_UNINITIALIZED_END
1342 }
1343 
1344 
1345 /* Lookahead token kind.  */
1346 int yychar;
1347 
1348 /* The semantic value of the lookahead symbol.  */
1349 YYSTYPE yylval;
1350 /* Number of syntax errors so far.  */
1351 int yynerrs;
1352 
1353 
1354 
1355 
1356 /*----------.
1357 | yyparse.  |
1358 `----------*/
1359 
1360 int
1361 yyparse (void)
1362 {
1363     yy_state_fast_t yystate = 0;
1364     /* Number of tokens to shift before error messages enabled.  */
1365     int yyerrstatus = 0;
1366 
1367     /* Refer to the stacks through separate pointers, to allow yyoverflow
1368        to reallocate them elsewhere.  */
1369 
1370     /* Their size.  */
1371     YYPTRDIFF_T yystacksize = YYINITDEPTH;
1372 
1373     /* The state stack: array, bottom, top.  */
1374     yy_state_t yyssa[YYINITDEPTH];
1375     yy_state_t *yyss = yyssa;
1376     yy_state_t *yyssp = yyss;
1377 
1378     /* The semantic value stack: array, bottom, top.  */
1379     YYSTYPE yyvsa[YYINITDEPTH];
1380     YYSTYPE *yyvs = yyvsa;
1381     YYSTYPE *yyvsp = yyvs;
1382 
1383   int yyn;
1384   /* The return value of yyparse.  */
1385   int yyresult;
1386   /* Lookahead symbol kind.  */
1387   yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1388   /* The variables used to return semantic value and location from the
1389      action routines.  */
1390   YYSTYPE yyval;
1391 
1392 
1393 
1394 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1395 
1396   /* The number of symbols on the RHS of the reduced rule.
1397      Keep to zero when no symbol should be popped.  */
1398   int yylen = 0;
1399 
1400   YYDPRINTF ((stderr, "Starting parse\n"));
1401 
1402   yychar = YYEMPTY; /* Cause a token to be read.  */
1403   goto yysetstate;
1404 
1405 
1406 /*------------------------------------------------------------.
1407 | yynewstate -- push a new state, which is found in yystate.  |
1408 `------------------------------------------------------------*/
1409 yynewstate:
1410   /* In all cases, when you get here, the value and location stacks
1411      have just been pushed.  So pushing a state here evens the stacks.  */
1412   yyssp++;
1413 
1414 
1415 /*--------------------------------------------------------------------.
1416 | yysetstate -- set current state (the top of the stack) to yystate.  |
1417 `--------------------------------------------------------------------*/
1418 yysetstate:
1419   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1420   YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1421   YY_IGNORE_USELESS_CAST_BEGIN
1422   *yyssp = YY_CAST (yy_state_t, yystate);
1423   YY_IGNORE_USELESS_CAST_END
1424   YY_STACK_PRINT (yyss, yyssp);
1425 
1426   if (yyss + yystacksize - 1 <= yyssp)
1427 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1428     goto yyexhaustedlab;
1429 #else
1430     {
1431       /* Get the current used size of the three stacks, in elements.  */
1432       YYPTRDIFF_T yysize = yyssp - yyss + 1;
1433 
1434 # if defined yyoverflow
1435       {
1436         /* Give user a chance to reallocate the stack.  Use copies of
1437            these so that the &'s don't force the real ones into
1438            memory.  */
1439         yy_state_t *yyss1 = yyss;
1440         YYSTYPE *yyvs1 = yyvs;
1441 
1442         /* Each stack pointer address is followed by the size of the
1443            data in use in that stack, in bytes.  This used to be a
1444            conditional around just the two extra args, but that might
1445            be undefined if yyoverflow is a macro.  */
1446         yyoverflow (YY_("memory exhausted"),
1447                     &yyss1, yysize * YYSIZEOF (*yyssp),
1448                     &yyvs1, yysize * YYSIZEOF (*yyvsp),
1449                     &yystacksize);
1450         yyss = yyss1;
1451         yyvs = yyvs1;
1452       }
1453 # else /* defined YYSTACK_RELOCATE */
1454       /* Extend the stack our own way.  */
1455       if (YYMAXDEPTH <= yystacksize)
1456         goto yyexhaustedlab;
1457       yystacksize *= 2;
1458       if (YYMAXDEPTH < yystacksize)
1459         yystacksize = YYMAXDEPTH;
1460 
1461       {
1462         yy_state_t *yyss1 = yyss;
1463         union yyalloc *yyptr =
1464           YY_CAST (union yyalloc *,
1465                    YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1466         if (! yyptr)
1467           goto yyexhaustedlab;
1468         YYSTACK_RELOCATE (yyss_alloc, yyss);
1469         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1470 #  undef YYSTACK_RELOCATE
1471         if (yyss1 != yyssa)
1472           YYSTACK_FREE (yyss1);
1473       }
1474 # endif
1475 
1476       yyssp = yyss + yysize - 1;
1477       yyvsp = yyvs + yysize - 1;
1478 
1479       YY_IGNORE_USELESS_CAST_BEGIN
1480       YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1481                   YY_CAST (long, yystacksize)));
1482       YY_IGNORE_USELESS_CAST_END
1483 
1484       if (yyss + yystacksize - 1 <= yyssp)
1485         YYABORT;
1486     }
1487 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1488 
1489   if (yystate == YYFINAL)
1490     YYACCEPT;
1491 
1492   goto yybackup;
1493 
1494 
1495 /*-----------.
1496 | yybackup.  |
1497 `-----------*/
1498 yybackup:
1499   /* Do appropriate processing given the current state.  Read a
1500      lookahead token if we need one and don't already have one.  */
1501 
1502   /* First try to decide what to do without reference to lookahead token.  */
1503   yyn = yypact[yystate];
1504   if (yypact_value_is_default (yyn))
1505     goto yydefault;
1506 
1507   /* Not known => get a lookahead token if don't already have one.  */
1508 
1509   /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
1510   if (yychar == YYEMPTY)
1511     {
1512       YYDPRINTF ((stderr, "Reading a token\n"));
1513       yychar = yylex ();
1514     }
1515 
1516   if (yychar <= YYEOF)
1517     {
1518       yychar = YYEOF;
1519       yytoken = YYSYMBOL_YYEOF;
1520       YYDPRINTF ((stderr, "Now at end of input.\n"));
1521     }
1522   else if (yychar == YYerror)
1523     {
1524       /* The scanner already issued an error message, process directly
1525          to error recovery.  But do not keep the error token as
1526          lookahead, it is too special and may lead us to an endless
1527          loop in error recovery. */
1528       yychar = YYUNDEF;
1529       yytoken = YYSYMBOL_YYerror;
1530       goto yyerrlab1;
1531     }
1532   else
1533     {
1534       yytoken = YYTRANSLATE (yychar);
1535       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1536     }
1537 
1538   /* If the proper action on seeing token YYTOKEN is to reduce or to
1539      detect an error, take that action.  */
1540   yyn += yytoken;
1541   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1542     goto yydefault;
1543   yyn = yytable[yyn];
1544   if (yyn <= 0)
1545     {
1546       if (yytable_value_is_error (yyn))
1547         goto yyerrlab;
1548       yyn = -yyn;
1549       goto yyreduce;
1550     }
1551 
1552   /* Count tokens shifted since error; after three, turn off error
1553      status.  */
1554   if (yyerrstatus)
1555     yyerrstatus--;
1556 
1557   /* Shift the lookahead token.  */
1558   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1559   yystate = yyn;
1560   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1561   *++yyvsp = yylval;
1562   YY_IGNORE_MAYBE_UNINITIALIZED_END
1563 
1564   /* Discard the shifted token.  */
1565   yychar = YYEMPTY;
1566   goto yynewstate;
1567 
1568 
1569 /*-----------------------------------------------------------.
1570 | yydefault -- do the default action for the current state.  |
1571 `-----------------------------------------------------------*/
1572 yydefault:
1573   yyn = yydefact[yystate];
1574   if (yyn == 0)
1575     goto yyerrlab;
1576   goto yyreduce;
1577 
1578 
1579 /*-----------------------------.
1580 | yyreduce -- do a reduction.  |
1581 `-----------------------------*/
1582 yyreduce:
1583   /* yyn is the number of a rule to reduce with.  */
1584   yylen = yyr2[yyn];
1585 
1586   /* If YYLEN is nonzero, implement the default value of the action:
1587      '$$ = $1'.
1588 
1589      Otherwise, the following line sets YYVAL to garbage.
1590      This behavior is undocumented and Bison
1591      users should not rely upon it.  Assigning to YYVAL
1592      unconditionally makes the parser a bit smaller, and it avoids a
1593      GCC warning that YYVAL may be used uninitialized.  */
1594   yyval = yyvsp[1-yylen];
1595 
1596 
1597   YY_REDUCE_PRINT (yyn);
1598   switch (yyn)
1599     {
1600   case 15: /* $@1: %empty  */
1601 #line 242 "configparser.y"
1602       {
1603         struct ip_address_option *ip = cfg_parser->opt->ip_addresses;
1604 
1605         if(ip == NULL) {
1606           cfg_parser->opt->ip_addresses = (yyvsp[0].ip);
1607         } else {
1608           while(ip->next) { ip = ip->next; }
1609           ip->next = (yyvsp[0].ip);
1610         }
1611 
1612         cfg_parser->ip = (yyvsp[0].ip);
1613       }
1614 #line 1615 "configparser.c"
1615     break;
1616 
1617   case 16: /* server_option: VAR_IP_ADDRESS ip_address $@1 socket_options  */
1618 #line 255 "configparser.y"
1619     {
1620       cfg_parser->ip = NULL;
1621     }
1622 #line 1623 "configparser.c"
1623     break;
1624 
1625   case 17: /* server_option: VAR_SERVER_COUNT number  */
1626 #line 259 "configparser.y"
1627     {
1628       if ((yyvsp[0].llng) > 0) {
1629         cfg_parser->opt->server_count = (int)(yyvsp[0].llng);
1630       } else {
1631         yyerror("expected a number greater than zero");
1632       }
1633     }
1634 #line 1635 "configparser.c"
1635     break;
1636 
1637   case 18: /* server_option: VAR_IP_TRANSPARENT boolean  */
1638 #line 267 "configparser.y"
1639     { cfg_parser->opt->ip_transparent = (yyvsp[0].bln); }
1640 #line 1641 "configparser.c"
1641     break;
1642 
1643   case 19: /* server_option: VAR_IP_FREEBIND boolean  */
1644 #line 269 "configparser.y"
1645     { cfg_parser->opt->ip_freebind = (yyvsp[0].bln); }
1646 #line 1647 "configparser.c"
1647     break;
1648 
1649   case 20: /* server_option: VAR_SEND_BUFFER_SIZE number  */
1650 #line 271 "configparser.y"
1651     { cfg_parser->opt->send_buffer_size = (int)(yyvsp[0].llng); }
1652 #line 1653 "configparser.c"
1653     break;
1654 
1655   case 21: /* server_option: VAR_RECEIVE_BUFFER_SIZE number  */
1656 #line 273 "configparser.y"
1657     { cfg_parser->opt->receive_buffer_size = (int)(yyvsp[0].llng); }
1658 #line 1659 "configparser.c"
1659     break;
1660 
1661   case 22: /* server_option: VAR_DEBUG_MODE boolean  */
1662 #line 275 "configparser.y"
1663     { cfg_parser->opt->debug_mode = (yyvsp[0].bln); }
1664 #line 1665 "configparser.c"
1665     break;
1666 
1667   case 23: /* server_option: VAR_USE_SYSTEMD boolean  */
1668 #line 277 "configparser.y"
1669     { /* ignored, deprecated */ }
1670 #line 1671 "configparser.c"
1671     break;
1672 
1673   case 24: /* server_option: VAR_HIDE_VERSION boolean  */
1674 #line 279 "configparser.y"
1675     { cfg_parser->opt->hide_version = (yyvsp[0].bln); }
1676 #line 1677 "configparser.c"
1677     break;
1678 
1679   case 25: /* server_option: VAR_HIDE_IDENTITY boolean  */
1680 #line 281 "configparser.y"
1681     { cfg_parser->opt->hide_identity = (yyvsp[0].bln); }
1682 #line 1683 "configparser.c"
1683     break;
1684 
1685   case 26: /* server_option: VAR_DROP_UPDATES boolean  */
1686 #line 283 "configparser.y"
1687     { cfg_parser->opt->drop_updates = (yyvsp[0].bln); }
1688 #line 1689 "configparser.c"
1689     break;
1690 
1691   case 27: /* server_option: VAR_IP4_ONLY boolean  */
1692 #line 285 "configparser.y"
1693     { if((yyvsp[0].bln)) { cfg_parser->opt->do_ip4 = 1; cfg_parser->opt->do_ip6 = 0; } }
1694 #line 1695 "configparser.c"
1695     break;
1696 
1697   case 28: /* server_option: VAR_IP6_ONLY boolean  */
1698 #line 287 "configparser.y"
1699     { if((yyvsp[0].bln)) { cfg_parser->opt->do_ip4 = 0; cfg_parser->opt->do_ip6 = 1; } }
1700 #line 1701 "configparser.c"
1701     break;
1702 
1703   case 29: /* server_option: VAR_DO_IP4 boolean  */
1704 #line 289 "configparser.y"
1705     { cfg_parser->opt->do_ip4 = (yyvsp[0].bln); }
1706 #line 1707 "configparser.c"
1707     break;
1708 
1709   case 30: /* server_option: VAR_DO_IP6 boolean  */
1710 #line 291 "configparser.y"
1711     { cfg_parser->opt->do_ip6 = (yyvsp[0].bln); }
1712 #line 1713 "configparser.c"
1713     break;
1714 
1715   case 31: /* server_option: VAR_DATABASE STRING  */
1716 #line 293 "configparser.y"
1717     {
1718       cfg_parser->opt->database = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
1719       if(cfg_parser->opt->database[0] == 0 &&
1720          cfg_parser->opt->zonefiles_write == 0)
1721       {
1722         cfg_parser->opt->zonefiles_write = ZONEFILES_WRITE_INTERVAL;
1723       }
1724     }
1725 #line 1726 "configparser.c"
1726     break;
1727 
1728   case 32: /* server_option: VAR_IDENTITY STRING  */
1729 #line 302 "configparser.y"
1730     { cfg_parser->opt->identity = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1731 #line 1732 "configparser.c"
1732     break;
1733 
1734   case 33: /* server_option: VAR_VERSION STRING  */
1735 #line 304 "configparser.y"
1736     { cfg_parser->opt->version = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1737 #line 1738 "configparser.c"
1738     break;
1739 
1740   case 34: /* server_option: VAR_NSID STRING  */
1741 #line 306 "configparser.y"
1742     {
1743       unsigned char* nsid = 0;
1744       size_t nsid_len = strlen((yyvsp[0].str));
1745 
1746       if (strncasecmp((yyvsp[0].str), "ascii_", 6) == 0) {
1747         nsid_len -= 6; /* discard "ascii_" */
1748         if(nsid_len < 65535) {
1749           cfg_parser->opt->nsid = region_alloc(cfg_parser->opt->region, nsid_len*2+1);
1750           hex_ntop((uint8_t*)(yyvsp[0].str)+6, nsid_len, (char*)cfg_parser->opt->nsid, nsid_len*2+1);
1751         } else {
1752           yyerror("NSID too long");
1753         }
1754       } else if (nsid_len % 2 != 0) {
1755         yyerror("the NSID must be a hex string of an even length.");
1756       } else {
1757         nsid_len = nsid_len / 2;
1758         if(nsid_len < 65535) {
1759           nsid = xalloc(nsid_len);
1760           if (hex_pton((yyvsp[0].str), nsid, nsid_len) == -1) {
1761             yyerror("hex string cannot be parsed in NSID.");
1762           } else {
1763             cfg_parser->opt->nsid = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
1764           }
1765           free(nsid);
1766         } else {
1767           yyerror("NSID too long");
1768         }
1769       }
1770     }
1771 #line 1772 "configparser.c"
1772     break;
1773 
1774   case 35: /* server_option: VAR_LOGFILE STRING  */
1775 #line 336 "configparser.y"
1776     { cfg_parser->opt->logfile = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1777 #line 1778 "configparser.c"
1778     break;
1779 
1780   case 36: /* server_option: VAR_LOG_ONLY_SYSLOG boolean  */
1781 #line 338 "configparser.y"
1782     { cfg_parser->opt->log_only_syslog = (yyvsp[0].bln); }
1783 #line 1784 "configparser.c"
1784     break;
1785 
1786   case 37: /* server_option: VAR_TCP_COUNT number  */
1787 #line 340 "configparser.y"
1788     {
1789       if ((yyvsp[0].llng) > 0) {
1790         cfg_parser->opt->tcp_count = (int)(yyvsp[0].llng);
1791       } else {
1792         yyerror("expected a number greater than zero");
1793       }
1794     }
1795 #line 1796 "configparser.c"
1796     break;
1797 
1798   case 38: /* server_option: VAR_TCP_REJECT_OVERFLOW boolean  */
1799 #line 348 "configparser.y"
1800     { cfg_parser->opt->tcp_reject_overflow = (yyvsp[0].bln); }
1801 #line 1802 "configparser.c"
1802     break;
1803 
1804   case 39: /* server_option: VAR_TCP_QUERY_COUNT number  */
1805 #line 350 "configparser.y"
1806     { cfg_parser->opt->tcp_query_count = (int)(yyvsp[0].llng); }
1807 #line 1808 "configparser.c"
1808     break;
1809 
1810   case 40: /* server_option: VAR_TCP_TIMEOUT number  */
1811 #line 352 "configparser.y"
1812     { cfg_parser->opt->tcp_timeout = (int)(yyvsp[0].llng); }
1813 #line 1814 "configparser.c"
1814     break;
1815 
1816   case 41: /* server_option: VAR_TCP_MSS number  */
1817 #line 354 "configparser.y"
1818     { cfg_parser->opt->tcp_mss = (int)(yyvsp[0].llng); }
1819 #line 1820 "configparser.c"
1820     break;
1821 
1822   case 42: /* server_option: VAR_OUTGOING_TCP_MSS number  */
1823 #line 356 "configparser.y"
1824     { cfg_parser->opt->outgoing_tcp_mss = (int)(yyvsp[0].llng); }
1825 #line 1826 "configparser.c"
1826     break;
1827 
1828   case 43: /* server_option: VAR_IPV4_EDNS_SIZE number  */
1829 #line 358 "configparser.y"
1830     { cfg_parser->opt->ipv4_edns_size = (size_t)(yyvsp[0].llng); }
1831 #line 1832 "configparser.c"
1832     break;
1833 
1834   case 44: /* server_option: VAR_IPV6_EDNS_SIZE number  */
1835 #line 360 "configparser.y"
1836     { cfg_parser->opt->ipv6_edns_size = (size_t)(yyvsp[0].llng); }
1837 #line 1838 "configparser.c"
1838     break;
1839 
1840   case 45: /* server_option: VAR_PIDFILE STRING  */
1841 #line 362 "configparser.y"
1842     { cfg_parser->opt->pidfile = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1843 #line 1844 "configparser.c"
1844     break;
1845 
1846   case 46: /* server_option: VAR_PORT number  */
1847 #line 364 "configparser.y"
1848     {
1849       /* port number, stored as a string */
1850       char buf[16];
1851       (void)snprintf(buf, sizeof(buf), "%lld", (yyvsp[0].llng));
1852       cfg_parser->opt->port = region_strdup(cfg_parser->opt->region, buf);
1853     }
1854 #line 1855 "configparser.c"
1855     break;
1856 
1857   case 47: /* server_option: VAR_REUSEPORT boolean  */
1858 #line 371 "configparser.y"
1859     { cfg_parser->opt->reuseport = (yyvsp[0].bln); }
1860 #line 1861 "configparser.c"
1861     break;
1862 
1863   case 48: /* server_option: VAR_STATISTICS number  */
1864 #line 373 "configparser.y"
1865     { cfg_parser->opt->statistics = (int)(yyvsp[0].llng); }
1866 #line 1867 "configparser.c"
1867     break;
1868 
1869   case 49: /* server_option: VAR_CHROOT STRING  */
1870 #line 375 "configparser.y"
1871     { cfg_parser->opt->chroot = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1872 #line 1873 "configparser.c"
1873     break;
1874 
1875   case 50: /* server_option: VAR_USERNAME STRING  */
1876 #line 377 "configparser.y"
1877     { cfg_parser->opt->username = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1878 #line 1879 "configparser.c"
1879     break;
1880 
1881   case 51: /* server_option: VAR_ZONESDIR STRING  */
1882 #line 379 "configparser.y"
1883     { cfg_parser->opt->zonesdir = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1884 #line 1885 "configparser.c"
1885     break;
1886 
1887   case 52: /* server_option: VAR_ZONELISTFILE STRING  */
1888 #line 381 "configparser.y"
1889     { cfg_parser->opt->zonelistfile = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1890 #line 1891 "configparser.c"
1891     break;
1892 
1893   case 53: /* server_option: VAR_DIFFFILE STRING  */
1894 #line 383 "configparser.y"
1895     { /* ignored, deprecated */ }
1896 #line 1897 "configparser.c"
1897     break;
1898 
1899   case 54: /* server_option: VAR_XFRDFILE STRING  */
1900 #line 385 "configparser.y"
1901     { cfg_parser->opt->xfrdfile = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1902 #line 1903 "configparser.c"
1903     break;
1904 
1905   case 55: /* server_option: VAR_XFRDIR STRING  */
1906 #line 387 "configparser.y"
1907     { cfg_parser->opt->xfrdir = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
1908 #line 1909 "configparser.c"
1909     break;
1910 
1911   case 56: /* server_option: VAR_XFRD_RELOAD_TIMEOUT number  */
1912 #line 389 "configparser.y"
1913     { cfg_parser->opt->xfrd_reload_timeout = (int)(yyvsp[0].llng); }
1914 #line 1915 "configparser.c"
1915     break;
1916 
1917   case 57: /* server_option: VAR_VERBOSITY number  */
1918 #line 391 "configparser.y"
1919     { cfg_parser->opt->verbosity = (int)(yyvsp[0].llng); }
1920 #line 1921 "configparser.c"
1921     break;
1922 
1923   case 58: /* server_option: VAR_RRL_SIZE number  */
1924 #line 393 "configparser.y"
1925     {
1926 #ifdef RATELIMIT
1927       if ((yyvsp[0].llng) > 0) {
1928         cfg_parser->opt->rrl_size = (size_t)(yyvsp[0].llng);
1929       } else {
1930         yyerror("expected a number greater than zero");
1931       }
1932 #endif
1933     }
1934 #line 1935 "configparser.c"
1935     break;
1936 
1937   case 59: /* server_option: VAR_RRL_RATELIMIT number  */
1938 #line 403 "configparser.y"
1939     {
1940 #ifdef RATELIMIT
1941       cfg_parser->opt->rrl_ratelimit = (size_t)(yyvsp[0].llng);
1942 #endif
1943     }
1944 #line 1945 "configparser.c"
1945     break;
1946 
1947   case 60: /* server_option: VAR_RRL_SLIP number  */
1948 #line 409 "configparser.y"
1949     {
1950 #ifdef RATELIMIT
1951       cfg_parser->opt->rrl_slip = (size_t)(yyvsp[0].llng);
1952 #endif
1953     }
1954 #line 1955 "configparser.c"
1955     break;
1956 
1957   case 61: /* server_option: VAR_RRL_IPV4_PREFIX_LENGTH number  */
1958 #line 415 "configparser.y"
1959     {
1960 #ifdef RATELIMIT
1961       if ((yyvsp[0].llng) > 32) {
1962         yyerror("invalid IPv4 prefix length");
1963       } else {
1964         cfg_parser->opt->rrl_ipv4_prefix_length = (size_t)(yyvsp[0].llng);
1965       }
1966 #endif
1967     }
1968 #line 1969 "configparser.c"
1969     break;
1970 
1971   case 62: /* server_option: VAR_RRL_IPV6_PREFIX_LENGTH number  */
1972 #line 425 "configparser.y"
1973     {
1974 #ifdef RATELIMIT
1975       if ((yyvsp[0].llng) > 64) {
1976         yyerror("invalid IPv6 prefix length");
1977       } else {
1978         cfg_parser->opt->rrl_ipv6_prefix_length = (size_t)(yyvsp[0].llng);
1979       }
1980 #endif
1981     }
1982 #line 1983 "configparser.c"
1983     break;
1984 
1985   case 63: /* server_option: VAR_RRL_WHITELIST_RATELIMIT number  */
1986 #line 435 "configparser.y"
1987     {
1988 #ifdef RATELIMIT
1989       cfg_parser->opt->rrl_whitelist_ratelimit = (size_t)(yyvsp[0].llng);
1990 #endif
1991     }
1992 #line 1993 "configparser.c"
1993     break;
1994 
1995   case 64: /* server_option: VAR_ZONEFILES_CHECK boolean  */
1996 #line 441 "configparser.y"
1997     { cfg_parser->opt->zonefiles_check = (yyvsp[0].bln); }
1998 #line 1999 "configparser.c"
1999     break;
2000 
2001   case 65: /* server_option: VAR_ZONEFILES_WRITE number  */
2002 #line 443 "configparser.y"
2003     { cfg_parser->opt->zonefiles_write = (int)(yyvsp[0].llng); }
2004 #line 2005 "configparser.c"
2005     break;
2006 
2007   case 66: /* server_option: VAR_LOG_TIME_ASCII boolean  */
2008 #line 445 "configparser.y"
2009     {
2010       cfg_parser->opt->log_time_ascii = (yyvsp[0].bln);
2011       log_time_asc = cfg_parser->opt->log_time_ascii;
2012     }
2013 #line 2014 "configparser.c"
2014     break;
2015 
2016   case 67: /* server_option: VAR_ROUND_ROBIN boolean  */
2017 #line 450 "configparser.y"
2018     {
2019       cfg_parser->opt->round_robin = (yyvsp[0].bln);
2020       round_robin = cfg_parser->opt->round_robin;
2021     }
2022 #line 2023 "configparser.c"
2023     break;
2024 
2025   case 68: /* server_option: VAR_MINIMAL_RESPONSES boolean  */
2026 #line 455 "configparser.y"
2027     {
2028       cfg_parser->opt->minimal_responses = (yyvsp[0].bln);
2029       minimal_responses = cfg_parser->opt->minimal_responses;
2030     }
2031 #line 2032 "configparser.c"
2032     break;
2033 
2034   case 69: /* server_option: VAR_CONFINE_TO_ZONE boolean  */
2035 #line 460 "configparser.y"
2036     { cfg_parser->opt->confine_to_zone = (yyvsp[0].bln); }
2037 #line 2038 "configparser.c"
2038     break;
2039 
2040   case 70: /* server_option: VAR_REFUSE_ANY boolean  */
2041 #line 462 "configparser.y"
2042     { cfg_parser->opt->refuse_any = (yyvsp[0].bln); }
2043 #line 2044 "configparser.c"
2044     break;
2045 
2046   case 71: /* server_option: VAR_TLS_SERVICE_KEY STRING  */
2047 #line 464 "configparser.y"
2048     { cfg_parser->opt->tls_service_key = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2049 #line 2050 "configparser.c"
2050     break;
2051 
2052   case 72: /* server_option: VAR_TLS_SERVICE_OCSP STRING  */
2053 #line 466 "configparser.y"
2054     { cfg_parser->opt->tls_service_ocsp = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2055 #line 2056 "configparser.c"
2056     break;
2057 
2058   case 73: /* server_option: VAR_TLS_SERVICE_PEM STRING  */
2059 #line 468 "configparser.y"
2060     { cfg_parser->opt->tls_service_pem = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2061 #line 2062 "configparser.c"
2062     break;
2063 
2064   case 74: /* server_option: VAR_TLS_PORT number  */
2065 #line 470 "configparser.y"
2066     {
2067       /* port number, stored as string */
2068       char buf[16];
2069       (void)snprintf(buf, sizeof(buf), "%lld", (yyvsp[0].llng));
2070       cfg_parser->opt->tls_port = region_strdup(cfg_parser->opt->region, buf);
2071     }
2072 #line 2073 "configparser.c"
2073     break;
2074 
2075   case 75: /* server_option: VAR_TLS_CERT_BUNDLE STRING  */
2076 #line 477 "configparser.y"
2077     { cfg_parser->opt->tls_cert_bundle = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2078 #line 2079 "configparser.c"
2079     break;
2080 
2081   case 76: /* server_option: VAR_ANSWER_COOKIE boolean  */
2082 #line 479 "configparser.y"
2083     { cfg_parser->opt->answer_cookie = (yyvsp[0].bln); }
2084 #line 2085 "configparser.c"
2085     break;
2086 
2087   case 77: /* server_option: VAR_COOKIE_SECRET STRING  */
2088 #line 481 "configparser.y"
2089     { cfg_parser->opt->cookie_secret = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2090 #line 2091 "configparser.c"
2091     break;
2092 
2093   case 78: /* server_option: VAR_COOKIE_SECRET_FILE STRING  */
2094 #line 483 "configparser.y"
2095     { cfg_parser->opt->cookie_secret_file = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2096 #line 2097 "configparser.c"
2097     break;
2098 
2099   case 79: /* server_option: VAR_XFRD_TCP_MAX number  */
2100 #line 485 "configparser.y"
2101     { cfg_parser->opt->xfrd_tcp_max = (int)(yyvsp[0].llng); }
2102 #line 2103 "configparser.c"
2103     break;
2104 
2105   case 80: /* server_option: VAR_XFRD_TCP_PIPELINE number  */
2106 #line 487 "configparser.y"
2107     { cfg_parser->opt->xfrd_tcp_pipeline = (int)(yyvsp[0].llng); }
2108 #line 2109 "configparser.c"
2109     break;
2110 
2111   case 81: /* server_option: VAR_CPU_AFFINITY cpus  */
2112 #line 489 "configparser.y"
2113     {
2114       cfg_parser->opt->cpu_affinity = (yyvsp[0].cpu);
2115     }
2116 #line 2117 "configparser.c"
2117     break;
2118 
2119   case 82: /* server_option: service_cpu_affinity number  */
2120 #line 493 "configparser.y"
2121     {
2122       if((yyvsp[0].llng) < 0) {
2123         yyerror("expected a non-negative number");
2124         YYABORT;
2125       } else {
2126         struct cpu_map_option *opt, *tail;
2127 
2128         opt = cfg_parser->opt->service_cpu_affinity;
2129         while(opt && opt->service != (yyvsp[-1].llng)) { opt = opt->next; }
2130 
2131         if(opt) {
2132           opt->cpu = (yyvsp[0].llng);
2133         } else {
2134           opt = region_alloc_zero(cfg_parser->opt->region, sizeof(*opt));
2135           opt->service = (int)(yyvsp[-1].llng);
2136           opt->cpu = (int)(yyvsp[0].llng);
2137 
2138           tail = cfg_parser->opt->service_cpu_affinity;
2139           if(tail) {
2140             while(tail->next) { tail = tail->next; }
2141             tail->next = opt;
2142           } else {
2143             cfg_parser->opt->service_cpu_affinity = opt;
2144           }
2145         }
2146       }
2147     }
2148 #line 2149 "configparser.c"
2149     break;
2150 
2151   case 85: /* socket_option: VAR_SERVERS STRING  */
2152 #line 527 "configparser.y"
2153     {
2154       char *tok, *ptr, *str;
2155       struct range_option *servers = NULL;
2156       long long first, last;
2157 
2158       /* user may specify "0 1", "0" "1", 0 1 or a combination thereof */
2159       for(str = (yyvsp[0].str); (tok = strtok_r(str, " \t", &ptr)); str = NULL) {
2160         struct range_option *opt =
2161           region_alloc(cfg_parser->opt->region, sizeof(*opt));
2162         first = last = 0;
2163         if(!parse_range(tok, &first, &last)) {
2164           yyerror("invalid server range '%s'", tok);
2165           YYABORT;
2166         }
2167         assert(first >= 0);
2168         assert(last >= 0);
2169         opt->next = NULL;
2170         opt->first = (int)first;
2171         opt->last = (int)last;
2172         if(servers) {
2173           servers = servers->next = opt;
2174         } else {
2175           servers = cfg_parser->ip->servers = opt;
2176         }
2177       }
2178     }
2179 #line 2180 "configparser.c"
2180     break;
2181 
2182   case 86: /* socket_option: VAR_BINDTODEVICE boolean  */
2183 #line 554 "configparser.y"
2184     { cfg_parser->ip->dev = (yyvsp[0].bln); }
2185 #line 2186 "configparser.c"
2186     break;
2187 
2188   case 87: /* socket_option: VAR_SETFIB number  */
2189 #line 556 "configparser.y"
2190     { cfg_parser->ip->fib = (yyvsp[0].llng); }
2191 #line 2192 "configparser.c"
2192     break;
2193 
2194   case 88: /* cpus: %empty  */
2195 #line 560 "configparser.y"
2196     { (yyval.cpu) = NULL; }
2197 #line 2198 "configparser.c"
2198     break;
2199 
2200   case 89: /* cpus: cpus STRING  */
2201 #line 562 "configparser.y"
2202     {
2203       char *tok, *ptr, *str;
2204       struct cpu_option *tail;
2205       long long cpu;
2206 
2207       str = (yyvsp[0].str);
2208       (yyval.cpu) = tail = (yyvsp[-1].cpu);
2209       if(tail) {
2210         while(tail->next) { tail = tail->next; }
2211       }
2212 
2213       /* Users may specify "0 1", "0" "1", 0 1 or a combination thereof. */
2214       for(str = (yyvsp[0].str); (tok = strtok_r(str, " \t", &ptr)); str = NULL) {
2215         struct cpu_option *opt =
2216           region_alloc_zero(cfg_parser->opt->region, sizeof(*opt));
2217         cpu = 0;
2218         if(!parse_number(tok, &cpu) || cpu < 0) {
2219           yyerror("expected a positive number");
2220           YYABORT;
2221         }
2222         assert(cpu >=0);
2223         opt->cpu = (int)cpu;
2224         if(tail) {
2225           tail->next = opt;
2226           tail = opt;
2227         } else {
2228           (yyval.cpu) = tail = opt;
2229         }
2230       }
2231     }
2232 #line 2233 "configparser.c"
2233     break;
2234 
2235   case 90: /* service_cpu_affinity: VAR_XFRD_CPU_AFFINITY  */
2236 #line 596 "configparser.y"
2237     { (yyval.llng) = -1; }
2238 #line 2239 "configparser.c"
2239     break;
2240 
2241   case 91: /* service_cpu_affinity: VAR_SERVER_CPU_AFFINITY  */
2242 #line 598 "configparser.y"
2243     {
2244       if((yyvsp[0].llng) <= 0) {
2245         yyerror("invalid server identifier");
2246         YYABORT;
2247       }
2248       (yyval.llng) = (yyvsp[0].llng);
2249     }
2250 #line 2251 "configparser.c"
2251     break;
2252 
2253   case 95: /* dnstap_option: VAR_DNSTAP_ENABLE boolean  */
2254 #line 615 "configparser.y"
2255     { cfg_parser->opt->dnstap_enable = (yyvsp[0].bln); }
2256 #line 2257 "configparser.c"
2257     break;
2258 
2259   case 96: /* dnstap_option: VAR_DNSTAP_SOCKET_PATH STRING  */
2260 #line 617 "configparser.y"
2261     { cfg_parser->opt->dnstap_socket_path = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2262 #line 2263 "configparser.c"
2263     break;
2264 
2265   case 97: /* dnstap_option: VAR_DNSTAP_SEND_IDENTITY boolean  */
2266 #line 619 "configparser.y"
2267     { cfg_parser->opt->dnstap_send_identity = (yyvsp[0].bln); }
2268 #line 2269 "configparser.c"
2269     break;
2270 
2271   case 98: /* dnstap_option: VAR_DNSTAP_SEND_VERSION boolean  */
2272 #line 621 "configparser.y"
2273     { cfg_parser->opt->dnstap_send_version = (yyvsp[0].bln); }
2274 #line 2275 "configparser.c"
2275     break;
2276 
2277   case 99: /* dnstap_option: VAR_DNSTAP_IDENTITY STRING  */
2278 #line 623 "configparser.y"
2279     { cfg_parser->opt->dnstap_identity = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2280 #line 2281 "configparser.c"
2281     break;
2282 
2283   case 100: /* dnstap_option: VAR_DNSTAP_VERSION STRING  */
2284 #line 625 "configparser.y"
2285     { cfg_parser->opt->dnstap_version = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2286 #line 2287 "configparser.c"
2287     break;
2288 
2289   case 101: /* dnstap_option: VAR_DNSTAP_LOG_AUTH_QUERY_MESSAGES boolean  */
2290 #line 627 "configparser.y"
2291     { cfg_parser->opt->dnstap_log_auth_query_messages = (yyvsp[0].bln); }
2292 #line 2293 "configparser.c"
2293     break;
2294 
2295   case 102: /* dnstap_option: VAR_DNSTAP_LOG_AUTH_RESPONSE_MESSAGES boolean  */
2296 #line 629 "configparser.y"
2297     { cfg_parser->opt->dnstap_log_auth_response_messages = (yyvsp[0].bln); }
2298 #line 2299 "configparser.c"
2299     break;
2300 
2301   case 106: /* remote_control_option: VAR_CONTROL_ENABLE boolean  */
2302 #line 640 "configparser.y"
2303     { cfg_parser->opt->control_enable = (yyvsp[0].bln); }
2304 #line 2305 "configparser.c"
2305     break;
2306 
2307   case 107: /* remote_control_option: VAR_CONTROL_INTERFACE ip_address  */
2308 #line 642 "configparser.y"
2309     {
2310       struct ip_address_option *ip = cfg_parser->opt->control_interface;
2311       if(ip == NULL) {
2312         cfg_parser->opt->control_interface = (yyvsp[0].ip);
2313       } else {
2314         while(ip->next != NULL) { ip = ip->next; }
2315         ip->next = (yyvsp[0].ip);
2316       }
2317     }
2318 #line 2319 "configparser.c"
2319     break;
2320 
2321   case 108: /* remote_control_option: VAR_CONTROL_PORT number  */
2322 #line 652 "configparser.y"
2323     {
2324       if((yyvsp[0].llng) == 0) {
2325         yyerror("control port number expected");
2326       } else {
2327         cfg_parser->opt->control_port = (int)(yyvsp[0].llng);
2328       }
2329     }
2330 #line 2331 "configparser.c"
2331     break;
2332 
2333   case 109: /* remote_control_option: VAR_SERVER_KEY_FILE STRING  */
2334 #line 660 "configparser.y"
2335     { cfg_parser->opt->server_key_file = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2336 #line 2337 "configparser.c"
2337     break;
2338 
2339   case 110: /* remote_control_option: VAR_SERVER_CERT_FILE STRING  */
2340 #line 662 "configparser.y"
2341     { cfg_parser->opt->server_cert_file = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2342 #line 2343 "configparser.c"
2343     break;
2344 
2345   case 111: /* remote_control_option: VAR_CONTROL_KEY_FILE STRING  */
2346 #line 664 "configparser.y"
2347     { cfg_parser->opt->control_key_file = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2348 #line 2349 "configparser.c"
2349     break;
2350 
2351   case 112: /* remote_control_option: VAR_CONTROL_CERT_FILE STRING  */
2352 #line 666 "configparser.y"
2353     { cfg_parser->opt->control_cert_file = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2354 #line 2355 "configparser.c"
2355     break;
2356 
2357   case 113: /* $@2: %empty  */
2358 #line 671 "configparser.y"
2359       {
2360         tls_auth_options_type *tls_auth = tls_auth_options_create(cfg_parser->opt->region);
2361         assert(cfg_parser->tls_auth == NULL);
2362         cfg_parser->tls_auth = tls_auth;
2363       }
2364 #line 2365 "configparser.c"
2365     break;
2366 
2367   case 114: /* tls_auth: VAR_TLS_AUTH $@2 tls_auth_block  */
2368 #line 677 "configparser.y"
2369     {
2370       struct tls_auth_options *tls_auth = cfg_parser->tls_auth;
2371       if(tls_auth->name == NULL) {
2372         yyerror("tls-auth has no name");
2373       } else if(tls_auth->auth_domain_name == NULL) {
2374         yyerror("tls-auth %s has no auth-domain-name", tls_auth->name);
2375       } else if(tls_auth_options_find(cfg_parser->opt, tls_auth->name)) {
2376         yyerror("duplicate tls-auth %s", tls_auth->name);
2377       } else {
2378       	tls_auth_options_insert(cfg_parser->opt, tls_auth);
2379         cfg_parser->tls_auth = NULL;
2380       }
2381     }
2382 #line 2383 "configparser.c"
2383     break;
2384 
2385   case 117: /* tls_auth_option: VAR_NAME STRING  */
2386 #line 696 "configparser.y"
2387     {
2388       dname_type *dname;
2389       dname = (dname_type *)dname_parse(cfg_parser->opt->region, (yyvsp[0].str));
2390       cfg_parser->tls_auth->name = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2391       if(dname == NULL) {
2392         yyerror("bad tls-auth name %s", (yyvsp[0].str));
2393       } else {
2394         region_recycle(cfg_parser->opt->region, dname, dname_total_size(dname));
2395       }
2396     }
2397 #line 2398 "configparser.c"
2398     break;
2399 
2400   case 118: /* tls_auth_option: VAR_TLS_AUTH_DOMAIN_NAME STRING  */
2401 #line 707 "configparser.y"
2402     {
2403       cfg_parser->tls_auth->auth_domain_name = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2404     }
2405 #line 2406 "configparser.c"
2406     break;
2407 
2408   case 119: /* tls_auth_option: VAR_TLS_AUTH_CLIENT_CERT STRING  */
2409 #line 711 "configparser.y"
2410     {
2411 	    cfg_parser->tls_auth->client_cert = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2412     }
2413 #line 2414 "configparser.c"
2414     break;
2415 
2416   case 120: /* tls_auth_option: VAR_TLS_AUTH_CLIENT_KEY STRING  */
2417 #line 715 "configparser.y"
2418     {
2419 	    cfg_parser->tls_auth->client_key = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2420     }
2421 #line 2422 "configparser.c"
2422     break;
2423 
2424   case 121: /* tls_auth_option: VAR_TLS_AUTH_CLIENT_KEY_PW STRING  */
2425 #line 719 "configparser.y"
2426     {
2427 	    cfg_parser->tls_auth->client_key_pw = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2428     }
2429 #line 2430 "configparser.c"
2430     break;
2431 
2432   case 122: /* $@3: %empty  */
2433 #line 726 "configparser.y"
2434       {
2435         key_options_type *key = key_options_create(cfg_parser->opt->region);
2436         key->algorithm = region_strdup(cfg_parser->opt->region, "sha256");
2437         assert(cfg_parser->key == NULL);
2438         cfg_parser->key = key;
2439       }
2440 #line 2441 "configparser.c"
2441     break;
2442 
2443   case 123: /* key: VAR_KEY $@3 key_block  */
2444 #line 733 "configparser.y"
2445     {
2446       struct key_options *key = cfg_parser->key;
2447       if(key->name == NULL) {
2448         yyerror("tsig key has no name");
2449       } else if(key->algorithm == NULL) {
2450         yyerror("tsig key %s has no algorithm", key->name);
2451       } else if(key->secret == NULL) {
2452         yyerror("tsig key %s has no secret blob", key->name);
2453       } else if(key_options_find(cfg_parser->opt, key->name)) {
2454         yyerror("duplicate tsig key %s", key->name);
2455       } else {
2456         key_options_insert(cfg_parser->opt, key);
2457         cfg_parser->key = NULL;
2458       }
2459     }
2460 #line 2461 "configparser.c"
2461     break;
2462 
2463   case 126: /* key_option: VAR_NAME STRING  */
2464 #line 754 "configparser.y"
2465     {
2466       dname_type *dname;
2467 
2468       dname = (dname_type *)dname_parse(cfg_parser->opt->region, (yyvsp[0].str));
2469       cfg_parser->key->name = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2470       if(dname == NULL) {
2471         yyerror("bad tsig key name %s", (yyvsp[0].str));
2472       } else {
2473         region_recycle(cfg_parser->opt->region, dname, dname_total_size(dname));
2474       }
2475     }
2476 #line 2477 "configparser.c"
2477     break;
2478 
2479   case 127: /* key_option: VAR_ALGORITHM STRING  */
2480 #line 766 "configparser.y"
2481     {
2482       if(tsig_get_algorithm_by_name((yyvsp[0].str)) == NULL) {
2483         yyerror("bad tsig key algorithm %s", (yyvsp[0].str));
2484       } else {
2485         cfg_parser->key->algorithm = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2486       }
2487     }
2488 #line 2489 "configparser.c"
2489     break;
2490 
2491   case 128: /* key_option: VAR_SECRET STRING  */
2492 #line 774 "configparser.y"
2493     {
2494       uint8_t data[16384];
2495       int size;
2496 
2497       cfg_parser->key->secret = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2498       size = b64_pton((yyvsp[0].str), data, sizeof(data));
2499       if(size == -1) {
2500         yyerror("cannot base64 decode tsig secret %s",
2501           cfg_parser->key->name?
2502           cfg_parser->key->name:"");
2503       } else if(size != 0) {
2504         memset(data, 0xdd, size); /* wipe secret */
2505       }
2506     }
2507 #line 2508 "configparser.c"
2508     break;
2509 
2510   case 129: /* $@4: %empty  */
2511 #line 792 "configparser.y"
2512       {
2513         assert(cfg_parser->pattern == NULL);
2514         assert(cfg_parser->zone == NULL);
2515         cfg_parser->zone = zone_options_create(cfg_parser->opt->region);
2516         cfg_parser->zone->part_of_config = 1;
2517         cfg_parser->zone->pattern = cfg_parser->pattern =
2518           pattern_options_create(cfg_parser->opt->region);
2519         cfg_parser->zone->pattern->implicit = 1;
2520       }
2521 #line 2522 "configparser.c"
2522     break;
2523 
2524   case 130: /* zone: VAR_ZONE $@4 zone_block  */
2525 #line 802 "configparser.y"
2526     {
2527       assert(cfg_parser->zone != NULL);
2528       if(cfg_parser->zone->name == NULL) {
2529         yyerror("zone has no name");
2530       } else if(!nsd_options_insert_zone(cfg_parser->opt, cfg_parser->zone)) {
2531         yyerror("duplicate zone %s", cfg_parser->zone->name);
2532       } else if(!nsd_options_insert_pattern(cfg_parser->opt, cfg_parser->zone->pattern)) {
2533         yyerror("duplicate pattern %s", cfg_parser->zone->pattern->pname);
2534       }
2535       cfg_parser->pattern = NULL;
2536       cfg_parser->zone = NULL;
2537     }
2538 #line 2539 "configparser.c"
2539     break;
2540 
2541   case 133: /* zone_option: VAR_NAME STRING  */
2542 #line 820 "configparser.y"
2543     {
2544       const char *marker = PATTERN_IMPLICIT_MARKER;
2545       char *pname = region_alloc(cfg_parser->opt->region, strlen((yyvsp[0].str)) + strlen(marker) + 1);
2546       memmove(pname, marker, strlen(marker));
2547       memmove(pname + strlen(marker), (yyvsp[0].str), strlen((yyvsp[0].str)) + 1);
2548       cfg_parser->zone->pattern->pname = pname;
2549       cfg_parser->zone->name = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2550       if(pattern_options_find(cfg_parser->opt, pname)) {
2551         yyerror("zone %s cannot be created because implicit pattern %s "
2552                     "already exists", (yyvsp[0].str), pname);
2553       }
2554     }
2555 #line 2556 "configparser.c"
2556     break;
2557 
2558   case 135: /* $@5: %empty  */
2559 #line 836 "configparser.y"
2560       {
2561         assert(cfg_parser->pattern == NULL);
2562         cfg_parser->pattern = pattern_options_create(cfg_parser->opt->region);
2563       }
2564 #line 2565 "configparser.c"
2565     break;
2566 
2567   case 136: /* pattern: VAR_PATTERN $@5 pattern_block  */
2568 #line 841 "configparser.y"
2569     {
2570       pattern_options_type *pattern = cfg_parser->pattern;
2571       if(pattern->pname == NULL) {
2572         yyerror("pattern has no name");
2573       } else if(!nsd_options_insert_pattern(cfg_parser->opt, pattern)) {
2574         yyerror("duplicate pattern %s", pattern->pname);
2575       }
2576       cfg_parser->pattern = NULL;
2577     }
2578 #line 2579 "configparser.c"
2579     break;
2580 
2581   case 139: /* pattern_option: VAR_NAME STRING  */
2582 #line 856 "configparser.y"
2583     {
2584       if(strchr((yyvsp[0].str), ' ')) {
2585         yyerror("space is not allowed in pattern name: '%s'", (yyvsp[0].str));
2586       }
2587       cfg_parser->pattern->pname = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2588     }
2589 #line 2590 "configparser.c"
2590     break;
2591 
2592   case 141: /* pattern_or_zone_option: VAR_RRL_WHITELIST STRING  */
2593 #line 866 "configparser.y"
2594     {
2595 #ifdef RATELIMIT
2596       cfg_parser->pattern->rrl_whitelist |= rrlstr2type((yyvsp[0].str));
2597 #endif
2598     }
2599 #line 2600 "configparser.c"
2600     break;
2601 
2602   case 142: /* pattern_or_zone_option: VAR_ZONEFILE STRING  */
2603 #line 872 "configparser.y"
2604     { cfg_parser->pattern->zonefile = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2605 #line 2606 "configparser.c"
2606     break;
2607 
2608   case 143: /* pattern_or_zone_option: VAR_ZONESTATS STRING  */
2609 #line 874 "configparser.y"
2610     { cfg_parser->pattern->zonestats = region_strdup(cfg_parser->opt->region, (yyvsp[0].str)); }
2611 #line 2612 "configparser.c"
2612     break;
2613 
2614   case 144: /* pattern_or_zone_option: VAR_SIZE_LIMIT_XFR number  */
2615 #line 876 "configparser.y"
2616     {
2617       if((yyvsp[0].llng) > 0) {
2618         cfg_parser->pattern->size_limit_xfr = (int)(yyvsp[0].llng);
2619       } else {
2620         yyerror("expected a number greater than zero");
2621       }
2622     }
2623 #line 2624 "configparser.c"
2624     break;
2625 
2626   case 145: /* pattern_or_zone_option: VAR_MULTI_MASTER_CHECK boolean  */
2627 #line 884 "configparser.y"
2628     { cfg_parser->pattern->multi_master_check = (int)(yyvsp[0].bln); }
2629 #line 2630 "configparser.c"
2630     break;
2631 
2632   case 146: /* pattern_or_zone_option: VAR_INCLUDE_PATTERN STRING  */
2633 #line 886 "configparser.y"
2634     { config_apply_pattern(cfg_parser->pattern, (yyvsp[0].str)); }
2635 #line 2636 "configparser.c"
2636     break;
2637 
2638   case 147: /* $@6: %empty  */
2639 #line 888 "configparser.y"
2640     {
2641       acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[-1].str), (yyvsp[0].str));
2642       if(acl->blocked)
2643         yyerror("blocked address used for request-xfr");
2644       if(acl->rangetype != acl_range_single)
2645         yyerror("address range used for request-xfr");
2646       append_acl(&cfg_parser->pattern->request_xfr, acl);
2647     }
2648 #line 2649 "configparser.c"
2649     break;
2650 
2651   case 148: /* pattern_or_zone_option: VAR_REQUEST_XFR STRING STRING $@6 tlsauth_option  */
2652 #line 897 "configparser.y"
2653         { }
2654 #line 2655 "configparser.c"
2655     break;
2656 
2657   case 149: /* $@7: %empty  */
2658 #line 899 "configparser.y"
2659     {
2660       acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[-1].str), (yyvsp[0].str));
2661       acl->use_axfr_only = 1;
2662       if(acl->blocked)
2663         yyerror("blocked address used for request-xfr");
2664       if(acl->rangetype != acl_range_single)
2665         yyerror("address range used for request-xfr");
2666       append_acl(&cfg_parser->pattern->request_xfr, acl);
2667     }
2668 #line 2669 "configparser.c"
2669     break;
2670 
2671   case 150: /* pattern_or_zone_option: VAR_REQUEST_XFR VAR_AXFR STRING STRING $@7 tlsauth_option  */
2672 #line 909 "configparser.y"
2673         { }
2674 #line 2675 "configparser.c"
2675     break;
2676 
2677   case 151: /* pattern_or_zone_option: VAR_REQUEST_XFR VAR_UDP STRING STRING  */
2678 #line 911 "configparser.y"
2679     {
2680       acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[-1].str), (yyvsp[0].str));
2681       acl->allow_udp = 1;
2682       if(acl->blocked)
2683         yyerror("blocked address used for request-xfr");
2684       if(acl->rangetype != acl_range_single)
2685         yyerror("address range used for request-xfr");
2686       append_acl(&cfg_parser->pattern->request_xfr, acl);
2687     }
2688 #line 2689 "configparser.c"
2689     break;
2690 
2691   case 152: /* pattern_or_zone_option: VAR_ALLOW_NOTIFY STRING STRING  */
2692 #line 921 "configparser.y"
2693     {
2694       acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[-1].str), (yyvsp[0].str));
2695       append_acl(&cfg_parser->pattern->allow_notify, acl);
2696     }
2697 #line 2698 "configparser.c"
2698     break;
2699 
2700   case 153: /* pattern_or_zone_option: VAR_NOTIFY STRING STRING  */
2701 #line 926 "configparser.y"
2702     {
2703       acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[-1].str), (yyvsp[0].str));
2704       if(acl->blocked)
2705         yyerror("blocked address used for notify");
2706       if(acl->rangetype != acl_range_single)
2707         yyerror("address range used for notify");
2708       append_acl(&cfg_parser->pattern->notify, acl);
2709     }
2710 #line 2711 "configparser.c"
2711     break;
2712 
2713   case 154: /* pattern_or_zone_option: VAR_PROVIDE_XFR STRING STRING  */
2714 #line 935 "configparser.y"
2715     {
2716       acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[-1].str), (yyvsp[0].str));
2717       append_acl(&cfg_parser->pattern->provide_xfr, acl);
2718     }
2719 #line 2720 "configparser.c"
2720     break;
2721 
2722   case 155: /* pattern_or_zone_option: VAR_ALLOW_QUERY STRING STRING  */
2723 #line 940 "configparser.y"
2724     {
2725       acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[-1].str), (yyvsp[0].str));
2726       append_acl(&cfg_parser->pattern->allow_query, acl);
2727     }
2728 #line 2729 "configparser.c"
2729     break;
2730 
2731   case 156: /* pattern_or_zone_option: VAR_OUTGOING_INTERFACE STRING  */
2732 #line 945 "configparser.y"
2733     {
2734       acl_options_type *acl = parse_acl_info(cfg_parser->opt->region, (yyvsp[0].str), "NOKEY");
2735       append_acl(&cfg_parser->pattern->outgoing_interface, acl);
2736     }
2737 #line 2738 "configparser.c"
2738     break;
2739 
2740   case 157: /* pattern_or_zone_option: VAR_ALLOW_AXFR_FALLBACK boolean  */
2741 #line 950 "configparser.y"
2742     {
2743       cfg_parser->pattern->allow_axfr_fallback = (yyvsp[0].bln);
2744       cfg_parser->pattern->allow_axfr_fallback_is_default = 0;
2745     }
2746 #line 2747 "configparser.c"
2747     break;
2748 
2749   case 158: /* pattern_or_zone_option: VAR_NOTIFY_RETRY number  */
2750 #line 955 "configparser.y"
2751     {
2752       cfg_parser->pattern->notify_retry = (yyvsp[0].llng);
2753       cfg_parser->pattern->notify_retry_is_default = 0;
2754     }
2755 #line 2756 "configparser.c"
2756     break;
2757 
2758   case 159: /* pattern_or_zone_option: VAR_MAX_REFRESH_TIME number  */
2759 #line 960 "configparser.y"
2760     {
2761       cfg_parser->pattern->max_refresh_time = (yyvsp[0].llng);
2762       cfg_parser->pattern->max_refresh_time_is_default = 0;
2763     }
2764 #line 2765 "configparser.c"
2765     break;
2766 
2767   case 160: /* pattern_or_zone_option: VAR_MIN_REFRESH_TIME number  */
2768 #line 965 "configparser.y"
2769     {
2770       cfg_parser->pattern->min_refresh_time = (yyvsp[0].llng);
2771       cfg_parser->pattern->min_refresh_time_is_default = 0;
2772     }
2773 #line 2774 "configparser.c"
2774     break;
2775 
2776   case 161: /* pattern_or_zone_option: VAR_MAX_RETRY_TIME number  */
2777 #line 970 "configparser.y"
2778     {
2779       cfg_parser->pattern->max_retry_time = (yyvsp[0].llng);
2780       cfg_parser->pattern->max_retry_time_is_default = 0;
2781     }
2782 #line 2783 "configparser.c"
2783     break;
2784 
2785   case 162: /* pattern_or_zone_option: VAR_MIN_RETRY_TIME number  */
2786 #line 975 "configparser.y"
2787     {
2788       cfg_parser->pattern->min_retry_time = (yyvsp[0].llng);
2789       cfg_parser->pattern->min_retry_time_is_default = 0;
2790     }
2791 #line 2792 "configparser.c"
2792     break;
2793 
2794   case 163: /* pattern_or_zone_option: VAR_MIN_EXPIRE_TIME STRING  */
2795 #line 980 "configparser.y"
2796     {
2797       long long num;
2798       uint8_t expr;
2799 
2800       if (!parse_expire_expr((yyvsp[0].str), &num, &expr)) {
2801         yyerror("expected an expire time in seconds or \"refresh+retry+1\"");
2802         YYABORT; /* trigger a parser error */
2803       }
2804       cfg_parser->pattern->min_expire_time = num;
2805       cfg_parser->pattern->min_expire_time_expr = expr;
2806     }
2807 #line 2808 "configparser.c"
2808     break;
2809 
2810   case 164: /* pattern_or_zone_option: VAR_STORE_IXFR boolean  */
2811 #line 992 "configparser.y"
2812     {
2813       cfg_parser->pattern->store_ixfr = (yyvsp[0].bln);
2814       cfg_parser->pattern->store_ixfr_is_default = 0;
2815     }
2816 #line 2817 "configparser.c"
2817     break;
2818 
2819   case 165: /* pattern_or_zone_option: VAR_IXFR_SIZE number  */
2820 #line 997 "configparser.y"
2821     {
2822       cfg_parser->pattern->ixfr_size = (yyvsp[0].llng);
2823       cfg_parser->pattern->ixfr_size_is_default = 0;
2824     }
2825 #line 2826 "configparser.c"
2826     break;
2827 
2828   case 166: /* pattern_or_zone_option: VAR_IXFR_NUMBER number  */
2829 #line 1002 "configparser.y"
2830     {
2831       cfg_parser->pattern->ixfr_number = (yyvsp[0].llng);
2832       cfg_parser->pattern->ixfr_number_is_default = 0;
2833     }
2834 #line 2835 "configparser.c"
2835     break;
2836 
2837   case 167: /* pattern_or_zone_option: VAR_CREATE_IXFR boolean  */
2838 #line 1007 "configparser.y"
2839     {
2840       cfg_parser->pattern->create_ixfr = (yyvsp[0].bln);
2841       cfg_parser->pattern->create_ixfr_is_default = 0;
2842     }
2843 #line 2844 "configparser.c"
2844     break;
2845 
2846   case 168: /* pattern_or_zone_option: VAR_VERIFY_ZONE boolean  */
2847 #line 1012 "configparser.y"
2848     { cfg_parser->pattern->verify_zone = (yyvsp[0].bln); }
2849 #line 2850 "configparser.c"
2850     break;
2851 
2852   case 169: /* pattern_or_zone_option: VAR_VERIFIER command  */
2853 #line 1014 "configparser.y"
2854     { cfg_parser->pattern->verifier = (yyvsp[0].strv); }
2855 #line 2856 "configparser.c"
2856     break;
2857 
2858   case 170: /* pattern_or_zone_option: VAR_VERIFIER_FEED_ZONE boolean  */
2859 #line 1016 "configparser.y"
2860     { cfg_parser->pattern->verifier_feed_zone = (yyvsp[0].bln); }
2861 #line 2862 "configparser.c"
2862     break;
2863 
2864   case 171: /* pattern_or_zone_option: VAR_VERIFIER_TIMEOUT number  */
2865 #line 1018 "configparser.y"
2866     { cfg_parser->pattern->verifier_timeout = (yyvsp[0].llng); }
2867 #line 2868 "configparser.c"
2868     break;
2869 
2870   case 175: /* verify_option: VAR_ENABLE boolean  */
2871 #line 1028 "configparser.y"
2872     { cfg_parser->opt->verify_enable = (yyvsp[0].bln); }
2873 #line 2874 "configparser.c"
2874     break;
2875 
2876   case 176: /* verify_option: VAR_IP_ADDRESS ip_address  */
2877 #line 1030 "configparser.y"
2878     {
2879       struct ip_address_option *ip = cfg_parser->opt->verify_ip_addresses;
2880       if(!ip) {
2881         cfg_parser->opt->verify_ip_addresses = (yyvsp[0].ip);
2882       } else {
2883         while(ip->next) { ip = ip->next; }
2884         ip->next = (yyvsp[0].ip);
2885       }
2886     }
2887 #line 2888 "configparser.c"
2888     break;
2889 
2890   case 177: /* verify_option: VAR_PORT number  */
2891 #line 1040 "configparser.y"
2892     {
2893       /* port number, stored as a string */
2894       char buf[16];
2895       (void)snprintf(buf, sizeof(buf), "%lld", (yyvsp[0].llng));
2896       cfg_parser->opt->verify_port = region_strdup(cfg_parser->opt->region, buf);
2897     }
2898 #line 2899 "configparser.c"
2899     break;
2900 
2901   case 178: /* verify_option: VAR_VERIFY_ZONES boolean  */
2902 #line 1047 "configparser.y"
2903     { cfg_parser->opt->verify_zones = (yyvsp[0].bln); }
2904 #line 2905 "configparser.c"
2905     break;
2906 
2907   case 179: /* verify_option: VAR_VERIFIER command  */
2908 #line 1049 "configparser.y"
2909     { cfg_parser->opt->verifier = (yyvsp[0].strv); }
2910 #line 2911 "configparser.c"
2911     break;
2912 
2913   case 180: /* verify_option: VAR_VERIFIER_COUNT number  */
2914 #line 1051 "configparser.y"
2915     { cfg_parser->opt->verifier_count = (int)(yyvsp[0].llng); }
2916 #line 2917 "configparser.c"
2917     break;
2918 
2919   case 181: /* verify_option: VAR_VERIFIER_TIMEOUT number  */
2920 #line 1053 "configparser.y"
2921     { cfg_parser->opt->verifier_timeout = (int)(yyvsp[0].llng); }
2922 #line 2923 "configparser.c"
2923     break;
2924 
2925   case 182: /* verify_option: VAR_VERIFIER_FEED_ZONE boolean  */
2926 #line 1055 "configparser.y"
2927     { cfg_parser->opt->verifier_feed_zone = (yyvsp[0].bln); }
2928 #line 2929 "configparser.c"
2929     break;
2930 
2931   case 183: /* command: STRING arguments  */
2932 #line 1059 "configparser.y"
2933     {
2934       char **argv;
2935       size_t argc = 1;
2936       for(struct component *i = (yyvsp[0].comp); i; i = i->next) {
2937         argc++;
2938       }
2939       argv = region_alloc_zero(
2940         cfg_parser->opt->region, (argc + 1) * sizeof(char *));
2941       argc = 0;
2942       argv[argc++] = (yyvsp[-1].str);
2943       for(struct component *j, *i = (yyvsp[0].comp); i; i = j) {
2944         j = i->next;
2945         argv[argc++] = i->str;
2946         region_recycle(cfg_parser->opt->region, i, sizeof(*i));
2947       }
2948       (yyval.strv) = argv;
2949     }
2950 #line 2951 "configparser.c"
2951     break;
2952 
2953   case 184: /* arguments: %empty  */
2954 #line 1078 "configparser.y"
2955     { (yyval.comp) = NULL; }
2956 #line 2957 "configparser.c"
2957     break;
2958 
2959   case 185: /* arguments: arguments STRING  */
2960 #line 1080 "configparser.y"
2961     {
2962       struct component *comp = region_alloc_zero(
2963         cfg_parser->opt->region, sizeof(*comp));
2964       comp->str = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2965       if((yyvsp[-1].comp)) {
2966         struct component *tail = (yyvsp[-1].comp);
2967         while(tail->next) {
2968          tail = tail->next;
2969         }
2970         tail->next = comp;
2971         (yyval.comp) = (yyvsp[-1].comp);
2972       } else {
2973         (yyval.comp) = comp;
2974       }
2975     }
2976 #line 2977 "configparser.c"
2977     break;
2978 
2979   case 186: /* ip_address: STRING  */
2980 #line 1098 "configparser.y"
2981     {
2982       struct ip_address_option *ip = region_alloc_zero(
2983         cfg_parser->opt->region, sizeof(*ip));
2984       ip->address = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
2985       ip->fib = -1;
2986       (yyval.ip) = ip;
2987     }
2988 #line 2989 "configparser.c"
2989     break;
2990 
2991   case 187: /* number: STRING  */
2992 #line 1108 "configparser.y"
2993     {
2994       if(!parse_number((yyvsp[0].str), &(yyval.llng))) {
2995         yyerror("expected a number");
2996         YYABORT; /* trigger a parser error */
2997       }
2998     }
2999 #line 3000 "configparser.c"
3000     break;
3001 
3002   case 188: /* boolean: STRING  */
3003 #line 1117 "configparser.y"
3004     {
3005       if(!parse_boolean((yyvsp[0].str), &(yyval.bln))) {
3006         yyerror("expected yes or no");
3007         YYABORT; /* trigger a parser error */
3008       }
3009     }
3010 #line 3011 "configparser.c"
3011     break;
3012 
3013   case 190: /* tlsauth_option: STRING  */
3014 #line 1126 "configparser.y"
3015         { char *tls_auth_name = region_strdup(cfg_parser->opt->region, (yyvsp[0].str));
3016 	  add_to_last_acl(&cfg_parser->pattern->request_xfr, tls_auth_name);}
3017 #line 3018 "configparser.c"
3018     break;
3019 
3020 
3021 #line 3022 "configparser.c"
3022 
3023       default: break;
3024     }
3025   /* User semantic actions sometimes alter yychar, and that requires
3026      that yytoken be updated with the new translation.  We take the
3027      approach of translating immediately before every use of yytoken.
3028      One alternative is translating here after every semantic action,
3029      but that translation would be missed if the semantic action invokes
3030      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3031      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
3032      incorrect destructor might then be invoked immediately.  In the
3033      case of YYERROR or YYBACKUP, subsequent parser actions might lead
3034      to an incorrect destructor call or verbose syntax error message
3035      before the lookahead is translated.  */
3036   YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
3037 
3038   YYPOPSTACK (yylen);
3039   yylen = 0;
3040 
3041   *++yyvsp = yyval;
3042 
3043   /* Now 'shift' the result of the reduction.  Determine what state
3044      that goes to, based on the state we popped back to and the rule
3045      number reduced by.  */
3046   {
3047     const int yylhs = yyr1[yyn] - YYNTOKENS;
3048     const int yyi = yypgoto[yylhs] + *yyssp;
3049     yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
3050                ? yytable[yyi]
3051                : yydefgoto[yylhs]);
3052   }
3053 
3054   goto yynewstate;
3055 
3056 
3057 /*--------------------------------------.
3058 | yyerrlab -- here on detecting error.  |
3059 `--------------------------------------*/
3060 yyerrlab:
3061   /* Make sure we have latest lookahead translation.  See comments at
3062      user semantic actions for why this is necessary.  */
3063   yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
3064   /* If not already recovering from an error, report this error.  */
3065   if (!yyerrstatus)
3066     {
3067       ++yynerrs;
3068       yyerror (YY_("syntax error"));
3069     }
3070 
3071   if (yyerrstatus == 3)
3072     {
3073       /* If just tried and failed to reuse lookahead token after an
3074          error, discard it.  */
3075 
3076       if (yychar <= YYEOF)
3077         {
3078           /* Return failure if at end of input.  */
3079           if (yychar == YYEOF)
3080             YYABORT;
3081         }
3082       else
3083         {
3084           yydestruct ("Error: discarding",
3085                       yytoken, &yylval);
3086           yychar = YYEMPTY;
3087         }
3088     }
3089 
3090   /* Else will try to reuse lookahead token after shifting the error
3091      token.  */
3092   goto yyerrlab1;
3093 
3094 
3095 /*---------------------------------------------------.
3096 | yyerrorlab -- error raised explicitly by YYERROR.  |
3097 `---------------------------------------------------*/
3098 yyerrorlab:
3099   /* Pacify compilers when the user code never invokes YYERROR and the
3100      label yyerrorlab therefore never appears in user code.  */
3101   if (0)
3102     YYERROR;
3103 
3104   /* Do not reclaim the symbols of the rule whose action triggered
3105      this YYERROR.  */
3106   YYPOPSTACK (yylen);
3107   yylen = 0;
3108   YY_STACK_PRINT (yyss, yyssp);
3109   yystate = *yyssp;
3110   goto yyerrlab1;
3111 
3112 
3113 /*-------------------------------------------------------------.
3114 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
3115 `-------------------------------------------------------------*/
3116 yyerrlab1:
3117   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
3118 
3119   /* Pop stack until we find a state that shifts the error token.  */
3120   for (;;)
3121     {
3122       yyn = yypact[yystate];
3123       if (!yypact_value_is_default (yyn))
3124         {
3125           yyn += YYSYMBOL_YYerror;
3126           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
3127             {
3128               yyn = yytable[yyn];
3129               if (0 < yyn)
3130                 break;
3131             }
3132         }
3133 
3134       /* Pop the current state because it cannot handle the error token.  */
3135       if (yyssp == yyss)
3136         YYABORT;
3137 
3138 
3139       yydestruct ("Error: popping",
3140                   YY_ACCESSING_SYMBOL (yystate), yyvsp);
3141       YYPOPSTACK (1);
3142       yystate = *yyssp;
3143       YY_STACK_PRINT (yyss, yyssp);
3144     }
3145 
3146   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3147   *++yyvsp = yylval;
3148   YY_IGNORE_MAYBE_UNINITIALIZED_END
3149 
3150 
3151   /* Shift the error token.  */
3152   YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
3153 
3154   yystate = yyn;
3155   goto yynewstate;
3156 
3157 
3158 /*-------------------------------------.
3159 | yyacceptlab -- YYACCEPT comes here.  |
3160 `-------------------------------------*/
3161 yyacceptlab:
3162   yyresult = 0;
3163   goto yyreturn;
3164 
3165 
3166 /*-----------------------------------.
3167 | yyabortlab -- YYABORT comes here.  |
3168 `-----------------------------------*/
3169 yyabortlab:
3170   yyresult = 1;
3171   goto yyreturn;
3172 
3173 
3174 #if !defined yyoverflow
3175 /*-------------------------------------------------.
3176 | yyexhaustedlab -- memory exhaustion comes here.  |
3177 `-------------------------------------------------*/
3178 yyexhaustedlab:
3179   yyerror (YY_("memory exhausted"));
3180   yyresult = 2;
3181   goto yyreturn;
3182 #endif
3183 
3184 
3185 /*-------------------------------------------------------.
3186 | yyreturn -- parsing is finished, clean up and return.  |
3187 `-------------------------------------------------------*/
3188 yyreturn:
3189   if (yychar != YYEMPTY)
3190     {
3191       /* Make sure we have latest lookahead translation.  See comments at
3192          user semantic actions for why this is necessary.  */
3193       yytoken = YYTRANSLATE (yychar);
3194       yydestruct ("Cleanup: discarding lookahead",
3195                   yytoken, &yylval);
3196     }
3197   /* Do not reclaim the symbols of the rule whose action triggered
3198      this YYABORT or YYACCEPT.  */
3199   YYPOPSTACK (yylen);
3200   YY_STACK_PRINT (yyss, yyssp);
3201   while (yyssp != yyss)
3202     {
3203       yydestruct ("Cleanup: popping",
3204                   YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
3205       YYPOPSTACK (1);
3206     }
3207 #ifndef yyoverflow
3208   if (yyss != yyssa)
3209     YYSTACK_FREE (yyss);
3210 #endif
3211 
3212   return yyresult;
3213 }
3214 
3215 #line 1129 "configparser.y"
3216 
3217 
3218 static void
3219 append_acl(struct acl_options **list, struct acl_options *acl)
3220 {
3221 	assert(list != NULL);
3222 
3223 	if(*list == NULL) {
3224 		*list = acl;
3225 	} else {
3226 		struct acl_options *tail = *list;
3227 		while(tail->next != NULL)
3228 			tail = tail->next;
3229 		tail->next = acl;
3230 	}
3231 }
3232 
3233 static void
3234 add_to_last_acl(struct acl_options **list, char *tls_auth_name)
3235 {
3236 	struct acl_options *tail = *list;
3237 	assert(list != NULL);
3238 	assert(*list != NULL);
3239 	while(tail->next != NULL)
3240 		tail = tail->next;
3241 	tail->tls_auth_name = tls_auth_name;
3242 }
3243 
3244 static int
3245 parse_boolean(const char *str, int *bln)
3246 {
3247 	if(strcmp(str, "yes") == 0) {
3248 		*bln = 1;
3249 	} else if(strcmp(str, "no") == 0) {
3250 		*bln = 0;
3251 	} else {
3252 		return 0;
3253 	}
3254 
3255 	return 1;
3256 }
3257 
3258 static int
3259 parse_expire_expr(const char *str, long long *num, uint8_t *expr)
3260 {
3261 	if(parse_number(str, num)) {
3262 		*expr = EXPIRE_TIME_HAS_VALUE;
3263 		return 1;
3264 	}
3265 	if(strcmp(str, REFRESHPLUSRETRYPLUS1_STR) == 0) {
3266 		*num = 0;
3267 		*expr = REFRESHPLUSRETRYPLUS1;
3268 		return 1;
3269 	}
3270 	return 0;
3271 }
3272 
3273 static int
3274 parse_number(const char *str, long long *num)
3275 {
3276 	/* ensure string consists entirely of digits */
3277 	size_t pos = 0;
3278 	while(str[pos] >= '0' && str[pos] <= '9') {
3279 		pos++;
3280 	}
3281 
3282 	if(pos != 0 && str[pos] == '\0') {
3283 		*num = strtoll(str, NULL, 10);
3284 		return 1;
3285 	}
3286 
3287 	return 0;
3288 }
3289 
3290 static int
3291 parse_range(const char *str, long long *low, long long *high)
3292 {
3293 	const char *ptr = str;
3294 	long long num[2];
3295 
3296 	/* require range to begin with a number */
3297 	if(*ptr < '0' || *ptr > '9') {
3298 		return 0;
3299 	}
3300 
3301 	num[0] = strtoll(ptr, (char **)&ptr, 10);
3302 
3303 	/* require number to be followed by nothing at all or a dash */
3304 	if(*ptr == '\0') {
3305 		*low = num[0];
3306 		*high = num[0];
3307 		return 1;
3308 	} else if(*ptr != '-') {
3309 		return 0;
3310 	}
3311 
3312 	++ptr;
3313 	/* require dash to be followed by a number */
3314 	if(*ptr < '0' || *ptr > '9') {
3315 		return 0;
3316 	}
3317 
3318 	num[1] = strtoll(ptr, (char **)&ptr, 10);
3319 
3320 	/* require number to be followed by nothing at all */
3321 	if(*ptr == '\0') {
3322 		if(num[0] < num[1]) {
3323 			*low = num[0];
3324 			*high = num[1];
3325 		} else {
3326 			*low = num[1];
3327 			*high = num[0];
3328 		}
3329 		return 1;
3330 	}
3331 
3332 	return 0;
3333 }
3334