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