1 /* A Bison parser, made by GNU Bison 3.0.2. */ 2 3 /* Bison implementation for Yacc-like parsers in C 4 5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. 6 7 This program is free software: you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation, either version 3 of the License, or 10 (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 19 20 /* As a special exception, you may create a larger work that contains 21 part or all of the Bison parser skeleton and distribute that work 22 under terms of your choice, so long as that work isn't itself a 23 parser generator using the skeleton or a modified version thereof 24 as a parser skeleton. Alternatively, if you modify or redistribute 25 the parser skeleton itself, you may (at your option) remove this 26 special exception, which will cause the skeleton and the resulting 27 Bison output files to be licensed under the GNU General Public 28 License without this special exception. 29 30 This special exception was added by the Free Software Foundation in 31 version 2.2 of Bison. */ 32 33 /* C LALR(1) parser skeleton written by Richard Stallman, by 34 simplifying the original so-called "semantic" parser. */ 35 36 /* All symbols defined below should begin with yy or YY, to avoid 37 infringing on user name space. This should be done even for local 38 variables, as they might otherwise be expanded by user macros. 39 There are some unavoidable exceptions within include files to 40 define necessary library symbols; they are noted "INFRINGES ON 41 USER NAME SPACE" below. */ 42 43 /* Identify Bison output. */ 44 #define YYBISON 1 45 46 /* Bison version. */ 47 #define YYBISON_VERSION "3.0.2" 48 49 /* Skeleton name. */ 50 #define YYSKELETON_NAME "yacc.c" 51 52 /* Pure parsers. */ 53 #define YYPURE 1 54 55 /* Push parsers. */ 56 #define YYPUSH 0 57 58 /* Pull parsers. */ 59 #define YYPULL 1 60 61 62 /* Substitute the variable and function names. */ 63 #define yyparse pcap_parse 64 #define yylex pcap_lex 65 #define yyerror pcap_error 66 #define yydebug pcap_debug 67 #define yynerrs pcap_nerrs 68 69 70 /* Copy the first part of user declarations. */ 71 #line 26 "grammar.y" /* yacc.c:339 */ 72 73 /* 74 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 75 * The Regents of the University of California. All rights reserved. 76 * 77 * Redistribution and use in source and binary forms, with or without 78 * modification, are permitted provided that: (1) source code distributions 79 * retain the above copyright notice and this paragraph in its entirety, (2) 80 * distributions including binary code include the above copyright notice and 81 * this paragraph in its entirety in the documentation or other materials 82 * provided with the distribution, and (3) all advertising materials mentioning 83 * features or use of this software display the following acknowledgement: 84 * ``This product includes software developed by the University of California, 85 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of 86 * the University nor the names of its contributors may be used to endorse 87 * or promote products derived from this software without specific prior 88 * written permission. 89 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 90 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 91 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 92 * 93 */ 94 95 #ifdef HAVE_CONFIG_H 96 #include "config.h" 97 #endif 98 99 #ifdef _WIN32 100 #include <pcap-stdinc.h> 101 #else /* _WIN32 */ 102 #include <sys/types.h> 103 #include <sys/socket.h> 104 #endif /* _WIN32 */ 105 106 #include <stdlib.h> 107 108 #ifndef _WIN32 109 #if __STDC__ 110 struct mbuf; 111 struct rtentry; 112 #endif 113 114 #include <netinet/in.h> 115 #include <arpa/inet.h> 116 #endif /* _WIN32 */ 117 118 #include <stdio.h> 119 120 #include "pcap-int.h" 121 122 #include "gencode.h" 123 #include "grammar.h" 124 #include "scanner.h" 125 126 #ifdef HAVE_NET_PFVAR_H 127 #include <net/if.h> 128 #include <net/pfvar.h> 129 #include <net/if_pflog.h> 130 #endif 131 #include "llc.h" 132 #include "ieee80211.h" 133 #include <pcap/namedb.h> 134 135 #ifdef HAVE_OS_PROTO_H 136 #include "os-proto.h" 137 #endif 138 139 #define QSET(q, p, d, a) (q).proto = (p),\ 140 (q).dir = (d),\ 141 (q).addr = (a) 142 143 struct tok { 144 int v; /* value */ 145 const char *s; /* string */ 146 }; 147 148 static const struct tok ieee80211_types[] = { 149 { IEEE80211_FC0_TYPE_DATA, "data" }, 150 { IEEE80211_FC0_TYPE_MGT, "mgt" }, 151 { IEEE80211_FC0_TYPE_MGT, "management" }, 152 { IEEE80211_FC0_TYPE_CTL, "ctl" }, 153 { IEEE80211_FC0_TYPE_CTL, "control" }, 154 { 0, NULL } 155 }; 156 static const struct tok ieee80211_mgt_subtypes[] = { 157 { IEEE80211_FC0_SUBTYPE_ASSOC_REQ, "assocreq" }, 158 { IEEE80211_FC0_SUBTYPE_ASSOC_REQ, "assoc-req" }, 159 { IEEE80211_FC0_SUBTYPE_ASSOC_RESP, "assocresp" }, 160 { IEEE80211_FC0_SUBTYPE_ASSOC_RESP, "assoc-resp" }, 161 { IEEE80211_FC0_SUBTYPE_REASSOC_REQ, "reassocreq" }, 162 { IEEE80211_FC0_SUBTYPE_REASSOC_REQ, "reassoc-req" }, 163 { IEEE80211_FC0_SUBTYPE_REASSOC_RESP, "reassocresp" }, 164 { IEEE80211_FC0_SUBTYPE_REASSOC_RESP, "reassoc-resp" }, 165 { IEEE80211_FC0_SUBTYPE_PROBE_REQ, "probereq" }, 166 { IEEE80211_FC0_SUBTYPE_PROBE_REQ, "probe-req" }, 167 { IEEE80211_FC0_SUBTYPE_PROBE_RESP, "proberesp" }, 168 { IEEE80211_FC0_SUBTYPE_PROBE_RESP, "probe-resp" }, 169 { IEEE80211_FC0_SUBTYPE_BEACON, "beacon" }, 170 { IEEE80211_FC0_SUBTYPE_ATIM, "atim" }, 171 { IEEE80211_FC0_SUBTYPE_DISASSOC, "disassoc" }, 172 { IEEE80211_FC0_SUBTYPE_DISASSOC, "disassociation" }, 173 { IEEE80211_FC0_SUBTYPE_AUTH, "auth" }, 174 { IEEE80211_FC0_SUBTYPE_AUTH, "authentication" }, 175 { IEEE80211_FC0_SUBTYPE_DEAUTH, "deauth" }, 176 { IEEE80211_FC0_SUBTYPE_DEAUTH, "deauthentication" }, 177 { 0, NULL } 178 }; 179 static const struct tok ieee80211_ctl_subtypes[] = { 180 { IEEE80211_FC0_SUBTYPE_PS_POLL, "ps-poll" }, 181 { IEEE80211_FC0_SUBTYPE_RTS, "rts" }, 182 { IEEE80211_FC0_SUBTYPE_CTS, "cts" }, 183 { IEEE80211_FC0_SUBTYPE_ACK, "ack" }, 184 { IEEE80211_FC0_SUBTYPE_CF_END, "cf-end" }, 185 { IEEE80211_FC0_SUBTYPE_CF_END_ACK, "cf-end-ack" }, 186 { 0, NULL } 187 }; 188 static const struct tok ieee80211_data_subtypes[] = { 189 { IEEE80211_FC0_SUBTYPE_DATA, "data" }, 190 { IEEE80211_FC0_SUBTYPE_CF_ACK, "data-cf-ack" }, 191 { IEEE80211_FC0_SUBTYPE_CF_POLL, "data-cf-poll" }, 192 { IEEE80211_FC0_SUBTYPE_CF_ACPL, "data-cf-ack-poll" }, 193 { IEEE80211_FC0_SUBTYPE_NODATA, "null" }, 194 { IEEE80211_FC0_SUBTYPE_NODATA_CF_ACK, "cf-ack" }, 195 { IEEE80211_FC0_SUBTYPE_NODATA_CF_POLL, "cf-poll" }, 196 { IEEE80211_FC0_SUBTYPE_NODATA_CF_ACPL, "cf-ack-poll" }, 197 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_DATA, "qos-data" }, 198 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CF_ACK, "qos-data-cf-ack" }, 199 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CF_POLL, "qos-data-cf-poll" }, 200 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CF_ACPL, "qos-data-cf-ack-poll" }, 201 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_NODATA, "qos" }, 202 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_NODATA_CF_POLL, "qos-cf-poll" }, 203 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_NODATA_CF_ACPL, "qos-cf-ack-poll" }, 204 { 0, NULL } 205 }; 206 static const struct tok llc_s_subtypes[] = { 207 { LLC_RR, "rr" }, 208 { LLC_RNR, "rnr" }, 209 { LLC_REJ, "rej" }, 210 { 0, NULL } 211 }; 212 static const struct tok llc_u_subtypes[] = { 213 { LLC_UI, "ui" }, 214 { LLC_UA, "ua" }, 215 { LLC_DISC, "disc" }, 216 { LLC_DM, "dm" }, 217 { LLC_SABME, "sabme" }, 218 { LLC_TEST, "test" }, 219 { LLC_XID, "xid" }, 220 { LLC_FRMR, "frmr" }, 221 { 0, NULL } 222 }; 223 struct type2tok { 224 int type; 225 const struct tok *tok; 226 }; 227 static const struct type2tok ieee80211_type_subtypes[] = { 228 { IEEE80211_FC0_TYPE_MGT, ieee80211_mgt_subtypes }, 229 { IEEE80211_FC0_TYPE_CTL, ieee80211_ctl_subtypes }, 230 { IEEE80211_FC0_TYPE_DATA, ieee80211_data_subtypes }, 231 { 0, NULL } 232 }; 233 234 static int 235 str2tok(const char *str, const struct tok *toks) 236 { 237 int i; 238 239 for (i = 0; toks[i].s != NULL; i++) { 240 if (pcap_strcasecmp(toks[i].s, str) == 0) 241 return (toks[i].v); 242 } 243 return (-1); 244 } 245 246 static struct qual qerr = { Q_UNDEF, Q_UNDEF, Q_UNDEF, Q_UNDEF }; 247 248 static void 249 yyerror(void *yyscanner, compiler_state_t *cstate, const char *msg) 250 { 251 bpf_syntax_error(cstate, msg); 252 /* NOTREACHED */ 253 } 254 255 #ifdef HAVE_NET_PFVAR_H 256 static int 257 pfreason_to_num(compiler_state_t *cstate, const char *reason) 258 { 259 const char *reasons[] = PFRES_NAMES; 260 int i; 261 262 for (i = 0; reasons[i]; i++) { 263 if (pcap_strcasecmp(reason, reasons[i]) == 0) 264 return (i); 265 } 266 bpf_error(cstate, "unknown PF reason"); 267 /*NOTREACHED*/ 268 } 269 270 static int 271 pfaction_to_num(compiler_state_t *cstate, const char *action) 272 { 273 if (pcap_strcasecmp(action, "pass") == 0 || 274 pcap_strcasecmp(action, "accept") == 0) 275 return (PF_PASS); 276 else if (pcap_strcasecmp(action, "drop") == 0 || 277 pcap_strcasecmp(action, "block") == 0) 278 return (PF_DROP); 279 #if HAVE_PF_NAT_THROUGH_PF_NORDR 280 else if (pcap_strcasecmp(action, "rdr") == 0) 281 return (PF_RDR); 282 else if (pcap_strcasecmp(action, "nat") == 0) 283 return (PF_NAT); 284 else if (pcap_strcasecmp(action, "binat") == 0) 285 return (PF_BINAT); 286 else if (pcap_strcasecmp(action, "nordr") == 0) 287 return (PF_NORDR); 288 #endif 289 else { 290 bpf_error(cstate, "unknown PF action"); 291 /*NOTREACHED*/ 292 } 293 } 294 #else /* !HAVE_NET_PFVAR_H */ 295 static int 296 pfreason_to_num(compiler_state_t *cstate, const char *reason) 297 { 298 bpf_error(cstate, "libpcap was compiled on a machine without pf support"); 299 /*NOTREACHED*/ 300 301 /* this is to make the VC compiler happy */ 302 return -1; 303 } 304 305 static int 306 pfaction_to_num(compiler_state_t *cstate, const char *action) 307 { 308 bpf_error(cstate, "libpcap was compiled on a machine without pf support"); 309 /*NOTREACHED*/ 310 311 /* this is to make the VC compiler happy */ 312 return -1; 313 } 314 #endif /* HAVE_NET_PFVAR_H */ 315 316 #line 317 "grammar.c" /* yacc.c:339 */ 317 318 # ifndef YY_NULLPTR 319 # if defined __cplusplus && 201103L <= __cplusplus 320 # define YY_NULLPTR nullptr 321 # else 322 # define YY_NULLPTR 0 323 # endif 324 # endif 325 326 /* Enabling verbose error messages. */ 327 #ifdef YYERROR_VERBOSE 328 # undef YYERROR_VERBOSE 329 # define YYERROR_VERBOSE 1 330 #else 331 # define YYERROR_VERBOSE 0 332 #endif 333 334 /* In a future release of Bison, this section will be replaced 335 by #include "grammar.h". */ 336 #ifndef YY_PCAP_GRAMMAR_H_INCLUDED 337 # define YY_PCAP_GRAMMAR_H_INCLUDED 338 /* Debug traces. */ 339 #ifndef YYDEBUG 340 # define YYDEBUG 0 341 #endif 342 #if YYDEBUG 343 extern int pcap_debug; 344 #endif 345 346 /* Token type. */ 347 #ifndef YYTOKENTYPE 348 # define YYTOKENTYPE 349 enum yytokentype 350 { 351 DST = 258, 352 SRC = 259, 353 HOST = 260, 354 GATEWAY = 261, 355 NET = 262, 356 NETMASK = 263, 357 PORT = 264, 358 PORTRANGE = 265, 359 LESS = 266, 360 GREATER = 267, 361 PROTO = 268, 362 PROTOCHAIN = 269, 363 CBYTE = 270, 364 ARP = 271, 365 RARP = 272, 366 IP = 273, 367 SCTP = 274, 368 TCP = 275, 369 UDP = 276, 370 ICMP = 277, 371 IGMP = 278, 372 IGRP = 279, 373 PIM = 280, 374 VRRP = 281, 375 CARP = 282, 376 ATALK = 283, 377 AARP = 284, 378 DECNET = 285, 379 LAT = 286, 380 SCA = 287, 381 MOPRC = 288, 382 MOPDL = 289, 383 TK_BROADCAST = 290, 384 TK_MULTICAST = 291, 385 NUM = 292, 386 INBOUND = 293, 387 OUTBOUND = 294, 388 PF_IFNAME = 295, 389 PF_RSET = 296, 390 PF_RNR = 297, 391 PF_SRNR = 298, 392 PF_REASON = 299, 393 PF_ACTION = 300, 394 TYPE = 301, 395 SUBTYPE = 302, 396 DIR = 303, 397 ADDR1 = 304, 398 ADDR2 = 305, 399 ADDR3 = 306, 400 ADDR4 = 307, 401 RA = 308, 402 TA = 309, 403 LINK = 310, 404 GEQ = 311, 405 LEQ = 312, 406 NEQ = 313, 407 ID = 314, 408 EID = 315, 409 HID = 316, 410 HID6 = 317, 411 AID = 318, 412 LSH = 319, 413 RSH = 320, 414 LEN = 321, 415 IPV6 = 322, 416 ICMPV6 = 323, 417 AH = 324, 418 ESP = 325, 419 VLAN = 326, 420 MPLS = 327, 421 PPPOED = 328, 422 PPPOES = 329, 423 GENEVE = 330, 424 ISO = 331, 425 ESIS = 332, 426 CLNP = 333, 427 ISIS = 334, 428 L1 = 335, 429 L2 = 336, 430 IIH = 337, 431 LSP = 338, 432 SNP = 339, 433 CSNP = 340, 434 PSNP = 341, 435 STP = 342, 436 IPX = 343, 437 NETBEUI = 344, 438 LANE = 345, 439 LLC = 346, 440 METAC = 347, 441 BCC = 348, 442 SC = 349, 443 ILMIC = 350, 444 OAMF4EC = 351, 445 OAMF4SC = 352, 446 OAM = 353, 447 OAMF4 = 354, 448 CONNECTMSG = 355, 449 METACONNECT = 356, 450 VPI = 357, 451 VCI = 358, 452 RADIO = 359, 453 FISU = 360, 454 LSSU = 361, 455 MSU = 362, 456 HFISU = 363, 457 HLSSU = 364, 458 HMSU = 365, 459 SIO = 366, 460 OPC = 367, 461 DPC = 368, 462 SLS = 369, 463 HSIO = 370, 464 HOPC = 371, 465 HDPC = 372, 466 HSLS = 373, 467 OR = 374, 468 AND = 375, 469 UMINUS = 376 470 }; 471 #endif 472 /* Tokens. */ 473 #define DST 258 474 #define SRC 259 475 #define HOST 260 476 #define GATEWAY 261 477 #define NET 262 478 #define NETMASK 263 479 #define PORT 264 480 #define PORTRANGE 265 481 #define LESS 266 482 #define GREATER 267 483 #define PROTO 268 484 #define PROTOCHAIN 269 485 #define CBYTE 270 486 #define ARP 271 487 #define RARP 272 488 #define IP 273 489 #define SCTP 274 490 #define TCP 275 491 #define UDP 276 492 #define ICMP 277 493 #define IGMP 278 494 #define IGRP 279 495 #define PIM 280 496 #define VRRP 281 497 #define CARP 282 498 #define ATALK 283 499 #define AARP 284 500 #define DECNET 285 501 #define LAT 286 502 #define SCA 287 503 #define MOPRC 288 504 #define MOPDL 289 505 #define TK_BROADCAST 290 506 #define TK_MULTICAST 291 507 #define NUM 292 508 #define INBOUND 293 509 #define OUTBOUND 294 510 #define PF_IFNAME 295 511 #define PF_RSET 296 512 #define PF_RNR 297 513 #define PF_SRNR 298 514 #define PF_REASON 299 515 #define PF_ACTION 300 516 #define TYPE 301 517 #define SUBTYPE 302 518 #define DIR 303 519 #define ADDR1 304 520 #define ADDR2 305 521 #define ADDR3 306 522 #define ADDR4 307 523 #define RA 308 524 #define TA 309 525 #define LINK 310 526 #define GEQ 311 527 #define LEQ 312 528 #define NEQ 313 529 #define ID 314 530 #define EID 315 531 #define HID 316 532 #define HID6 317 533 #define AID 318 534 #define LSH 319 535 #define RSH 320 536 #define LEN 321 537 #define IPV6 322 538 #define ICMPV6 323 539 #define AH 324 540 #define ESP 325 541 #define VLAN 326 542 #define MPLS 327 543 #define PPPOED 328 544 #define PPPOES 329 545 #define GENEVE 330 546 #define ISO 331 547 #define ESIS 332 548 #define CLNP 333 549 #define ISIS 334 550 #define L1 335 551 #define L2 336 552 #define IIH 337 553 #define LSP 338 554 #define SNP 339 555 #define CSNP 340 556 #define PSNP 341 557 #define STP 342 558 #define IPX 343 559 #define NETBEUI 344 560 #define LANE 345 561 #define LLC 346 562 #define METAC 347 563 #define BCC 348 564 #define SC 349 565 #define ILMIC 350 566 #define OAMF4EC 351 567 #define OAMF4SC 352 568 #define OAM 353 569 #define OAMF4 354 570 #define CONNECTMSG 355 571 #define METACONNECT 356 572 #define VPI 357 573 #define VCI 358 574 #define RADIO 359 575 #define FISU 360 576 #define LSSU 361 577 #define MSU 362 578 #define HFISU 363 579 #define HLSSU 364 580 #define HMSU 365 581 #define SIO 366 582 #define OPC 367 583 #define DPC 368 584 #define SLS 369 585 #define HSIO 370 586 #define HOPC 371 587 #define HDPC 372 588 #define HSLS 373 589 #define OR 374 590 #define AND 375 591 #define UMINUS 376 592 593 /* Value type. */ 594 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 595 typedef union YYSTYPE YYSTYPE; 596 union YYSTYPE 597 { 598 #line 271 "grammar.y" /* yacc.c:355 */ 599 600 int i; 601 bpf_u_int32 h; 602 u_char *e; 603 char *s; 604 struct stmt *stmt; 605 struct arth *a; 606 struct { 607 struct qual q; 608 int atmfieldtype; 609 int mtp3fieldtype; 610 struct block *b; 611 } blk; 612 struct block *rblk; 613 614 #line 615 "grammar.c" /* yacc.c:355 */ 615 }; 616 # define YYSTYPE_IS_TRIVIAL 1 617 # define YYSTYPE_IS_DECLARED 1 618 #endif 619 620 621 622 int pcap_parse (void *yyscanner, compiler_state_t *cstate); 623 624 #endif /* !YY_PCAP_GRAMMAR_H_INCLUDED */ 625 626 /* Copy the second part of user declarations. */ 627 628 #line 629 "grammar.c" /* yacc.c:358 */ 629 630 #ifdef short 631 # undef short 632 #endif 633 634 #ifdef YYTYPE_UINT8 635 typedef YYTYPE_UINT8 yytype_uint8; 636 #else 637 typedef unsigned char yytype_uint8; 638 #endif 639 640 #ifdef YYTYPE_INT8 641 typedef YYTYPE_INT8 yytype_int8; 642 #else 643 typedef signed char yytype_int8; 644 #endif 645 646 #ifdef YYTYPE_UINT16 647 typedef YYTYPE_UINT16 yytype_uint16; 648 #else 649 typedef unsigned short int yytype_uint16; 650 #endif 651 652 #ifdef YYTYPE_INT16 653 typedef YYTYPE_INT16 yytype_int16; 654 #else 655 typedef short int yytype_int16; 656 #endif 657 658 #ifndef YYSIZE_T 659 # ifdef __SIZE_TYPE__ 660 # define YYSIZE_T __SIZE_TYPE__ 661 # elif defined size_t 662 # define YYSIZE_T size_t 663 # elif ! defined YYSIZE_T 664 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 665 # define YYSIZE_T size_t 666 # else 667 # define YYSIZE_T unsigned int 668 # endif 669 #endif 670 671 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 672 673 #ifndef YY_ 674 # if defined YYENABLE_NLS && YYENABLE_NLS 675 # if ENABLE_NLS 676 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 677 # define YY_(Msgid) dgettext ("bison-runtime", Msgid) 678 # endif 679 # endif 680 # ifndef YY_ 681 # define YY_(Msgid) Msgid 682 # endif 683 #endif 684 685 #ifndef YY_ATTRIBUTE 686 # if (defined __GNUC__ \ 687 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 688 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 689 # define YY_ATTRIBUTE(Spec) __attribute__(Spec) 690 # else 691 # define YY_ATTRIBUTE(Spec) /* empty */ 692 # endif 693 #endif 694 695 #ifndef YY_ATTRIBUTE_PURE 696 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 697 #endif 698 699 #ifndef YY_ATTRIBUTE_UNUSED 700 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 701 #endif 702 703 #if !defined _Noreturn \ 704 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) 705 # if defined _MSC_VER && 1200 <= _MSC_VER 706 # define _Noreturn __declspec (noreturn) 707 # else 708 # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) 709 # endif 710 #endif 711 712 /* Suppress unused-variable warnings by "using" E. */ 713 #if ! defined lint || defined __GNUC__ 714 # define YYUSE(E) ((void) (E)) 715 #else 716 # define YYUSE(E) /* empty */ 717 #endif 718 719 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 720 /* Suppress an incorrect diagnostic about yylval being uninitialized. */ 721 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 722 _Pragma ("GCC diagnostic push") \ 723 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 724 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 725 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 726 _Pragma ("GCC diagnostic pop") 727 #else 728 # define YY_INITIAL_VALUE(Value) Value 729 #endif 730 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 731 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 732 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 733 #endif 734 #ifndef YY_INITIAL_VALUE 735 # define YY_INITIAL_VALUE(Value) /* Nothing. */ 736 #endif 737 738 739 #if ! defined yyoverflow || YYERROR_VERBOSE 740 741 /* The parser invokes alloca or malloc; define the necessary symbols. */ 742 743 # ifdef YYSTACK_USE_ALLOCA 744 # if YYSTACK_USE_ALLOCA 745 # ifdef __GNUC__ 746 # define YYSTACK_ALLOC __builtin_alloca 747 # elif defined __BUILTIN_VA_ARG_INCR 748 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 749 # elif defined _AIX 750 # define YYSTACK_ALLOC __alloca 751 # elif defined _MSC_VER 752 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 753 # define alloca _alloca 754 # else 755 # define YYSTACK_ALLOC alloca 756 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 757 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 758 /* Use EXIT_SUCCESS as a witness for stdlib.h. */ 759 # ifndef EXIT_SUCCESS 760 # define EXIT_SUCCESS 0 761 # endif 762 # endif 763 # endif 764 # endif 765 # endif 766 767 # ifdef YYSTACK_ALLOC 768 /* Pacify GCC's 'empty if-body' warning. */ 769 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 770 # ifndef YYSTACK_ALLOC_MAXIMUM 771 /* The OS might guarantee only one guard page at the bottom of the stack, 772 and a page size can be as small as 4096 bytes. So we cannot safely 773 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 774 to allow for a few compiler-allocated temporary stack slots. */ 775 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 776 # endif 777 # else 778 # define YYSTACK_ALLOC YYMALLOC 779 # define YYSTACK_FREE YYFREE 780 # ifndef YYSTACK_ALLOC_MAXIMUM 781 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 782 # endif 783 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 784 && ! ((defined YYMALLOC || defined malloc) \ 785 && (defined YYFREE || defined free))) 786 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 787 # ifndef EXIT_SUCCESS 788 # define EXIT_SUCCESS 0 789 # endif 790 # endif 791 # ifndef YYMALLOC 792 # define YYMALLOC malloc 793 # if ! defined malloc && ! defined EXIT_SUCCESS 794 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 795 # endif 796 # endif 797 # ifndef YYFREE 798 # define YYFREE free 799 # if ! defined free && ! defined EXIT_SUCCESS 800 void free (void *); /* INFRINGES ON USER NAME SPACE */ 801 # endif 802 # endif 803 # endif 804 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 805 806 807 #if (! defined yyoverflow \ 808 && (! defined __cplusplus \ 809 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 810 811 /* A type that is properly aligned for any stack member. */ 812 union yyalloc 813 { 814 yytype_int16 yyss_alloc; 815 YYSTYPE yyvs_alloc; 816 }; 817 818 /* The size of the maximum gap between one aligned stack and the next. */ 819 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 820 821 /* The size of an array large to enough to hold all stacks, each with 822 N elements. */ 823 # define YYSTACK_BYTES(N) \ 824 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 825 + YYSTACK_GAP_MAXIMUM) 826 827 # define YYCOPY_NEEDED 1 828 829 /* Relocate STACK from its old location to the new one. The 830 local variables YYSIZE and YYSTACKSIZE give the old and new number of 831 elements in the stack, and YYPTR gives the new location of the 832 stack. Advance YYPTR to a properly aligned location for the next 833 stack. */ 834 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 835 do \ 836 { \ 837 YYSIZE_T yynewbytes; \ 838 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 839 Stack = &yyptr->Stack_alloc; \ 840 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 841 yyptr += yynewbytes / sizeof (*yyptr); \ 842 } \ 843 while (0) 844 845 #endif 846 847 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 848 /* Copy COUNT objects from SRC to DST. The source and destination do 849 not overlap. */ 850 # ifndef YYCOPY 851 # if defined __GNUC__ && 1 < __GNUC__ 852 # define YYCOPY(Dst, Src, Count) \ 853 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 854 # else 855 # define YYCOPY(Dst, Src, Count) \ 856 do \ 857 { \ 858 YYSIZE_T yyi; \ 859 for (yyi = 0; yyi < (Count); yyi++) \ 860 (Dst)[yyi] = (Src)[yyi]; \ 861 } \ 862 while (0) 863 # endif 864 # endif 865 #endif /* !YYCOPY_NEEDED */ 866 867 /* YYFINAL -- State number of the termination state. */ 868 #define YYFINAL 3 869 /* YYLAST -- Last index in YYTABLE. */ 870 #define YYLAST 788 871 872 /* YYNTOKENS -- Number of terminals. */ 873 #define YYNTOKENS 139 874 /* YYNNTS -- Number of nonterminals. */ 875 #define YYNNTS 47 876 /* YYNRULES -- Number of rules. */ 877 #define YYNRULES 220 878 /* YYNSTATES -- Number of states. */ 879 #define YYNSTATES 294 880 881 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned 882 by yylex, with out-of-bounds checking. */ 883 #define YYUNDEFTOK 2 884 #define YYMAXUTOK 376 885 886 #define YYTRANSLATE(YYX) \ 887 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 888 889 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM 890 as returned by yylex, without out-of-bounds checking. */ 891 static const yytype_uint8 yytranslate[] = 892 { 893 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 894 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 895 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 896 2, 2, 2, 121, 2, 2, 2, 137, 123, 2, 897 130, 129, 126, 124, 2, 125, 2, 127, 2, 2, 898 2, 2, 2, 2, 2, 2, 2, 2, 136, 2, 899 133, 132, 131, 2, 2, 2, 2, 2, 2, 2, 900 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 901 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 902 2, 134, 2, 135, 138, 2, 2, 2, 2, 2, 903 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 904 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 905 2, 2, 2, 2, 122, 2, 2, 2, 2, 2, 906 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 907 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 908 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 909 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 910 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 911 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 912 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 913 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 914 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 915 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 916 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 917 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 918 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 919 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 920 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 921 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 922 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 923 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 924 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 925 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 926 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 927 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 928 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 929 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 930 115, 116, 117, 118, 119, 120, 128 931 }; 932 933 #if YYDEBUG 934 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ 935 static const yytype_uint16 yyrline[] = 936 { 937 0, 345, 345, 349, 351, 353, 354, 355, 356, 357, 938 359, 361, 363, 364, 366, 368, 369, 371, 373, 386, 939 395, 404, 413, 422, 424, 426, 428, 429, 430, 432, 940 434, 436, 437, 439, 440, 441, 442, 443, 444, 446, 941 447, 448, 449, 451, 453, 454, 455, 456, 457, 458, 942 461, 462, 465, 466, 467, 468, 469, 470, 471, 472, 943 473, 474, 475, 476, 479, 480, 481, 482, 485, 487, 944 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 945 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 946 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 947 518, 519, 520, 521, 522, 523, 524, 525, 527, 528, 948 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 949 539, 540, 541, 542, 543, 544, 545, 548, 549, 550, 950 551, 552, 553, 556, 561, 564, 568, 571, 572, 578, 951 579, 599, 615, 616, 637, 640, 641, 654, 655, 658, 952 661, 662, 663, 665, 666, 667, 669, 670, 672, 673, 953 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 954 684, 685, 686, 688, 689, 690, 691, 692, 694, 695, 955 697, 698, 699, 700, 701, 702, 703, 705, 706, 707, 956 708, 711, 712, 714, 715, 716, 717, 719, 726, 727, 957 730, 731, 732, 733, 734, 735, 738, 739, 740, 741, 958 742, 743, 744, 745, 747, 748, 749, 750, 752, 765, 959 766 960 }; 961 #endif 962 963 #if YYDEBUG || YYERROR_VERBOSE || 0 964 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 965 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 966 static const char *const yytname[] = 967 { 968 "$end", "error", "$undefined", "DST", "SRC", "HOST", "GATEWAY", "NET", 969 "NETMASK", "PORT", "PORTRANGE", "LESS", "GREATER", "PROTO", "PROTOCHAIN", 970 "CBYTE", "ARP", "RARP", "IP", "SCTP", "TCP", "UDP", "ICMP", "IGMP", 971 "IGRP", "PIM", "VRRP", "CARP", "ATALK", "AARP", "DECNET", "LAT", "SCA", 972 "MOPRC", "MOPDL", "TK_BROADCAST", "TK_MULTICAST", "NUM", "INBOUND", 973 "OUTBOUND", "PF_IFNAME", "PF_RSET", "PF_RNR", "PF_SRNR", "PF_REASON", 974 "PF_ACTION", "TYPE", "SUBTYPE", "DIR", "ADDR1", "ADDR2", "ADDR3", 975 "ADDR4", "RA", "TA", "LINK", "GEQ", "LEQ", "NEQ", "ID", "EID", "HID", 976 "HID6", "AID", "LSH", "RSH", "LEN", "IPV6", "ICMPV6", "AH", "ESP", 977 "VLAN", "MPLS", "PPPOED", "PPPOES", "GENEVE", "ISO", "ESIS", "CLNP", 978 "ISIS", "L1", "L2", "IIH", "LSP", "SNP", "CSNP", "PSNP", "STP", "IPX", 979 "NETBEUI", "LANE", "LLC", "METAC", "BCC", "SC", "ILMIC", "OAMF4EC", 980 "OAMF4SC", "OAM", "OAMF4", "CONNECTMSG", "METACONNECT", "VPI", "VCI", 981 "RADIO", "FISU", "LSSU", "MSU", "HFISU", "HLSSU", "HMSU", "SIO", "OPC", 982 "DPC", "SLS", "HSIO", "HOPC", "HDPC", "HSLS", "OR", "AND", "'!'", "'|'", 983 "'&'", "'+'", "'-'", "'*'", "'/'", "UMINUS", "')'", "'('", "'>'", "'='", 984 "'<'", "'['", "']'", "':'", "'%'", "'^'", "$accept", "prog", "null", 985 "expr", "and", "or", "id", "nid", "not", "paren", "pid", "qid", "term", 986 "head", "rterm", "pqual", "dqual", "aqual", "ndaqual", "pname", "other", 987 "pfvar", "p80211", "type", "subtype", "type_subtype", "pllc", "dir", 988 "reason", "action", "relop", "irelop", "arth", "narth", "byteop", "pnum", 989 "atmtype", "atmmultitype", "atmfield", "atmvalue", "atmfieldvalue", 990 "atmlistvalue", "mtp2type", "mtp3field", "mtp3value", "mtp3fieldvalue", 991 "mtp3listvalue", YY_NULLPTR 992 }; 993 #endif 994 995 # ifdef YYPRINT 996 /* YYTOKNUM[NUM] -- (External) token number corresponding to the 997 (internal) symbol number NUM (which must be that of a token). */ 998 static const yytype_uint16 yytoknum[] = 999 { 1000 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 1001 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 1002 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 1003 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 1004 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 1005 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 1006 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 1007 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 1008 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 1009 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 1010 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 1011 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 1012 375, 33, 124, 38, 43, 45, 42, 47, 376, 41, 1013 40, 62, 61, 60, 91, 93, 58, 37, 94 1014 }; 1015 # endif 1016 1017 #define YYPACT_NINF -216 1018 1019 #define yypact_value_is_default(Yystate) \ 1020 (!!((Yystate) == (-216))) 1021 1022 #define YYTABLE_NINF -42 1023 1024 #define yytable_value_is_error(Yytable_value) \ 1025 0 1026 1027 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 1028 STATE-NUM. */ 1029 static const yytype_int16 yypact[] = 1030 { 1031 -216, 24, 257, -216, 0, 12, 17, -216, -216, -216, 1032 -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, 1033 -216, -216, -216, -216, -216, -216, -216, -216, -216, 16, 1034 25, 29, 72, -18, 55, -216, -216, -216, -216, -216, 1035 -216, -25, -25, -216, -25, -25, -216, -216, -216, -216, 1036 -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, 1037 -216, -24, -216, -216, -216, -216, -216, -216, -216, -216, 1038 -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, 1039 -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, 1040 604, -216, -30, 489, 489, -216, 125, -216, 734, 3, 1041 -216, -216, -216, 183, -216, -216, -216, -216, -5, -216, 1042 39, -216, -216, -54, -216, -216, -216, -216, -216, -216, 1043 -216, -216, -216, -25, -216, -216, -216, -216, -216, -216, 1044 604, -16, -108, -216, -216, 373, 373, -216, -103, -10, 1045 2, -216, -216, -7, 11, -216, -216, -216, 125, 125, 1046 -216, -3, 21, -216, -216, -216, -216, -216, -216, -216, 1047 -216, -216, -12, 77, -9, -216, -216, -216, -216, -216, 1048 -216, 78, -216, -216, -216, 604, -216, -216, -216, 604, 1049 604, 604, 604, 604, 604, 604, 604, -216, -216, -216, 1050 604, 604, 604, 604, -216, 111, 113, 114, -216, -216, 1051 -216, 115, 124, 126, -216, -216, -216, -216, -216, -216, 1052 -216, 131, 2, 575, -216, 373, 373, -216, 10, -216, 1053 -216, -216, -216, -216, 112, 137, 138, -216, -216, 47, 1054 -30, 2, 173, 176, 178, 186, -216, -216, 143, -216, 1055 -216, -216, -216, -216, -216, 127, -64, -64, 580, 598, 1056 -104, -104, -108, -108, 575, 575, 575, 575, -216, -98, 1057 -216, -216, -216, -47, -216, -216, -216, -49, -216, -216, 1058 -216, -216, 125, 125, -216, -216, -216, -216, -1, -216, 1059 156, -216, 111, -216, 115, -216, -216, -216, -216, -216, 1060 59, -216, -216, -216 1061 }; 1062 1063 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. 1064 Performed when YYTABLE does not specify something else to do. Zero 1065 means the default is an error. */ 1066 static const yytype_uint8 yydefact[] = 1067 { 1068 4, 0, 51, 1, 0, 0, 0, 71, 72, 70, 1069 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 1070 83, 84, 85, 86, 88, 87, 178, 113, 114, 0, 1071 0, 0, 0, 0, 0, 69, 172, 89, 90, 91, 1072 92, 116, 118, 119, 121, 123, 93, 94, 103, 95, 1073 96, 97, 98, 99, 100, 102, 101, 104, 105, 106, 1074 180, 142, 181, 182, 185, 186, 183, 184, 187, 188, 1075 189, 190, 191, 192, 107, 200, 201, 202, 203, 204, 1076 205, 206, 207, 208, 209, 210, 211, 212, 213, 24, 1077 0, 25, 2, 51, 51, 5, 0, 31, 0, 50, 1078 44, 124, 126, 0, 157, 156, 45, 46, 0, 48, 1079 0, 110, 111, 0, 127, 128, 129, 130, 147, 148, 1080 131, 149, 132, 0, 115, 117, 120, 122, 144, 143, 1081 0, 0, 170, 11, 10, 51, 51, 32, 0, 157, 1082 156, 15, 21, 18, 20, 22, 39, 12, 0, 0, 1083 13, 53, 52, 64, 68, 65, 66, 67, 36, 37, 1084 108, 109, 0, 0, 0, 58, 59, 60, 61, 62, 1085 63, 34, 35, 38, 125, 0, 151, 153, 155, 0, 1086 0, 0, 0, 0, 0, 0, 0, 150, 152, 154, 1087 0, 0, 0, 0, 197, 0, 0, 0, 47, 193, 1088 218, 0, 0, 0, 49, 214, 174, 173, 176, 177, 1089 175, 0, 0, 0, 7, 51, 51, 6, 156, 9, 1090 8, 40, 171, 179, 0, 0, 0, 23, 26, 30, 1091 0, 29, 0, 0, 0, 0, 137, 138, 134, 141, 1092 135, 145, 146, 136, 33, 0, 168, 169, 166, 165, 1093 160, 161, 162, 163, 164, 167, 42, 43, 198, 0, 1094 194, 195, 219, 0, 215, 216, 112, 156, 17, 16, 1095 19, 14, 0, 0, 55, 57, 54, 56, 0, 158, 1096 0, 196, 0, 217, 0, 27, 28, 139, 140, 133, 1097 0, 199, 220, 159 1098 }; 1099 1100 /* YYPGOTO[NTERM-NUM]. */ 1101 static const yytype_int16 yypgoto[] = 1102 { 1103 -216, -216, -216, 193, -34, -215, -90, -135, 7, -2, 1104 -216, -216, -80, -216, -216, -216, -216, 26, -216, 9, 1105 -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, 1106 -43, 5, -26, -92, -216, -37, -216, -216, -216, -216, 1107 -175, -216, -216, -216, -216, -174, -216 1108 }; 1109 1110 /* YYDEFGOTO[NTERM-NUM]. */ 1111 static const yytype_int16 yydefgoto[] = 1112 { 1113 -1, 1, 2, 138, 135, 136, 227, 147, 148, 130, 1114 229, 230, 95, 96, 97, 98, 171, 172, 173, 131, 1115 100, 101, 174, 238, 289, 240, 102, 243, 120, 122, 1116 192, 193, 103, 104, 211, 105, 106, 107, 108, 198, 1117 199, 259, 109, 110, 204, 205, 263 1118 }; 1119 1120 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If 1121 positive, shift that token. If negative, reduce the rule whose 1122 number is the opposite. If YYTABLE_NINF, syntax error. */ 1123 static const yytype_int16 yytable[] = 1124 { 1125 94, 224, 139, -41, 124, 125, 146, 126, 127, 93, 1126 -13, 99, 26, 137, 228, 273, 133, 134, 128, 118, 1127 258, 133, 185, 186, 3, 236, 221, 262, 241, 190, 1128 191, 281, 194, 190, 191, 129, 287, 111, 139, 123, 1129 123, 119, 123, 123, 282, 214, 219, 237, 284, 112, 1130 242, 176, 177, 178, 113, 217, 220, 140, 288, 150, 1131 183, 184, 185, 186, 132, 196, 116, 202, 206, 207, 1132 -29, -29, 133, 190, 191, 114, 200, 208, 209, 210, 1133 223, 228, 283, 153, 115, 155, 212, 156, 157, 133, 1134 134, 94, 94, 140, 149, 176, 177, 178, 218, 218, 1135 93, 93, 99, 99, 213, 91, 195, 291, 201, 117, 1136 292, 150, 231, 197, 121, 203, 232, 233, 175, 222, 1137 225, 123, -41, -41, 139, 91, 187, 188, 189, -13, 1138 -13, 223, -41, 216, 216, 137, 239, 175, 226, -13, 1139 234, 235, 215, 215, 99, 99, 149, 123, 194, 245, 1140 260, 261, 200, 246, 247, 248, 249, 250, 251, 252, 1141 253, 264, 26, 265, 254, 255, 256, 257, 266, 91, 1142 187, 188, 189, 268, 269, 270, 271, 274, 218, 267, 1143 275, 276, 285, 286, 141, 142, 143, 144, 145, 277, 1144 278, 179, 180, 290, 293, 92, 272, 244, 0, 0, 1145 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1146 0, 0, 0, 216, 94, 0, 0, 0, 0, 0, 1147 0, 0, 215, 215, 99, 99, 0, 0, 0, 0, 1148 0, 0, 0, 0, 0, 150, 150, 0, 0, 176, 1149 177, 178, 0, 0, 0, 0, 89, 179, 180, 181, 1150 182, 183, 184, 185, 186, 91, 0, -3, 0, 0, 1151 0, 0, 279, 280, 190, 191, 0, 0, 4, 5, 1152 149, 149, 6, 7, 8, 9, 10, 11, 12, 13, 1153 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 1154 24, 25, 0, 0, 26, 27, 28, 29, 30, 31, 1155 32, 33, 34, 0, 0, 181, 182, 183, 184, 185, 1156 186, 0, 35, 0, 187, 188, 189, 0, 0, 0, 1157 190, 191, 0, 36, 37, 38, 39, 40, 41, 42, 1158 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 1159 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 1160 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 1161 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 1162 83, 84, 85, 86, 87, 88, 0, 0, 89, 0, 1163 0, 0, 90, 0, 4, 5, 0, 91, 6, 7, 1164 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1165 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 1166 26, 27, 28, 29, 30, 31, 32, 33, 34, 0, 1167 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 1168 0, 0, 141, 142, 143, 144, 145, 0, 0, 36, 1169 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 1170 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 1171 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 1172 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 1173 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 1174 87, 88, 0, 0, 89, 0, 0, 0, 90, 0, 1175 4, 5, 0, 91, 6, 7, 8, 9, 10, 11, 1176 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 1177 22, 23, 24, 25, 0, 0, 26, 27, 28, 29, 1178 30, 31, 32, 33, 34, 0, 0, 0, 0, 0, 1179 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 1180 0, 0, 0, 0, 0, 36, 37, 38, 39, 40, 1181 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 1182 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 1183 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 1184 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 1185 81, 82, 83, 84, 85, 86, 87, 88, 0, 0, 1186 89, 0, 0, 0, 90, 0, 0, 0, 0, 91, 1187 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1188 17, 18, 19, 20, 21, 22, 23, 24, 25, 179, 1189 180, 26, 0, 0, 179, 180, 0, 0, 0, 0, 1190 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 1191 0, 0, 179, 180, 0, 0, 0, 0, 0, 0, 1192 36, 37, 38, 39, 40, 0, 0, 0, 0, 0, 1193 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 1194 56, 57, 58, 59, 0, 0, 0, 181, 182, 183, 1195 184, 185, 186, 182, 183, 184, 185, 186, 74, 0, 1196 0, 0, 190, 191, 0, 0, 0, 190, 191, 0, 1197 0, 0, 183, 184, 185, 186, 0, 0, 0, 90, 1198 0, 0, 0, 0, 91, 190, 191, 151, 152, 153, 1199 154, 155, 0, 156, 157, 0, 0, 158, 159, 0, 1200 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1201 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 1202 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1203 162, 163, 164, 165, 166, 167, 168, 169, 170 1204 }; 1205 1206 static const yytype_int16 yycheck[] = 1207 { 1208 2, 8, 94, 0, 41, 42, 96, 44, 45, 2, 1209 0, 2, 37, 93, 149, 230, 119, 120, 42, 37, 1210 195, 119, 126, 127, 0, 37, 129, 201, 37, 137, 1211 138, 129, 37, 137, 138, 59, 37, 37, 130, 41, 1212 42, 59, 44, 45, 259, 135, 136, 59, 263, 37, 1213 59, 56, 57, 58, 37, 135, 136, 94, 59, 96, 1214 124, 125, 126, 127, 90, 108, 37, 110, 122, 123, 1215 119, 120, 119, 137, 138, 59, 37, 131, 132, 133, 1216 129, 216, 129, 5, 59, 7, 123, 9, 10, 119, 1217 120, 93, 94, 130, 96, 56, 57, 58, 135, 136, 1218 93, 94, 93, 94, 130, 130, 108, 282, 110, 37, 1219 284, 148, 149, 108, 59, 110, 119, 120, 134, 129, 1220 127, 123, 119, 120, 216, 130, 131, 132, 133, 119, 1221 120, 129, 129, 135, 136, 215, 59, 134, 127, 129, 1222 119, 120, 135, 136, 135, 136, 148, 149, 37, 175, 1223 37, 37, 37, 179, 180, 181, 182, 183, 184, 185, 1224 186, 37, 37, 37, 190, 191, 192, 193, 37, 130, 1225 131, 132, 133, 61, 37, 37, 129, 4, 215, 216, 1226 4, 3, 272, 273, 59, 60, 61, 62, 63, 3, 1227 47, 64, 65, 37, 135, 2, 230, 171, -1, -1, 1228 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1229 -1, -1, -1, 215, 216, -1, -1, -1, -1, -1, 1230 -1, -1, 215, 216, 215, 216, -1, -1, -1, -1, 1231 -1, -1, -1, -1, -1, 272, 273, -1, -1, 56, 1232 57, 58, -1, -1, -1, -1, 121, 64, 65, 122, 1233 123, 124, 125, 126, 127, 130, -1, 0, -1, -1, 1234 -1, -1, 135, 136, 137, 138, -1, -1, 11, 12, 1235 272, 273, 15, 16, 17, 18, 19, 20, 21, 22, 1236 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 1237 33, 34, -1, -1, 37, 38, 39, 40, 41, 42, 1238 43, 44, 45, -1, -1, 122, 123, 124, 125, 126, 1239 127, -1, 55, -1, 131, 132, 133, -1, -1, -1, 1240 137, 138, -1, 66, 67, 68, 69, 70, 71, 72, 1241 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 1242 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 1243 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 1244 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 1245 113, 114, 115, 116, 117, 118, -1, -1, 121, -1, 1246 -1, -1, 125, -1, 11, 12, -1, 130, 15, 16, 1247 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 1248 27, 28, 29, 30, 31, 32, 33, 34, -1, -1, 1249 37, 38, 39, 40, 41, 42, 43, 44, 45, -1, 1250 -1, -1, -1, -1, -1, -1, -1, -1, 55, -1, 1251 -1, -1, 59, 60, 61, 62, 63, -1, -1, 66, 1252 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 1253 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 1254 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 1255 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 1256 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 1257 117, 118, -1, -1, 121, -1, -1, -1, 125, -1, 1258 11, 12, -1, 130, 15, 16, 17, 18, 19, 20, 1259 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 1260 31, 32, 33, 34, -1, -1, 37, 38, 39, 40, 1261 41, 42, 43, 44, 45, -1, -1, -1, -1, -1, 1262 -1, -1, -1, -1, 55, -1, -1, -1, -1, -1, 1263 -1, -1, -1, -1, -1, 66, 67, 68, 69, 70, 1264 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 1265 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 1266 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 1267 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 1268 111, 112, 113, 114, 115, 116, 117, 118, -1, -1, 1269 121, -1, -1, -1, 125, -1, -1, -1, -1, 130, 1270 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 1271 26, 27, 28, 29, 30, 31, 32, 33, 34, 64, 1272 65, 37, -1, -1, 64, 65, -1, -1, -1, -1, 1273 -1, -1, -1, -1, -1, -1, -1, -1, -1, 55, 1274 -1, -1, 64, 65, -1, -1, -1, -1, -1, -1, 1275 66, 67, 68, 69, 70, -1, -1, -1, -1, -1, 1276 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 1277 86, 87, 88, 89, -1, -1, -1, 122, 123, 124, 1278 125, 126, 127, 123, 124, 125, 126, 127, 104, -1, 1279 -1, -1, 137, 138, -1, -1, -1, 137, 138, -1, 1280 -1, -1, 124, 125, 126, 127, -1, -1, -1, 125, 1281 -1, -1, -1, -1, 130, 137, 138, 3, 4, 5, 1282 6, 7, -1, 9, 10, -1, -1, 13, 14, -1, 1283 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1284 -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 1285 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1286 46, 47, 48, 49, 50, 51, 52, 53, 54 1287 }; 1288 1289 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 1290 symbol of state STATE-NUM. */ 1291 static const yytype_uint8 yystos[] = 1292 { 1293 0, 140, 141, 0, 11, 12, 15, 16, 17, 18, 1294 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 1295 29, 30, 31, 32, 33, 34, 37, 38, 39, 40, 1296 41, 42, 43, 44, 45, 55, 66, 67, 68, 69, 1297 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 1298 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 1299 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 1300 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 1301 110, 111, 112, 113, 114, 115, 116, 117, 118, 121, 1302 125, 130, 142, 147, 148, 151, 152, 153, 154, 158, 1303 159, 160, 165, 171, 172, 174, 175, 176, 177, 181, 1304 182, 37, 37, 37, 59, 59, 37, 37, 37, 59, 1305 167, 59, 168, 148, 174, 174, 174, 174, 42, 59, 1306 148, 158, 171, 119, 120, 143, 144, 151, 142, 172, 1307 174, 59, 60, 61, 62, 63, 145, 146, 147, 148, 1308 174, 3, 4, 5, 6, 7, 9, 10, 13, 14, 1309 35, 36, 46, 47, 48, 49, 50, 51, 52, 53, 1310 54, 155, 156, 157, 161, 134, 56, 57, 58, 64, 1311 65, 122, 123, 124, 125, 126, 127, 131, 132, 133, 1312 137, 138, 169, 170, 37, 148, 169, 170, 178, 179, 1313 37, 148, 169, 170, 183, 184, 122, 123, 131, 132, 1314 133, 173, 174, 171, 145, 147, 148, 151, 174, 145, 1315 151, 129, 129, 129, 8, 127, 127, 145, 146, 149, 1316 150, 174, 119, 120, 119, 120, 37, 59, 162, 59, 1317 164, 37, 59, 166, 156, 171, 171, 171, 171, 171, 1318 171, 171, 171, 171, 171, 171, 171, 171, 179, 180, 1319 37, 37, 184, 185, 37, 37, 37, 174, 61, 37, 1320 37, 129, 143, 144, 4, 4, 3, 3, 47, 135, 1321 136, 129, 144, 129, 144, 145, 145, 37, 59, 163, 1322 37, 179, 184, 135 1323 }; 1324 1325 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 1326 static const yytype_uint8 yyr1[] = 1327 { 1328 0, 139, 140, 140, 141, 142, 142, 142, 142, 142, 1329 143, 144, 145, 145, 145, 146, 146, 146, 146, 146, 1330 146, 146, 146, 146, 147, 148, 149, 149, 149, 150, 1331 150, 151, 151, 152, 152, 152, 152, 152, 152, 153, 1332 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 1333 154, 154, 155, 155, 155, 155, 155, 155, 155, 155, 1334 155, 155, 155, 155, 156, 156, 156, 156, 157, 158, 1335 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 1336 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 1337 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 1338 158, 158, 158, 158, 158, 158, 158, 158, 159, 159, 1339 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 1340 159, 159, 159, 159, 159, 159, 159, 160, 160, 160, 1341 160, 160, 160, 161, 161, 161, 161, 162, 162, 163, 1342 163, 164, 165, 165, 165, 166, 166, 167, 167, 168, 1343 169, 169, 169, 170, 170, 170, 171, 171, 172, 172, 1344 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 1345 172, 172, 172, 173, 173, 173, 173, 173, 174, 174, 1346 175, 175, 175, 175, 175, 175, 175, 176, 176, 176, 1347 176, 177, 177, 178, 178, 178, 178, 179, 180, 180, 1348 181, 181, 181, 181, 181, 181, 182, 182, 182, 182, 1349 182, 182, 182, 182, 183, 183, 183, 183, 184, 185, 1350 185 1351 }; 1352 1353 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ 1354 static const yytype_uint8 yyr2[] = 1355 { 1356 0, 2, 2, 1, 0, 1, 3, 3, 3, 3, 1357 1, 1, 1, 1, 3, 1, 3, 3, 1, 3, 1358 1, 1, 1, 2, 1, 1, 1, 3, 3, 1, 1359 1, 1, 2, 3, 2, 2, 2, 2, 2, 2, 1360 3, 1, 3, 3, 1, 1, 1, 2, 1, 2, 1361 1, 0, 1, 1, 3, 3, 3, 3, 1, 1, 1362 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1363 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1364 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1365 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1366 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1367 2, 2, 4, 1, 1, 2, 1, 2, 1, 1, 1368 2, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1369 2, 2, 2, 4, 2, 2, 2, 1, 1, 1, 1370 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1371 1, 1, 1, 1, 1, 1, 1, 1, 4, 6, 1372 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1373 2, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1374 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1375 1, 1, 1, 1, 2, 2, 3, 1, 1, 3, 1376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1377 1, 1, 1, 1, 1, 2, 2, 3, 1, 1, 1378 3 1379 }; 1380 1381 1382 #define yyerrok (yyerrstatus = 0) 1383 #define yyclearin (yychar = YYEMPTY) 1384 #define YYEMPTY (-2) 1385 #define YYEOF 0 1386 1387 #define YYACCEPT goto yyacceptlab 1388 #define YYABORT goto yyabortlab 1389 #define YYERROR goto yyerrorlab 1390 1391 1392 #define YYRECOVERING() (!!yyerrstatus) 1393 1394 #define YYBACKUP(Token, Value) \ 1395 do \ 1396 if (yychar == YYEMPTY) \ 1397 { \ 1398 yychar = (Token); \ 1399 yylval = (Value); \ 1400 YYPOPSTACK (yylen); \ 1401 yystate = *yyssp; \ 1402 goto yybackup; \ 1403 } \ 1404 else \ 1405 { \ 1406 yyerror (yyscanner, cstate, YY_("syntax error: cannot back up")); \ 1407 YYERROR; \ 1408 } \ 1409 while (0) 1410 1411 /* Error token number */ 1412 #define YYTERROR 1 1413 #define YYERRCODE 256 1414 1415 1416 1417 /* Enable debugging if requested. */ 1418 #if YYDEBUG 1419 1420 # ifndef YYFPRINTF 1421 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 1422 # define YYFPRINTF fprintf 1423 # endif 1424 1425 # define YYDPRINTF(Args) \ 1426 do { \ 1427 if (yydebug) \ 1428 YYFPRINTF Args; \ 1429 } while (0) 1430 1431 /* This macro is provided for backward compatibility. */ 1432 #ifndef YY_LOCATION_PRINT 1433 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 1434 #endif 1435 1436 1437 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 1438 do { \ 1439 if (yydebug) \ 1440 { \ 1441 YYFPRINTF (stderr, "%s ", Title); \ 1442 yy_symbol_print (stderr, \ 1443 Type, Value, yyscanner, cstate); \ 1444 YYFPRINTF (stderr, "\n"); \ 1445 } \ 1446 } while (0) 1447 1448 1449 /*----------------------------------------. 1450 | Print this symbol's value on YYOUTPUT. | 1451 `----------------------------------------*/ 1452 1453 static void 1454 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *yyscanner, compiler_state_t *cstate) 1455 { 1456 FILE *yyo = yyoutput; 1457 YYUSE (yyo); 1458 YYUSE (yyscanner); 1459 YYUSE (cstate); 1460 if (!yyvaluep) 1461 return; 1462 # ifdef YYPRINT 1463 if (yytype < YYNTOKENS) 1464 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 1465 # endif 1466 YYUSE (yytype); 1467 } 1468 1469 1470 /*--------------------------------. 1471 | Print this symbol on YYOUTPUT. | 1472 `--------------------------------*/ 1473 1474 static void 1475 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *yyscanner, compiler_state_t *cstate) 1476 { 1477 YYFPRINTF (yyoutput, "%s %s (", 1478 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); 1479 1480 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yyscanner, cstate); 1481 YYFPRINTF (yyoutput, ")"); 1482 } 1483 1484 /*------------------------------------------------------------------. 1485 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 1486 | TOP (included). | 1487 `------------------------------------------------------------------*/ 1488 1489 static void 1490 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 1491 { 1492 YYFPRINTF (stderr, "Stack now"); 1493 for (; yybottom <= yytop; yybottom++) 1494 { 1495 int yybot = *yybottom; 1496 YYFPRINTF (stderr, " %d", yybot); 1497 } 1498 YYFPRINTF (stderr, "\n"); 1499 } 1500 1501 # define YY_STACK_PRINT(Bottom, Top) \ 1502 do { \ 1503 if (yydebug) \ 1504 yy_stack_print ((Bottom), (Top)); \ 1505 } while (0) 1506 1507 1508 /*------------------------------------------------. 1509 | Report that the YYRULE is going to be reduced. | 1510 `------------------------------------------------*/ 1511 1512 static void 1513 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, void *yyscanner, compiler_state_t *cstate) 1514 { 1515 unsigned long int yylno = yyrline[yyrule]; 1516 int yynrhs = yyr2[yyrule]; 1517 int yyi; 1518 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 1519 yyrule - 1, yylno); 1520 /* The symbols being reduced. */ 1521 for (yyi = 0; yyi < yynrhs; yyi++) 1522 { 1523 YYFPRINTF (stderr, " $%d = ", yyi + 1); 1524 yy_symbol_print (stderr, 1525 yystos[yyssp[yyi + 1 - yynrhs]], 1526 &(yyvsp[(yyi + 1) - (yynrhs)]) 1527 , yyscanner, cstate); 1528 YYFPRINTF (stderr, "\n"); 1529 } 1530 } 1531 1532 # define YY_REDUCE_PRINT(Rule) \ 1533 do { \ 1534 if (yydebug) \ 1535 yy_reduce_print (yyssp, yyvsp, Rule, yyscanner, cstate); \ 1536 } while (0) 1537 1538 /* Nonzero means print parse trace. It is left uninitialized so that 1539 multiple parsers can coexist. */ 1540 int yydebug; 1541 #else /* !YYDEBUG */ 1542 # define YYDPRINTF(Args) 1543 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 1544 # define YY_STACK_PRINT(Bottom, Top) 1545 # define YY_REDUCE_PRINT(Rule) 1546 #endif /* !YYDEBUG */ 1547 1548 1549 /* YYINITDEPTH -- initial size of the parser's stacks. */ 1550 #ifndef YYINITDEPTH 1551 # define YYINITDEPTH 200 1552 #endif 1553 1554 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 1555 if the built-in stack extension method is used). 1556 1557 Do not make this value too large; the results are undefined if 1558 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 1559 evaluated with infinite-precision integer arithmetic. */ 1560 1561 #ifndef YYMAXDEPTH 1562 # define YYMAXDEPTH 10000 1563 #endif 1564 1565 1566 #if YYERROR_VERBOSE 1567 1568 # ifndef yystrlen 1569 # if defined __GLIBC__ && defined _STRING_H 1570 # define yystrlen strlen 1571 # else 1572 /* Return the length of YYSTR. */ 1573 static YYSIZE_T 1574 yystrlen (const char *yystr) 1575 { 1576 YYSIZE_T yylen; 1577 for (yylen = 0; yystr[yylen]; yylen++) 1578 continue; 1579 return yylen; 1580 } 1581 # endif 1582 # endif 1583 1584 # ifndef yystpcpy 1585 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 1586 # define yystpcpy stpcpy 1587 # else 1588 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 1589 YYDEST. */ 1590 static char * 1591 yystpcpy (char *yydest, const char *yysrc) 1592 { 1593 char *yyd = yydest; 1594 const char *yys = yysrc; 1595 1596 while ((*yyd++ = *yys++) != '\0') 1597 continue; 1598 1599 return yyd - 1; 1600 } 1601 # endif 1602 # endif 1603 1604 # ifndef yytnamerr 1605 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary 1606 quotes and backslashes, so that it's suitable for yyerror. The 1607 heuristic is that double-quoting is unnecessary unless the string 1608 contains an apostrophe, a comma, or backslash (other than 1609 backslash-backslash). YYSTR is taken from yytname. If YYRES is 1610 null, do not copy; instead, return the length of what the result 1611 would have been. */ 1612 static YYSIZE_T 1613 yytnamerr (char *yyres, const char *yystr) 1614 { 1615 if (*yystr == '"') 1616 { 1617 YYSIZE_T yyn = 0; 1618 char const *yyp = yystr; 1619 1620 for (;;) 1621 switch (*++yyp) 1622 { 1623 case '\'': 1624 case ',': 1625 goto do_not_strip_quotes; 1626 1627 case '\\': 1628 if (*++yyp != '\\') 1629 goto do_not_strip_quotes; 1630 /* Fall through. */ 1631 default: 1632 if (yyres) 1633 yyres[yyn] = *yyp; 1634 yyn++; 1635 break; 1636 1637 case '"': 1638 if (yyres) 1639 yyres[yyn] = '\0'; 1640 return yyn; 1641 } 1642 do_not_strip_quotes: ; 1643 } 1644 1645 if (! yyres) 1646 return yystrlen (yystr); 1647 1648 return yystpcpy (yyres, yystr) - yyres; 1649 } 1650 # endif 1651 1652 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 1653 about the unexpected token YYTOKEN for the state stack whose top is 1654 YYSSP. 1655 1656 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 1657 not large enough to hold the message. In that case, also set 1658 *YYMSG_ALLOC to the required number of bytes. Return 2 if the 1659 required number of bytes is too large to store. */ 1660 static int 1661 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 1662 yytype_int16 *yyssp, int yytoken) 1663 { 1664 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); 1665 YYSIZE_T yysize = yysize0; 1666 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1667 /* Internationalized format string. */ 1668 const char *yyformat = YY_NULLPTR; 1669 /* Arguments of yyformat. */ 1670 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1671 /* Number of reported tokens (one for the "unexpected", one per 1672 "expected"). */ 1673 int yycount = 0; 1674 1675 /* There are many possibilities here to consider: 1676 - If this state is a consistent state with a default action, then 1677 the only way this function was invoked is if the default action 1678 is an error action. In that case, don't check for expected 1679 tokens because there are none. 1680 - The only way there can be no lookahead present (in yychar) is if 1681 this state is a consistent state with a default action. Thus, 1682 detecting the absence of a lookahead is sufficient to determine 1683 that there is no unexpected or expected token to report. In that 1684 case, just report a simple "syntax error". 1685 - Don't assume there isn't a lookahead just because this state is a 1686 consistent state with a default action. There might have been a 1687 previous inconsistent state, consistent state with a non-default 1688 action, or user semantic action that manipulated yychar. 1689 - Of course, the expected token list depends on states to have 1690 correct lookahead information, and it depends on the parser not 1691 to perform extra reductions after fetching a lookahead from the 1692 scanner and before detecting a syntax error. Thus, state merging 1693 (from LALR or IELR) and default reductions corrupt the expected 1694 token list. However, the list is correct for canonical LR with 1695 one exception: it will still contain any token that will not be 1696 accepted due to an error action in a later state. 1697 */ 1698 if (yytoken != YYEMPTY) 1699 { 1700 int yyn = yypact[*yyssp]; 1701 yyarg[yycount++] = yytname[yytoken]; 1702 if (!yypact_value_is_default (yyn)) 1703 { 1704 /* Start YYX at -YYN if negative to avoid negative indexes in 1705 YYCHECK. In other words, skip the first -YYN actions for 1706 this state because they are default actions. */ 1707 int yyxbegin = yyn < 0 ? -yyn : 0; 1708 /* Stay within bounds of both yycheck and yytname. */ 1709 int yychecklim = YYLAST - yyn + 1; 1710 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 1711 int yyx; 1712 1713 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1714 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 1715 && !yytable_value_is_error (yytable[yyx + yyn])) 1716 { 1717 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1718 { 1719 yycount = 1; 1720 yysize = yysize0; 1721 break; 1722 } 1723 yyarg[yycount++] = yytname[yyx]; 1724 { 1725 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); 1726 if (! (yysize <= yysize1 1727 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1728 return 2; 1729 yysize = yysize1; 1730 } 1731 } 1732 } 1733 } 1734 1735 switch (yycount) 1736 { 1737 # define YYCASE_(N, S) \ 1738 case N: \ 1739 yyformat = S; \ 1740 break 1741 YYCASE_(0, YY_("syntax error")); 1742 YYCASE_(1, YY_("syntax error, unexpected %s")); 1743 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 1744 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 1745 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 1746 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 1747 # undef YYCASE_ 1748 } 1749 1750 { 1751 YYSIZE_T yysize1 = yysize + yystrlen (yyformat); 1752 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1753 return 2; 1754 yysize = yysize1; 1755 } 1756 1757 if (*yymsg_alloc < yysize) 1758 { 1759 *yymsg_alloc = 2 * yysize; 1760 if (! (yysize <= *yymsg_alloc 1761 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 1762 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 1763 return 1; 1764 } 1765 1766 /* Avoid sprintf, as that infringes on the user's name space. 1767 Don't have undefined behavior even if the translation 1768 produced a string with the wrong number of "%s"s. */ 1769 { 1770 char *yyp = *yymsg; 1771 int yyi = 0; 1772 while ((*yyp = *yyformat) != '\0') 1773 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 1774 { 1775 yyp += yytnamerr (yyp, yyarg[yyi++]); 1776 yyformat += 2; 1777 } 1778 else 1779 { 1780 yyp++; 1781 yyformat++; 1782 } 1783 } 1784 return 0; 1785 } 1786 #endif /* YYERROR_VERBOSE */ 1787 1788 /*-----------------------------------------------. 1789 | Release the memory associated to this symbol. | 1790 `-----------------------------------------------*/ 1791 1792 static void 1793 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *yyscanner, compiler_state_t *cstate) 1794 { 1795 YYUSE (yyvaluep); 1796 YYUSE (yyscanner); 1797 YYUSE (cstate); 1798 if (!yymsg) 1799 yymsg = "Deleting"; 1800 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1801 1802 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1803 YYUSE (yytype); 1804 YY_IGNORE_MAYBE_UNINITIALIZED_END 1805 } 1806 1807 1808 1809 1810 /*----------. 1811 | yyparse. | 1812 `----------*/ 1813 1814 int 1815 yyparse (void *yyscanner, compiler_state_t *cstate) 1816 { 1817 /* The lookahead symbol. */ 1818 int yychar; 1819 1820 1821 /* The semantic value of the lookahead symbol. */ 1822 /* Default value used for initialization, for pacifying older GCCs 1823 or non-GCC compilers. */ 1824 YY_INITIAL_VALUE (static YYSTYPE yyval_default;) 1825 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); 1826 1827 /* Number of syntax errors so far. */ 1828 int yynerrs; 1829 1830 int yystate; 1831 /* Number of tokens to shift before error messages enabled. */ 1832 int yyerrstatus; 1833 1834 /* The stacks and their tools: 1835 'yyss': related to states. 1836 'yyvs': related to semantic values. 1837 1838 Refer to the stacks through separate pointers, to allow yyoverflow 1839 to reallocate them elsewhere. */ 1840 1841 /* The state stack. */ 1842 yytype_int16 yyssa[YYINITDEPTH]; 1843 yytype_int16 *yyss; 1844 yytype_int16 *yyssp; 1845 1846 /* The semantic value stack. */ 1847 YYSTYPE yyvsa[YYINITDEPTH]; 1848 YYSTYPE *yyvs; 1849 YYSTYPE *yyvsp; 1850 1851 YYSIZE_T yystacksize; 1852 1853 int yyn; 1854 int yyresult; 1855 /* Lookahead token as an internal (translated) token number. */ 1856 int yytoken = 0; 1857 /* The variables used to return semantic value and location from the 1858 action routines. */ 1859 YYSTYPE yyval; 1860 1861 #if YYERROR_VERBOSE 1862 /* Buffer for error messages, and its allocated size. */ 1863 char yymsgbuf[128]; 1864 char *yymsg = yymsgbuf; 1865 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1866 #endif 1867 1868 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1869 1870 /* The number of symbols on the RHS of the reduced rule. 1871 Keep to zero when no symbol should be popped. */ 1872 int yylen = 0; 1873 1874 yyssp = yyss = yyssa; 1875 yyvsp = yyvs = yyvsa; 1876 yystacksize = YYINITDEPTH; 1877 1878 YYDPRINTF ((stderr, "Starting parse\n")); 1879 1880 yystate = 0; 1881 yyerrstatus = 0; 1882 yynerrs = 0; 1883 yychar = YYEMPTY; /* Cause a token to be read. */ 1884 goto yysetstate; 1885 1886 /*------------------------------------------------------------. 1887 | yynewstate -- Push a new state, which is found in yystate. | 1888 `------------------------------------------------------------*/ 1889 yynewstate: 1890 /* In all cases, when you get here, the value and location stacks 1891 have just been pushed. So pushing a state here evens the stacks. */ 1892 yyssp++; 1893 1894 yysetstate: 1895 *yyssp = yystate; 1896 1897 if (yyss + yystacksize - 1 <= yyssp) 1898 { 1899 /* Get the current used size of the three stacks, in elements. */ 1900 YYSIZE_T yysize = yyssp - yyss + 1; 1901 1902 #ifdef yyoverflow 1903 { 1904 /* Give user a chance to reallocate the stack. Use copies of 1905 these so that the &'s don't force the real ones into 1906 memory. */ 1907 YYSTYPE *yyvs1 = yyvs; 1908 yytype_int16 *yyss1 = yyss; 1909 1910 /* Each stack pointer address is followed by the size of the 1911 data in use in that stack, in bytes. This used to be a 1912 conditional around just the two extra args, but that might 1913 be undefined if yyoverflow is a macro. */ 1914 yyoverflow (YY_("memory exhausted"), 1915 &yyss1, yysize * sizeof (*yyssp), 1916 &yyvs1, yysize * sizeof (*yyvsp), 1917 &yystacksize); 1918 1919 yyss = yyss1; 1920 yyvs = yyvs1; 1921 } 1922 #else /* no yyoverflow */ 1923 # ifndef YYSTACK_RELOCATE 1924 goto yyexhaustedlab; 1925 # else 1926 /* Extend the stack our own way. */ 1927 if (YYMAXDEPTH <= yystacksize) 1928 goto yyexhaustedlab; 1929 yystacksize *= 2; 1930 if (YYMAXDEPTH < yystacksize) 1931 yystacksize = YYMAXDEPTH; 1932 1933 { 1934 yytype_int16 *yyss1 = yyss; 1935 union yyalloc *yyptr = 1936 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1937 if (! yyptr) 1938 goto yyexhaustedlab; 1939 YYSTACK_RELOCATE (yyss_alloc, yyss); 1940 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 1941 # undef YYSTACK_RELOCATE 1942 if (yyss1 != yyssa) 1943 YYSTACK_FREE (yyss1); 1944 } 1945 # endif 1946 #endif /* no yyoverflow */ 1947 1948 yyssp = yyss + yysize - 1; 1949 yyvsp = yyvs + yysize - 1; 1950 1951 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1952 (unsigned long int) yystacksize)); 1953 1954 if (yyss + yystacksize - 1 <= yyssp) 1955 YYABORT; 1956 } 1957 1958 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1959 1960 if (yystate == YYFINAL) 1961 YYACCEPT; 1962 1963 goto yybackup; 1964 1965 /*-----------. 1966 | yybackup. | 1967 `-----------*/ 1968 yybackup: 1969 1970 /* Do appropriate processing given the current state. Read a 1971 lookahead token if we need one and don't already have one. */ 1972 1973 /* First try to decide what to do without reference to lookahead token. */ 1974 yyn = yypact[yystate]; 1975 if (yypact_value_is_default (yyn)) 1976 goto yydefault; 1977 1978 /* Not known => get a lookahead token if don't already have one. */ 1979 1980 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 1981 if (yychar == YYEMPTY) 1982 { 1983 YYDPRINTF ((stderr, "Reading a token: ")); 1984 yychar = yylex (&yylval, yyscanner); 1985 } 1986 1987 if (yychar <= YYEOF) 1988 { 1989 yychar = yytoken = YYEOF; 1990 YYDPRINTF ((stderr, "Now at end of input.\n")); 1991 } 1992 else 1993 { 1994 yytoken = YYTRANSLATE (yychar); 1995 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1996 } 1997 1998 /* If the proper action on seeing token YYTOKEN is to reduce or to 1999 detect an error, take that action. */ 2000 yyn += yytoken; 2001 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 2002 goto yydefault; 2003 yyn = yytable[yyn]; 2004 if (yyn <= 0) 2005 { 2006 if (yytable_value_is_error (yyn)) 2007 goto yyerrlab; 2008 yyn = -yyn; 2009 goto yyreduce; 2010 } 2011 2012 /* Count tokens shifted since error; after three, turn off error 2013 status. */ 2014 if (yyerrstatus) 2015 yyerrstatus--; 2016 2017 /* Shift the lookahead token. */ 2018 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 2019 2020 /* Discard the shifted token. */ 2021 yychar = YYEMPTY; 2022 2023 yystate = yyn; 2024 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 2025 *++yyvsp = yylval; 2026 YY_IGNORE_MAYBE_UNINITIALIZED_END 2027 2028 goto yynewstate; 2029 2030 2031 /*-----------------------------------------------------------. 2032 | yydefault -- do the default action for the current state. | 2033 `-----------------------------------------------------------*/ 2034 yydefault: 2035 yyn = yydefact[yystate]; 2036 if (yyn == 0) 2037 goto yyerrlab; 2038 goto yyreduce; 2039 2040 2041 /*-----------------------------. 2042 | yyreduce -- Do a reduction. | 2043 `-----------------------------*/ 2044 yyreduce: 2045 /* yyn is the number of a rule to reduce with. */ 2046 yylen = yyr2[yyn]; 2047 2048 /* If YYLEN is nonzero, implement the default value of the action: 2049 '$$ = $1'. 2050 2051 Otherwise, the following line sets YYVAL to garbage. 2052 This behavior is undocumented and Bison 2053 users should not rely upon it. Assigning to YYVAL 2054 unconditionally makes the parser a bit smaller, and it avoids a 2055 GCC warning that YYVAL may be used uninitialized. */ 2056 yyval = yyvsp[1-yylen]; 2057 2058 2059 YY_REDUCE_PRINT (yyn); 2060 switch (yyn) 2061 { 2062 case 2: 2063 #line 346 "grammar.y" /* yacc.c:1646 */ 2064 { 2065 finish_parse(cstate, (yyvsp[0].blk).b); 2066 } 2067 #line 2068 "grammar.c" /* yacc.c:1646 */ 2068 break; 2069 2070 case 4: 2071 #line 351 "grammar.y" /* yacc.c:1646 */ 2072 { (yyval.blk).q = qerr; } 2073 #line 2074 "grammar.c" /* yacc.c:1646 */ 2074 break; 2075 2076 case 6: 2077 #line 354 "grammar.y" /* yacc.c:1646 */ 2078 { gen_and((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 2079 #line 2080 "grammar.c" /* yacc.c:1646 */ 2080 break; 2081 2082 case 7: 2083 #line 355 "grammar.y" /* yacc.c:1646 */ 2084 { gen_and((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 2085 #line 2086 "grammar.c" /* yacc.c:1646 */ 2086 break; 2087 2088 case 8: 2089 #line 356 "grammar.y" /* yacc.c:1646 */ 2090 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 2091 #line 2092 "grammar.c" /* yacc.c:1646 */ 2092 break; 2093 2094 case 9: 2095 #line 357 "grammar.y" /* yacc.c:1646 */ 2096 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 2097 #line 2098 "grammar.c" /* yacc.c:1646 */ 2098 break; 2099 2100 case 10: 2101 #line 359 "grammar.y" /* yacc.c:1646 */ 2102 { (yyval.blk) = (yyvsp[-1].blk); } 2103 #line 2104 "grammar.c" /* yacc.c:1646 */ 2104 break; 2105 2106 case 11: 2107 #line 361 "grammar.y" /* yacc.c:1646 */ 2108 { (yyval.blk) = (yyvsp[-1].blk); } 2109 #line 2110 "grammar.c" /* yacc.c:1646 */ 2110 break; 2111 2112 case 13: 2113 #line 364 "grammar.y" /* yacc.c:1646 */ 2114 { (yyval.blk).b = gen_ncode(cstate, NULL, (bpf_u_int32)(yyvsp[0].i), 2115 (yyval.blk).q = (yyvsp[-1].blk).q); } 2116 #line 2117 "grammar.c" /* yacc.c:1646 */ 2117 break; 2118 2119 case 14: 2120 #line 366 "grammar.y" /* yacc.c:1646 */ 2121 { (yyval.blk) = (yyvsp[-1].blk); } 2122 #line 2123 "grammar.c" /* yacc.c:1646 */ 2123 break; 2124 2125 case 15: 2126 #line 368 "grammar.y" /* yacc.c:1646 */ 2127 { (yyval.blk).b = gen_scode(cstate, (yyvsp[0].s), (yyval.blk).q = (yyvsp[-1].blk).q); } 2128 #line 2129 "grammar.c" /* yacc.c:1646 */ 2129 break; 2130 2131 case 16: 2132 #line 369 "grammar.y" /* yacc.c:1646 */ 2133 { (yyval.blk).b = gen_mcode(cstate, (yyvsp[-2].s), NULL, (yyvsp[0].i), 2134 (yyval.blk).q = (yyvsp[-3].blk).q); } 2135 #line 2136 "grammar.c" /* yacc.c:1646 */ 2136 break; 2137 2138 case 17: 2139 #line 371 "grammar.y" /* yacc.c:1646 */ 2140 { (yyval.blk).b = gen_mcode(cstate, (yyvsp[-2].s), (yyvsp[0].s), 0, 2141 (yyval.blk).q = (yyvsp[-3].blk).q); } 2142 #line 2143 "grammar.c" /* yacc.c:1646 */ 2143 break; 2144 2145 case 18: 2146 #line 373 "grammar.y" /* yacc.c:1646 */ 2147 { 2148 /* Decide how to parse HID based on proto */ 2149 (yyval.blk).q = (yyvsp[-1].blk).q; 2150 if ((yyval.blk).q.addr == Q_PORT) 2151 bpf_error(cstate, "'port' modifier applied to ip host"); 2152 else if ((yyval.blk).q.addr == Q_PORTRANGE) 2153 bpf_error(cstate, "'portrange' modifier applied to ip host"); 2154 else if ((yyval.blk).q.addr == Q_PROTO) 2155 bpf_error(cstate, "'proto' modifier applied to ip host"); 2156 else if ((yyval.blk).q.addr == Q_PROTOCHAIN) 2157 bpf_error(cstate, "'protochain' modifier applied to ip host"); 2158 (yyval.blk).b = gen_ncode(cstate, (yyvsp[0].s), 0, (yyval.blk).q); 2159 } 2160 #line 2161 "grammar.c" /* yacc.c:1646 */ 2161 break; 2162 2163 case 19: 2164 #line 386 "grammar.y" /* yacc.c:1646 */ 2165 { 2166 #ifdef INET6 2167 (yyval.blk).b = gen_mcode6(cstate, (yyvsp[-2].s), NULL, (yyvsp[0].i), 2168 (yyval.blk).q = (yyvsp[-3].blk).q); 2169 #else 2170 bpf_error(cstate, "'ip6addr/prefixlen' not supported " 2171 "in this configuration"); 2172 #endif /*INET6*/ 2173 } 2174 #line 2175 "grammar.c" /* yacc.c:1646 */ 2175 break; 2176 2177 case 20: 2178 #line 395 "grammar.y" /* yacc.c:1646 */ 2179 { 2180 #ifdef INET6 2181 (yyval.blk).b = gen_mcode6(cstate, (yyvsp[0].s), 0, 128, 2182 (yyval.blk).q = (yyvsp[-1].blk).q); 2183 #else 2184 bpf_error(cstate, "'ip6addr' not supported " 2185 "in this configuration"); 2186 #endif /*INET6*/ 2187 } 2188 #line 2189 "grammar.c" /* yacc.c:1646 */ 2189 break; 2190 2191 case 21: 2192 #line 404 "grammar.y" /* yacc.c:1646 */ 2193 { 2194 (yyval.blk).b = gen_ecode(cstate, (yyvsp[0].e), (yyval.blk).q = (yyvsp[-1].blk).q); 2195 /* 2196 * $1 was allocated by "pcap_ether_aton()", 2197 * so we must free it now that we're done 2198 * with it. 2199 */ 2200 free((yyvsp[0].e)); 2201 } 2202 #line 2203 "grammar.c" /* yacc.c:1646 */ 2203 break; 2204 2205 case 22: 2206 #line 413 "grammar.y" /* yacc.c:1646 */ 2207 { 2208 (yyval.blk).b = gen_acode(cstate, (yyvsp[0].e), (yyval.blk).q = (yyvsp[-1].blk).q); 2209 /* 2210 * $1 was allocated by "pcap_ether_aton()", 2211 * so we must free it now that we're done 2212 * with it. 2213 */ 2214 free((yyvsp[0].e)); 2215 } 2216 #line 2217 "grammar.c" /* yacc.c:1646 */ 2217 break; 2218 2219 case 23: 2220 #line 422 "grammar.y" /* yacc.c:1646 */ 2221 { gen_not((yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 2222 #line 2223 "grammar.c" /* yacc.c:1646 */ 2223 break; 2224 2225 case 24: 2226 #line 424 "grammar.y" /* yacc.c:1646 */ 2227 { (yyval.blk) = (yyvsp[-1].blk); } 2228 #line 2229 "grammar.c" /* yacc.c:1646 */ 2229 break; 2230 2231 case 25: 2232 #line 426 "grammar.y" /* yacc.c:1646 */ 2233 { (yyval.blk) = (yyvsp[-1].blk); } 2234 #line 2235 "grammar.c" /* yacc.c:1646 */ 2235 break; 2236 2237 case 27: 2238 #line 429 "grammar.y" /* yacc.c:1646 */ 2239 { gen_and((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 2240 #line 2241 "grammar.c" /* yacc.c:1646 */ 2241 break; 2242 2243 case 28: 2244 #line 430 "grammar.y" /* yacc.c:1646 */ 2245 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 2246 #line 2247 "grammar.c" /* yacc.c:1646 */ 2247 break; 2248 2249 case 29: 2250 #line 432 "grammar.y" /* yacc.c:1646 */ 2251 { (yyval.blk).b = gen_ncode(cstate, NULL, (bpf_u_int32)(yyvsp[0].i), 2252 (yyval.blk).q = (yyvsp[-1].blk).q); } 2253 #line 2254 "grammar.c" /* yacc.c:1646 */ 2254 break; 2255 2256 case 32: 2257 #line 437 "grammar.y" /* yacc.c:1646 */ 2258 { gen_not((yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 2259 #line 2260 "grammar.c" /* yacc.c:1646 */ 2260 break; 2261 2262 case 33: 2263 #line 439 "grammar.y" /* yacc.c:1646 */ 2264 { QSET((yyval.blk).q, (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i)); } 2265 #line 2266 "grammar.c" /* yacc.c:1646 */ 2266 break; 2267 2268 case 34: 2269 #line 440 "grammar.y" /* yacc.c:1646 */ 2270 { QSET((yyval.blk).q, (yyvsp[-1].i), (yyvsp[0].i), Q_DEFAULT); } 2271 #line 2272 "grammar.c" /* yacc.c:1646 */ 2272 break; 2273 2274 case 35: 2275 #line 441 "grammar.y" /* yacc.c:1646 */ 2276 { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, (yyvsp[0].i)); } 2277 #line 2278 "grammar.c" /* yacc.c:1646 */ 2278 break; 2279 2280 case 36: 2281 #line 442 "grammar.y" /* yacc.c:1646 */ 2282 { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, Q_PROTO); } 2283 #line 2284 "grammar.c" /* yacc.c:1646 */ 2284 break; 2285 2286 case 37: 2287 #line 443 "grammar.y" /* yacc.c:1646 */ 2288 { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, Q_PROTOCHAIN); } 2289 #line 2290 "grammar.c" /* yacc.c:1646 */ 2290 break; 2291 2292 case 38: 2293 #line 444 "grammar.y" /* yacc.c:1646 */ 2294 { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, (yyvsp[0].i)); } 2295 #line 2296 "grammar.c" /* yacc.c:1646 */ 2296 break; 2297 2298 case 39: 2299 #line 446 "grammar.y" /* yacc.c:1646 */ 2300 { (yyval.blk) = (yyvsp[0].blk); } 2301 #line 2302 "grammar.c" /* yacc.c:1646 */ 2302 break; 2303 2304 case 40: 2305 #line 447 "grammar.y" /* yacc.c:1646 */ 2306 { (yyval.blk).b = (yyvsp[-1].blk).b; (yyval.blk).q = (yyvsp[-2].blk).q; } 2307 #line 2308 "grammar.c" /* yacc.c:1646 */ 2308 break; 2309 2310 case 41: 2311 #line 448 "grammar.y" /* yacc.c:1646 */ 2312 { (yyval.blk).b = gen_proto_abbrev(cstate, (yyvsp[0].i)); (yyval.blk).q = qerr; } 2313 #line 2314 "grammar.c" /* yacc.c:1646 */ 2314 break; 2315 2316 case 42: 2317 #line 449 "grammar.y" /* yacc.c:1646 */ 2318 { (yyval.blk).b = gen_relation(cstate, (yyvsp[-1].i), (yyvsp[-2].a), (yyvsp[0].a), 0); 2319 (yyval.blk).q = qerr; } 2320 #line 2321 "grammar.c" /* yacc.c:1646 */ 2321 break; 2322 2323 case 43: 2324 #line 451 "grammar.y" /* yacc.c:1646 */ 2325 { (yyval.blk).b = gen_relation(cstate, (yyvsp[-1].i), (yyvsp[-2].a), (yyvsp[0].a), 1); 2326 (yyval.blk).q = qerr; } 2327 #line 2328 "grammar.c" /* yacc.c:1646 */ 2328 break; 2329 2330 case 44: 2331 #line 453 "grammar.y" /* yacc.c:1646 */ 2332 { (yyval.blk).b = (yyvsp[0].rblk); (yyval.blk).q = qerr; } 2333 #line 2334 "grammar.c" /* yacc.c:1646 */ 2334 break; 2335 2336 case 45: 2337 #line 454 "grammar.y" /* yacc.c:1646 */ 2338 { (yyval.blk).b = gen_atmtype_abbrev(cstate, (yyvsp[0].i)); (yyval.blk).q = qerr; } 2339 #line 2340 "grammar.c" /* yacc.c:1646 */ 2340 break; 2341 2342 case 46: 2343 #line 455 "grammar.y" /* yacc.c:1646 */ 2344 { (yyval.blk).b = gen_atmmulti_abbrev(cstate, (yyvsp[0].i)); (yyval.blk).q = qerr; } 2345 #line 2346 "grammar.c" /* yacc.c:1646 */ 2346 break; 2347 2348 case 47: 2349 #line 456 "grammar.y" /* yacc.c:1646 */ 2350 { (yyval.blk).b = (yyvsp[0].blk).b; (yyval.blk).q = qerr; } 2351 #line 2352 "grammar.c" /* yacc.c:1646 */ 2352 break; 2353 2354 case 48: 2355 #line 457 "grammar.y" /* yacc.c:1646 */ 2356 { (yyval.blk).b = gen_mtp2type_abbrev(cstate, (yyvsp[0].i)); (yyval.blk).q = qerr; } 2357 #line 2358 "grammar.c" /* yacc.c:1646 */ 2358 break; 2359 2360 case 49: 2361 #line 458 "grammar.y" /* yacc.c:1646 */ 2362 { (yyval.blk).b = (yyvsp[0].blk).b; (yyval.blk).q = qerr; } 2363 #line 2364 "grammar.c" /* yacc.c:1646 */ 2364 break; 2365 2366 case 51: 2367 #line 462 "grammar.y" /* yacc.c:1646 */ 2368 { (yyval.i) = Q_DEFAULT; } 2369 #line 2370 "grammar.c" /* yacc.c:1646 */ 2370 break; 2371 2372 case 52: 2373 #line 465 "grammar.y" /* yacc.c:1646 */ 2374 { (yyval.i) = Q_SRC; } 2375 #line 2376 "grammar.c" /* yacc.c:1646 */ 2376 break; 2377 2378 case 53: 2379 #line 466 "grammar.y" /* yacc.c:1646 */ 2380 { (yyval.i) = Q_DST; } 2381 #line 2382 "grammar.c" /* yacc.c:1646 */ 2382 break; 2383 2384 case 54: 2385 #line 467 "grammar.y" /* yacc.c:1646 */ 2386 { (yyval.i) = Q_OR; } 2387 #line 2388 "grammar.c" /* yacc.c:1646 */ 2388 break; 2389 2390 case 55: 2391 #line 468 "grammar.y" /* yacc.c:1646 */ 2392 { (yyval.i) = Q_OR; } 2393 #line 2394 "grammar.c" /* yacc.c:1646 */ 2394 break; 2395 2396 case 56: 2397 #line 469 "grammar.y" /* yacc.c:1646 */ 2398 { (yyval.i) = Q_AND; } 2399 #line 2400 "grammar.c" /* yacc.c:1646 */ 2400 break; 2401 2402 case 57: 2403 #line 470 "grammar.y" /* yacc.c:1646 */ 2404 { (yyval.i) = Q_AND; } 2405 #line 2406 "grammar.c" /* yacc.c:1646 */ 2406 break; 2407 2408 case 58: 2409 #line 471 "grammar.y" /* yacc.c:1646 */ 2410 { (yyval.i) = Q_ADDR1; } 2411 #line 2412 "grammar.c" /* yacc.c:1646 */ 2412 break; 2413 2414 case 59: 2415 #line 472 "grammar.y" /* yacc.c:1646 */ 2416 { (yyval.i) = Q_ADDR2; } 2417 #line 2418 "grammar.c" /* yacc.c:1646 */ 2418 break; 2419 2420 case 60: 2421 #line 473 "grammar.y" /* yacc.c:1646 */ 2422 { (yyval.i) = Q_ADDR3; } 2423 #line 2424 "grammar.c" /* yacc.c:1646 */ 2424 break; 2425 2426 case 61: 2427 #line 474 "grammar.y" /* yacc.c:1646 */ 2428 { (yyval.i) = Q_ADDR4; } 2429 #line 2430 "grammar.c" /* yacc.c:1646 */ 2430 break; 2431 2432 case 62: 2433 #line 475 "grammar.y" /* yacc.c:1646 */ 2434 { (yyval.i) = Q_RA; } 2435 #line 2436 "grammar.c" /* yacc.c:1646 */ 2436 break; 2437 2438 case 63: 2439 #line 476 "grammar.y" /* yacc.c:1646 */ 2440 { (yyval.i) = Q_TA; } 2441 #line 2442 "grammar.c" /* yacc.c:1646 */ 2442 break; 2443 2444 case 64: 2445 #line 479 "grammar.y" /* yacc.c:1646 */ 2446 { (yyval.i) = Q_HOST; } 2447 #line 2448 "grammar.c" /* yacc.c:1646 */ 2448 break; 2449 2450 case 65: 2451 #line 480 "grammar.y" /* yacc.c:1646 */ 2452 { (yyval.i) = Q_NET; } 2453 #line 2454 "grammar.c" /* yacc.c:1646 */ 2454 break; 2455 2456 case 66: 2457 #line 481 "grammar.y" /* yacc.c:1646 */ 2458 { (yyval.i) = Q_PORT; } 2459 #line 2460 "grammar.c" /* yacc.c:1646 */ 2460 break; 2461 2462 case 67: 2463 #line 482 "grammar.y" /* yacc.c:1646 */ 2464 { (yyval.i) = Q_PORTRANGE; } 2465 #line 2466 "grammar.c" /* yacc.c:1646 */ 2466 break; 2467 2468 case 68: 2469 #line 485 "grammar.y" /* yacc.c:1646 */ 2470 { (yyval.i) = Q_GATEWAY; } 2471 #line 2472 "grammar.c" /* yacc.c:1646 */ 2472 break; 2473 2474 case 69: 2475 #line 487 "grammar.y" /* yacc.c:1646 */ 2476 { (yyval.i) = Q_LINK; } 2477 #line 2478 "grammar.c" /* yacc.c:1646 */ 2478 break; 2479 2480 case 70: 2481 #line 488 "grammar.y" /* yacc.c:1646 */ 2482 { (yyval.i) = Q_IP; } 2483 #line 2484 "grammar.c" /* yacc.c:1646 */ 2484 break; 2485 2486 case 71: 2487 #line 489 "grammar.y" /* yacc.c:1646 */ 2488 { (yyval.i) = Q_ARP; } 2489 #line 2490 "grammar.c" /* yacc.c:1646 */ 2490 break; 2491 2492 case 72: 2493 #line 490 "grammar.y" /* yacc.c:1646 */ 2494 { (yyval.i) = Q_RARP; } 2495 #line 2496 "grammar.c" /* yacc.c:1646 */ 2496 break; 2497 2498 case 73: 2499 #line 491 "grammar.y" /* yacc.c:1646 */ 2500 { (yyval.i) = Q_SCTP; } 2501 #line 2502 "grammar.c" /* yacc.c:1646 */ 2502 break; 2503 2504 case 74: 2505 #line 492 "grammar.y" /* yacc.c:1646 */ 2506 { (yyval.i) = Q_TCP; } 2507 #line 2508 "grammar.c" /* yacc.c:1646 */ 2508 break; 2509 2510 case 75: 2511 #line 493 "grammar.y" /* yacc.c:1646 */ 2512 { (yyval.i) = Q_UDP; } 2513 #line 2514 "grammar.c" /* yacc.c:1646 */ 2514 break; 2515 2516 case 76: 2517 #line 494 "grammar.y" /* yacc.c:1646 */ 2518 { (yyval.i) = Q_ICMP; } 2519 #line 2520 "grammar.c" /* yacc.c:1646 */ 2520 break; 2521 2522 case 77: 2523 #line 495 "grammar.y" /* yacc.c:1646 */ 2524 { (yyval.i) = Q_IGMP; } 2525 #line 2526 "grammar.c" /* yacc.c:1646 */ 2526 break; 2527 2528 case 78: 2529 #line 496 "grammar.y" /* yacc.c:1646 */ 2530 { (yyval.i) = Q_IGRP; } 2531 #line 2532 "grammar.c" /* yacc.c:1646 */ 2532 break; 2533 2534 case 79: 2535 #line 497 "grammar.y" /* yacc.c:1646 */ 2536 { (yyval.i) = Q_PIM; } 2537 #line 2538 "grammar.c" /* yacc.c:1646 */ 2538 break; 2539 2540 case 80: 2541 #line 498 "grammar.y" /* yacc.c:1646 */ 2542 { (yyval.i) = Q_VRRP; } 2543 #line 2544 "grammar.c" /* yacc.c:1646 */ 2544 break; 2545 2546 case 81: 2547 #line 499 "grammar.y" /* yacc.c:1646 */ 2548 { (yyval.i) = Q_CARP; } 2549 #line 2550 "grammar.c" /* yacc.c:1646 */ 2550 break; 2551 2552 case 82: 2553 #line 500 "grammar.y" /* yacc.c:1646 */ 2554 { (yyval.i) = Q_ATALK; } 2555 #line 2556 "grammar.c" /* yacc.c:1646 */ 2556 break; 2557 2558 case 83: 2559 #line 501 "grammar.y" /* yacc.c:1646 */ 2560 { (yyval.i) = Q_AARP; } 2561 #line 2562 "grammar.c" /* yacc.c:1646 */ 2562 break; 2563 2564 case 84: 2565 #line 502 "grammar.y" /* yacc.c:1646 */ 2566 { (yyval.i) = Q_DECNET; } 2567 #line 2568 "grammar.c" /* yacc.c:1646 */ 2568 break; 2569 2570 case 85: 2571 #line 503 "grammar.y" /* yacc.c:1646 */ 2572 { (yyval.i) = Q_LAT; } 2573 #line 2574 "grammar.c" /* yacc.c:1646 */ 2574 break; 2575 2576 case 86: 2577 #line 504 "grammar.y" /* yacc.c:1646 */ 2578 { (yyval.i) = Q_SCA; } 2579 #line 2580 "grammar.c" /* yacc.c:1646 */ 2580 break; 2581 2582 case 87: 2583 #line 505 "grammar.y" /* yacc.c:1646 */ 2584 { (yyval.i) = Q_MOPDL; } 2585 #line 2586 "grammar.c" /* yacc.c:1646 */ 2586 break; 2587 2588 case 88: 2589 #line 506 "grammar.y" /* yacc.c:1646 */ 2590 { (yyval.i) = Q_MOPRC; } 2591 #line 2592 "grammar.c" /* yacc.c:1646 */ 2592 break; 2593 2594 case 89: 2595 #line 507 "grammar.y" /* yacc.c:1646 */ 2596 { (yyval.i) = Q_IPV6; } 2597 #line 2598 "grammar.c" /* yacc.c:1646 */ 2598 break; 2599 2600 case 90: 2601 #line 508 "grammar.y" /* yacc.c:1646 */ 2602 { (yyval.i) = Q_ICMPV6; } 2603 #line 2604 "grammar.c" /* yacc.c:1646 */ 2604 break; 2605 2606 case 91: 2607 #line 509 "grammar.y" /* yacc.c:1646 */ 2608 { (yyval.i) = Q_AH; } 2609 #line 2610 "grammar.c" /* yacc.c:1646 */ 2610 break; 2611 2612 case 92: 2613 #line 510 "grammar.y" /* yacc.c:1646 */ 2614 { (yyval.i) = Q_ESP; } 2615 #line 2616 "grammar.c" /* yacc.c:1646 */ 2616 break; 2617 2618 case 93: 2619 #line 511 "grammar.y" /* yacc.c:1646 */ 2620 { (yyval.i) = Q_ISO; } 2621 #line 2622 "grammar.c" /* yacc.c:1646 */ 2622 break; 2623 2624 case 94: 2625 #line 512 "grammar.y" /* yacc.c:1646 */ 2626 { (yyval.i) = Q_ESIS; } 2627 #line 2628 "grammar.c" /* yacc.c:1646 */ 2628 break; 2629 2630 case 95: 2631 #line 513 "grammar.y" /* yacc.c:1646 */ 2632 { (yyval.i) = Q_ISIS; } 2633 #line 2634 "grammar.c" /* yacc.c:1646 */ 2634 break; 2635 2636 case 96: 2637 #line 514 "grammar.y" /* yacc.c:1646 */ 2638 { (yyval.i) = Q_ISIS_L1; } 2639 #line 2640 "grammar.c" /* yacc.c:1646 */ 2640 break; 2641 2642 case 97: 2643 #line 515 "grammar.y" /* yacc.c:1646 */ 2644 { (yyval.i) = Q_ISIS_L2; } 2645 #line 2646 "grammar.c" /* yacc.c:1646 */ 2646 break; 2647 2648 case 98: 2649 #line 516 "grammar.y" /* yacc.c:1646 */ 2650 { (yyval.i) = Q_ISIS_IIH; } 2651 #line 2652 "grammar.c" /* yacc.c:1646 */ 2652 break; 2653 2654 case 99: 2655 #line 517 "grammar.y" /* yacc.c:1646 */ 2656 { (yyval.i) = Q_ISIS_LSP; } 2657 #line 2658 "grammar.c" /* yacc.c:1646 */ 2658 break; 2659 2660 case 100: 2661 #line 518 "grammar.y" /* yacc.c:1646 */ 2662 { (yyval.i) = Q_ISIS_SNP; } 2663 #line 2664 "grammar.c" /* yacc.c:1646 */ 2664 break; 2665 2666 case 101: 2667 #line 519 "grammar.y" /* yacc.c:1646 */ 2668 { (yyval.i) = Q_ISIS_PSNP; } 2669 #line 2670 "grammar.c" /* yacc.c:1646 */ 2670 break; 2671 2672 case 102: 2673 #line 520 "grammar.y" /* yacc.c:1646 */ 2674 { (yyval.i) = Q_ISIS_CSNP; } 2675 #line 2676 "grammar.c" /* yacc.c:1646 */ 2676 break; 2677 2678 case 103: 2679 #line 521 "grammar.y" /* yacc.c:1646 */ 2680 { (yyval.i) = Q_CLNP; } 2681 #line 2682 "grammar.c" /* yacc.c:1646 */ 2682 break; 2683 2684 case 104: 2685 #line 522 "grammar.y" /* yacc.c:1646 */ 2686 { (yyval.i) = Q_STP; } 2687 #line 2688 "grammar.c" /* yacc.c:1646 */ 2688 break; 2689 2690 case 105: 2691 #line 523 "grammar.y" /* yacc.c:1646 */ 2692 { (yyval.i) = Q_IPX; } 2693 #line 2694 "grammar.c" /* yacc.c:1646 */ 2694 break; 2695 2696 case 106: 2697 #line 524 "grammar.y" /* yacc.c:1646 */ 2698 { (yyval.i) = Q_NETBEUI; } 2699 #line 2700 "grammar.c" /* yacc.c:1646 */ 2700 break; 2701 2702 case 107: 2703 #line 525 "grammar.y" /* yacc.c:1646 */ 2704 { (yyval.i) = Q_RADIO; } 2705 #line 2706 "grammar.c" /* yacc.c:1646 */ 2706 break; 2707 2708 case 108: 2709 #line 527 "grammar.y" /* yacc.c:1646 */ 2710 { (yyval.rblk) = gen_broadcast(cstate, (yyvsp[-1].i)); } 2711 #line 2712 "grammar.c" /* yacc.c:1646 */ 2712 break; 2713 2714 case 109: 2715 #line 528 "grammar.y" /* yacc.c:1646 */ 2716 { (yyval.rblk) = gen_multicast(cstate, (yyvsp[-1].i)); } 2717 #line 2718 "grammar.c" /* yacc.c:1646 */ 2718 break; 2719 2720 case 110: 2721 #line 529 "grammar.y" /* yacc.c:1646 */ 2722 { (yyval.rblk) = gen_less(cstate, (yyvsp[0].i)); } 2723 #line 2724 "grammar.c" /* yacc.c:1646 */ 2724 break; 2725 2726 case 111: 2727 #line 530 "grammar.y" /* yacc.c:1646 */ 2728 { (yyval.rblk) = gen_greater(cstate, (yyvsp[0].i)); } 2729 #line 2730 "grammar.c" /* yacc.c:1646 */ 2730 break; 2731 2732 case 112: 2733 #line 531 "grammar.y" /* yacc.c:1646 */ 2734 { (yyval.rblk) = gen_byteop(cstate, (yyvsp[-1].i), (yyvsp[-2].i), (yyvsp[0].i)); } 2735 #line 2736 "grammar.c" /* yacc.c:1646 */ 2736 break; 2737 2738 case 113: 2739 #line 532 "grammar.y" /* yacc.c:1646 */ 2740 { (yyval.rblk) = gen_inbound(cstate, 0); } 2741 #line 2742 "grammar.c" /* yacc.c:1646 */ 2742 break; 2743 2744 case 114: 2745 #line 533 "grammar.y" /* yacc.c:1646 */ 2746 { (yyval.rblk) = gen_inbound(cstate, 1); } 2747 #line 2748 "grammar.c" /* yacc.c:1646 */ 2748 break; 2749 2750 case 115: 2751 #line 534 "grammar.y" /* yacc.c:1646 */ 2752 { (yyval.rblk) = gen_vlan(cstate, (yyvsp[0].i)); } 2753 #line 2754 "grammar.c" /* yacc.c:1646 */ 2754 break; 2755 2756 case 116: 2757 #line 535 "grammar.y" /* yacc.c:1646 */ 2758 { (yyval.rblk) = gen_vlan(cstate, -1); } 2759 #line 2760 "grammar.c" /* yacc.c:1646 */ 2760 break; 2761 2762 case 117: 2763 #line 536 "grammar.y" /* yacc.c:1646 */ 2764 { (yyval.rblk) = gen_mpls(cstate, (yyvsp[0].i)); } 2765 #line 2766 "grammar.c" /* yacc.c:1646 */ 2766 break; 2767 2768 case 118: 2769 #line 537 "grammar.y" /* yacc.c:1646 */ 2770 { (yyval.rblk) = gen_mpls(cstate, -1); } 2771 #line 2772 "grammar.c" /* yacc.c:1646 */ 2772 break; 2773 2774 case 119: 2775 #line 538 "grammar.y" /* yacc.c:1646 */ 2776 { (yyval.rblk) = gen_pppoed(cstate); } 2777 #line 2778 "grammar.c" /* yacc.c:1646 */ 2778 break; 2779 2780 case 120: 2781 #line 539 "grammar.y" /* yacc.c:1646 */ 2782 { (yyval.rblk) = gen_pppoes(cstate, (yyvsp[0].i)); } 2783 #line 2784 "grammar.c" /* yacc.c:1646 */ 2784 break; 2785 2786 case 121: 2787 #line 540 "grammar.y" /* yacc.c:1646 */ 2788 { (yyval.rblk) = gen_pppoes(cstate, -1); } 2789 #line 2790 "grammar.c" /* yacc.c:1646 */ 2790 break; 2791 2792 case 122: 2793 #line 541 "grammar.y" /* yacc.c:1646 */ 2794 { (yyval.rblk) = gen_geneve(cstate, (yyvsp[0].i)); } 2795 #line 2796 "grammar.c" /* yacc.c:1646 */ 2796 break; 2797 2798 case 123: 2799 #line 542 "grammar.y" /* yacc.c:1646 */ 2800 { (yyval.rblk) = gen_geneve(cstate, -1); } 2801 #line 2802 "grammar.c" /* yacc.c:1646 */ 2802 break; 2803 2804 case 124: 2805 #line 543 "grammar.y" /* yacc.c:1646 */ 2806 { (yyval.rblk) = (yyvsp[0].rblk); } 2807 #line 2808 "grammar.c" /* yacc.c:1646 */ 2808 break; 2809 2810 case 125: 2811 #line 544 "grammar.y" /* yacc.c:1646 */ 2812 { (yyval.rblk) = (yyvsp[0].rblk); } 2813 #line 2814 "grammar.c" /* yacc.c:1646 */ 2814 break; 2815 2816 case 126: 2817 #line 545 "grammar.y" /* yacc.c:1646 */ 2818 { (yyval.rblk) = (yyvsp[0].rblk); } 2819 #line 2820 "grammar.c" /* yacc.c:1646 */ 2820 break; 2821 2822 case 127: 2823 #line 548 "grammar.y" /* yacc.c:1646 */ 2824 { (yyval.rblk) = gen_pf_ifname(cstate, (yyvsp[0].s)); } 2825 #line 2826 "grammar.c" /* yacc.c:1646 */ 2826 break; 2827 2828 case 128: 2829 #line 549 "grammar.y" /* yacc.c:1646 */ 2830 { (yyval.rblk) = gen_pf_ruleset(cstate, (yyvsp[0].s)); } 2831 #line 2832 "grammar.c" /* yacc.c:1646 */ 2832 break; 2833 2834 case 129: 2835 #line 550 "grammar.y" /* yacc.c:1646 */ 2836 { (yyval.rblk) = gen_pf_rnr(cstate, (yyvsp[0].i)); } 2837 #line 2838 "grammar.c" /* yacc.c:1646 */ 2838 break; 2839 2840 case 130: 2841 #line 551 "grammar.y" /* yacc.c:1646 */ 2842 { (yyval.rblk) = gen_pf_srnr(cstate, (yyvsp[0].i)); } 2843 #line 2844 "grammar.c" /* yacc.c:1646 */ 2844 break; 2845 2846 case 131: 2847 #line 552 "grammar.y" /* yacc.c:1646 */ 2848 { (yyval.rblk) = gen_pf_reason(cstate, (yyvsp[0].i)); } 2849 #line 2850 "grammar.c" /* yacc.c:1646 */ 2850 break; 2851 2852 case 132: 2853 #line 553 "grammar.y" /* yacc.c:1646 */ 2854 { (yyval.rblk) = gen_pf_action(cstate, (yyvsp[0].i)); } 2855 #line 2856 "grammar.c" /* yacc.c:1646 */ 2856 break; 2857 2858 case 133: 2859 #line 557 "grammar.y" /* yacc.c:1646 */ 2860 { (yyval.rblk) = gen_p80211_type(cstate, (yyvsp[-2].i) | (yyvsp[0].i), 2861 IEEE80211_FC0_TYPE_MASK | 2862 IEEE80211_FC0_SUBTYPE_MASK); 2863 } 2864 #line 2865 "grammar.c" /* yacc.c:1646 */ 2865 break; 2866 2867 case 134: 2868 #line 561 "grammar.y" /* yacc.c:1646 */ 2869 { (yyval.rblk) = gen_p80211_type(cstate, (yyvsp[0].i), 2870 IEEE80211_FC0_TYPE_MASK); 2871 } 2872 #line 2873 "grammar.c" /* yacc.c:1646 */ 2873 break; 2874 2875 case 135: 2876 #line 564 "grammar.y" /* yacc.c:1646 */ 2877 { (yyval.rblk) = gen_p80211_type(cstate, (yyvsp[0].i), 2878 IEEE80211_FC0_TYPE_MASK | 2879 IEEE80211_FC0_SUBTYPE_MASK); 2880 } 2881 #line 2882 "grammar.c" /* yacc.c:1646 */ 2882 break; 2883 2884 case 136: 2885 #line 568 "grammar.y" /* yacc.c:1646 */ 2886 { (yyval.rblk) = gen_p80211_fcdir(cstate, (yyvsp[0].i)); } 2887 #line 2888 "grammar.c" /* yacc.c:1646 */ 2888 break; 2889 2890 case 138: 2891 #line 572 "grammar.y" /* yacc.c:1646 */ 2892 { (yyval.i) = str2tok((yyvsp[0].s), ieee80211_types); 2893 if ((yyval.i) == -1) 2894 bpf_error(cstate, "unknown 802.11 type name"); 2895 } 2896 #line 2897 "grammar.c" /* yacc.c:1646 */ 2897 break; 2898 2899 case 140: 2900 #line 579 "grammar.y" /* yacc.c:1646 */ 2901 { const struct tok *types = NULL; 2902 int i; 2903 for (i = 0;; i++) { 2904 if (ieee80211_type_subtypes[i].tok == NULL) { 2905 /* Ran out of types */ 2906 bpf_error(cstate, "unknown 802.11 type"); 2907 break; 2908 } 2909 if ((yyvsp[(-1) - (1)].i) == ieee80211_type_subtypes[i].type) { 2910 types = ieee80211_type_subtypes[i].tok; 2911 break; 2912 } 2913 } 2914 2915 (yyval.i) = str2tok((yyvsp[0].s), types); 2916 if ((yyval.i) == -1) 2917 bpf_error(cstate, "unknown 802.11 subtype name"); 2918 } 2919 #line 2920 "grammar.c" /* yacc.c:1646 */ 2920 break; 2921 2922 case 141: 2923 #line 599 "grammar.y" /* yacc.c:1646 */ 2924 { int i; 2925 for (i = 0;; i++) { 2926 if (ieee80211_type_subtypes[i].tok == NULL) { 2927 /* Ran out of types */ 2928 bpf_error(cstate, "unknown 802.11 type name"); 2929 break; 2930 } 2931 (yyval.i) = str2tok((yyvsp[0].s), ieee80211_type_subtypes[i].tok); 2932 if ((yyval.i) != -1) { 2933 (yyval.i) |= ieee80211_type_subtypes[i].type; 2934 break; 2935 } 2936 } 2937 } 2938 #line 2939 "grammar.c" /* yacc.c:1646 */ 2939 break; 2940 2941 case 142: 2942 #line 615 "grammar.y" /* yacc.c:1646 */ 2943 { (yyval.rblk) = gen_llc(cstate); } 2944 #line 2945 "grammar.c" /* yacc.c:1646 */ 2945 break; 2946 2947 case 143: 2948 #line 616 "grammar.y" /* yacc.c:1646 */ 2949 { if (pcap_strcasecmp((yyvsp[0].s), "i") == 0) 2950 (yyval.rblk) = gen_llc_i(cstate); 2951 else if (pcap_strcasecmp((yyvsp[0].s), "s") == 0) 2952 (yyval.rblk) = gen_llc_s(cstate); 2953 else if (pcap_strcasecmp((yyvsp[0].s), "u") == 0) 2954 (yyval.rblk) = gen_llc_u(cstate); 2955 else { 2956 int subtype; 2957 2958 subtype = str2tok((yyvsp[0].s), llc_s_subtypes); 2959 if (subtype != -1) 2960 (yyval.rblk) = gen_llc_s_subtype(cstate, subtype); 2961 else { 2962 subtype = str2tok((yyvsp[0].s), llc_u_subtypes); 2963 if (subtype == -1) 2964 bpf_error(cstate, "unknown LLC type name \"%s\"", (yyvsp[0].s)); 2965 (yyval.rblk) = gen_llc_u_subtype(cstate, subtype); 2966 } 2967 } 2968 } 2969 #line 2970 "grammar.c" /* yacc.c:1646 */ 2970 break; 2971 2972 case 144: 2973 #line 637 "grammar.y" /* yacc.c:1646 */ 2974 { (yyval.rblk) = gen_llc_s_subtype(cstate, LLC_RNR); } 2975 #line 2976 "grammar.c" /* yacc.c:1646 */ 2976 break; 2977 2978 case 146: 2979 #line 641 "grammar.y" /* yacc.c:1646 */ 2980 { if (pcap_strcasecmp((yyvsp[0].s), "nods") == 0) 2981 (yyval.i) = IEEE80211_FC1_DIR_NODS; 2982 else if (pcap_strcasecmp((yyvsp[0].s), "tods") == 0) 2983 (yyval.i) = IEEE80211_FC1_DIR_TODS; 2984 else if (pcap_strcasecmp((yyvsp[0].s), "fromds") == 0) 2985 (yyval.i) = IEEE80211_FC1_DIR_FROMDS; 2986 else if (pcap_strcasecmp((yyvsp[0].s), "dstods") == 0) 2987 (yyval.i) = IEEE80211_FC1_DIR_DSTODS; 2988 else 2989 bpf_error(cstate, "unknown 802.11 direction"); 2990 } 2991 #line 2992 "grammar.c" /* yacc.c:1646 */ 2992 break; 2993 2994 case 147: 2995 #line 654 "grammar.y" /* yacc.c:1646 */ 2996 { (yyval.i) = (yyvsp[0].i); } 2997 #line 2998 "grammar.c" /* yacc.c:1646 */ 2998 break; 2999 3000 case 148: 3001 #line 655 "grammar.y" /* yacc.c:1646 */ 3002 { (yyval.i) = pfreason_to_num(cstate, (yyvsp[0].s)); } 3003 #line 3004 "grammar.c" /* yacc.c:1646 */ 3004 break; 3005 3006 case 149: 3007 #line 658 "grammar.y" /* yacc.c:1646 */ 3008 { (yyval.i) = pfaction_to_num(cstate, (yyvsp[0].s)); } 3009 #line 3010 "grammar.c" /* yacc.c:1646 */ 3010 break; 3011 3012 case 150: 3013 #line 661 "grammar.y" /* yacc.c:1646 */ 3014 { (yyval.i) = BPF_JGT; } 3015 #line 3016 "grammar.c" /* yacc.c:1646 */ 3016 break; 3017 3018 case 151: 3019 #line 662 "grammar.y" /* yacc.c:1646 */ 3020 { (yyval.i) = BPF_JGE; } 3021 #line 3022 "grammar.c" /* yacc.c:1646 */ 3022 break; 3023 3024 case 152: 3025 #line 663 "grammar.y" /* yacc.c:1646 */ 3026 { (yyval.i) = BPF_JEQ; } 3027 #line 3028 "grammar.c" /* yacc.c:1646 */ 3028 break; 3029 3030 case 153: 3031 #line 665 "grammar.y" /* yacc.c:1646 */ 3032 { (yyval.i) = BPF_JGT; } 3033 #line 3034 "grammar.c" /* yacc.c:1646 */ 3034 break; 3035 3036 case 154: 3037 #line 666 "grammar.y" /* yacc.c:1646 */ 3038 { (yyval.i) = BPF_JGE; } 3039 #line 3040 "grammar.c" /* yacc.c:1646 */ 3040 break; 3041 3042 case 155: 3043 #line 667 "grammar.y" /* yacc.c:1646 */ 3044 { (yyval.i) = BPF_JEQ; } 3045 #line 3046 "grammar.c" /* yacc.c:1646 */ 3046 break; 3047 3048 case 156: 3049 #line 669 "grammar.y" /* yacc.c:1646 */ 3050 { (yyval.a) = gen_loadi(cstate, (yyvsp[0].i)); } 3051 #line 3052 "grammar.c" /* yacc.c:1646 */ 3052 break; 3053 3054 case 158: 3055 #line 672 "grammar.y" /* yacc.c:1646 */ 3056 { (yyval.a) = gen_load(cstate, (yyvsp[-3].i), (yyvsp[-1].a), 1); } 3057 #line 3058 "grammar.c" /* yacc.c:1646 */ 3058 break; 3059 3060 case 159: 3061 #line 673 "grammar.y" /* yacc.c:1646 */ 3062 { (yyval.a) = gen_load(cstate, (yyvsp[-5].i), (yyvsp[-3].a), (yyvsp[-1].i)); } 3063 #line 3064 "grammar.c" /* yacc.c:1646 */ 3064 break; 3065 3066 case 160: 3067 #line 674 "grammar.y" /* yacc.c:1646 */ 3068 { (yyval.a) = gen_arth(cstate, BPF_ADD, (yyvsp[-2].a), (yyvsp[0].a)); } 3069 #line 3070 "grammar.c" /* yacc.c:1646 */ 3070 break; 3071 3072 case 161: 3073 #line 675 "grammar.y" /* yacc.c:1646 */ 3074 { (yyval.a) = gen_arth(cstate, BPF_SUB, (yyvsp[-2].a), (yyvsp[0].a)); } 3075 #line 3076 "grammar.c" /* yacc.c:1646 */ 3076 break; 3077 3078 case 162: 3079 #line 676 "grammar.y" /* yacc.c:1646 */ 3080 { (yyval.a) = gen_arth(cstate, BPF_MUL, (yyvsp[-2].a), (yyvsp[0].a)); } 3081 #line 3082 "grammar.c" /* yacc.c:1646 */ 3082 break; 3083 3084 case 163: 3085 #line 677 "grammar.y" /* yacc.c:1646 */ 3086 { (yyval.a) = gen_arth(cstate, BPF_DIV, (yyvsp[-2].a), (yyvsp[0].a)); } 3087 #line 3088 "grammar.c" /* yacc.c:1646 */ 3088 break; 3089 3090 case 164: 3091 #line 678 "grammar.y" /* yacc.c:1646 */ 3092 { (yyval.a) = gen_arth(cstate, BPF_MOD, (yyvsp[-2].a), (yyvsp[0].a)); } 3093 #line 3094 "grammar.c" /* yacc.c:1646 */ 3094 break; 3095 3096 case 165: 3097 #line 679 "grammar.y" /* yacc.c:1646 */ 3098 { (yyval.a) = gen_arth(cstate, BPF_AND, (yyvsp[-2].a), (yyvsp[0].a)); } 3099 #line 3100 "grammar.c" /* yacc.c:1646 */ 3100 break; 3101 3102 case 166: 3103 #line 680 "grammar.y" /* yacc.c:1646 */ 3104 { (yyval.a) = gen_arth(cstate, BPF_OR, (yyvsp[-2].a), (yyvsp[0].a)); } 3105 #line 3106 "grammar.c" /* yacc.c:1646 */ 3106 break; 3107 3108 case 167: 3109 #line 681 "grammar.y" /* yacc.c:1646 */ 3110 { (yyval.a) = gen_arth(cstate, BPF_XOR, (yyvsp[-2].a), (yyvsp[0].a)); } 3111 #line 3112 "grammar.c" /* yacc.c:1646 */ 3112 break; 3113 3114 case 168: 3115 #line 682 "grammar.y" /* yacc.c:1646 */ 3116 { (yyval.a) = gen_arth(cstate, BPF_LSH, (yyvsp[-2].a), (yyvsp[0].a)); } 3117 #line 3118 "grammar.c" /* yacc.c:1646 */ 3118 break; 3119 3120 case 169: 3121 #line 683 "grammar.y" /* yacc.c:1646 */ 3122 { (yyval.a) = gen_arth(cstate, BPF_RSH, (yyvsp[-2].a), (yyvsp[0].a)); } 3123 #line 3124 "grammar.c" /* yacc.c:1646 */ 3124 break; 3125 3126 case 170: 3127 #line 684 "grammar.y" /* yacc.c:1646 */ 3128 { (yyval.a) = gen_neg(cstate, (yyvsp[0].a)); } 3129 #line 3130 "grammar.c" /* yacc.c:1646 */ 3130 break; 3131 3132 case 171: 3133 #line 685 "grammar.y" /* yacc.c:1646 */ 3134 { (yyval.a) = (yyvsp[-1].a); } 3135 #line 3136 "grammar.c" /* yacc.c:1646 */ 3136 break; 3137 3138 case 172: 3139 #line 686 "grammar.y" /* yacc.c:1646 */ 3140 { (yyval.a) = gen_loadlen(cstate); } 3141 #line 3142 "grammar.c" /* yacc.c:1646 */ 3142 break; 3143 3144 case 173: 3145 #line 688 "grammar.y" /* yacc.c:1646 */ 3146 { (yyval.i) = '&'; } 3147 #line 3148 "grammar.c" /* yacc.c:1646 */ 3148 break; 3149 3150 case 174: 3151 #line 689 "grammar.y" /* yacc.c:1646 */ 3152 { (yyval.i) = '|'; } 3153 #line 3154 "grammar.c" /* yacc.c:1646 */ 3154 break; 3155 3156 case 175: 3157 #line 690 "grammar.y" /* yacc.c:1646 */ 3158 { (yyval.i) = '<'; } 3159 #line 3160 "grammar.c" /* yacc.c:1646 */ 3160 break; 3161 3162 case 176: 3163 #line 691 "grammar.y" /* yacc.c:1646 */ 3164 { (yyval.i) = '>'; } 3165 #line 3166 "grammar.c" /* yacc.c:1646 */ 3166 break; 3167 3168 case 177: 3169 #line 692 "grammar.y" /* yacc.c:1646 */ 3170 { (yyval.i) = '='; } 3171 #line 3172 "grammar.c" /* yacc.c:1646 */ 3172 break; 3173 3174 case 179: 3175 #line 695 "grammar.y" /* yacc.c:1646 */ 3176 { (yyval.i) = (yyvsp[-1].i); } 3177 #line 3178 "grammar.c" /* yacc.c:1646 */ 3178 break; 3179 3180 case 180: 3181 #line 697 "grammar.y" /* yacc.c:1646 */ 3182 { (yyval.i) = A_LANE; } 3183 #line 3184 "grammar.c" /* yacc.c:1646 */ 3184 break; 3185 3186 case 181: 3187 #line 698 "grammar.y" /* yacc.c:1646 */ 3188 { (yyval.i) = A_METAC; } 3189 #line 3190 "grammar.c" /* yacc.c:1646 */ 3190 break; 3191 3192 case 182: 3193 #line 699 "grammar.y" /* yacc.c:1646 */ 3194 { (yyval.i) = A_BCC; } 3195 #line 3196 "grammar.c" /* yacc.c:1646 */ 3196 break; 3197 3198 case 183: 3199 #line 700 "grammar.y" /* yacc.c:1646 */ 3200 { (yyval.i) = A_OAMF4EC; } 3201 #line 3202 "grammar.c" /* yacc.c:1646 */ 3202 break; 3203 3204 case 184: 3205 #line 701 "grammar.y" /* yacc.c:1646 */ 3206 { (yyval.i) = A_OAMF4SC; } 3207 #line 3208 "grammar.c" /* yacc.c:1646 */ 3208 break; 3209 3210 case 185: 3211 #line 702 "grammar.y" /* yacc.c:1646 */ 3212 { (yyval.i) = A_SC; } 3213 #line 3214 "grammar.c" /* yacc.c:1646 */ 3214 break; 3215 3216 case 186: 3217 #line 703 "grammar.y" /* yacc.c:1646 */ 3218 { (yyval.i) = A_ILMIC; } 3219 #line 3220 "grammar.c" /* yacc.c:1646 */ 3220 break; 3221 3222 case 187: 3223 #line 705 "grammar.y" /* yacc.c:1646 */ 3224 { (yyval.i) = A_OAM; } 3225 #line 3226 "grammar.c" /* yacc.c:1646 */ 3226 break; 3227 3228 case 188: 3229 #line 706 "grammar.y" /* yacc.c:1646 */ 3230 { (yyval.i) = A_OAMF4; } 3231 #line 3232 "grammar.c" /* yacc.c:1646 */ 3232 break; 3233 3234 case 189: 3235 #line 707 "grammar.y" /* yacc.c:1646 */ 3236 { (yyval.i) = A_CONNECTMSG; } 3237 #line 3238 "grammar.c" /* yacc.c:1646 */ 3238 break; 3239 3240 case 190: 3241 #line 708 "grammar.y" /* yacc.c:1646 */ 3242 { (yyval.i) = A_METACONNECT; } 3243 #line 3244 "grammar.c" /* yacc.c:1646 */ 3244 break; 3245 3246 case 191: 3247 #line 711 "grammar.y" /* yacc.c:1646 */ 3248 { (yyval.blk).atmfieldtype = A_VPI; } 3249 #line 3250 "grammar.c" /* yacc.c:1646 */ 3250 break; 3251 3252 case 192: 3253 #line 712 "grammar.y" /* yacc.c:1646 */ 3254 { (yyval.blk).atmfieldtype = A_VCI; } 3255 #line 3256 "grammar.c" /* yacc.c:1646 */ 3256 break; 3257 3258 case 194: 3259 #line 715 "grammar.y" /* yacc.c:1646 */ 3260 { (yyval.blk).b = gen_atmfield_code(cstate, (yyvsp[-2].blk).atmfieldtype, (bpf_int32)(yyvsp[0].i), (bpf_u_int32)(yyvsp[-1].i), 0); } 3261 #line 3262 "grammar.c" /* yacc.c:1646 */ 3262 break; 3263 3264 case 195: 3265 #line 716 "grammar.y" /* yacc.c:1646 */ 3266 { (yyval.blk).b = gen_atmfield_code(cstate, (yyvsp[-2].blk).atmfieldtype, (bpf_int32)(yyvsp[0].i), (bpf_u_int32)(yyvsp[-1].i), 1); } 3267 #line 3268 "grammar.c" /* yacc.c:1646 */ 3268 break; 3269 3270 case 196: 3271 #line 717 "grammar.y" /* yacc.c:1646 */ 3272 { (yyval.blk).b = (yyvsp[-1].blk).b; (yyval.blk).q = qerr; } 3273 #line 3274 "grammar.c" /* yacc.c:1646 */ 3274 break; 3275 3276 case 197: 3277 #line 719 "grammar.y" /* yacc.c:1646 */ 3278 { 3279 (yyval.blk).atmfieldtype = (yyvsp[-1].blk).atmfieldtype; 3280 if ((yyval.blk).atmfieldtype == A_VPI || 3281 (yyval.blk).atmfieldtype == A_VCI) 3282 (yyval.blk).b = gen_atmfield_code(cstate, (yyval.blk).atmfieldtype, (bpf_int32) (yyvsp[0].i), BPF_JEQ, 0); 3283 } 3284 #line 3285 "grammar.c" /* yacc.c:1646 */ 3285 break; 3286 3287 case 199: 3288 #line 727 "grammar.y" /* yacc.c:1646 */ 3289 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 3290 #line 3291 "grammar.c" /* yacc.c:1646 */ 3291 break; 3292 3293 case 200: 3294 #line 730 "grammar.y" /* yacc.c:1646 */ 3295 { (yyval.i) = M_FISU; } 3296 #line 3297 "grammar.c" /* yacc.c:1646 */ 3297 break; 3298 3299 case 201: 3300 #line 731 "grammar.y" /* yacc.c:1646 */ 3301 { (yyval.i) = M_LSSU; } 3302 #line 3303 "grammar.c" /* yacc.c:1646 */ 3303 break; 3304 3305 case 202: 3306 #line 732 "grammar.y" /* yacc.c:1646 */ 3307 { (yyval.i) = M_MSU; } 3308 #line 3309 "grammar.c" /* yacc.c:1646 */ 3309 break; 3310 3311 case 203: 3312 #line 733 "grammar.y" /* yacc.c:1646 */ 3313 { (yyval.i) = MH_FISU; } 3314 #line 3315 "grammar.c" /* yacc.c:1646 */ 3315 break; 3316 3317 case 204: 3318 #line 734 "grammar.y" /* yacc.c:1646 */ 3319 { (yyval.i) = MH_LSSU; } 3320 #line 3321 "grammar.c" /* yacc.c:1646 */ 3321 break; 3322 3323 case 205: 3324 #line 735 "grammar.y" /* yacc.c:1646 */ 3325 { (yyval.i) = MH_MSU; } 3326 #line 3327 "grammar.c" /* yacc.c:1646 */ 3327 break; 3328 3329 case 206: 3330 #line 738 "grammar.y" /* yacc.c:1646 */ 3331 { (yyval.blk).mtp3fieldtype = M_SIO; } 3332 #line 3333 "grammar.c" /* yacc.c:1646 */ 3333 break; 3334 3335 case 207: 3336 #line 739 "grammar.y" /* yacc.c:1646 */ 3337 { (yyval.blk).mtp3fieldtype = M_OPC; } 3338 #line 3339 "grammar.c" /* yacc.c:1646 */ 3339 break; 3340 3341 case 208: 3342 #line 740 "grammar.y" /* yacc.c:1646 */ 3343 { (yyval.blk).mtp3fieldtype = M_DPC; } 3344 #line 3345 "grammar.c" /* yacc.c:1646 */ 3345 break; 3346 3347 case 209: 3348 #line 741 "grammar.y" /* yacc.c:1646 */ 3349 { (yyval.blk).mtp3fieldtype = M_SLS; } 3350 #line 3351 "grammar.c" /* yacc.c:1646 */ 3351 break; 3352 3353 case 210: 3354 #line 742 "grammar.y" /* yacc.c:1646 */ 3355 { (yyval.blk).mtp3fieldtype = MH_SIO; } 3356 #line 3357 "grammar.c" /* yacc.c:1646 */ 3357 break; 3358 3359 case 211: 3360 #line 743 "grammar.y" /* yacc.c:1646 */ 3361 { (yyval.blk).mtp3fieldtype = MH_OPC; } 3362 #line 3363 "grammar.c" /* yacc.c:1646 */ 3363 break; 3364 3365 case 212: 3366 #line 744 "grammar.y" /* yacc.c:1646 */ 3367 { (yyval.blk).mtp3fieldtype = MH_DPC; } 3368 #line 3369 "grammar.c" /* yacc.c:1646 */ 3369 break; 3370 3371 case 213: 3372 #line 745 "grammar.y" /* yacc.c:1646 */ 3373 { (yyval.blk).mtp3fieldtype = MH_SLS; } 3374 #line 3375 "grammar.c" /* yacc.c:1646 */ 3375 break; 3376 3377 case 215: 3378 #line 748 "grammar.y" /* yacc.c:1646 */ 3379 { (yyval.blk).b = gen_mtp3field_code(cstate, (yyvsp[-2].blk).mtp3fieldtype, (u_int)(yyvsp[0].i), (u_int)(yyvsp[-1].i), 0); } 3380 #line 3381 "grammar.c" /* yacc.c:1646 */ 3381 break; 3382 3383 case 216: 3384 #line 749 "grammar.y" /* yacc.c:1646 */ 3385 { (yyval.blk).b = gen_mtp3field_code(cstate, (yyvsp[-2].blk).mtp3fieldtype, (u_int)(yyvsp[0].i), (u_int)(yyvsp[-1].i), 1); } 3386 #line 3387 "grammar.c" /* yacc.c:1646 */ 3387 break; 3388 3389 case 217: 3390 #line 750 "grammar.y" /* yacc.c:1646 */ 3391 { (yyval.blk).b = (yyvsp[-1].blk).b; (yyval.blk).q = qerr; } 3392 #line 3393 "grammar.c" /* yacc.c:1646 */ 3393 break; 3394 3395 case 218: 3396 #line 752 "grammar.y" /* yacc.c:1646 */ 3397 { 3398 (yyval.blk).mtp3fieldtype = (yyvsp[-1].blk).mtp3fieldtype; 3399 if ((yyval.blk).mtp3fieldtype == M_SIO || 3400 (yyval.blk).mtp3fieldtype == M_OPC || 3401 (yyval.blk).mtp3fieldtype == M_DPC || 3402 (yyval.blk).mtp3fieldtype == M_SLS || 3403 (yyval.blk).mtp3fieldtype == MH_SIO || 3404 (yyval.blk).mtp3fieldtype == MH_OPC || 3405 (yyval.blk).mtp3fieldtype == MH_DPC || 3406 (yyval.blk).mtp3fieldtype == MH_SLS) 3407 (yyval.blk).b = gen_mtp3field_code(cstate, (yyval.blk).mtp3fieldtype, (u_int) (yyvsp[0].i), BPF_JEQ, 0); 3408 } 3409 #line 3410 "grammar.c" /* yacc.c:1646 */ 3410 break; 3411 3412 case 220: 3413 #line 766 "grammar.y" /* yacc.c:1646 */ 3414 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 3415 #line 3416 "grammar.c" /* yacc.c:1646 */ 3416 break; 3417 3418 3419 #line 3420 "grammar.c" /* yacc.c:1646 */ 3420 default: break; 3421 } 3422 /* User semantic actions sometimes alter yychar, and that requires 3423 that yytoken be updated with the new translation. We take the 3424 approach of translating immediately before every use of yytoken. 3425 One alternative is translating here after every semantic action, 3426 but that translation would be missed if the semantic action invokes 3427 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 3428 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 3429 incorrect destructor might then be invoked immediately. In the 3430 case of YYERROR or YYBACKUP, subsequent parser actions might lead 3431 to an incorrect destructor call or verbose syntax error message 3432 before the lookahead is translated. */ 3433 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 3434 3435 YYPOPSTACK (yylen); 3436 yylen = 0; 3437 YY_STACK_PRINT (yyss, yyssp); 3438 3439 *++yyvsp = yyval; 3440 3441 /* Now 'shift' the result of the reduction. Determine what state 3442 that goes to, based on the state we popped back to and the rule 3443 number reduced by. */ 3444 3445 yyn = yyr1[yyn]; 3446 3447 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 3448 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 3449 yystate = yytable[yystate]; 3450 else 3451 yystate = yydefgoto[yyn - YYNTOKENS]; 3452 3453 goto yynewstate; 3454 3455 3456 /*--------------------------------------. 3457 | yyerrlab -- here on detecting error. | 3458 `--------------------------------------*/ 3459 yyerrlab: 3460 /* Make sure we have latest lookahead translation. See comments at 3461 user semantic actions for why this is necessary. */ 3462 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 3463 3464 /* If not already recovering from an error, report this error. */ 3465 if (!yyerrstatus) 3466 { 3467 ++yynerrs; 3468 #if ! YYERROR_VERBOSE 3469 yyerror (yyscanner, cstate, YY_("syntax error")); 3470 #else 3471 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 3472 yyssp, yytoken) 3473 { 3474 char const *yymsgp = YY_("syntax error"); 3475 int yysyntax_error_status; 3476 yysyntax_error_status = YYSYNTAX_ERROR; 3477 if (yysyntax_error_status == 0) 3478 yymsgp = yymsg; 3479 else if (yysyntax_error_status == 1) 3480 { 3481 if (yymsg != yymsgbuf) 3482 YYSTACK_FREE (yymsg); 3483 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 3484 if (!yymsg) 3485 { 3486 yymsg = yymsgbuf; 3487 yymsg_alloc = sizeof yymsgbuf; 3488 yysyntax_error_status = 2; 3489 } 3490 else 3491 { 3492 yysyntax_error_status = YYSYNTAX_ERROR; 3493 yymsgp = yymsg; 3494 } 3495 } 3496 yyerror (yyscanner, cstate, yymsgp); 3497 if (yysyntax_error_status == 2) 3498 goto yyexhaustedlab; 3499 } 3500 # undef YYSYNTAX_ERROR 3501 #endif 3502 } 3503 3504 3505 3506 if (yyerrstatus == 3) 3507 { 3508 /* If just tried and failed to reuse lookahead token after an 3509 error, discard it. */ 3510 3511 if (yychar <= YYEOF) 3512 { 3513 /* Return failure if at end of input. */ 3514 if (yychar == YYEOF) 3515 YYABORT; 3516 } 3517 else 3518 { 3519 yydestruct ("Error: discarding", 3520 yytoken, &yylval, yyscanner, cstate); 3521 yychar = YYEMPTY; 3522 } 3523 } 3524 3525 /* Else will try to reuse lookahead token after shifting the error 3526 token. */ 3527 goto yyerrlab1; 3528 3529 3530 /*---------------------------------------------------. 3531 | yyerrorlab -- error raised explicitly by YYERROR. | 3532 `---------------------------------------------------*/ 3533 yyerrorlab: 3534 3535 /* Pacify compilers like GCC when the user code never invokes 3536 YYERROR and the label yyerrorlab therefore never appears in user 3537 code. */ 3538 if (/*CONSTCOND*/ 0) 3539 goto yyerrorlab; 3540 3541 /* Do not reclaim the symbols of the rule whose action triggered 3542 this YYERROR. */ 3543 YYPOPSTACK (yylen); 3544 yylen = 0; 3545 YY_STACK_PRINT (yyss, yyssp); 3546 yystate = *yyssp; 3547 goto yyerrlab1; 3548 3549 3550 /*-------------------------------------------------------------. 3551 | yyerrlab1 -- common code for both syntax error and YYERROR. | 3552 `-------------------------------------------------------------*/ 3553 yyerrlab1: 3554 yyerrstatus = 3; /* Each real token shifted decrements this. */ 3555 3556 for (;;) 3557 { 3558 yyn = yypact[yystate]; 3559 if (!yypact_value_is_default (yyn)) 3560 { 3561 yyn += YYTERROR; 3562 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 3563 { 3564 yyn = yytable[yyn]; 3565 if (0 < yyn) 3566 break; 3567 } 3568 } 3569 3570 /* Pop the current state because it cannot handle the error token. */ 3571 if (yyssp == yyss) 3572 YYABORT; 3573 3574 3575 yydestruct ("Error: popping", 3576 yystos[yystate], yyvsp, yyscanner, cstate); 3577 YYPOPSTACK (1); 3578 yystate = *yyssp; 3579 YY_STACK_PRINT (yyss, yyssp); 3580 } 3581 3582 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 3583 *++yyvsp = yylval; 3584 YY_IGNORE_MAYBE_UNINITIALIZED_END 3585 3586 3587 /* Shift the error token. */ 3588 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 3589 3590 yystate = yyn; 3591 goto yynewstate; 3592 3593 3594 /*-------------------------------------. 3595 | yyacceptlab -- YYACCEPT comes here. | 3596 `-------------------------------------*/ 3597 yyacceptlab: 3598 yyresult = 0; 3599 goto yyreturn; 3600 3601 /*-----------------------------------. 3602 | yyabortlab -- YYABORT comes here. | 3603 `-----------------------------------*/ 3604 yyabortlab: 3605 yyresult = 1; 3606 goto yyreturn; 3607 3608 #if !defined yyoverflow || YYERROR_VERBOSE 3609 /*-------------------------------------------------. 3610 | yyexhaustedlab -- memory exhaustion comes here. | 3611 `-------------------------------------------------*/ 3612 yyexhaustedlab: 3613 yyerror (yyscanner, cstate, YY_("memory exhausted")); 3614 yyresult = 2; 3615 /* Fall through. */ 3616 #endif 3617 3618 yyreturn: 3619 if (yychar != YYEMPTY) 3620 { 3621 /* Make sure we have latest lookahead translation. See comments at 3622 user semantic actions for why this is necessary. */ 3623 yytoken = YYTRANSLATE (yychar); 3624 yydestruct ("Cleanup: discarding lookahead", 3625 yytoken, &yylval, yyscanner, cstate); 3626 } 3627 /* Do not reclaim the symbols of the rule whose action triggered 3628 this YYABORT or YYACCEPT. */ 3629 YYPOPSTACK (yylen); 3630 YY_STACK_PRINT (yyss, yyssp); 3631 while (yyssp != yyss) 3632 { 3633 yydestruct ("Cleanup: popping", 3634 yystos[*yyssp], yyvsp, yyscanner, cstate); 3635 YYPOPSTACK (1); 3636 } 3637 #ifndef yyoverflow 3638 if (yyss != yyssa) 3639 YYSTACK_FREE (yyss); 3640 #endif 3641 #if YYERROR_VERBOSE 3642 if (yymsg != yymsgbuf) 3643 YYSTACK_FREE (yymsg); 3644 #endif 3645 return yyresult; 3646 } 3647 #line 768 "grammar.y" /* yacc.c:1906 */ 3648 3649