1 /* A Bison parser, made by GNU Bison 3.4.1. */ 2 3 /* Bison implementation for Yacc-like parsers in C 4 5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, 6 Inc. 7 8 This program is free software: you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation, either version 3 of the License, or 11 (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 20 21 /* As a special exception, you may create a larger work that contains 22 part or all of the Bison parser skeleton and distribute that work 23 under terms of your choice, so long as that work isn't itself a 24 parser generator using the skeleton or a modified version thereof 25 as a parser skeleton. Alternatively, if you modify or redistribute 26 the parser skeleton itself, you may (at your option) remove this 27 special exception, which will cause the skeleton and the resulting 28 Bison output files to be licensed under the GNU General Public 29 License without this special exception. 30 31 This special exception was added by the Free Software Foundation in 32 version 2.2 of Bison. */ 33 34 /* C LALR(1) parser skeleton written by Richard Stallman, by 35 simplifying the original so-called "semantic" parser. */ 36 37 /* All symbols defined below should begin with yy or YY, to avoid 38 infringing on user name space. This should be done even for local 39 variables, as they might otherwise be expanded by user macros. 40 There are some unavoidable exceptions within include files to 41 define necessary library symbols; they are noted "INFRINGES ON 42 USER NAME SPACE" below. */ 43 44 /* Undocumented macros, especially those whose name start with YY_, 45 are private implementation details. Do not rely on them. */ 46 47 /* Identify Bison output. */ 48 #define YYBISON 1 49 50 /* Bison version. */ 51 #define YYBISON_VERSION "3.4.1" 52 53 /* Skeleton name. */ 54 #define YYSKELETON_NAME "yacc.c" 55 56 /* Pure parsers. */ 57 #define YYPURE 0 58 59 /* Push parsers. */ 60 #define YYPUSH 0 61 62 /* Pull parsers. */ 63 #define YYPULL 1 64 65 66 67 68 /* First part of user prologue. */ 69 #line 1 "zparser.y" 70 71 /* 72 * zyparser.y -- yacc grammar for (DNS) zone files 73 * 74 * Copyright (c) 2001-2006, NLnet Labs. All rights reserved. 75 * 76 * See LICENSE for the license. 77 * 78 */ 79 80 #include "config.h" 81 82 #include <stdarg.h> 83 #include <stdio.h> 84 #include <string.h> 85 86 #include "dname.h" 87 #include "namedb.h" 88 #include "zonec.h" 89 90 /* these need to be global, otherwise they cannot be used inside yacc */ 91 zparser_type *parser; 92 93 #ifdef __cplusplus 94 extern "C" 95 #endif /* __cplusplus */ 96 int yywrap(void); 97 98 /* this hold the nxt bits */ 99 static uint8_t nxtbits[16]; 100 static int dlv_warn = 1; 101 102 /* 256 windows of 256 bits (32 bytes) */ 103 /* still need to reset the bastard somewhere */ 104 static uint8_t nsecbits[NSEC_WINDOW_COUNT][NSEC_WINDOW_BITS_SIZE]; 105 106 /* hold the highest rcode seen in a NSEC rdata , BUG #106 */ 107 uint16_t nsec_highest_rcode; 108 109 void yyerror(const char *message); 110 111 #ifdef NSEC3 112 /* parse nsec3 parameters and add the (first) rdata elements */ 113 static void 114 nsec3_add_params(const char* hash_algo_str, const char* flag_str, 115 const char* iter_str, const char* salt_str, int salt_len); 116 #endif /* NSEC3 */ 117 118 119 #line 120 "zparser.c" 120 121 # ifndef YY_NULLPTR 122 # if defined __cplusplus 123 # if 201103L <= __cplusplus 124 # define YY_NULLPTR nullptr 125 # else 126 # define YY_NULLPTR 0 127 # endif 128 # else 129 # define YY_NULLPTR ((void*)0) 130 # endif 131 # endif 132 133 /* Enabling verbose error messages. */ 134 #ifdef YYERROR_VERBOSE 135 # undef YYERROR_VERBOSE 136 # define YYERROR_VERBOSE 1 137 #else 138 # define YYERROR_VERBOSE 0 139 #endif 140 141 /* Use api.header.include to #include this header 142 instead of duplicating it here. */ 143 #ifndef YY_YY_ZPARSER_H_INCLUDED 144 # define YY_YY_ZPARSER_H_INCLUDED 145 /* Debug traces. */ 146 #ifndef YYDEBUG 147 # define YYDEBUG 0 148 #endif 149 #if YYDEBUG 150 extern int yydebug; 151 #endif 152 153 /* Token type. */ 154 #ifndef YYTOKENTYPE 155 # define YYTOKENTYPE 156 enum yytokentype 157 { 158 T_A = 258, 159 T_NS = 259, 160 T_MX = 260, 161 T_TXT = 261, 162 T_CNAME = 262, 163 T_AAAA = 263, 164 T_PTR = 264, 165 T_NXT = 265, 166 T_KEY = 266, 167 T_SOA = 267, 168 T_SIG = 268, 169 T_SRV = 269, 170 T_CERT = 270, 171 T_LOC = 271, 172 T_MD = 272, 173 T_MF = 273, 174 T_MB = 274, 175 T_MG = 275, 176 T_MR = 276, 177 T_NULL = 277, 178 T_WKS = 278, 179 T_HINFO = 279, 180 T_MINFO = 280, 181 T_RP = 281, 182 T_AFSDB = 282, 183 T_X25 = 283, 184 T_ISDN = 284, 185 T_RT = 285, 186 T_NSAP = 286, 187 T_NSAP_PTR = 287, 188 T_PX = 288, 189 T_GPOS = 289, 190 T_EID = 290, 191 T_NIMLOC = 291, 192 T_ATMA = 292, 193 T_NAPTR = 293, 194 T_KX = 294, 195 T_A6 = 295, 196 T_DNAME = 296, 197 T_SINK = 297, 198 T_OPT = 298, 199 T_APL = 299, 200 T_UINFO = 300, 201 T_UID = 301, 202 T_GID = 302, 203 T_UNSPEC = 303, 204 T_TKEY = 304, 205 T_TSIG = 305, 206 T_IXFR = 306, 207 T_AXFR = 307, 208 T_MAILB = 308, 209 T_MAILA = 309, 210 T_DS = 310, 211 T_DLV = 311, 212 T_SSHFP = 312, 213 T_RRSIG = 313, 214 T_NSEC = 314, 215 T_DNSKEY = 315, 216 T_SPF = 316, 217 T_NSEC3 = 317, 218 T_IPSECKEY = 318, 219 T_DHCID = 319, 220 T_NSEC3PARAM = 320, 221 T_TLSA = 321, 222 T_URI = 322, 223 T_NID = 323, 224 T_L32 = 324, 225 T_L64 = 325, 226 T_LP = 326, 227 T_EUI48 = 327, 228 T_EUI64 = 328, 229 T_CAA = 329, 230 T_CDS = 330, 231 T_CDNSKEY = 331, 232 T_OPENPGPKEY = 332, 233 T_CSYNC = 333, 234 T_ZONEMD = 334, 235 T_AVC = 335, 236 T_SMIMEA = 336, 237 DOLLAR_TTL = 337, 238 DOLLAR_ORIGIN = 338, 239 NL = 339, 240 SP = 340, 241 STR = 341, 242 PREV = 342, 243 BITLAB = 343, 244 T_TTL = 344, 245 T_RRCLASS = 345, 246 URR = 346, 247 T_UTYPE = 347 248 }; 249 #endif 250 /* Tokens. */ 251 #define T_A 258 252 #define T_NS 259 253 #define T_MX 260 254 #define T_TXT 261 255 #define T_CNAME 262 256 #define T_AAAA 263 257 #define T_PTR 264 258 #define T_NXT 265 259 #define T_KEY 266 260 #define T_SOA 267 261 #define T_SIG 268 262 #define T_SRV 269 263 #define T_CERT 270 264 #define T_LOC 271 265 #define T_MD 272 266 #define T_MF 273 267 #define T_MB 274 268 #define T_MG 275 269 #define T_MR 276 270 #define T_NULL 277 271 #define T_WKS 278 272 #define T_HINFO 279 273 #define T_MINFO 280 274 #define T_RP 281 275 #define T_AFSDB 282 276 #define T_X25 283 277 #define T_ISDN 284 278 #define T_RT 285 279 #define T_NSAP 286 280 #define T_NSAP_PTR 287 281 #define T_PX 288 282 #define T_GPOS 289 283 #define T_EID 290 284 #define T_NIMLOC 291 285 #define T_ATMA 292 286 #define T_NAPTR 293 287 #define T_KX 294 288 #define T_A6 295 289 #define T_DNAME 296 290 #define T_SINK 297 291 #define T_OPT 298 292 #define T_APL 299 293 #define T_UINFO 300 294 #define T_UID 301 295 #define T_GID 302 296 #define T_UNSPEC 303 297 #define T_TKEY 304 298 #define T_TSIG 305 299 #define T_IXFR 306 300 #define T_AXFR 307 301 #define T_MAILB 308 302 #define T_MAILA 309 303 #define T_DS 310 304 #define T_DLV 311 305 #define T_SSHFP 312 306 #define T_RRSIG 313 307 #define T_NSEC 314 308 #define T_DNSKEY 315 309 #define T_SPF 316 310 #define T_NSEC3 317 311 #define T_IPSECKEY 318 312 #define T_DHCID 319 313 #define T_NSEC3PARAM 320 314 #define T_TLSA 321 315 #define T_URI 322 316 #define T_NID 323 317 #define T_L32 324 318 #define T_L64 325 319 #define T_LP 326 320 #define T_EUI48 327 321 #define T_EUI64 328 322 #define T_CAA 329 323 #define T_CDS 330 324 #define T_CDNSKEY 331 325 #define T_OPENPGPKEY 332 326 #define T_CSYNC 333 327 #define T_ZONEMD 334 328 #define T_AVC 335 329 #define T_SMIMEA 336 330 #define DOLLAR_TTL 337 331 #define DOLLAR_ORIGIN 338 332 #define NL 339 333 #define SP 340 334 #define STR 341 335 #define PREV 342 336 #define BITLAB 343 337 #define T_TTL 344 338 #define T_RRCLASS 345 339 #define URR 346 340 #define T_UTYPE 347 341 342 /* Value type. */ 343 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 344 union YYSTYPE 345 { 346 #line 50 "zparser.y" 347 348 domain_type *domain; 349 const dname_type *dname; 350 struct lex_data data; 351 uint32_t ttl; 352 uint16_t klass; 353 uint16_t type; 354 uint16_t *unknown; 355 356 #line 357 "zparser.c" 357 358 }; 359 typedef union YYSTYPE YYSTYPE; 360 # define YYSTYPE_IS_TRIVIAL 1 361 # define YYSTYPE_IS_DECLARED 1 362 #endif 363 364 365 extern YYSTYPE yylval; 366 367 int yyparse (void); 368 369 #endif /* !YY_YY_ZPARSER_H_INCLUDED */ 370 371 372 373 #ifdef short 374 # undef short 375 #endif 376 377 #ifdef YYTYPE_UINT8 378 typedef YYTYPE_UINT8 yytype_uint8; 379 #else 380 typedef unsigned char yytype_uint8; 381 #endif 382 383 #ifdef YYTYPE_INT8 384 typedef YYTYPE_INT8 yytype_int8; 385 #else 386 typedef signed char yytype_int8; 387 #endif 388 389 #ifdef YYTYPE_UINT16 390 typedef YYTYPE_UINT16 yytype_uint16; 391 #else 392 typedef unsigned short yytype_uint16; 393 #endif 394 395 #ifdef YYTYPE_INT16 396 typedef YYTYPE_INT16 yytype_int16; 397 #else 398 typedef short yytype_int16; 399 #endif 400 401 #ifndef YYSIZE_T 402 # ifdef __SIZE_TYPE__ 403 # define YYSIZE_T __SIZE_TYPE__ 404 # elif defined size_t 405 # define YYSIZE_T size_t 406 # elif ! defined YYSIZE_T 407 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 408 # define YYSIZE_T size_t 409 # else 410 # define YYSIZE_T unsigned 411 # endif 412 #endif 413 414 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 415 416 #ifndef YY_ 417 # if defined YYENABLE_NLS && YYENABLE_NLS 418 # if ENABLE_NLS 419 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 420 # define YY_(Msgid) dgettext ("bison-runtime", Msgid) 421 # endif 422 # endif 423 # ifndef YY_ 424 # define YY_(Msgid) Msgid 425 # endif 426 #endif 427 428 #ifndef YY_ATTRIBUTE 429 # if (defined __GNUC__ \ 430 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 431 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 432 # define YY_ATTRIBUTE(Spec) __attribute__(Spec) 433 # else 434 # define YY_ATTRIBUTE(Spec) /* empty */ 435 # endif 436 #endif 437 438 #ifndef YY_ATTRIBUTE_PURE 439 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 440 #endif 441 442 #ifndef YY_ATTRIBUTE_UNUSED 443 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 444 #endif 445 446 /* Suppress unused-variable warnings by "using" E. */ 447 #if ! defined lint || defined __GNUC__ 448 # define YYUSE(E) ((void) (E)) 449 #else 450 # define YYUSE(E) /* empty */ 451 #endif 452 453 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 454 /* Suppress an incorrect diagnostic about yylval being uninitialized. */ 455 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 456 _Pragma ("GCC diagnostic push") \ 457 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 458 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 459 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 460 _Pragma ("GCC diagnostic pop") 461 #else 462 # define YY_INITIAL_VALUE(Value) Value 463 #endif 464 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 465 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 466 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 467 #endif 468 #ifndef YY_INITIAL_VALUE 469 # define YY_INITIAL_VALUE(Value) /* Nothing. */ 470 #endif 471 472 473 #define YY_ASSERT(E) ((void) (0 && (E))) 474 475 #if ! defined yyoverflow || YYERROR_VERBOSE 476 477 /* The parser invokes alloca or malloc; define the necessary symbols. */ 478 479 # ifdef YYSTACK_USE_ALLOCA 480 # if YYSTACK_USE_ALLOCA 481 # ifdef __GNUC__ 482 # define YYSTACK_ALLOC __builtin_alloca 483 # elif defined __BUILTIN_VA_ARG_INCR 484 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 485 # elif defined _AIX 486 # define YYSTACK_ALLOC __alloca 487 # elif defined _MSC_VER 488 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 489 # define alloca _alloca 490 # else 491 # define YYSTACK_ALLOC alloca 492 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 493 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 494 /* Use EXIT_SUCCESS as a witness for stdlib.h. */ 495 # ifndef EXIT_SUCCESS 496 # define EXIT_SUCCESS 0 497 # endif 498 # endif 499 # endif 500 # endif 501 # endif 502 503 # ifdef YYSTACK_ALLOC 504 /* Pacify GCC's 'empty if-body' warning. */ 505 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 506 # ifndef YYSTACK_ALLOC_MAXIMUM 507 /* The OS might guarantee only one guard page at the bottom of the stack, 508 and a page size can be as small as 4096 bytes. So we cannot safely 509 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 510 to allow for a few compiler-allocated temporary stack slots. */ 511 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 512 # endif 513 # else 514 # define YYSTACK_ALLOC YYMALLOC 515 # define YYSTACK_FREE YYFREE 516 # ifndef YYSTACK_ALLOC_MAXIMUM 517 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 518 # endif 519 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 520 && ! ((defined YYMALLOC || defined malloc) \ 521 && (defined YYFREE || defined free))) 522 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 523 # ifndef EXIT_SUCCESS 524 # define EXIT_SUCCESS 0 525 # endif 526 # endif 527 # ifndef YYMALLOC 528 # define YYMALLOC malloc 529 # if ! defined malloc && ! defined EXIT_SUCCESS 530 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 531 # endif 532 # endif 533 # ifndef YYFREE 534 # define YYFREE free 535 # if ! defined free && ! defined EXIT_SUCCESS 536 void free (void *); /* INFRINGES ON USER NAME SPACE */ 537 # endif 538 # endif 539 # endif 540 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 541 542 543 #if (! defined yyoverflow \ 544 && (! defined __cplusplus \ 545 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 546 547 /* A type that is properly aligned for any stack member. */ 548 union yyalloc 549 { 550 yytype_int16 yyss_alloc; 551 YYSTYPE yyvs_alloc; 552 }; 553 554 /* The size of the maximum gap between one aligned stack and the next. */ 555 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 556 557 /* The size of an array large to enough to hold all stacks, each with 558 N elements. */ 559 # define YYSTACK_BYTES(N) \ 560 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 561 + YYSTACK_GAP_MAXIMUM) 562 563 # define YYCOPY_NEEDED 1 564 565 /* Relocate STACK from its old location to the new one. The 566 local variables YYSIZE and YYSTACKSIZE give the old and new number of 567 elements in the stack, and YYPTR gives the new location of the 568 stack. Advance YYPTR to a properly aligned location for the next 569 stack. */ 570 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 571 do \ 572 { \ 573 YYSIZE_T yynewbytes; \ 574 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 575 Stack = &yyptr->Stack_alloc; \ 576 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 577 yyptr += yynewbytes / sizeof (*yyptr); \ 578 } \ 579 while (0) 580 581 #endif 582 583 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 584 /* Copy COUNT objects from SRC to DST. The source and destination do 585 not overlap. */ 586 # ifndef YYCOPY 587 # if defined __GNUC__ && 1 < __GNUC__ 588 # define YYCOPY(Dst, Src, Count) \ 589 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 590 # else 591 # define YYCOPY(Dst, Src, Count) \ 592 do \ 593 { \ 594 YYSIZE_T yyi; \ 595 for (yyi = 0; yyi < (Count); yyi++) \ 596 (Dst)[yyi] = (Src)[yyi]; \ 597 } \ 598 while (0) 599 # endif 600 # endif 601 #endif /* !YYCOPY_NEEDED */ 602 603 /* YYFINAL -- State number of the termination state. */ 604 #define YYFINAL 2 605 /* YYLAST -- Last index in YYTABLE. */ 606 #define YYLAST 977 607 608 /* YYNTOKENS -- Number of terminals. */ 609 #define YYNTOKENS 95 610 /* YYNNTS -- Number of nonterminals. */ 611 #define YYNNTS 76 612 /* YYNRULES -- Number of rules. */ 613 #define YYNRULES 240 614 /* YYNSTATES -- Number of states. */ 615 #define YYNSTATES 599 616 617 #define YYUNDEFTOK 2 618 #define YYMAXUTOK 347 619 620 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM 621 as returned by yylex, with out-of-bounds checking. */ 622 #define YYTRANSLATE(YYX) \ 623 ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 624 625 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM 626 as returned by yylex. */ 627 static const yytype_uint8 yytranslate[] = 628 { 629 0, 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, 93, 2, 2, 2, 634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 635 2, 2, 2, 2, 94, 2, 2, 2, 2, 2, 636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 654 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 655 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 656 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 657 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 658 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 659 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 660 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 661 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 662 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 663 85, 86, 87, 88, 89, 90, 91, 92 664 }; 665 666 #if YYDEBUG 667 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ 668 static const yytype_uint16 yyrline[] = 669 { 670 0, 92, 92, 93, 96, 97, 98, 99, 107, 115, 671 135, 139, 140, 143, 144, 147, 157, 168, 174, 181, 672 186, 193, 197, 202, 207, 212, 219, 220, 241, 245, 673 249, 259, 273, 280, 281, 299, 300, 324, 331, 343, 674 355, 372, 373, 385, 389, 399, 400, 405, 414, 426, 675 435, 446, 449, 452, 466, 467, 474, 475, 491, 492, 676 507, 508, 513, 523, 541, 542, 543, 544, 545, 546, 677 551, 552, 558, 559, 560, 561, 562, 563, 569, 570, 678 571, 572, 574, 575, 576, 577, 578, 579, 580, 581, 679 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 680 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 681 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 682 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 683 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 684 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 685 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 686 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 687 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 688 672, 673, 674, 675, 676, 677, 678, 690, 696, 703, 689 716, 723, 730, 738, 745, 752, 760, 768, 775, 779, 690 787, 795, 807, 815, 821, 827, 835, 845, 857, 865, 691 875, 878, 882, 888, 897, 906, 915, 921, 936, 946, 692 961, 971, 980, 989, 998, 1043, 1047, 1051, 1058, 1065, 693 1072, 1079, 1085, 1092, 1101, 1110, 1117, 1128, 1137, 1143, 694 1147 695 }; 696 #endif 697 698 #if YYDEBUG || YYERROR_VERBOSE || 0 699 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 700 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 701 static const char *const yytname[] = 702 { 703 "$end", "error", "$undefined", "T_A", "T_NS", "T_MX", "T_TXT", 704 "T_CNAME", "T_AAAA", "T_PTR", "T_NXT", "T_KEY", "T_SOA", "T_SIG", 705 "T_SRV", "T_CERT", "T_LOC", "T_MD", "T_MF", "T_MB", "T_MG", "T_MR", 706 "T_NULL", "T_WKS", "T_HINFO", "T_MINFO", "T_RP", "T_AFSDB", "T_X25", 707 "T_ISDN", "T_RT", "T_NSAP", "T_NSAP_PTR", "T_PX", "T_GPOS", "T_EID", 708 "T_NIMLOC", "T_ATMA", "T_NAPTR", "T_KX", "T_A6", "T_DNAME", "T_SINK", 709 "T_OPT", "T_APL", "T_UINFO", "T_UID", "T_GID", "T_UNSPEC", "T_TKEY", 710 "T_TSIG", "T_IXFR", "T_AXFR", "T_MAILB", "T_MAILA", "T_DS", "T_DLV", 711 "T_SSHFP", "T_RRSIG", "T_NSEC", "T_DNSKEY", "T_SPF", "T_NSEC3", 712 "T_IPSECKEY", "T_DHCID", "T_NSEC3PARAM", "T_TLSA", "T_URI", "T_NID", 713 "T_L32", "T_L64", "T_LP", "T_EUI48", "T_EUI64", "T_CAA", "T_CDS", 714 "T_CDNSKEY", "T_OPENPGPKEY", "T_CSYNC", "T_ZONEMD", "T_AVC", "T_SMIMEA", 715 "DOLLAR_TTL", "DOLLAR_ORIGIN", "NL", "SP", "STR", "PREV", "BITLAB", 716 "T_TTL", "T_RRCLASS", "URR", "T_UTYPE", "'.'", "'@'", "$accept", "lines", 717 "line", "sp", "trail", "ttl_directive", "origin_directive", "rr", 718 "owner", "classttl", "dname", "abs_dname", "label", "rel_dname", 719 "wire_dname", "wire_abs_dname", "wire_label", "wire_rel_dname", 720 "str_seq", "concatenated_str_seq", "nxt_seq", "nsec_more", "nsec_seq", 721 "str_sp_seq", "str_dot_seq", "dotted_str", "type_and_rdata", "rdata_a", 722 "rdata_domain_name", "rdata_soa", "rdata_wks", "rdata_hinfo", 723 "rdata_minfo", "rdata_mx", "rdata_txt", "rdata_rp", "rdata_afsdb", 724 "rdata_x25", "rdata_isdn", "rdata_rt", "rdata_nsap", "rdata_px", 725 "rdata_aaaa", "rdata_loc", "rdata_nxt", "rdata_srv", "rdata_naptr", 726 "rdata_kx", "rdata_cert", "rdata_apl", "rdata_apl_seq", "rdata_ds", 727 "rdata_dlv", "rdata_sshfp", "rdata_dhcid", "rdata_rrsig", "rdata_nsec", 728 "rdata_nsec3", "rdata_nsec3_param", "rdata_tlsa", "rdata_smimea", 729 "rdata_dnskey", "rdata_ipsec_base", "rdata_ipseckey", "rdata_nid", 730 "rdata_l32", "rdata_l64", "rdata_lp", "rdata_eui48", "rdata_eui64", 731 "rdata_uri", "rdata_caa", "rdata_openpgpkey", "rdata_csync", 732 "rdata_zonemd", "rdata_unknown", 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, 46, 64 751 }; 752 # endif 753 754 #define YYPACT_NINF -451 755 756 #define yypact_value_is_default(Yystate) \ 757 (!!((Yystate) == (-451))) 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 -451, 109, -451, -57, -51, -51, -451, -451, -451, 40, 769 -451, -451, -451, -451, 79, -451, -451, -451, 100, -51, 770 -451, -451, 50, -451, 83, 41, -451, -451, -451, -51, 771 -51, 885, 48, 28, 141, 141, 65, -55, -73, -51, 772 -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, 773 -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, 774 -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, 775 -51, 141, -51, -51, -51, -51, -51, -51, -51, -51, 776 -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, 777 -51, -51, -51, -51, -51, -51, -51, -51, -51, 170, 778 -51, -451, -451, -451, 208, -451, -451, -451, -51, -51, 779 81, 27, -54, 81, 27, 81, 27, 27, 37, 27, 780 114, 126, 129, 92, 27, 27, 27, 27, 27, 81, 781 136, 27, 27, 138, 147, 150, 160, 162, 169, 172, 782 182, 27, -78, -451, 184, 193, 196, 114, 51, 37, 783 81, 200, 203, 214, 222, 225, 237, 244, 246, 248, 784 256, 259, 266, 273, 184, 37, 214, 281, 283, 81, 785 292, 89, 68, -451, 48, 48, -451, 13, -451, 67, 786 -451, -451, 141, -451, -451, -51, -451, -451, 141, 82, 787 -451, -451, -451, -451, 67, -451, -451, -451, -451, -51, 788 -451, -451, -51, -451, -451, -51, -451, -451, -51, -451, 789 -451, -51, -451, -451, -51, -451, -451, -451, -451, 72, 790 -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, 791 -451, -451, -60, -451, -451, -51, -451, -451, -51, -451, 792 -451, -51, -451, -451, -51, -451, -451, 141, -451, -451, 793 141, -451, -451, -51, -451, -451, -451, 77, -451, -451, 794 -51, -451, -451, -51, -451, -451, -51, -451, -451, -451, 795 -451, 82, -451, 141, -451, -51, -451, -451, -51, -451, 796 -451, -51, -451, -451, -451, -451, -451, -451, -451, 219, 797 -451, -451, 86, -451, -451, -451, -451, -451, -451, -51, 798 -451, -451, -51, 141, -451, -451, -451, 141, -451, -451, 799 -51, -451, -451, -51, -451, -451, -51, -451, -451, -51, 800 -451, -451, -51, -451, -451, -51, -451, -451, -51, -451, 801 -451, 141, -451, -451, 141, -451, -451, -51, -451, -451, 802 -451, -451, -451, -451, 141, -451, -451, -51, -451, -451, 803 -51, -451, -451, -451, -451, -51, -451, -451, -451, -451, 804 98, 234, 120, -451, -451, 41, 55, -451, -451, 270, 805 299, 41, 316, 318, 324, 133, 16, -451, 326, 329, 806 41, 41, 41, -451, 19, -451, 41, 142, -451, 41, 807 331, 41, 55, -451, 333, 337, 339, -451, 211, -451, 808 144, 347, 350, 308, -451, 311, -451, 352, 354, 359, 809 95, 95, 95, 41, -451, -451, 364, -451, 366, 376, 810 378, -451, 141, -451, 141, 82, -451, 141, -51, -51, 811 -51, -51, -51, -451, -451, -51, 141, 141, 141, 141, 812 141, 141, -451, -51, -51, 141, 82, -51, -51, -51, 813 -451, 211, 219, -451, -451, -51, -51, 141, -451, -51, 814 -51, -51, 67, 67, 67, 141, -51, 219, -51, -51, 815 308, -451, -451, 314, -451, 385, 388, 390, 394, 397, 816 123, -451, -451, -451, -451, -451, -451, 41, 400, -451, 817 403, 405, 407, -451, -451, 409, 412, -451, 414, 417, 818 95, -451, -451, -451, -451, 95, -451, 419, 421, 141, 819 -451, -51, -51, -51, -51, -51, 72, 141, -51, -51, 820 -51, 141, -51, -51, -51, -51, 67, 67, -51, -51, 821 -451, 407, 440, 444, 41, 407, -451, -451, 446, 407, 822 407, -451, 450, 95, 456, 407, -451, -451, 407, 407, 823 141, -51, -51, 141, 141, -51, 141, 141, -51, 82, 824 141, 141, 141, 141, -451, 458, 460, -451, -451, 473, 825 -451, -451, 479, -451, -451, -451, -451, -51, -51, -51, 826 219, 481, 483, 41, -451, -51, -51, 141, 486, 488, 827 -451, 141, -51, -451, 61, -51, 407, 141, -451 828 }; 829 830 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. 831 Performed when YYTABLE does not specify something else to do. Zero 832 means the default is an error. */ 833 static const yytype_uint8 yydefact[] = 834 { 835 2, 0, 1, 0, 0, 0, 4, 11, 31, 20, 836 32, 28, 29, 3, 0, 7, 8, 9, 21, 0, 837 26, 33, 27, 10, 0, 0, 6, 5, 12, 0, 838 0, 0, 19, 30, 0, 0, 0, 23, 22, 0, 839 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 840 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 841 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 842 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 843 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 844 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 845 0, 18, 34, 13, 0, 15, 16, 17, 0, 0, 846 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 847 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 848 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 849 0, 0, 0, 136, 0, 0, 0, 0, 0, 0, 850 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 851 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 852 0, 0, 0, 14, 24, 25, 60, 0, 61, 0, 853 64, 65, 0, 66, 67, 0, 90, 91, 0, 43, 854 92, 93, 72, 73, 0, 120, 121, 84, 85, 0, 855 124, 125, 0, 116, 117, 0, 74, 75, 0, 114, 856 115, 0, 126, 127, 0, 132, 133, 45, 46, 0, 857 122, 123, 68, 69, 70, 71, 76, 77, 78, 79, 858 80, 81, 0, 82, 83, 0, 86, 87, 0, 88, 859 89, 0, 98, 99, 0, 100, 101, 0, 102, 103, 860 0, 104, 105, 0, 110, 111, 58, 0, 112, 113, 861 0, 118, 119, 0, 128, 129, 0, 130, 131, 134, 862 135, 211, 137, 0, 138, 0, 139, 140, 0, 141, 863 142, 0, 143, 144, 145, 146, 40, 37, 38, 0, 864 35, 41, 36, 147, 148, 153, 154, 94, 95, 0, 865 149, 150, 0, 0, 106, 107, 56, 0, 108, 109, 866 0, 151, 152, 0, 155, 156, 0, 183, 184, 0, 867 159, 160, 0, 161, 162, 0, 163, 164, 0, 165, 868 166, 0, 167, 168, 0, 169, 170, 0, 171, 172, 869 173, 174, 175, 176, 0, 177, 178, 0, 179, 180, 870 0, 181, 182, 96, 97, 0, 157, 158, 186, 185, 871 0, 0, 62, 187, 188, 0, 0, 194, 203, 0, 872 0, 0, 0, 0, 0, 0, 0, 204, 0, 0, 873 0, 0, 0, 197, 0, 198, 0, 0, 201, 0, 874 0, 0, 0, 210, 0, 0, 0, 54, 0, 218, 875 39, 0, 0, 0, 226, 0, 216, 0, 0, 0, 876 0, 0, 0, 0, 231, 232, 0, 235, 0, 0, 877 0, 240, 0, 63, 0, 44, 49, 0, 0, 0, 878 0, 0, 0, 48, 47, 0, 0, 0, 0, 0, 879 0, 0, 59, 0, 0, 0, 212, 0, 0, 0, 880 52, 0, 0, 55, 42, 0, 0, 0, 57, 0, 881 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 882 0, 239, 193, 0, 205, 0, 0, 0, 0, 0, 883 0, 191, 192, 195, 196, 199, 200, 0, 0, 208, 884 0, 0, 0, 51, 53, 0, 0, 225, 0, 0, 885 0, 227, 228, 229, 230, 0, 236, 0, 0, 0, 886 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 887 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 888 238, 0, 0, 0, 0, 0, 190, 202, 0, 0, 889 0, 215, 0, 0, 0, 0, 233, 234, 0, 0, 890 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 891 0, 0, 0, 0, 223, 0, 0, 206, 209, 0, 892 213, 214, 0, 220, 221, 237, 222, 0, 0, 0, 893 0, 0, 0, 0, 219, 0, 0, 0, 0, 0, 894 207, 0, 0, 189, 0, 0, 0, 0, 217 895 }; 896 897 /* YYPGOTO[NTERM-NUM]. */ 898 static const yytype_int16 yypgoto[] = 899 { 900 -451, -451, -451, -1, 290, -451, -451, -451, -451, -451, 901 0, 161, 206, 217, -344, -451, -144, -451, -451, -219, 902 -451, -187, -450, 78, -451, -4, -451, -451, -105, -451, 903 -451, -451, -451, -451, -145, -451, -451, -451, -451, -451, 904 -451, -451, -451, -451, -451, -451, -451, -451, -451, -451, 905 -451, 102, -451, -451, -451, 124, -451, -451, -451, -451, 906 -451, -139, -451, -451, -451, -451, -451, -451, -451, -451, 907 -451, -451, -451, -451, -451, 531 908 }; 909 910 /* YYDEFGOTO[NTERM-NUM]. */ 911 static const yytype_int16 yydefgoto[] = 912 { 913 -1, 1, 13, 104, 105, 15, 16, 17, 18, 31, 914 182, 20, 21, 22, 289, 290, 291, 292, 188, 219, 915 427, 453, 399, 307, 257, 189, 101, 180, 183, 206, 916 233, 236, 239, 186, 190, 242, 245, 248, 251, 254, 917 258, 261, 195, 220, 200, 212, 264, 267, 215, 272, 918 273, 276, 279, 282, 308, 209, 293, 300, 311, 314, 919 356, 203, 303, 304, 320, 323, 326, 329, 332, 335, 920 317, 338, 345, 348, 351, 181 921 }; 922 923 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If 924 positive, shift that token. If negative, reduce the rule whose 925 number is the opposite. If YYTABLE_NINF, syntax error. */ 926 static const yytype_uint16 yytable[] = 927 { 928 14, 19, 494, 24, 25, 297, 173, 28, 176, 192, 929 295, 197, 28, 177, 360, 178, 109, 506, 32, 222, 930 224, 226, 228, 230, 353, 7, 342, 23, 37, 38, 931 28, 28, 185, 362, 7, 108, 269, 177, 110, 111, 932 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 933 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 934 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 935 142, 144, 145, 146, 147, 148, 149, 150, 151, 152, 936 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 937 163, 164, 165, 166, 167, 168, 169, 170, 7, 172, 938 173, 28, 434, 173, 28, 440, 179, 174, 175, 2, 939 3, 194, 28, 8, 8, 10, 10, 199, 177, 205, 940 11, 12, 28, 202, 26, 232, 28, 8, 177, 10, 941 584, 238, 241, 28, 11, 12, 28, 286, 271, 173, 942 28, 176, 177, 33, 287, 288, 28, 286, 178, 103, 943 7, 103, 7, 28, 287, 288, 103, 7, 33, 177, 944 362, 103, 7, 27, 28, 375, 28, 176, 28, 34, 945 387, 171, 177, 358, 178, 362, 361, 28, 217, 400, 946 28, 176, 421, 177, 365, 218, 35, 366, 178, 29, 947 30, 4, 5, 6, 7, 8, 9, 10, 369, 28, 948 208, 370, 11, 12, 371, 177, 423, 372, 28, 217, 949 373, 28, 211, 374, 28, 214, 218, 177, 376, 433, 950 177, 28, 235, 28, 244, 103, 7, 177, 442, 177, 951 286, 378, 28, 247, 379, 28, 250, 380, 177, 102, 952 381, 177, 36, 382, 344, 28, 253, 28, 256, 384, 953 595, 177, 386, 177, 28, 260, 454, 28, 263, 389, 954 177, 516, 390, 177, 493, 391, 340, 28, 266, 28, 955 275, 284, 392, 177, 394, 177, 0, 395, 28, 278, 956 396, 28, 281, 0, 177, 28, 299, 177, 28, 302, 957 0, 177, 173, 28, 177, 450, 451, 452, 401, 28, 958 306, 402, 403, 397, 398, 177, 405, 28, 310, 407, 959 28, 313, 408, 177, 0, 409, 177, 0, 410, 28, 960 422, 411, 28, 316, 412, 106, 107, 413, 177, 28, 961 319, 28, 322, 28, 325, 177, 416, 177, 0, 177, 962 0, 28, 328, 405, 28, 331, 418, 177, 0, 419, 963 177, 28, 334, 0, 420, 28, 426, 177, 28, 337, 964 0, 143, 425, 0, 177, 424, 28, 347, 28, 350, 965 0, 429, 177, 0, 177, 0, 0, 28, 355, 0, 966 437, 438, 439, 177, 28, 428, 441, 0, 446, 443, 967 0, 445, 173, 28, 306, 173, 28, 458, 173, 28, 968 510, 28, 430, 28, 431, 0, 462, 463, 464, 28, 969 432, 28, 435, 465, 28, 436, 28, 444, 28, 447, 970 0, 470, 28, 448, 28, 449, 473, 475, 476, 477, 971 478, 479, 28, 455, 480, 28, 456, 28, 459, 28, 972 460, 0, 487, 488, 28, 461, 490, 491, 492, 28, 973 466, 28, 467, 0, 495, 496, 405, 0, 498, 499, 974 500, 28, 468, 28, 469, 505, 0, 507, 508, 363, 975 28, 511, 364, 28, 512, 28, 513, 0, 367, 28, 976 514, 457, 28, 515, 368, 28, 518, 517, 28, 519, 977 28, 520, 28, 306, 28, 522, 526, 28, 523, 28, 978 524, 527, 28, 525, 28, 528, 28, 529, 405, 377, 979 531, 532, 533, 534, 535, 376, 0, 538, 539, 540, 980 405, 542, 543, 544, 545, 28, 551, 548, 549, 28, 981 552, 28, 555, 0, 553, 28, 558, 383, 0, 559, 982 385, 28, 560, 28, 577, 28, 578, 388, 509, 405, 983 565, 566, 0, 405, 569, 405, 405, 572, 28, 579, 984 405, 405, 405, 393, 28, 580, 28, 585, 28, 586, 985 521, 28, 591, 28, 592, 0, 581, 582, 583, 0, 986 0, 0, 0, 587, 588, 589, 0, 0, 0, 0, 987 0, 594, 0, 404, 596, 0, 405, 406, 0, 0, 988 0, 0, 0, 0, 0, 0, 0, 0, 0, 550, 989 0, 0, 0, 554, 0, 0, 0, 556, 557, 0, 990 0, 414, 0, 561, 415, 0, 562, 563, 0, 0, 991 0, 0, 0, 0, 417, 0, 0, 0, 0, 0, 992 0, 0, 184, 187, 191, 193, 196, 198, 201, 204, 993 207, 210, 213, 216, 221, 223, 225, 227, 229, 231, 994 234, 237, 240, 243, 246, 249, 252, 255, 259, 262, 995 265, 268, 270, 274, 597, 277, 280, 283, 285, 294, 996 296, 298, 301, 305, 309, 312, 315, 318, 321, 324, 997 327, 330, 333, 336, 339, 341, 343, 346, 349, 352, 998 354, 357, 0, 359, 0, 0, 0, 0, 0, 0, 999 0, 0, 471, 0, 472, 0, 0, 474, 0, 0, 1000 0, 0, 0, 0, 0, 0, 481, 482, 483, 484, 1001 485, 486, 0, 0, 0, 489, 0, 0, 0, 0, 1002 0, 0, 0, 0, 0, 0, 0, 497, 0, 0, 1003 0, 0, 501, 502, 503, 504, 0, 0, 0, 0, 1004 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1005 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1006 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1007 0, 0, 0, 0, 0, 0, 0, 0, 0, 530, 1008 0, 0, 0, 0, 0, 0, 536, 537, 0, 0, 1009 0, 541, 0, 0, 0, 0, 546, 547, 0, 0, 1010 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1011 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1012 564, 0, 0, 567, 568, 0, 570, 571, 0, 0, 1013 573, 574, 575, 576, 0, 0, 0, 0, 0, 0, 1014 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1015 0, 0, 0, 0, 0, 0, 0, 590, 0, 0, 1016 0, 593, 0, 0, 0, 0, 0, 598, 39, 40, 1017 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 1018 51, 52, 53, 54, 55, 56, 57, 0, 58, 59, 1019 60, 61, 62, 63, 64, 65, 66, 0, 67, 0, 1020 0, 0, 0, 68, 69, 0, 70, 0, 0, 71, 1021 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1022 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 1023 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 1024 92, 93, 94, 95, 96, 97, 98, 0, 0, 0, 1025 0, 99, 0, 0, 0, 0, 0, 100 1026 }; 1027 1028 static const yytype_int16 yycheck[] = 1029 { 1030 1, 1, 452, 4, 5, 150, 84, 85, 86, 114, 1031 149, 116, 85, 91, 1, 93, 89, 467, 19, 124, 1032 125, 126, 127, 128, 169, 85, 165, 84, 29, 30, 1033 85, 85, 86, 93, 85, 90, 141, 91, 39, 40, 1034 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 1035 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 1036 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 1037 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 1038 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 1039 91, 92, 93, 94, 95, 96, 97, 98, 85, 100, 1040 84, 85, 86, 84, 85, 86, 110, 108, 109, 0, 1041 1, 115, 85, 86, 86, 88, 88, 117, 91, 119, 1042 93, 94, 85, 86, 84, 129, 85, 86, 91, 88, 1043 580, 131, 132, 85, 93, 94, 85, 86, 142, 84, 1044 85, 86, 91, 93, 93, 94, 85, 86, 93, 84, 1045 85, 84, 85, 85, 93, 94, 84, 85, 93, 91, 1046 93, 84, 85, 84, 85, 93, 85, 86, 85, 86, 1047 93, 1, 91, 84, 93, 93, 177, 85, 86, 93, 1048 85, 86, 84, 91, 185, 93, 25, 188, 93, 89, 1049 90, 82, 83, 84, 85, 86, 87, 88, 199, 85, 1050 86, 202, 93, 94, 205, 91, 86, 208, 85, 86, 1051 211, 85, 86, 214, 85, 86, 93, 91, 219, 86, 1052 91, 85, 86, 85, 86, 84, 85, 91, 86, 91, 1053 86, 232, 85, 86, 235, 85, 86, 238, 91, 33, 1054 241, 91, 25, 244, 166, 85, 86, 85, 86, 250, 1055 594, 91, 253, 91, 85, 86, 400, 85, 86, 260, 1056 91, 480, 263, 91, 451, 266, 164, 85, 86, 85, 1057 86, 147, 273, 91, 275, 91, -1, 278, 85, 86, 1058 281, 85, 86, -1, 91, 85, 86, 91, 85, 86, 1059 -1, 91, 84, 85, 91, 84, 85, 86, 299, 85, 1060 86, 302, 303, 84, 85, 91, 307, 85, 86, 310, 1061 85, 86, 313, 91, -1, 316, 91, -1, 319, 85, 1062 86, 322, 85, 86, 325, 35, 36, 328, 91, 85, 1063 86, 85, 86, 85, 86, 91, 337, 91, -1, 91, 1064 -1, 85, 86, 344, 85, 86, 347, 91, -1, 350, 1065 91, 85, 86, -1, 355, 85, 86, 91, 85, 86, 1066 -1, 71, 366, -1, 91, 365, 85, 86, 85, 86, 1067 -1, 371, 91, -1, 91, -1, -1, 85, 86, -1, 1068 380, 381, 382, 91, 85, 86, 386, -1, 392, 389, 1069 -1, 391, 84, 85, 86, 84, 85, 86, 84, 85, 1070 86, 85, 86, 85, 86, -1, 410, 411, 412, 85, 1071 86, 85, 86, 413, 85, 86, 85, 86, 85, 86, 1072 -1, 422, 85, 86, 85, 86, 427, 428, 429, 430, 1073 431, 432, 85, 86, 435, 85, 86, 85, 86, 85, 1074 86, -1, 443, 444, 85, 86, 447, 448, 449, 85, 1075 86, 85, 86, -1, 455, 456, 457, -1, 459, 460, 1076 461, 85, 86, 85, 86, 466, -1, 468, 469, 179, 1077 85, 86, 182, 85, 86, 85, 86, -1, 188, 85, 1078 86, 403, 85, 86, 194, 85, 86, 487, 85, 86, 1079 85, 86, 85, 86, 85, 86, 500, 85, 86, 85, 1080 86, 505, 85, 86, 85, 86, 85, 86, 509, 219, 1081 511, 512, 513, 514, 515, 516, -1, 518, 519, 520, 1082 521, 522, 523, 524, 525, 85, 86, 528, 529, 85, 1083 86, 85, 86, -1, 534, 85, 86, 247, -1, 543, 1084 250, 85, 86, 85, 86, 85, 86, 257, 470, 550, 1085 551, 552, -1, 554, 555, 556, 557, 558, 85, 86, 1086 561, 562, 563, 273, 85, 86, 85, 86, 85, 86, 1087 492, 85, 86, 85, 86, -1, 577, 578, 579, -1, 1088 -1, -1, -1, 583, 585, 586, -1, -1, -1, -1, 1089 -1, 592, -1, 303, 595, -1, 597, 307, -1, -1, 1090 -1, -1, -1, -1, -1, -1, -1, -1, -1, 531, 1091 -1, -1, -1, 535, -1, -1, -1, 539, 540, -1, 1092 -1, 331, -1, 545, 334, -1, 548, 549, -1, -1, 1093 -1, -1, -1, -1, 344, -1, -1, -1, -1, -1, 1094 -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 1095 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 1096 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 1097 139, 140, 141, 142, 596, 144, 145, 146, 147, 148, 1098 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 1099 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 1100 169, 170, -1, 172, -1, -1, -1, -1, -1, -1, 1101 -1, -1, 422, -1, 424, -1, -1, 427, -1, -1, 1102 -1, -1, -1, -1, -1, -1, 436, 437, 438, 439, 1103 440, 441, -1, -1, -1, 445, -1, -1, -1, -1, 1104 -1, -1, -1, -1, -1, -1, -1, 457, -1, -1, 1105 -1, -1, 462, 463, 464, 465, -1, -1, -1, -1, 1106 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1107 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1108 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1109 -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, 1110 -1, -1, -1, -1, -1, -1, 516, 517, -1, -1, 1111 -1, 521, -1, -1, -1, -1, 526, 527, -1, -1, 1112 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1113 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1114 550, -1, -1, 553, 554, -1, 556, 557, -1, -1, 1115 560, 561, 562, 563, -1, -1, -1, -1, -1, -1, 1116 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1117 -1, -1, -1, -1, -1, -1, -1, 587, -1, -1, 1118 -1, 591, -1, -1, -1, -1, -1, 597, 3, 4, 1119 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1120 15, 16, 17, 18, 19, 20, 21, -1, 23, 24, 1121 25, 26, 27, 28, 29, 30, 31, -1, 33, -1, 1122 -1, -1, -1, 38, 39, -1, 41, -1, -1, 44, 1123 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1124 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 1125 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 1126 75, 76, 77, 78, 79, 80, 81, -1, -1, -1, 1127 -1, 86, -1, -1, -1, -1, -1, 92 1128 }; 1129 1130 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 1131 symbol of state STATE-NUM. */ 1132 static const yytype_uint8 yystos[] = 1133 { 1134 0, 96, 0, 1, 82, 83, 84, 85, 86, 87, 1135 88, 93, 94, 97, 98, 100, 101, 102, 103, 105, 1136 106, 107, 108, 84, 98, 98, 84, 84, 85, 89, 1137 90, 104, 98, 93, 86, 106, 108, 98, 98, 3, 1138 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1139 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 1140 25, 26, 27, 28, 29, 30, 31, 33, 38, 39, 1141 41, 44, 55, 56, 57, 58, 59, 60, 61, 62, 1142 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 1143 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 1144 92, 121, 107, 84, 98, 99, 99, 99, 90, 89, 1145 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 1146 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 1147 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 1148 98, 98, 98, 99, 98, 98, 98, 98, 98, 98, 1149 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 1150 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 1151 98, 1, 98, 84, 98, 98, 86, 91, 93, 120, 1152 122, 170, 105, 123, 170, 86, 128, 170, 113, 120, 1153 129, 170, 123, 170, 120, 137, 170, 123, 170, 105, 1154 139, 170, 86, 156, 170, 105, 124, 170, 86, 150, 1155 170, 86, 140, 170, 86, 143, 170, 86, 93, 114, 1156 138, 170, 123, 170, 123, 170, 123, 170, 123, 170, 1157 123, 170, 120, 125, 170, 86, 126, 170, 105, 127, 1158 170, 105, 130, 170, 86, 131, 170, 86, 132, 170, 1159 86, 133, 170, 86, 134, 170, 86, 119, 135, 170, 1160 86, 136, 170, 86, 141, 170, 86, 142, 170, 123, 1161 170, 120, 144, 145, 170, 86, 146, 170, 86, 147, 1162 170, 86, 148, 170, 150, 170, 86, 93, 94, 109, 1163 110, 111, 112, 151, 170, 156, 170, 129, 170, 86, 1164 152, 170, 86, 157, 158, 170, 86, 118, 149, 170, 1165 86, 153, 170, 86, 154, 170, 86, 165, 170, 86, 1166 159, 170, 86, 160, 170, 86, 161, 170, 86, 162, 1167 170, 86, 163, 170, 86, 164, 170, 86, 166, 170, 1168 146, 170, 156, 170, 118, 167, 170, 86, 168, 170, 1169 86, 169, 170, 129, 170, 86, 155, 170, 84, 170, 1170 1, 98, 93, 99, 99, 98, 98, 99, 99, 98, 1171 98, 98, 98, 98, 98, 93, 98, 99, 98, 98, 1172 98, 98, 98, 99, 98, 99, 98, 93, 99, 98, 1173 98, 98, 98, 99, 98, 98, 98, 84, 85, 117, 1174 93, 98, 98, 98, 99, 98, 99, 98, 98, 98, 1175 98, 98, 98, 98, 99, 99, 98, 99, 98, 98, 1176 98, 84, 86, 86, 105, 120, 86, 115, 86, 105, 1177 86, 86, 86, 86, 86, 86, 86, 105, 105, 105, 1178 86, 105, 86, 105, 86, 105, 120, 86, 86, 86, 1179 84, 85, 86, 116, 111, 86, 86, 118, 86, 86, 1180 86, 86, 120, 120, 120, 105, 86, 86, 86, 86, 1181 98, 99, 99, 98, 99, 98, 98, 98, 98, 98, 1182 98, 99, 99, 99, 99, 99, 99, 98, 98, 99, 1183 98, 98, 98, 116, 117, 98, 98, 99, 98, 98, 1184 98, 99, 99, 99, 99, 98, 117, 98, 98, 118, 1185 86, 86, 86, 86, 86, 86, 114, 105, 86, 86, 1186 86, 118, 86, 86, 86, 86, 120, 120, 86, 86, 1187 99, 98, 98, 98, 98, 98, 99, 99, 98, 98, 1188 98, 99, 98, 98, 98, 98, 99, 99, 98, 98, 1189 118, 86, 86, 105, 118, 86, 118, 118, 86, 120, 1190 86, 118, 118, 118, 99, 98, 98, 99, 99, 98, 1191 99, 99, 98, 99, 99, 99, 99, 86, 86, 86, 1192 86, 98, 98, 98, 117, 86, 86, 105, 98, 98, 1193 99, 86, 86, 99, 98, 109, 98, 118, 99 1194 }; 1195 1196 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 1197 static const yytype_uint8 yyr1[] = 1198 { 1199 0, 95, 96, 96, 97, 97, 97, 97, 97, 97, 1200 97, 98, 98, 99, 99, 100, 101, 101, 102, 103, 1201 103, 104, 104, 104, 104, 104, 105, 105, 106, 106, 1202 106, 107, 107, 108, 108, 109, 109, 110, 110, 110, 1203 111, 112, 112, 113, 113, 114, 114, 114, 114, 115, 1204 115, 116, 116, 116, 117, 117, 118, 118, 119, 119, 1205 120, 120, 120, 120, 121, 121, 121, 121, 121, 121, 1206 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 1207 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 1208 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 1209 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 1210 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 1211 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 1212 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 1213 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 1214 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 1215 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 1216 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 1217 121, 121, 121, 121, 121, 121, 121, 122, 123, 124, 1218 125, 126, 127, 128, 129, 130, 131, 132, 133, 133, 1219 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 1220 144, 145, 145, 146, 147, 148, 149, 150, 151, 152, 1221 153, 154, 155, 156, 157, 158, 158, 159, 160, 161, 1222 162, 163, 164, 165, 166, 167, 168, 169, 170, 170, 1223 170 1224 }; 1225 1226 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ 1227 static const yytype_uint8 yyr2[] = 1228 { 1229 0, 2, 0, 2, 1, 2, 2, 1, 1, 1, 1230 2, 1, 2, 1, 2, 4, 4, 4, 3, 2, 1231 1, 0, 2, 2, 4, 4, 1, 1, 1, 1, 1232 2, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1233 1, 1, 3, 1, 3, 1, 1, 3, 3, 1, 1234 3, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1235 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 1236 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1237 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1238 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1239 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1240 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1241 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1242 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 1243 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1244 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1245 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1246 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1247 3, 3, 3, 3, 3, 3, 3, 2, 2, 14, 1248 6, 4, 4, 4, 2, 4, 4, 2, 2, 4, 1249 4, 2, 6, 2, 2, 4, 8, 12, 4, 8, 1250 2, 1, 3, 8, 8, 6, 2, 18, 2, 10, 1251 8, 8, 8, 8, 7, 4, 2, 4, 4, 4, 1252 4, 2, 2, 6, 6, 2, 4, 8, 6, 4, 1253 3 1254 }; 1255 1256 1257 #define yyerrok (yyerrstatus = 0) 1258 #define yyclearin (yychar = YYEMPTY) 1259 #define YYEMPTY (-2) 1260 #define YYEOF 0 1261 1262 #define YYACCEPT goto yyacceptlab 1263 #define YYABORT goto yyabortlab 1264 #define YYERROR goto yyerrorlab 1265 1266 1267 #define YYRECOVERING() (!!yyerrstatus) 1268 1269 #define YYBACKUP(Token, Value) \ 1270 do \ 1271 if (yychar == YYEMPTY) \ 1272 { \ 1273 yychar = (Token); \ 1274 yylval = (Value); \ 1275 YYPOPSTACK (yylen); \ 1276 yystate = *yyssp; \ 1277 goto yybackup; \ 1278 } \ 1279 else \ 1280 { \ 1281 yyerror (YY_("syntax error: cannot back up")); \ 1282 YYERROR; \ 1283 } \ 1284 while (0) 1285 1286 /* Error token number */ 1287 #define YYTERROR 1 1288 #define YYERRCODE 256 1289 1290 1291 1292 /* Enable debugging if requested. */ 1293 #if YYDEBUG 1294 1295 # ifndef YYFPRINTF 1296 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 1297 # define YYFPRINTF fprintf 1298 # endif 1299 1300 # define YYDPRINTF(Args) \ 1301 do { \ 1302 if (yydebug) \ 1303 YYFPRINTF Args; \ 1304 } while (0) 1305 1306 /* This macro is provided for backward compatibility. */ 1307 #ifndef YY_LOCATION_PRINT 1308 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 1309 #endif 1310 1311 1312 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 1313 do { \ 1314 if (yydebug) \ 1315 { \ 1316 YYFPRINTF (stderr, "%s ", Title); \ 1317 yy_symbol_print (stderr, \ 1318 Type, Value); \ 1319 YYFPRINTF (stderr, "\n"); \ 1320 } \ 1321 } while (0) 1322 1323 1324 /*-----------------------------------. 1325 | Print this symbol's value on YYO. | 1326 `-----------------------------------*/ 1327 1328 static void 1329 yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) 1330 { 1331 FILE *yyoutput = yyo; 1332 YYUSE (yyoutput); 1333 if (!yyvaluep) 1334 return; 1335 # ifdef YYPRINT 1336 if (yytype < YYNTOKENS) 1337 YYPRINT (yyo, yytoknum[yytype], *yyvaluep); 1338 # endif 1339 YYUSE (yytype); 1340 } 1341 1342 1343 /*---------------------------. 1344 | Print this symbol on YYO. | 1345 `---------------------------*/ 1346 1347 static void 1348 yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) 1349 { 1350 YYFPRINTF (yyo, "%s %s (", 1351 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); 1352 1353 yy_symbol_value_print (yyo, yytype, yyvaluep); 1354 YYFPRINTF (yyo, ")"); 1355 } 1356 1357 /*------------------------------------------------------------------. 1358 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 1359 | TOP (included). | 1360 `------------------------------------------------------------------*/ 1361 1362 static void 1363 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 1364 { 1365 YYFPRINTF (stderr, "Stack now"); 1366 for (; yybottom <= yytop; yybottom++) 1367 { 1368 int yybot = *yybottom; 1369 YYFPRINTF (stderr, " %d", yybot); 1370 } 1371 YYFPRINTF (stderr, "\n"); 1372 } 1373 1374 # define YY_STACK_PRINT(Bottom, Top) \ 1375 do { \ 1376 if (yydebug) \ 1377 yy_stack_print ((Bottom), (Top)); \ 1378 } while (0) 1379 1380 1381 /*------------------------------------------------. 1382 | Report that the YYRULE is going to be reduced. | 1383 `------------------------------------------------*/ 1384 1385 static void 1386 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) 1387 { 1388 unsigned long yylno = yyrline[yyrule]; 1389 int yynrhs = yyr2[yyrule]; 1390 int yyi; 1391 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 1392 yyrule - 1, yylno); 1393 /* The symbols being reduced. */ 1394 for (yyi = 0; yyi < yynrhs; yyi++) 1395 { 1396 YYFPRINTF (stderr, " $%d = ", yyi + 1); 1397 yy_symbol_print (stderr, 1398 yystos[yyssp[yyi + 1 - yynrhs]], 1399 &yyvsp[(yyi + 1) - (yynrhs)] 1400 ); 1401 YYFPRINTF (stderr, "\n"); 1402 } 1403 } 1404 1405 # define YY_REDUCE_PRINT(Rule) \ 1406 do { \ 1407 if (yydebug) \ 1408 yy_reduce_print (yyssp, yyvsp, Rule); \ 1409 } while (0) 1410 1411 /* Nonzero means print parse trace. It is left uninitialized so that 1412 multiple parsers can coexist. */ 1413 int yydebug; 1414 #else /* !YYDEBUG */ 1415 # define YYDPRINTF(Args) 1416 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 1417 # define YY_STACK_PRINT(Bottom, Top) 1418 # define YY_REDUCE_PRINT(Rule) 1419 #endif /* !YYDEBUG */ 1420 1421 1422 /* YYINITDEPTH -- initial size of the parser's stacks. */ 1423 #ifndef YYINITDEPTH 1424 # define YYINITDEPTH 200 1425 #endif 1426 1427 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 1428 if the built-in stack extension method is used). 1429 1430 Do not make this value too large; the results are undefined if 1431 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 1432 evaluated with infinite-precision integer arithmetic. */ 1433 1434 #ifndef YYMAXDEPTH 1435 # define YYMAXDEPTH 10000 1436 #endif 1437 1438 1439 #if YYERROR_VERBOSE 1440 1441 # ifndef yystrlen 1442 # if defined __GLIBC__ && defined _STRING_H 1443 # define yystrlen strlen 1444 # else 1445 /* Return the length of YYSTR. */ 1446 static YYSIZE_T 1447 yystrlen (const char *yystr) 1448 { 1449 YYSIZE_T yylen; 1450 for (yylen = 0; yystr[yylen]; yylen++) 1451 continue; 1452 return yylen; 1453 } 1454 # endif 1455 # endif 1456 1457 # ifndef yystpcpy 1458 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 1459 # define yystpcpy stpcpy 1460 # else 1461 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 1462 YYDEST. */ 1463 static char * 1464 yystpcpy (char *yydest, const char *yysrc) 1465 { 1466 char *yyd = yydest; 1467 const char *yys = yysrc; 1468 1469 while ((*yyd++ = *yys++) != '\0') 1470 continue; 1471 1472 return yyd - 1; 1473 } 1474 # endif 1475 # endif 1476 1477 # ifndef yytnamerr 1478 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary 1479 quotes and backslashes, so that it's suitable for yyerror. The 1480 heuristic is that double-quoting is unnecessary unless the string 1481 contains an apostrophe, a comma, or backslash (other than 1482 backslash-backslash). YYSTR is taken from yytname. If YYRES is 1483 null, do not copy; instead, return the length of what the result 1484 would have been. */ 1485 static YYSIZE_T 1486 yytnamerr (char *yyres, const char *yystr) 1487 { 1488 if (*yystr == '"') 1489 { 1490 YYSIZE_T yyn = 0; 1491 char const *yyp = yystr; 1492 1493 for (;;) 1494 switch (*++yyp) 1495 { 1496 case '\'': 1497 case ',': 1498 goto do_not_strip_quotes; 1499 1500 case '\\': 1501 if (*++yyp != '\\') 1502 goto do_not_strip_quotes; 1503 else 1504 goto append; 1505 1506 append: 1507 default: 1508 if (yyres) 1509 yyres[yyn] = *yyp; 1510 yyn++; 1511 break; 1512 1513 case '"': 1514 if (yyres) 1515 yyres[yyn] = '\0'; 1516 return yyn; 1517 } 1518 do_not_strip_quotes: ; 1519 } 1520 1521 if (! yyres) 1522 return yystrlen (yystr); 1523 1524 return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); 1525 } 1526 # endif 1527 1528 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 1529 about the unexpected token YYTOKEN for the state stack whose top is 1530 YYSSP. 1531 1532 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 1533 not large enough to hold the message. In that case, also set 1534 *YYMSG_ALLOC to the required number of bytes. Return 2 if the 1535 required number of bytes is too large to store. */ 1536 static int 1537 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 1538 yytype_int16 *yyssp, int yytoken) 1539 { 1540 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); 1541 YYSIZE_T yysize = yysize0; 1542 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1543 /* Internationalized format string. */ 1544 const char *yyformat = YY_NULLPTR; 1545 /* Arguments of yyformat. */ 1546 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1547 /* Number of reported tokens (one for the "unexpected", one per 1548 "expected"). */ 1549 int yycount = 0; 1550 1551 /* There are many possibilities here to consider: 1552 - If this state is a consistent state with a default action, then 1553 the only way this function was invoked is if the default action 1554 is an error action. In that case, don't check for expected 1555 tokens because there are none. 1556 - The only way there can be no lookahead present (in yychar) is if 1557 this state is a consistent state with a default action. Thus, 1558 detecting the absence of a lookahead is sufficient to determine 1559 that there is no unexpected or expected token to report. In that 1560 case, just report a simple "syntax error". 1561 - Don't assume there isn't a lookahead just because this state is a 1562 consistent state with a default action. There might have been a 1563 previous inconsistent state, consistent state with a non-default 1564 action, or user semantic action that manipulated yychar. 1565 - Of course, the expected token list depends on states to have 1566 correct lookahead information, and it depends on the parser not 1567 to perform extra reductions after fetching a lookahead from the 1568 scanner and before detecting a syntax error. Thus, state merging 1569 (from LALR or IELR) and default reductions corrupt the expected 1570 token list. However, the list is correct for canonical LR with 1571 one exception: it will still contain any token that will not be 1572 accepted due to an error action in a later state. 1573 */ 1574 if (yytoken != YYEMPTY) 1575 { 1576 int yyn = yypact[*yyssp]; 1577 yyarg[yycount++] = yytname[yytoken]; 1578 if (!yypact_value_is_default (yyn)) 1579 { 1580 /* Start YYX at -YYN if negative to avoid negative indexes in 1581 YYCHECK. In other words, skip the first -YYN actions for 1582 this state because they are default actions. */ 1583 int yyxbegin = yyn < 0 ? -yyn : 0; 1584 /* Stay within bounds of both yycheck and yytname. */ 1585 int yychecklim = YYLAST - yyn + 1; 1586 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 1587 int yyx; 1588 1589 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1590 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 1591 && !yytable_value_is_error (yytable[yyx + yyn])) 1592 { 1593 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1594 { 1595 yycount = 1; 1596 yysize = yysize0; 1597 break; 1598 } 1599 yyarg[yycount++] = yytname[yyx]; 1600 { 1601 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); 1602 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) 1603 yysize = yysize1; 1604 else 1605 return 2; 1606 } 1607 } 1608 } 1609 } 1610 1611 switch (yycount) 1612 { 1613 # define YYCASE_(N, S) \ 1614 case N: \ 1615 yyformat = S; \ 1616 break 1617 default: /* Avoid compiler warnings. */ 1618 YYCASE_(0, YY_("syntax error")); 1619 YYCASE_(1, YY_("syntax error, unexpected %s")); 1620 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 1621 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 1622 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 1623 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 1624 # undef YYCASE_ 1625 } 1626 1627 { 1628 YYSIZE_T yysize1 = yysize + yystrlen (yyformat); 1629 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) 1630 yysize = yysize1; 1631 else 1632 return 2; 1633 } 1634 1635 if (*yymsg_alloc < yysize) 1636 { 1637 *yymsg_alloc = 2 * yysize; 1638 if (! (yysize <= *yymsg_alloc 1639 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 1640 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 1641 return 1; 1642 } 1643 1644 /* Avoid sprintf, as that infringes on the user's name space. 1645 Don't have undefined behavior even if the translation 1646 produced a string with the wrong number of "%s"s. */ 1647 { 1648 char *yyp = *yymsg; 1649 int yyi = 0; 1650 while ((*yyp = *yyformat) != '\0') 1651 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 1652 { 1653 yyp += yytnamerr (yyp, yyarg[yyi++]); 1654 yyformat += 2; 1655 } 1656 else 1657 { 1658 yyp++; 1659 yyformat++; 1660 } 1661 } 1662 return 0; 1663 } 1664 #endif /* YYERROR_VERBOSE */ 1665 1666 /*-----------------------------------------------. 1667 | Release the memory associated to this symbol. | 1668 `-----------------------------------------------*/ 1669 1670 static void 1671 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1672 { 1673 YYUSE (yyvaluep); 1674 if (!yymsg) 1675 yymsg = "Deleting"; 1676 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1677 1678 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1679 YYUSE (yytype); 1680 YY_IGNORE_MAYBE_UNINITIALIZED_END 1681 } 1682 1683 1684 1685 1686 /* The lookahead symbol. */ 1687 int yychar; 1688 1689 /* The semantic value of the lookahead symbol. */ 1690 YYSTYPE yylval; 1691 /* Number of syntax errors so far. */ 1692 int yynerrs; 1693 1694 1695 /*----------. 1696 | yyparse. | 1697 `----------*/ 1698 1699 int 1700 yyparse (void) 1701 { 1702 int yystate; 1703 /* Number of tokens to shift before error messages enabled. */ 1704 int yyerrstatus; 1705 1706 /* The stacks and their tools: 1707 'yyss': related to states. 1708 'yyvs': related to semantic values. 1709 1710 Refer to the stacks through separate pointers, to allow yyoverflow 1711 to reallocate them elsewhere. */ 1712 1713 /* The state stack. */ 1714 yytype_int16 yyssa[YYINITDEPTH]; 1715 yytype_int16 *yyss; 1716 yytype_int16 *yyssp; 1717 1718 /* The semantic value stack. */ 1719 YYSTYPE yyvsa[YYINITDEPTH]; 1720 YYSTYPE *yyvs; 1721 YYSTYPE *yyvsp; 1722 1723 YYSIZE_T yystacksize; 1724 1725 int yyn; 1726 int yyresult; 1727 /* Lookahead token as an internal (translated) token number. */ 1728 int yytoken = 0; 1729 /* The variables used to return semantic value and location from the 1730 action routines. */ 1731 YYSTYPE yyval; 1732 1733 #if YYERROR_VERBOSE 1734 /* Buffer for error messages, and its allocated size. */ 1735 char yymsgbuf[128]; 1736 char *yymsg = yymsgbuf; 1737 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1738 #endif 1739 1740 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1741 1742 /* The number of symbols on the RHS of the reduced rule. 1743 Keep to zero when no symbol should be popped. */ 1744 int yylen = 0; 1745 1746 yyssp = yyss = yyssa; 1747 yyvsp = yyvs = yyvsa; 1748 yystacksize = YYINITDEPTH; 1749 1750 YYDPRINTF ((stderr, "Starting parse\n")); 1751 1752 yystate = 0; 1753 yyerrstatus = 0; 1754 yynerrs = 0; 1755 yychar = YYEMPTY; /* Cause a token to be read. */ 1756 goto yysetstate; 1757 1758 1759 /*------------------------------------------------------------. 1760 | yynewstate -- push a new state, which is found in yystate. | 1761 `------------------------------------------------------------*/ 1762 yynewstate: 1763 /* In all cases, when you get here, the value and location stacks 1764 have just been pushed. So pushing a state here evens the stacks. */ 1765 yyssp++; 1766 1767 1768 /*--------------------------------------------------------------------. 1769 | yynewstate -- set current state (the top of the stack) to yystate. | 1770 `--------------------------------------------------------------------*/ 1771 yysetstate: 1772 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1773 YY_ASSERT (0 <= yystate && yystate < YYNSTATES); 1774 *yyssp = (yytype_int16) yystate; 1775 1776 if (yyss + yystacksize - 1 <= yyssp) 1777 #if !defined yyoverflow && !defined YYSTACK_RELOCATE 1778 goto yyexhaustedlab; 1779 #else 1780 { 1781 /* Get the current used size of the three stacks, in elements. */ 1782 YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); 1783 1784 # if defined yyoverflow 1785 { 1786 /* Give user a chance to reallocate the stack. Use copies of 1787 these so that the &'s don't force the real ones into 1788 memory. */ 1789 YYSTYPE *yyvs1 = yyvs; 1790 yytype_int16 *yyss1 = yyss; 1791 1792 /* Each stack pointer address is followed by the size of the 1793 data in use in that stack, in bytes. This used to be a 1794 conditional around just the two extra args, but that might 1795 be undefined if yyoverflow is a macro. */ 1796 yyoverflow (YY_("memory exhausted"), 1797 &yyss1, yysize * sizeof (*yyssp), 1798 &yyvs1, yysize * sizeof (*yyvsp), 1799 &yystacksize); 1800 yyss = yyss1; 1801 yyvs = yyvs1; 1802 } 1803 # else /* defined YYSTACK_RELOCATE */ 1804 /* Extend the stack our own way. */ 1805 if (YYMAXDEPTH <= yystacksize) 1806 goto yyexhaustedlab; 1807 yystacksize *= 2; 1808 if (YYMAXDEPTH < yystacksize) 1809 yystacksize = YYMAXDEPTH; 1810 1811 { 1812 yytype_int16 *yyss1 = yyss; 1813 union yyalloc *yyptr = 1814 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1815 if (! yyptr) 1816 goto yyexhaustedlab; 1817 YYSTACK_RELOCATE (yyss_alloc, yyss); 1818 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 1819 # undef YYSTACK_RELOCATE 1820 if (yyss1 != yyssa) 1821 YYSTACK_FREE (yyss1); 1822 } 1823 # endif 1824 1825 yyssp = yyss + yysize - 1; 1826 yyvsp = yyvs + yysize - 1; 1827 1828 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1829 (unsigned long) yystacksize)); 1830 1831 if (yyss + yystacksize - 1 <= yyssp) 1832 YYABORT; 1833 } 1834 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ 1835 1836 if (yystate == YYFINAL) 1837 YYACCEPT; 1838 1839 goto yybackup; 1840 1841 1842 /*-----------. 1843 | yybackup. | 1844 `-----------*/ 1845 yybackup: 1846 /* Do appropriate processing given the current state. Read a 1847 lookahead token if we need one and don't already have one. */ 1848 1849 /* First try to decide what to do without reference to lookahead token. */ 1850 yyn = yypact[yystate]; 1851 if (yypact_value_is_default (yyn)) 1852 goto yydefault; 1853 1854 /* Not known => get a lookahead token if don't already have one. */ 1855 1856 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 1857 if (yychar == YYEMPTY) 1858 { 1859 YYDPRINTF ((stderr, "Reading a token: ")); 1860 yychar = yylex (); 1861 } 1862 1863 if (yychar <= YYEOF) 1864 { 1865 yychar = yytoken = YYEOF; 1866 YYDPRINTF ((stderr, "Now at end of input.\n")); 1867 } 1868 else 1869 { 1870 yytoken = YYTRANSLATE (yychar); 1871 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1872 } 1873 1874 /* If the proper action on seeing token YYTOKEN is to reduce or to 1875 detect an error, take that action. */ 1876 yyn += yytoken; 1877 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1878 goto yydefault; 1879 yyn = yytable[yyn]; 1880 if (yyn <= 0) 1881 { 1882 if (yytable_value_is_error (yyn)) 1883 goto yyerrlab; 1884 yyn = -yyn; 1885 goto yyreduce; 1886 } 1887 1888 /* Count tokens shifted since error; after three, turn off error 1889 status. */ 1890 if (yyerrstatus) 1891 yyerrstatus--; 1892 1893 /* Shift the lookahead token. */ 1894 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1895 1896 /* Discard the shifted token. */ 1897 yychar = YYEMPTY; 1898 1899 yystate = yyn; 1900 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1901 *++yyvsp = yylval; 1902 YY_IGNORE_MAYBE_UNINITIALIZED_END 1903 goto yynewstate; 1904 1905 1906 /*-----------------------------------------------------------. 1907 | yydefault -- do the default action for the current state. | 1908 `-----------------------------------------------------------*/ 1909 yydefault: 1910 yyn = yydefact[yystate]; 1911 if (yyn == 0) 1912 goto yyerrlab; 1913 goto yyreduce; 1914 1915 1916 /*-----------------------------. 1917 | yyreduce -- do a reduction. | 1918 `-----------------------------*/ 1919 yyreduce: 1920 /* yyn is the number of a rule to reduce with. */ 1921 yylen = yyr2[yyn]; 1922 1923 /* If YYLEN is nonzero, implement the default value of the action: 1924 '$$ = $1'. 1925 1926 Otherwise, the following line sets YYVAL to garbage. 1927 This behavior is undocumented and Bison 1928 users should not rely upon it. Assigning to YYVAL 1929 unconditionally makes the parser a bit smaller, and it avoids a 1930 GCC warning that YYVAL may be used uninitialized. */ 1931 yyval = yyvsp[1-yylen]; 1932 1933 1934 YY_REDUCE_PRINT (yyn); 1935 switch (yyn) 1936 { 1937 case 6: 1938 #line 98 "zparser.y" 1939 {} 1940 #line 1941 "zparser.c" 1941 break; 1942 1943 case 7: 1944 #line 100 "zparser.y" 1945 { 1946 region_free_all(parser->rr_region); 1947 parser->current_rr.type = 0; 1948 parser->current_rr.rdata_count = 0; 1949 parser->current_rr.rdatas = parser->temporary_rdatas; 1950 parser->error_occurred = 0; 1951 } 1952 #line 1953 "zparser.c" 1953 break; 1954 1955 case 8: 1956 #line 108 "zparser.y" 1957 { 1958 region_free_all(parser->rr_region); 1959 parser->current_rr.type = 0; 1960 parser->current_rr.rdata_count = 0; 1961 parser->current_rr.rdatas = parser->temporary_rdatas; 1962 parser->error_occurred = 0; 1963 } 1964 #line 1965 "zparser.c" 1965 break; 1966 1967 case 9: 1968 #line 116 "zparser.y" 1969 { /* rr should be fully parsed */ 1970 if (!parser->error_occurred) { 1971 parser->current_rr.rdatas 1972 =(rdata_atom_type *)region_alloc_array_init( 1973 parser->region, 1974 parser->current_rr.rdatas, 1975 parser->current_rr.rdata_count, 1976 sizeof(rdata_atom_type)); 1977 1978 process_rr(); 1979 } 1980 1981 region_free_all(parser->rr_region); 1982 1983 parser->current_rr.type = 0; 1984 parser->current_rr.rdata_count = 0; 1985 parser->current_rr.rdatas = parser->temporary_rdatas; 1986 parser->error_occurred = 0; 1987 } 1988 #line 1989 "zparser.c" 1989 break; 1990 1991 case 15: 1992 #line 148 "zparser.y" 1993 { 1994 parser->default_ttl = zparser_ttl2int((yyvsp[-1].data).str, &(parser->error_occurred)); 1995 if (parser->error_occurred == 1) { 1996 parser->default_ttl = DEFAULT_TTL; 1997 parser->error_occurred = 0; 1998 } 1999 } 2000 #line 2001 "zparser.c" 2001 break; 2002 2003 case 16: 2004 #line 158 "zparser.y" 2005 { 2006 /* if previous origin is unused, remove it, do not leak it */ 2007 if(parser->origin != error_domain && parser->origin != (yyvsp[-1].domain)) { 2008 /* protect $3 from deletion, because deldomain walks up */ 2009 (yyvsp[-1].domain)->usage ++; 2010 domain_table_deldomain(parser->db, parser->origin); 2011 (yyvsp[-1].domain)->usage --; 2012 } 2013 parser->origin = (yyvsp[-1].domain); 2014 } 2015 #line 2016 "zparser.c" 2016 break; 2017 2018 case 17: 2019 #line 169 "zparser.y" 2020 { 2021 zc_error_prev_line("$ORIGIN directive requires absolute domain name"); 2022 } 2023 #line 2024 "zparser.c" 2024 break; 2025 2026 case 18: 2027 #line 175 "zparser.y" 2028 { 2029 parser->current_rr.owner = (yyvsp[-2].domain); 2030 parser->current_rr.type = (yyvsp[0].type); 2031 } 2032 #line 2033 "zparser.c" 2033 break; 2034 2035 case 19: 2036 #line 182 "zparser.y" 2037 { 2038 parser->prev_dname = (yyvsp[-1].domain); 2039 (yyval.domain) = (yyvsp[-1].domain); 2040 } 2041 #line 2042 "zparser.c" 2042 break; 2043 2044 case 20: 2045 #line 187 "zparser.y" 2046 { 2047 (yyval.domain) = parser->prev_dname; 2048 } 2049 #line 2050 "zparser.c" 2050 break; 2051 2052 case 21: 2053 #line 193 "zparser.y" 2054 { 2055 parser->current_rr.ttl = parser->default_ttl; 2056 parser->current_rr.klass = parser->default_class; 2057 } 2058 #line 2059 "zparser.c" 2059 break; 2060 2061 case 22: 2062 #line 198 "zparser.y" 2063 { 2064 parser->current_rr.ttl = parser->default_ttl; 2065 parser->current_rr.klass = (yyvsp[-1].klass); 2066 } 2067 #line 2068 "zparser.c" 2068 break; 2069 2070 case 23: 2071 #line 203 "zparser.y" 2072 { 2073 parser->current_rr.ttl = (yyvsp[-1].ttl); 2074 parser->current_rr.klass = parser->default_class; 2075 } 2076 #line 2077 "zparser.c" 2077 break; 2078 2079 case 24: 2080 #line 208 "zparser.y" 2081 { 2082 parser->current_rr.ttl = (yyvsp[-3].ttl); 2083 parser->current_rr.klass = (yyvsp[-1].klass); 2084 } 2085 #line 2086 "zparser.c" 2086 break; 2087 2088 case 25: 2089 #line 213 "zparser.y" 2090 { 2091 parser->current_rr.ttl = (yyvsp[-1].ttl); 2092 parser->current_rr.klass = (yyvsp[-3].klass); 2093 } 2094 #line 2095 "zparser.c" 2095 break; 2096 2097 case 27: 2098 #line 221 "zparser.y" 2099 { 2100 if ((yyvsp[0].dname) == error_dname) { 2101 (yyval.domain) = error_domain; 2102 } else if(parser->origin == error_domain) { 2103 zc_error("cannot concatenate origin to domain name, because origin failed to parse"); 2104 (yyval.domain) = error_domain; 2105 } else if ((yyvsp[0].dname)->name_size + domain_dname(parser->origin)->name_size - 1 > MAXDOMAINLEN) { 2106 zc_error("domain name exceeds %d character limit", MAXDOMAINLEN); 2107 (yyval.domain) = error_domain; 2108 } else { 2109 (yyval.domain) = domain_table_insert( 2110 parser->db->domains, 2111 dname_concatenate( 2112 parser->rr_region, 2113 (yyvsp[0].dname), 2114 domain_dname(parser->origin))); 2115 } 2116 } 2117 #line 2118 "zparser.c" 2118 break; 2119 2120 case 28: 2121 #line 242 "zparser.y" 2122 { 2123 (yyval.domain) = parser->db->domains->root; 2124 } 2125 #line 2126 "zparser.c" 2126 break; 2127 2128 case 29: 2129 #line 246 "zparser.y" 2130 { 2131 (yyval.domain) = parser->origin; 2132 } 2133 #line 2134 "zparser.c" 2134 break; 2135 2136 case 30: 2137 #line 250 "zparser.y" 2138 { 2139 if ((yyvsp[-1].dname) != error_dname) { 2140 (yyval.domain) = domain_table_insert(parser->db->domains, (yyvsp[-1].dname)); 2141 } else { 2142 (yyval.domain) = error_domain; 2143 } 2144 } 2145 #line 2146 "zparser.c" 2146 break; 2147 2148 case 31: 2149 #line 260 "zparser.y" 2150 { 2151 if ((yyvsp[0].data).len > MAXLABELLEN) { 2152 zc_error("label exceeds %d character limit", MAXLABELLEN); 2153 (yyval.dname) = error_dname; 2154 } else if ((yyvsp[0].data).len <= 0) { 2155 zc_error("zero label length"); 2156 (yyval.dname) = error_dname; 2157 } else { 2158 (yyval.dname) = dname_make_from_label(parser->rr_region, 2159 (uint8_t *) (yyvsp[0].data).str, 2160 (yyvsp[0].data).len); 2161 } 2162 } 2163 #line 2164 "zparser.c" 2164 break; 2165 2166 case 32: 2167 #line 274 "zparser.y" 2168 { 2169 zc_error("bitlabels are now deprecated. RFC2673 is obsoleted."); 2170 (yyval.dname) = error_dname; 2171 } 2172 #line 2173 "zparser.c" 2173 break; 2174 2175 case 34: 2176 #line 282 "zparser.y" 2177 { 2178 if ((yyvsp[-2].dname) == error_dname || (yyvsp[0].dname) == error_dname) { 2179 (yyval.dname) = error_dname; 2180 } else if ((yyvsp[-2].dname)->name_size + (yyvsp[0].dname)->name_size - 1 > MAXDOMAINLEN) { 2181 zc_error("domain name exceeds %d character limit", 2182 MAXDOMAINLEN); 2183 (yyval.dname) = error_dname; 2184 } else { 2185 (yyval.dname) = dname_concatenate(parser->rr_region, (yyvsp[-2].dname), (yyvsp[0].dname)); 2186 } 2187 } 2188 #line 2189 "zparser.c" 2189 break; 2190 2191 case 36: 2192 #line 301 "zparser.y" 2193 { 2194 /* terminate in root label and copy the origin in there */ 2195 if(parser->origin && domain_dname(parser->origin)) { 2196 (yyval.data).len = (yyvsp[0].data).len + domain_dname(parser->origin)->name_size; 2197 if ((yyval.data).len > MAXDOMAINLEN) 2198 zc_error("domain name exceeds %d character limit", 2199 MAXDOMAINLEN); 2200 (yyval.data).str = (char *) region_alloc(parser->rr_region, (yyval.data).len); 2201 memmove((yyval.data).str, (yyvsp[0].data).str, (yyvsp[0].data).len); 2202 memmove((yyval.data).str + (yyvsp[0].data).len, dname_name(domain_dname(parser->origin)), 2203 domain_dname(parser->origin)->name_size); 2204 } else { 2205 (yyval.data).len = (yyvsp[0].data).len + 1; 2206 if ((yyval.data).len > MAXDOMAINLEN) 2207 zc_error("domain name exceeds %d character limit", 2208 MAXDOMAINLEN); 2209 (yyval.data).str = (char *) region_alloc(parser->rr_region, (yyval.data).len); 2210 memmove((yyval.data).str, (yyvsp[0].data).str, (yyvsp[0].data).len); 2211 (yyval.data).str[ (yyvsp[0].data).len ] = 0; 2212 } 2213 } 2214 #line 2215 "zparser.c" 2215 break; 2216 2217 case 37: 2218 #line 325 "zparser.y" 2219 { 2220 char *result = (char *) region_alloc(parser->rr_region, 1); 2221 result[0] = 0; 2222 (yyval.data).str = result; 2223 (yyval.data).len = 1; 2224 } 2225 #line 2226 "zparser.c" 2226 break; 2227 2228 case 38: 2229 #line 332 "zparser.y" 2230 { 2231 if(parser->origin && domain_dname(parser->origin)) { 2232 (yyval.data).len = domain_dname(parser->origin)->name_size; 2233 (yyval.data).str = (char *) region_alloc(parser->rr_region, (yyval.data).len); 2234 memmove((yyval.data).str, dname_name(domain_dname(parser->origin)), (yyval.data).len); 2235 } else { 2236 (yyval.data).len = 1; 2237 (yyval.data).str = (char *) region_alloc(parser->rr_region, (yyval.data).len); 2238 (yyval.data).str[0] = 0; 2239 } 2240 } 2241 #line 2242 "zparser.c" 2242 break; 2243 2244 case 39: 2245 #line 344 "zparser.y" 2246 { 2247 (yyval.data).len = (yyvsp[-1].data).len + 1; 2248 if ((yyval.data).len > MAXDOMAINLEN) 2249 zc_error("domain name exceeds %d character limit", 2250 MAXDOMAINLEN); 2251 (yyval.data).str = (char *) region_alloc(parser->rr_region, (yyval.data).len); 2252 memcpy((yyval.data).str, (yyvsp[-1].data).str, (yyvsp[-1].data).len); 2253 (yyval.data).str[(yyvsp[-1].data).len] = 0; 2254 } 2255 #line 2256 "zparser.c" 2256 break; 2257 2258 case 40: 2259 #line 356 "zparser.y" 2260 { 2261 char *result = (char *) region_alloc(parser->rr_region, 2262 (yyvsp[0].data).len + 1); 2263 2264 if ((yyvsp[0].data).len > MAXLABELLEN) 2265 zc_error("label exceeds %d character limit", MAXLABELLEN); 2266 2267 /* make label anyway */ 2268 result[0] = (yyvsp[0].data).len; 2269 memmove(result+1, (yyvsp[0].data).str, (yyvsp[0].data).len); 2270 2271 (yyval.data).str = result; 2272 (yyval.data).len = (yyvsp[0].data).len + 1; 2273 } 2274 #line 2275 "zparser.c" 2275 break; 2276 2277 case 42: 2278 #line 374 "zparser.y" 2279 { 2280 (yyval.data).len = (yyvsp[-2].data).len + (yyvsp[0].data).len; 2281 if ((yyval.data).len > MAXDOMAINLEN) 2282 zc_error("domain name exceeds %d character limit", 2283 MAXDOMAINLEN); 2284 (yyval.data).str = (char *) region_alloc(parser->rr_region, (yyval.data).len); 2285 memmove((yyval.data).str, (yyvsp[-2].data).str, (yyvsp[-2].data).len); 2286 memmove((yyval.data).str + (yyvsp[-2].data).len, (yyvsp[0].data).str, (yyvsp[0].data).len); 2287 } 2288 #line 2289 "zparser.c" 2289 break; 2290 2291 case 43: 2292 #line 386 "zparser.y" 2293 { 2294 zadd_rdata_txt_wireformat(zparser_conv_text(parser->rr_region, (yyvsp[0].data).str, (yyvsp[0].data).len), 1); 2295 } 2296 #line 2297 "zparser.c" 2297 break; 2298 2299 case 44: 2300 #line 390 "zparser.y" 2301 { 2302 zadd_rdata_txt_wireformat(zparser_conv_text(parser->rr_region, (yyvsp[0].data).str, (yyvsp[0].data).len), 0); 2303 } 2304 #line 2305 "zparser.c" 2305 break; 2306 2307 case 46: 2308 #line 401 "zparser.y" 2309 { 2310 (yyval.data).len = 1; 2311 (yyval.data).str = region_strdup(parser->rr_region, "."); 2312 } 2313 #line 2314 "zparser.c" 2314 break; 2315 2316 case 47: 2317 #line 406 "zparser.y" 2318 { 2319 (yyval.data).len = (yyvsp[-2].data).len + (yyvsp[0].data).len + 1; 2320 (yyval.data).str = (char *) region_alloc(parser->rr_region, (yyval.data).len + 1); 2321 memcpy((yyval.data).str, (yyvsp[-2].data).str, (yyvsp[-2].data).len); 2322 memcpy((yyval.data).str + (yyvsp[-2].data).len, " ", 1); 2323 memcpy((yyval.data).str + (yyvsp[-2].data).len + 1, (yyvsp[0].data).str, (yyvsp[0].data).len); 2324 (yyval.data).str[(yyval.data).len] = '\0'; 2325 } 2326 #line 2327 "zparser.c" 2327 break; 2328 2329 case 48: 2330 #line 415 "zparser.y" 2331 { 2332 (yyval.data).len = (yyvsp[-2].data).len + (yyvsp[0].data).len + 1; 2333 (yyval.data).str = (char *) region_alloc(parser->rr_region, (yyval.data).len + 1); 2334 memcpy((yyval.data).str, (yyvsp[-2].data).str, (yyvsp[-2].data).len); 2335 memcpy((yyval.data).str + (yyvsp[-2].data).len, ".", 1); 2336 memcpy((yyval.data).str + (yyvsp[-2].data).len + 1, (yyvsp[0].data).str, (yyvsp[0].data).len); 2337 (yyval.data).str[(yyval.data).len] = '\0'; 2338 } 2339 #line 2340 "zparser.c" 2340 break; 2341 2342 case 49: 2343 #line 427 "zparser.y" 2344 { 2345 uint16_t type = rrtype_from_string((yyvsp[0].data).str); 2346 if (type != 0 && type < 128) { 2347 set_bit(nxtbits, type); 2348 } else { 2349 zc_error("bad type %d in NXT record", (int) type); 2350 } 2351 } 2352 #line 2353 "zparser.c" 2353 break; 2354 2355 case 50: 2356 #line 436 "zparser.y" 2357 { 2358 uint16_t type = rrtype_from_string((yyvsp[0].data).str); 2359 if (type != 0 && type < 128) { 2360 set_bit(nxtbits, type); 2361 } else { 2362 zc_error("bad type %d in NXT record", (int) type); 2363 } 2364 } 2365 #line 2366 "zparser.c" 2366 break; 2367 2368 case 51: 2369 #line 447 "zparser.y" 2370 { 2371 } 2372 #line 2373 "zparser.c" 2373 break; 2374 2375 case 52: 2376 #line 450 "zparser.y" 2377 { 2378 } 2379 #line 2380 "zparser.c" 2380 break; 2381 2382 case 53: 2383 #line 453 "zparser.y" 2384 { 2385 uint16_t type = rrtype_from_string((yyvsp[-1].data).str); 2386 if (type != 0) { 2387 if (type > nsec_highest_rcode) { 2388 nsec_highest_rcode = type; 2389 } 2390 set_bitnsec(nsecbits, type); 2391 } else { 2392 zc_error("bad type %d in NSEC record", (int) type); 2393 } 2394 } 2395 #line 2396 "zparser.c" 2396 break; 2397 2398 case 57: 2399 #line 476 "zparser.y" 2400 { 2401 char *result = (char *) region_alloc(parser->rr_region, 2402 (yyvsp[-2].data).len + (yyvsp[0].data).len + 1); 2403 memcpy(result, (yyvsp[-2].data).str, (yyvsp[-2].data).len); 2404 memcpy(result + (yyvsp[-2].data).len, (yyvsp[0].data).str, (yyvsp[0].data).len); 2405 (yyval.data).str = result; 2406 (yyval.data).len = (yyvsp[-2].data).len + (yyvsp[0].data).len; 2407 (yyval.data).str[(yyval.data).len] = '\0'; 2408 } 2409 #line 2410 "zparser.c" 2410 break; 2411 2412 case 59: 2413 #line 493 "zparser.y" 2414 { 2415 char *result = (char *) region_alloc(parser->rr_region, 2416 (yyvsp[-2].data).len + (yyvsp[0].data).len + 1); 2417 memcpy(result, (yyvsp[-2].data).str, (yyvsp[-2].data).len); 2418 memcpy(result + (yyvsp[-2].data).len, (yyvsp[0].data).str, (yyvsp[0].data).len); 2419 (yyval.data).str = result; 2420 (yyval.data).len = (yyvsp[-2].data).len + (yyvsp[0].data).len; 2421 (yyval.data).str[(yyval.data).len] = '\0'; 2422 } 2423 #line 2424 "zparser.c" 2424 break; 2425 2426 case 61: 2427 #line 509 "zparser.y" 2428 { 2429 (yyval.data).str = "."; 2430 (yyval.data).len = 1; 2431 } 2432 #line 2433 "zparser.c" 2433 break; 2434 2435 case 62: 2436 #line 514 "zparser.y" 2437 { 2438 char *result = (char *) region_alloc(parser->rr_region, 2439 (yyvsp[-1].data).len + 2); 2440 memcpy(result, (yyvsp[-1].data).str, (yyvsp[-1].data).len); 2441 result[(yyvsp[-1].data).len] = '.'; 2442 (yyval.data).str = result; 2443 (yyval.data).len = (yyvsp[-1].data).len + 1; 2444 (yyval.data).str[(yyval.data).len] = '\0'; 2445 } 2446 #line 2447 "zparser.c" 2447 break; 2448 2449 case 63: 2450 #line 524 "zparser.y" 2451 { 2452 char *result = (char *) region_alloc(parser->rr_region, 2453 (yyvsp[-2].data).len + (yyvsp[0].data).len + 2); 2454 memcpy(result, (yyvsp[-2].data).str, (yyvsp[-2].data).len); 2455 result[(yyvsp[-2].data).len] = '.'; 2456 memcpy(result + (yyvsp[-2].data).len + 1, (yyvsp[0].data).str, (yyvsp[0].data).len); 2457 (yyval.data).str = result; 2458 (yyval.data).len = (yyvsp[-2].data).len + (yyvsp[0].data).len + 1; 2459 (yyval.data).str[(yyval.data).len] = '\0'; 2460 } 2461 #line 2462 "zparser.c" 2462 break; 2463 2464 case 65: 2465 #line 542 "zparser.y" 2466 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2467 #line 2468 "zparser.c" 2468 break; 2469 2470 case 67: 2471 #line 544 "zparser.y" 2472 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2473 #line 2474 "zparser.c" 2474 break; 2475 2476 case 68: 2477 #line 545 "zparser.y" 2478 { zc_warning_prev_line("MD is obsolete"); } 2479 #line 2480 "zparser.c" 2480 break; 2481 2482 case 69: 2483 #line 547 "zparser.y" 2484 { 2485 zc_warning_prev_line("MD is obsolete"); 2486 (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); 2487 } 2488 #line 2489 "zparser.c" 2489 break; 2490 2491 case 70: 2492 #line 551 "zparser.y" 2493 { zc_warning_prev_line("MF is obsolete"); } 2494 #line 2495 "zparser.c" 2495 break; 2496 2497 case 71: 2498 #line 553 "zparser.y" 2499 { 2500 zc_warning_prev_line("MF is obsolete"); 2501 (yyval.type) = (yyvsp[-2].type); 2502 parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); 2503 } 2504 #line 2505 "zparser.c" 2505 break; 2506 2507 case 73: 2508 #line 559 "zparser.y" 2509 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2510 #line 2511 "zparser.c" 2511 break; 2512 2513 case 75: 2514 #line 561 "zparser.y" 2515 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2516 #line 2517 "zparser.c" 2517 break; 2518 2519 case 76: 2520 #line 562 "zparser.y" 2521 { zc_warning_prev_line("MB is obsolete"); } 2522 #line 2523 "zparser.c" 2523 break; 2524 2525 case 77: 2526 #line 564 "zparser.y" 2527 { 2528 zc_warning_prev_line("MB is obsolete"); 2529 (yyval.type) = (yyvsp[-2].type); 2530 parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); 2531 } 2532 #line 2533 "zparser.c" 2533 break; 2534 2535 case 79: 2536 #line 570 "zparser.y" 2537 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2538 #line 2539 "zparser.c" 2539 break; 2540 2541 case 81: 2542 #line 572 "zparser.y" 2543 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2544 #line 2545 "zparser.c" 2545 break; 2546 2547 case 83: 2548 #line 575 "zparser.y" 2549 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2550 #line 2551 "zparser.c" 2551 break; 2552 2553 case 85: 2554 #line 577 "zparser.y" 2555 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2556 #line 2557 "zparser.c" 2557 break; 2558 2559 case 87: 2560 #line 579 "zparser.y" 2561 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2562 #line 2563 "zparser.c" 2563 break; 2564 2565 case 89: 2566 #line 581 "zparser.y" 2567 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2568 #line 2569 "zparser.c" 2569 break; 2570 2571 case 91: 2572 #line 583 "zparser.y" 2573 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2574 #line 2575 "zparser.c" 2575 break; 2576 2577 case 93: 2578 #line 585 "zparser.y" 2579 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2580 #line 2581 "zparser.c" 2581 break; 2582 2583 case 95: 2584 #line 587 "zparser.y" 2585 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2586 #line 2587 "zparser.c" 2587 break; 2588 2589 case 97: 2590 #line 589 "zparser.y" 2591 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2592 #line 2593 "zparser.c" 2593 break; 2594 2595 case 99: 2596 #line 591 "zparser.y" 2597 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2598 #line 2599 "zparser.c" 2599 break; 2600 2601 case 101: 2602 #line 593 "zparser.y" 2603 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2604 #line 2605 "zparser.c" 2605 break; 2606 2607 case 103: 2608 #line 595 "zparser.y" 2609 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2610 #line 2611 "zparser.c" 2611 break; 2612 2613 case 105: 2614 #line 597 "zparser.y" 2615 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2616 #line 2617 "zparser.c" 2617 break; 2618 2619 case 107: 2620 #line 599 "zparser.y" 2621 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2622 #line 2623 "zparser.c" 2623 break; 2624 2625 case 109: 2626 #line 601 "zparser.y" 2627 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2628 #line 2629 "zparser.c" 2629 break; 2630 2631 case 111: 2632 #line 603 "zparser.y" 2633 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2634 #line 2635 "zparser.c" 2635 break; 2636 2637 case 113: 2638 #line 605 "zparser.y" 2639 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2640 #line 2641 "zparser.c" 2641 break; 2642 2643 case 115: 2644 #line 607 "zparser.y" 2645 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2646 #line 2647 "zparser.c" 2647 break; 2648 2649 case 117: 2650 #line 609 "zparser.y" 2651 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2652 #line 2653 "zparser.c" 2653 break; 2654 2655 case 119: 2656 #line 611 "zparser.y" 2657 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2658 #line 2659 "zparser.c" 2659 break; 2660 2661 case 121: 2662 #line 613 "zparser.y" 2663 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2664 #line 2665 "zparser.c" 2665 break; 2666 2667 case 123: 2668 #line 615 "zparser.y" 2669 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2670 #line 2671 "zparser.c" 2671 break; 2672 2673 case 125: 2674 #line 617 "zparser.y" 2675 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2676 #line 2677 "zparser.c" 2677 break; 2678 2679 case 127: 2680 #line 619 "zparser.y" 2681 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2682 #line 2683 "zparser.c" 2683 break; 2684 2685 case 129: 2686 #line 621 "zparser.y" 2687 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2688 #line 2689 "zparser.c" 2689 break; 2690 2691 case 131: 2692 #line 623 "zparser.y" 2693 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2694 #line 2695 "zparser.c" 2695 break; 2696 2697 case 133: 2698 #line 625 "zparser.y" 2699 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2700 #line 2701 "zparser.c" 2701 break; 2702 2703 case 135: 2704 #line 627 "zparser.y" 2705 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2706 #line 2707 "zparser.c" 2707 break; 2708 2709 case 138: 2710 #line 630 "zparser.y" 2711 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2712 #line 2713 "zparser.c" 2713 break; 2714 2715 case 140: 2716 #line 632 "zparser.y" 2717 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2718 #line 2719 "zparser.c" 2719 break; 2720 2721 case 141: 2722 #line 633 "zparser.y" 2723 { if (dlv_warn) { dlv_warn = 0; zc_warning_prev_line("DLV is experimental"); } } 2724 #line 2725 "zparser.c" 2725 break; 2726 2727 case 142: 2728 #line 634 "zparser.y" 2729 { if (dlv_warn) { dlv_warn = 0; zc_warning_prev_line("DLV is experimental"); } (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2730 #line 2731 "zparser.c" 2731 break; 2732 2733 case 144: 2734 #line 636 "zparser.y" 2735 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); check_sshfp(); } 2736 #line 2737 "zparser.c" 2737 break; 2738 2739 case 146: 2740 #line 638 "zparser.y" 2741 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2742 #line 2743 "zparser.c" 2743 break; 2744 2745 case 148: 2746 #line 640 "zparser.y" 2747 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2748 #line 2749 "zparser.c" 2749 break; 2750 2751 case 150: 2752 #line 642 "zparser.y" 2753 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2754 #line 2755 "zparser.c" 2755 break; 2756 2757 case 152: 2758 #line 644 "zparser.y" 2759 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2760 #line 2761 "zparser.c" 2761 break; 2762 2763 case 154: 2764 #line 646 "zparser.y" 2765 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2766 #line 2767 "zparser.c" 2767 break; 2768 2769 case 156: 2770 #line 648 "zparser.y" 2771 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2772 #line 2773 "zparser.c" 2773 break; 2774 2775 case 158: 2776 #line 650 "zparser.y" 2777 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2778 #line 2779 "zparser.c" 2779 break; 2780 2781 case 160: 2782 #line 652 "zparser.y" 2783 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2784 #line 2785 "zparser.c" 2785 break; 2786 2787 case 162: 2788 #line 654 "zparser.y" 2789 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2790 #line 2791 "zparser.c" 2791 break; 2792 2793 case 164: 2794 #line 656 "zparser.y" 2795 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2796 #line 2797 "zparser.c" 2797 break; 2798 2799 case 166: 2800 #line 658 "zparser.y" 2801 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2802 #line 2803 "zparser.c" 2803 break; 2804 2805 case 168: 2806 #line 660 "zparser.y" 2807 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2808 #line 2809 "zparser.c" 2809 break; 2810 2811 case 170: 2812 #line 662 "zparser.y" 2813 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2814 #line 2815 "zparser.c" 2815 break; 2816 2817 case 172: 2818 #line 664 "zparser.y" 2819 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2820 #line 2821 "zparser.c" 2821 break; 2822 2823 case 174: 2824 #line 666 "zparser.y" 2825 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2826 #line 2827 "zparser.c" 2827 break; 2828 2829 case 176: 2830 #line 668 "zparser.y" 2831 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2832 #line 2833 "zparser.c" 2833 break; 2834 2835 case 178: 2836 #line 670 "zparser.y" 2837 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2838 #line 2839 "zparser.c" 2839 break; 2840 2841 case 180: 2842 #line 672 "zparser.y" 2843 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2844 #line 2845 "zparser.c" 2845 break; 2846 2847 case 182: 2848 #line 674 "zparser.y" 2849 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2850 #line 2851 "zparser.c" 2851 break; 2852 2853 case 184: 2854 #line 676 "zparser.y" 2855 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2856 #line 2857 "zparser.c" 2857 break; 2858 2859 case 185: 2860 #line 677 "zparser.y" 2861 { (yyval.type) = (yyvsp[-2].type); parse_unknown_rdata((yyvsp[-2].type), (yyvsp[0].unknown)); } 2862 #line 2863 "zparser.c" 2863 break; 2864 2865 case 186: 2866 #line 679 "zparser.y" 2867 { 2868 zc_error_prev_line("unrecognized RR type '%s'", (yyvsp[-2].data).str); 2869 } 2870 #line 2871 "zparser.c" 2871 break; 2872 2873 case 187: 2874 #line 691 "zparser.y" 2875 { 2876 zadd_rdata_wireformat(zparser_conv_a(parser->region, (yyvsp[-1].data).str)); 2877 } 2878 #line 2879 "zparser.c" 2879 break; 2880 2881 case 188: 2882 #line 697 "zparser.y" 2883 { 2884 /* convert a single dname record */ 2885 zadd_rdata_domain((yyvsp[-1].domain)); 2886 } 2887 #line 2888 "zparser.c" 2888 break; 2889 2890 case 189: 2891 #line 704 "zparser.y" 2892 { 2893 /* convert the soa data */ 2894 zadd_rdata_domain((yyvsp[-13].domain)); /* prim. ns */ 2895 zadd_rdata_domain((yyvsp[-11].domain)); /* email */ 2896 zadd_rdata_wireformat(zparser_conv_serial(parser->region, (yyvsp[-9].data).str)); /* serial */ 2897 zadd_rdata_wireformat(zparser_conv_period(parser->region, (yyvsp[-7].data).str)); /* refresh */ 2898 zadd_rdata_wireformat(zparser_conv_period(parser->region, (yyvsp[-5].data).str)); /* retry */ 2899 zadd_rdata_wireformat(zparser_conv_period(parser->region, (yyvsp[-3].data).str)); /* expire */ 2900 zadd_rdata_wireformat(zparser_conv_period(parser->region, (yyvsp[-1].data).str)); /* minimum */ 2901 } 2902 #line 2903 "zparser.c" 2903 break; 2904 2905 case 190: 2906 #line 717 "zparser.y" 2907 { 2908 zadd_rdata_wireformat(zparser_conv_a(parser->region, (yyvsp[-5].data).str)); /* address */ 2909 zadd_rdata_wireformat(zparser_conv_services(parser->region, (yyvsp[-3].data).str, (yyvsp[-1].data).str)); /* protocol and services */ 2910 } 2911 #line 2912 "zparser.c" 2912 break; 2913 2914 case 191: 2915 #line 724 "zparser.y" 2916 { 2917 zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-3].data).str, (yyvsp[-3].data).len)); /* CPU */ 2918 zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* OS*/ 2919 } 2920 #line 2921 "zparser.c" 2921 break; 2922 2923 case 192: 2924 #line 731 "zparser.y" 2925 { 2926 /* convert a single dname record */ 2927 zadd_rdata_domain((yyvsp[-3].domain)); 2928 zadd_rdata_domain((yyvsp[-1].domain)); 2929 } 2930 #line 2931 "zparser.c" 2931 break; 2932 2933 case 193: 2934 #line 739 "zparser.y" 2935 { 2936 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* priority */ 2937 zadd_rdata_domain((yyvsp[-1].domain)); /* MX host */ 2938 } 2939 #line 2940 "zparser.c" 2940 break; 2941 2942 case 194: 2943 #line 746 "zparser.y" 2944 { 2945 zadd_rdata_txt_clean_wireformat(); 2946 } 2947 #line 2948 "zparser.c" 2948 break; 2949 2950 case 195: 2951 #line 753 "zparser.y" 2952 { 2953 zadd_rdata_domain((yyvsp[-3].domain)); /* mbox d-name */ 2954 zadd_rdata_domain((yyvsp[-1].domain)); /* txt d-name */ 2955 } 2956 #line 2957 "zparser.c" 2957 break; 2958 2959 case 196: 2960 #line 761 "zparser.y" 2961 { 2962 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* subtype */ 2963 zadd_rdata_domain((yyvsp[-1].domain)); /* domain name */ 2964 } 2965 #line 2966 "zparser.c" 2966 break; 2967 2968 case 197: 2969 #line 769 "zparser.y" 2970 { 2971 zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* X.25 address. */ 2972 } 2973 #line 2974 "zparser.c" 2974 break; 2975 2976 case 198: 2977 #line 776 "zparser.y" 2978 { 2979 zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* address */ 2980 } 2981 #line 2982 "zparser.c" 2982 break; 2983 2984 case 199: 2985 #line 780 "zparser.y" 2986 { 2987 zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-3].data).str, (yyvsp[-3].data).len)); /* address */ 2988 zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* sub-address */ 2989 } 2990 #line 2991 "zparser.c" 2991 break; 2992 2993 case 200: 2994 #line 788 "zparser.y" 2995 { 2996 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* preference */ 2997 zadd_rdata_domain((yyvsp[-1].domain)); /* intermediate host */ 2998 } 2999 #line 3000 "zparser.c" 3000 break; 3001 3002 case 201: 3003 #line 796 "zparser.y" 3004 { 3005 /* String must start with "0x" or "0X". */ 3006 if (strncasecmp((yyvsp[-1].data).str, "0x", 2) != 0) { 3007 zc_error_prev_line("NSAP rdata must start with '0x'"); 3008 } else { 3009 zadd_rdata_wireformat(zparser_conv_hex(parser->region, (yyvsp[-1].data).str + 2, (yyvsp[-1].data).len - 2)); /* NSAP */ 3010 } 3011 } 3012 #line 3013 "zparser.c" 3013 break; 3014 3015 case 202: 3016 #line 808 "zparser.y" 3017 { 3018 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-5].data).str)); /* preference */ 3019 zadd_rdata_domain((yyvsp[-3].domain)); /* MAP822 */ 3020 zadd_rdata_domain((yyvsp[-1].domain)); /* MAPX400 */ 3021 } 3022 #line 3023 "zparser.c" 3023 break; 3024 3025 case 203: 3026 #line 816 "zparser.y" 3027 { 3028 zadd_rdata_wireformat(zparser_conv_aaaa(parser->region, (yyvsp[-1].data).str)); /* IPv6 address */ 3029 } 3030 #line 3031 "zparser.c" 3031 break; 3032 3033 case 204: 3034 #line 822 "zparser.y" 3035 { 3036 zadd_rdata_wireformat(zparser_conv_loc(parser->region, (yyvsp[-1].data).str)); /* Location */ 3037 } 3038 #line 3039 "zparser.c" 3039 break; 3040 3041 case 205: 3042 #line 828 "zparser.y" 3043 { 3044 zadd_rdata_domain((yyvsp[-3].domain)); /* nxt name */ 3045 zadd_rdata_wireformat(zparser_conv_nxt(parser->region, nxtbits)); /* nxt bitlist */ 3046 memset(nxtbits, 0, sizeof(nxtbits)); 3047 } 3048 #line 3049 "zparser.c" 3049 break; 3050 3051 case 206: 3052 #line 836 "zparser.y" 3053 { 3054 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-7].data).str)); /* prio */ 3055 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-5].data).str)); /* weight */ 3056 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* port */ 3057 zadd_rdata_domain((yyvsp[-1].domain)); /* target name */ 3058 } 3059 #line 3060 "zparser.c" 3060 break; 3061 3062 case 207: 3063 #line 846 "zparser.y" 3064 { 3065 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-11].data).str)); /* order */ 3066 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-9].data).str)); /* preference */ 3067 zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-7].data).str, (yyvsp[-7].data).len)); /* flags */ 3068 zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-5].data).str, (yyvsp[-5].data).len)); /* service */ 3069 zadd_rdata_wireformat(zparser_conv_text(parser->region, (yyvsp[-3].data).str, (yyvsp[-3].data).len)); /* regexp */ 3070 zadd_rdata_domain((yyvsp[-1].domain)); /* target name */ 3071 } 3072 #line 3073 "zparser.c" 3073 break; 3074 3075 case 208: 3076 #line 858 "zparser.y" 3077 { 3078 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* preference */ 3079 zadd_rdata_domain((yyvsp[-1].domain)); /* exchanger */ 3080 } 3081 #line 3082 "zparser.c" 3082 break; 3083 3084 case 209: 3085 #line 866 "zparser.y" 3086 { 3087 zadd_rdata_wireformat(zparser_conv_certificate_type(parser->region, (yyvsp[-7].data).str)); /* type */ 3088 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-5].data).str)); /* key tag */ 3089 zadd_rdata_wireformat(zparser_conv_algorithm(parser->region, (yyvsp[-3].data).str)); /* algorithm */ 3090 zadd_rdata_wireformat(zparser_conv_b64(parser->region, (yyvsp[-1].data).str)); /* certificate or CRL */ 3091 } 3092 #line 3093 "zparser.c" 3093 break; 3094 3095 case 211: 3096 #line 879 "zparser.y" 3097 { 3098 zadd_rdata_wireformat(zparser_conv_apl_rdata(parser->region, (yyvsp[0].data).str)); 3099 } 3100 #line 3101 "zparser.c" 3101 break; 3102 3103 case 212: 3104 #line 883 "zparser.y" 3105 { 3106 zadd_rdata_wireformat(zparser_conv_apl_rdata(parser->region, (yyvsp[0].data).str)); 3107 } 3108 #line 3109 "zparser.c" 3109 break; 3110 3111 case 213: 3112 #line 889 "zparser.y" 3113 { 3114 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-7].data).str)); /* keytag */ 3115 zadd_rdata_wireformat(zparser_conv_algorithm(parser->region, (yyvsp[-5].data).str)); /* alg */ 3116 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-3].data).str)); /* type */ 3117 zadd_rdata_wireformat(zparser_conv_hex(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* hash */ 3118 } 3119 #line 3120 "zparser.c" 3120 break; 3121 3122 case 214: 3123 #line 898 "zparser.y" 3124 { 3125 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-7].data).str)); /* keytag */ 3126 zadd_rdata_wireformat(zparser_conv_algorithm(parser->region, (yyvsp[-5].data).str)); /* alg */ 3127 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-3].data).str)); /* type */ 3128 zadd_rdata_wireformat(zparser_conv_hex(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* hash */ 3129 } 3130 #line 3131 "zparser.c" 3131 break; 3132 3133 case 215: 3134 #line 907 "zparser.y" 3135 { 3136 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-5].data).str)); /* alg */ 3137 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-3].data).str)); /* fp type */ 3138 zadd_rdata_wireformat(zparser_conv_hex(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* hash */ 3139 check_sshfp(); 3140 } 3141 #line 3142 "zparser.c" 3142 break; 3143 3144 case 216: 3145 #line 916 "zparser.y" 3146 { 3147 zadd_rdata_wireformat(zparser_conv_b64(parser->region, (yyvsp[-1].data).str)); /* data blob */ 3148 } 3149 #line 3150 "zparser.c" 3150 break; 3151 3152 case 217: 3153 #line 922 "zparser.y" 3154 { 3155 zadd_rdata_wireformat(zparser_conv_rrtype(parser->region, (yyvsp[-17].data).str)); /* rr covered */ 3156 zadd_rdata_wireformat(zparser_conv_algorithm(parser->region, (yyvsp[-15].data).str)); /* alg */ 3157 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-13].data).str)); /* # labels */ 3158 zadd_rdata_wireformat(zparser_conv_period(parser->region, (yyvsp[-11].data).str)); /* # orig TTL */ 3159 zadd_rdata_wireformat(zparser_conv_time(parser->region, (yyvsp[-9].data).str)); /* sig exp */ 3160 zadd_rdata_wireformat(zparser_conv_time(parser->region, (yyvsp[-7].data).str)); /* sig inc */ 3161 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-5].data).str)); /* key id */ 3162 zadd_rdata_wireformat(zparser_conv_dns_name(parser->region, 3163 (const uint8_t*) (yyvsp[-3].data).str,(yyvsp[-3].data).len)); /* sig name */ 3164 zadd_rdata_wireformat(zparser_conv_b64(parser->region, (yyvsp[-1].data).str)); /* sig data */ 3165 } 3166 #line 3167 "zparser.c" 3167 break; 3168 3169 case 218: 3170 #line 937 "zparser.y" 3171 { 3172 zadd_rdata_wireformat(zparser_conv_dns_name(parser->region, 3173 (const uint8_t*) (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* nsec name */ 3174 zadd_rdata_wireformat(zparser_conv_nsec(parser->region, nsecbits)); /* nsec bitlist */ 3175 memset(nsecbits, 0, sizeof(nsecbits)); 3176 nsec_highest_rcode = 0; 3177 } 3178 #line 3179 "zparser.c" 3179 break; 3180 3181 case 219: 3182 #line 947 "zparser.y" 3183 { 3184 #ifdef NSEC3 3185 nsec3_add_params((yyvsp[-9].data).str, (yyvsp[-7].data).str, (yyvsp[-5].data).str, (yyvsp[-3].data).str, (yyvsp[-3].data).len); 3186 3187 zadd_rdata_wireformat(zparser_conv_b32(parser->region, (yyvsp[-1].data).str)); /* next hashed name */ 3188 zadd_rdata_wireformat(zparser_conv_nsec(parser->region, nsecbits)); /* nsec bitlist */ 3189 memset(nsecbits, 0, sizeof(nsecbits)); 3190 nsec_highest_rcode = 0; 3191 #else 3192 zc_error_prev_line("nsec3 not supported"); 3193 #endif /* NSEC3 */ 3194 } 3195 #line 3196 "zparser.c" 3196 break; 3197 3198 case 220: 3199 #line 962 "zparser.y" 3200 { 3201 #ifdef NSEC3 3202 nsec3_add_params((yyvsp[-7].data).str, (yyvsp[-5].data).str, (yyvsp[-3].data).str, (yyvsp[-1].data).str, (yyvsp[-1].data).len); 3203 #else 3204 zc_error_prev_line("nsec3 not supported"); 3205 #endif /* NSEC3 */ 3206 } 3207 #line 3208 "zparser.c" 3208 break; 3209 3210 case 221: 3211 #line 972 "zparser.y" 3212 { 3213 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-7].data).str)); /* usage */ 3214 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-5].data).str)); /* selector */ 3215 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-3].data).str)); /* matching type */ 3216 zadd_rdata_wireformat(zparser_conv_hex(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* ca data */ 3217 } 3218 #line 3219 "zparser.c" 3219 break; 3220 3221 case 222: 3222 #line 981 "zparser.y" 3223 { 3224 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-7].data).str)); /* usage */ 3225 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-5].data).str)); /* selector */ 3226 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-3].data).str)); /* matching type */ 3227 zadd_rdata_wireformat(zparser_conv_hex(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* ca data */ 3228 } 3229 #line 3230 "zparser.c" 3230 break; 3231 3232 case 223: 3233 #line 990 "zparser.y" 3234 { 3235 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-7].data).str)); /* flags */ 3236 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-5].data).str)); /* proto */ 3237 zadd_rdata_wireformat(zparser_conv_algorithm(parser->region, (yyvsp[-3].data).str)); /* alg */ 3238 zadd_rdata_wireformat(zparser_conv_b64(parser->region, (yyvsp[-1].data).str)); /* hash */ 3239 } 3240 #line 3241 "zparser.c" 3241 break; 3242 3243 case 224: 3244 #line 999 "zparser.y" 3245 { 3246 const dname_type* name = 0; 3247 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-6].data).str)); /* precedence */ 3248 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-4].data).str)); /* gateway type */ 3249 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-2].data).str)); /* algorithm */ 3250 switch(atoi((yyvsp[-4].data).str)) { 3251 case IPSECKEY_NOGATEWAY: 3252 zadd_rdata_wireformat(alloc_rdata_init(parser->region, "", 0)); 3253 break; 3254 case IPSECKEY_IP4: 3255 zadd_rdata_wireformat(zparser_conv_a(parser->region, (yyvsp[0].data).str)); 3256 break; 3257 case IPSECKEY_IP6: 3258 zadd_rdata_wireformat(zparser_conv_aaaa(parser->region, (yyvsp[0].data).str)); 3259 break; 3260 case IPSECKEY_DNAME: 3261 /* convert and insert the dname */ 3262 if(strlen((yyvsp[0].data).str) == 0) 3263 zc_error_prev_line("IPSECKEY must specify gateway name"); 3264 if(!(name = dname_parse(parser->region, (yyvsp[0].data).str))) { 3265 zc_error_prev_line("IPSECKEY bad gateway dname %s", (yyvsp[0].data).str); 3266 break; 3267 } 3268 if((yyvsp[0].data).str[strlen((yyvsp[0].data).str)-1] != '.') { 3269 if(parser->origin == error_domain) { 3270 zc_error("cannot concatenate origin to domain name, because origin failed to parse"); 3271 break; 3272 } else if(name->name_size + domain_dname(parser->origin)->name_size - 1 > MAXDOMAINLEN) { 3273 zc_error("ipsec gateway name exceeds %d character limit", 3274 MAXDOMAINLEN); 3275 break; 3276 } 3277 name = dname_concatenate(parser->rr_region, name, 3278 domain_dname(parser->origin)); 3279 } 3280 zadd_rdata_wireformat(alloc_rdata_init(parser->region, 3281 dname_name(name), name->name_size)); 3282 break; 3283 default: 3284 zc_error_prev_line("unknown IPSECKEY gateway type"); 3285 } 3286 } 3287 #line 3288 "zparser.c" 3288 break; 3289 3290 case 225: 3291 #line 1044 "zparser.y" 3292 { 3293 zadd_rdata_wireformat(zparser_conv_b64(parser->region, (yyvsp[-1].data).str)); /* public key */ 3294 } 3295 #line 3296 "zparser.c" 3296 break; 3297 3298 case 227: 3299 #line 1052 "zparser.y" 3300 { 3301 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* preference */ 3302 zadd_rdata_wireformat(zparser_conv_ilnp64(parser->region, (yyvsp[-1].data).str)); /* NodeID */ 3303 } 3304 #line 3305 "zparser.c" 3305 break; 3306 3307 case 228: 3308 #line 1059 "zparser.y" 3309 { 3310 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* preference */ 3311 zadd_rdata_wireformat(zparser_conv_a(parser->region, (yyvsp[-1].data).str)); /* Locator32 */ 3312 } 3313 #line 3314 "zparser.c" 3314 break; 3315 3316 case 229: 3317 #line 1066 "zparser.y" 3318 { 3319 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* preference */ 3320 zadd_rdata_wireformat(zparser_conv_ilnp64(parser->region, (yyvsp[-1].data).str)); /* Locator64 */ 3321 } 3322 #line 3323 "zparser.c" 3323 break; 3324 3325 case 230: 3326 #line 1073 "zparser.y" 3327 { 3328 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* preference */ 3329 zadd_rdata_domain((yyvsp[-1].domain)); /* FQDN */ 3330 } 3331 #line 3332 "zparser.c" 3332 break; 3333 3334 case 231: 3335 #line 1080 "zparser.y" 3336 { 3337 zadd_rdata_wireformat(zparser_conv_eui(parser->region, (yyvsp[-1].data).str, 48)); 3338 } 3339 #line 3340 "zparser.c" 3340 break; 3341 3342 case 232: 3343 #line 1086 "zparser.y" 3344 { 3345 zadd_rdata_wireformat(zparser_conv_eui(parser->region, (yyvsp[-1].data).str, 64)); 3346 } 3347 #line 3348 "zparser.c" 3348 break; 3349 3350 case 233: 3351 #line 1093 "zparser.y" 3352 { 3353 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-5].data).str)); /* priority */ 3354 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-3].data).str)); /* weight */ 3355 zadd_rdata_wireformat(zparser_conv_long_text(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* target */ 3356 } 3357 #line 3358 "zparser.c" 3358 break; 3359 3360 case 234: 3361 #line 1102 "zparser.y" 3362 { 3363 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-5].data).str)); /* Flags */ 3364 zadd_rdata_wireformat(zparser_conv_tag(parser->region, (yyvsp[-3].data).str, (yyvsp[-3].data).len)); /* Tag */ 3365 zadd_rdata_wireformat(zparser_conv_long_text(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* Value */ 3366 } 3367 #line 3368 "zparser.c" 3368 break; 3369 3370 case 235: 3371 #line 1111 "zparser.y" 3372 { 3373 zadd_rdata_wireformat(zparser_conv_b64(parser->region, (yyvsp[-1].data).str)); 3374 } 3375 #line 3376 "zparser.c" 3376 break; 3377 3378 case 236: 3379 #line 1118 "zparser.y" 3380 { 3381 zadd_rdata_wireformat(zparser_conv_serial(parser->region, (yyvsp[-3].data).str)); 3382 zadd_rdata_wireformat(zparser_conv_short(parser->region, (yyvsp[-1].data).str)); 3383 zadd_rdata_wireformat(zparser_conv_nsec(parser->region, nsecbits)); /* nsec bitlist */ 3384 memset(nsecbits, 0, sizeof(nsecbits)); 3385 nsec_highest_rcode = 0; 3386 } 3387 #line 3388 "zparser.c" 3388 break; 3389 3390 case 237: 3391 #line 1129 "zparser.y" 3392 { 3393 zadd_rdata_wireformat(zparser_conv_serial(parser->region, (yyvsp[-7].data).str)); /* serial */ 3394 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-5].data).str)); /* scheme */ 3395 zadd_rdata_wireformat(zparser_conv_byte(parser->region, (yyvsp[-3].data).str)); /* hash algorithm */ 3396 zadd_rdata_wireformat(zparser_conv_hex(parser->region, (yyvsp[-1].data).str, (yyvsp[-1].data).len)); /* digest */ 3397 } 3398 #line 3399 "zparser.c" 3399 break; 3400 3401 case 238: 3402 #line 1138 "zparser.y" 3403 { 3404 /* $2 is the number of octets, currently ignored */ 3405 (yyval.unknown) = zparser_conv_hex(parser->rr_region, (yyvsp[-1].data).str, (yyvsp[-1].data).len); 3406 3407 } 3408 #line 3409 "zparser.c" 3409 break; 3410 3411 case 239: 3412 #line 1144 "zparser.y" 3413 { 3414 (yyval.unknown) = zparser_conv_hex(parser->rr_region, "", 0); 3415 } 3416 #line 3417 "zparser.c" 3417 break; 3418 3419 case 240: 3420 #line 1148 "zparser.y" 3421 { 3422 (yyval.unknown) = zparser_conv_hex(parser->rr_region, "", 0); 3423 } 3424 #line 3425 "zparser.c" 3425 break; 3426 3427 3428 #line 3429 "zparser.c" 3429 3430 default: break; 3431 } 3432 /* User semantic actions sometimes alter yychar, and that requires 3433 that yytoken be updated with the new translation. We take the 3434 approach of translating immediately before every use of yytoken. 3435 One alternative is translating here after every semantic action, 3436 but that translation would be missed if the semantic action invokes 3437 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 3438 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 3439 incorrect destructor might then be invoked immediately. In the 3440 case of YYERROR or YYBACKUP, subsequent parser actions might lead 3441 to an incorrect destructor call or verbose syntax error message 3442 before the lookahead is translated. */ 3443 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 3444 3445 YYPOPSTACK (yylen); 3446 yylen = 0; 3447 YY_STACK_PRINT (yyss, yyssp); 3448 3449 *++yyvsp = yyval; 3450 3451 /* Now 'shift' the result of the reduction. Determine what state 3452 that goes to, based on the state we popped back to and the rule 3453 number reduced by. */ 3454 { 3455 const int yylhs = yyr1[yyn] - YYNTOKENS; 3456 const int yyi = yypgoto[yylhs] + *yyssp; 3457 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp 3458 ? yytable[yyi] 3459 : yydefgoto[yylhs]); 3460 } 3461 3462 goto yynewstate; 3463 3464 3465 /*--------------------------------------. 3466 | yyerrlab -- here on detecting error. | 3467 `--------------------------------------*/ 3468 yyerrlab: 3469 /* Make sure we have latest lookahead translation. See comments at 3470 user semantic actions for why this is necessary. */ 3471 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 3472 3473 /* If not already recovering from an error, report this error. */ 3474 if (!yyerrstatus) 3475 { 3476 ++yynerrs; 3477 #if ! YYERROR_VERBOSE 3478 yyerror (YY_("syntax error")); 3479 #else 3480 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 3481 yyssp, yytoken) 3482 { 3483 char const *yymsgp = YY_("syntax error"); 3484 int yysyntax_error_status; 3485 yysyntax_error_status = YYSYNTAX_ERROR; 3486 if (yysyntax_error_status == 0) 3487 yymsgp = yymsg; 3488 else if (yysyntax_error_status == 1) 3489 { 3490 if (yymsg != yymsgbuf) 3491 YYSTACK_FREE (yymsg); 3492 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 3493 if (!yymsg) 3494 { 3495 yymsg = yymsgbuf; 3496 yymsg_alloc = sizeof yymsgbuf; 3497 yysyntax_error_status = 2; 3498 } 3499 else 3500 { 3501 yysyntax_error_status = YYSYNTAX_ERROR; 3502 yymsgp = yymsg; 3503 } 3504 } 3505 yyerror (yymsgp); 3506 if (yysyntax_error_status == 2) 3507 goto yyexhaustedlab; 3508 } 3509 # undef YYSYNTAX_ERROR 3510 #endif 3511 } 3512 3513 3514 3515 if (yyerrstatus == 3) 3516 { 3517 /* If just tried and failed to reuse lookahead token after an 3518 error, discard it. */ 3519 3520 if (yychar <= YYEOF) 3521 { 3522 /* Return failure if at end of input. */ 3523 if (yychar == YYEOF) 3524 YYABORT; 3525 } 3526 else 3527 { 3528 yydestruct ("Error: discarding", 3529 yytoken, &yylval); 3530 yychar = YYEMPTY; 3531 } 3532 } 3533 3534 /* Else will try to reuse lookahead token after shifting the error 3535 token. */ 3536 goto yyerrlab1; 3537 3538 3539 /*---------------------------------------------------. 3540 | yyerrorlab -- error raised explicitly by YYERROR. | 3541 `---------------------------------------------------*/ 3542 yyerrorlab: 3543 /* Pacify compilers when the user code never invokes YYERROR and the 3544 label yyerrorlab therefore never appears in user code. */ 3545 if (0) 3546 YYERROR; 3547 3548 /* Do not reclaim the symbols of the rule whose action triggered 3549 this YYERROR. */ 3550 YYPOPSTACK (yylen); 3551 yylen = 0; 3552 YY_STACK_PRINT (yyss, yyssp); 3553 yystate = *yyssp; 3554 goto yyerrlab1; 3555 3556 3557 /*-------------------------------------------------------------. 3558 | yyerrlab1 -- common code for both syntax error and YYERROR. | 3559 `-------------------------------------------------------------*/ 3560 yyerrlab1: 3561 yyerrstatus = 3; /* Each real token shifted decrements this. */ 3562 3563 for (;;) 3564 { 3565 yyn = yypact[yystate]; 3566 if (!yypact_value_is_default (yyn)) 3567 { 3568 yyn += YYTERROR; 3569 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 3570 { 3571 yyn = yytable[yyn]; 3572 if (0 < yyn) 3573 break; 3574 } 3575 } 3576 3577 /* Pop the current state because it cannot handle the error token. */ 3578 if (yyssp == yyss) 3579 YYABORT; 3580 3581 3582 yydestruct ("Error: popping", 3583 yystos[yystate], yyvsp); 3584 YYPOPSTACK (1); 3585 yystate = *yyssp; 3586 YY_STACK_PRINT (yyss, yyssp); 3587 } 3588 3589 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 3590 *++yyvsp = yylval; 3591 YY_IGNORE_MAYBE_UNINITIALIZED_END 3592 3593 3594 /* Shift the error token. */ 3595 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 3596 3597 yystate = yyn; 3598 goto yynewstate; 3599 3600 3601 /*-------------------------------------. 3602 | yyacceptlab -- YYACCEPT comes here. | 3603 `-------------------------------------*/ 3604 yyacceptlab: 3605 yyresult = 0; 3606 goto yyreturn; 3607 3608 3609 /*-----------------------------------. 3610 | yyabortlab -- YYABORT comes here. | 3611 `-----------------------------------*/ 3612 yyabortlab: 3613 yyresult = 1; 3614 goto yyreturn; 3615 3616 3617 #if !defined yyoverflow || YYERROR_VERBOSE 3618 /*-------------------------------------------------. 3619 | yyexhaustedlab -- memory exhaustion comes here. | 3620 `-------------------------------------------------*/ 3621 yyexhaustedlab: 3622 yyerror (YY_("memory exhausted")); 3623 yyresult = 2; 3624 /* Fall through. */ 3625 #endif 3626 3627 3628 /*-----------------------------------------------------. 3629 | yyreturn -- parsing is finished, return the result. | 3630 `-----------------------------------------------------*/ 3631 yyreturn: 3632 if (yychar != YYEMPTY) 3633 { 3634 /* Make sure we have latest lookahead translation. See comments at 3635 user semantic actions for why this is necessary. */ 3636 yytoken = YYTRANSLATE (yychar); 3637 yydestruct ("Cleanup: discarding lookahead", 3638 yytoken, &yylval); 3639 } 3640 /* Do not reclaim the symbols of the rule whose action triggered 3641 this YYABORT or YYACCEPT. */ 3642 YYPOPSTACK (yylen); 3643 YY_STACK_PRINT (yyss, yyssp); 3644 while (yyssp != yyss) 3645 { 3646 yydestruct ("Cleanup: popping", 3647 yystos[*yyssp], yyvsp); 3648 YYPOPSTACK (1); 3649 } 3650 #ifndef yyoverflow 3651 if (yyss != yyssa) 3652 YYSTACK_FREE (yyss); 3653 #endif 3654 #if YYERROR_VERBOSE 3655 if (yymsg != yymsgbuf) 3656 YYSTACK_FREE (yymsg); 3657 #endif 3658 return yyresult; 3659 } 3660 #line 1152 "zparser.y" 3661 3662 3663 int 3664 yywrap(void) 3665 { 3666 return 1; 3667 } 3668 3669 /* 3670 * Create the parser. 3671 */ 3672 zparser_type * 3673 zparser_create(region_type *region, region_type *rr_region, namedb_type *db) 3674 { 3675 zparser_type *result; 3676 3677 result = (zparser_type *) region_alloc(region, sizeof(zparser_type)); 3678 result->region = region; 3679 result->rr_region = rr_region; 3680 result->db = db; 3681 3682 result->filename = NULL; 3683 result->current_zone = NULL; 3684 result->origin = NULL; 3685 result->prev_dname = NULL; 3686 3687 result->temporary_rdatas = (rdata_atom_type *) region_alloc_array( 3688 result->region, MAXRDATALEN, sizeof(rdata_atom_type)); 3689 3690 return result; 3691 } 3692 3693 /* 3694 * Initialize the parser for a new zone file. 3695 */ 3696 void 3697 zparser_init(const char *filename, uint32_t ttl, uint16_t klass, 3698 const dname_type *origin) 3699 { 3700 memset(nxtbits, 0, sizeof(nxtbits)); 3701 memset(nsecbits, 0, sizeof(nsecbits)); 3702 nsec_highest_rcode = 0; 3703 3704 parser->default_ttl = ttl; 3705 parser->default_class = klass; 3706 parser->current_zone = NULL; 3707 parser->origin = domain_table_insert(parser->db->domains, origin); 3708 parser->prev_dname = parser->origin; 3709 parser->error_occurred = 0; 3710 parser->errors = 0; 3711 parser->line = 1; 3712 parser->filename = filename; 3713 parser->current_rr.rdata_count = 0; 3714 parser->current_rr.rdatas = parser->temporary_rdatas; 3715 } 3716 3717 void 3718 yyerror(const char *message) 3719 { 3720 zc_error("%s", message); 3721 } 3722 3723 static void 3724 error_va_list(unsigned line, const char *fmt, va_list args) 3725 { 3726 if (parser->filename) { 3727 char message[MAXSYSLOGMSGLEN]; 3728 vsnprintf(message, sizeof(message), fmt, args); 3729 log_msg(LOG_ERR, "%s:%u: %s", parser->filename, line, message); 3730 } 3731 else log_vmsg(LOG_ERR, fmt, args); 3732 3733 ++parser->errors; 3734 parser->error_occurred = 1; 3735 } 3736 3737 /* the line counting sux, to say the least 3738 * with this grose hack we try do give sane 3739 * numbers back */ 3740 void 3741 zc_error_prev_line(const char *fmt, ...) 3742 { 3743 va_list args; 3744 va_start(args, fmt); 3745 error_va_list(parser->line - 1, fmt, args); 3746 va_end(args); 3747 } 3748 3749 void 3750 zc_error(const char *fmt, ...) 3751 { 3752 /* send an error message to stderr */ 3753 va_list args; 3754 va_start(args, fmt); 3755 error_va_list(parser->line, fmt, args); 3756 va_end(args); 3757 } 3758 3759 static void 3760 warning_va_list(unsigned line, const char *fmt, va_list args) 3761 { 3762 if (parser->filename) { 3763 char m[MAXSYSLOGMSGLEN]; 3764 vsnprintf(m, sizeof(m), fmt, args); 3765 log_msg(LOG_WARNING, "%s:%u: %s", parser->filename, line, m); 3766 } 3767 else log_vmsg(LOG_WARNING, fmt, args); 3768 } 3769 3770 void 3771 zc_warning_prev_line(const char *fmt, ...) 3772 { 3773 va_list args; 3774 va_start(args, fmt); 3775 warning_va_list(parser->line - 1, fmt, args); 3776 va_end(args); 3777 } 3778 3779 void 3780 zc_warning(const char *fmt, ... ) 3781 { 3782 va_list args; 3783 va_start(args, fmt); 3784 warning_va_list(parser->line, fmt, args); 3785 va_end(args); 3786 } 3787 3788 #ifdef NSEC3 3789 static void 3790 nsec3_add_params(const char* hashalgo_str, const char* flag_str, 3791 const char* iter_str, const char* salt_str, int salt_len) 3792 { 3793 zadd_rdata_wireformat(zparser_conv_byte(parser->region, hashalgo_str)); 3794 zadd_rdata_wireformat(zparser_conv_byte(parser->region, flag_str)); 3795 zadd_rdata_wireformat(zparser_conv_short(parser->region, iter_str)); 3796 3797 /* salt */ 3798 if(strcmp(salt_str, "-") != 0) 3799 zadd_rdata_wireformat(zparser_conv_hex_length(parser->region, 3800 salt_str, salt_len)); 3801 else 3802 zadd_rdata_wireformat(alloc_rdata_init(parser->region, "", 1)); 3803 } 3804 #endif /* NSEC3 */ 3805