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