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