grammar.c

来自「Ubuntu packages of security software。 相」· C语言 代码 · 共 1,792 行 · 第 1/4 页

C
1,792
字号
#ifndef lintstatic char const yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $";#endif#include <stdlib.h>#define YYBYACC 1#define YYMAJOR 1#define YYMINOR 9#define YYLEX yylex()#define YYEMPTY -1#define yyclearin (yychar=(YYEMPTY))#define yyerrok (yyerrflag=0)#define YYRECOVERING() (yyerrflag!=0)static int yygrowstack();#define YYPREFIX "yy"#line 2 "grammar.y"/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 *	The Regents of the University of California.  All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * */#ifndef lintstatic const char rcsid[] _U_ =    "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.86.2.5 2005/09/05 09:08:06 guy Exp $ (LBL)";#endif#ifdef HAVE_CONFIG_H#include "config.h"#endif#ifdef WIN32#include <pcap-stdinc.h>#else /* WIN32 */#include <sys/types.h>#include <sys/socket.h>#endif /* WIN32 */#include <stdlib.h>#ifndef WIN32#if __STDC__struct mbuf;struct rtentry;#endif#include <netinet/in.h>#endif /* WIN32 */#include <stdio.h>#include "pcap-int.h"#include "gencode.h"#include "pf.h"#include <pcap-namedb.h>#ifdef HAVE_OS_PROTO_H#include "os-proto.h"#endif#define QSET(q, p, d, a) (q).proto = (p),\			 (q).dir = (d),\			 (q).addr = (a)int n_errors = 0;static struct qual qerr = { Q_UNDEF, Q_UNDEF, Q_UNDEF, Q_UNDEF };static voidyyerror(char *msg){	++n_errors;	bpf_error("%s", msg);	/* NOTREACHED */}#ifndef YYBISONint yyparse(void);intpcap_parse(){	return (yyparse());}#endif#line 90 "grammar.y"typedef union {	int i;	bpf_u_int32 h;	u_char *e;	char *s;	struct stmt *stmt;	struct arth *a;	struct {		struct qual q;		int atmfieldtype;		int mtp3fieldtype;		struct block *b;	} blk;	struct block *rblk;} YYSTYPE;#line 120 "y.tab.c"#define YYERRCODE 256#define DST 257#define SRC 258#define HOST 259#define GATEWAY 260#define NET 261#define NETMASK 262#define PORT 263#define PORTRANGE 264#define LESS 265#define GREATER 266#define PROTO 267#define PROTOCHAIN 268#define CBYTE 269#define ARP 270#define RARP 271#define IP 272#define SCTP 273#define TCP 274#define UDP 275#define ICMP 276#define IGMP 277#define IGRP 278#define PIM 279#define VRRP 280#define ATALK 281#define AARP 282#define DECNET 283#define LAT 284#define SCA 285#define MOPRC 286#define MOPDL 287#define TK_BROADCAST 288#define TK_MULTICAST 289#define NUM 290#define INBOUND 291#define OUTBOUND 292#define PF_IFNAME 293#define PF_RSET 294#define PF_RNR 295#define PF_SRNR 296#define PF_REASON 297#define PF_ACTION 298#define LINK 299#define GEQ 300#define LEQ 301#define NEQ 302#define ID 303#define EID 304#define HID 305#define HID6 306#define AID 307#define LSH 308#define RSH 309#define LEN 310#define IPV6 311#define ICMPV6 312#define AH 313#define ESP 314#define VLAN 315#define MPLS 316#define PPPOED 317#define PPPOES 318#define ISO 319#define ESIS 320#define CLNP 321#define ISIS 322#define L1 323#define L2 324#define IIH 325#define LSP 326#define SNP 327#define CSNP 328#define PSNP 329#define STP 330#define IPX 331#define NETBEUI 332#define LANE 333#define LLC 334#define METAC 335#define BCC 336#define SC 337#define ILMIC 338#define OAMF4EC 339#define OAMF4SC 340#define OAM 341#define OAMF4 342#define CONNECTMSG 343#define METACONNECT 344#define VPI 345#define VCI 346#define RADIO 347#define SIO 348#define OPC 349#define DPC 350#define SLS 351#define OR 352#define AND 353#define UMINUS 354const short yylhs[] = {                                        -1,    0,    0,   24,    1,    1,    1,    1,    1,   20,   21,    2,    2,    2,    3,    3,    3,    3,    3,    3,    3,    3,    3,   23,   22,    4,    4,    4,    7,    7,    5,    5,    8,    8,    8,    8,    8,    8,    6,    6,    6,    6,    6,    6,    6,    6,    6,    6,    9,    9,   10,   10,   10,   10,   10,   10,   11,   11,   11,   11,   12,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,   25,   25,   25,   25,   25,   25,   25,   25,   25,   25,   25,   25,   25,   25,   26,   26,   26,   26,   26,   26,   38,   38,   37,   18,   18,   18,   19,   19,   19,   13,   13,   14,   14,   14,   14,   14,   14,   14,   14,   14,   14,   14,   14,   14,   15,   15,   15,   15,   15,   17,   17,   27,   27,   27,   27,   27,   27,   27,   27,   28,   28,   28,   28,   29,   29,   31,   31,   31,   31,   30,   32,   32,   33,   33,   33,   33,   35,   35,   35,   35,   34,   36,   36,};const short yylen[] = {                                         2,    2,    1,    0,    1,    3,    3,    3,    3,    1,    1,    1,    1,    3,    1,    3,    3,    1,    3,    1,    1,    1,    2,    1,    1,    1,    3,    3,    1,    1,    1,    2,    3,    2,    2,    2,    2,    2,    2,    3,    1,    3,    3,    1,    1,    1,    2,    2,    1,    0,    1,    1,    3,    3,    3,    3,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    2,    2,    2,    2,    4,    1,    1,    2,    1,    2,    1,    1,    1,    1,    2,    2,    2,    2,    2,    2,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    4,    6,    3,    3,    3,    3,    3,    3,    3,    3,    2,    3,    1,    1,    1,    1,    1,    1,    1,    3,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    2,    2,    3,    1,    1,    3,    1,    1,    1,    1,    1,    2,    2,    3,    1,    1,    3,};const short yydefred[] = {                                      3,    0,    0,    0,    0,    0,   63,   64,   62,   65,   66,   67,   68,   69,   70,   71,   72,   73,   74,   75,   76,   77,   79,   78,  148,  104,  105,    0,    0,    0,    0,    0,    0,   61,  142,   80,   81,   82,   83,    0,    0,  110,  111,   84,   85,   94,   86,   87,   88,   89,   90,   91,   93,   92,   95,   96,   97,  150,  151,  152,  153,  156,  157,  154,  155,  158,  159,  160,  161,  162,  163,   98,  171,  172,  173,  174,   23,    0,   24,    0,    4,   30,    0,    0,    0,  129,    0,  128,    0,    0,   43,  112,   44,   45,    0,    0,  101,  102,    0,  113,  114,  115,  116,  119,  120,  117,  121,  118,  106,    0,  108,  140,    0,    0,   10,    9,    0,    0,   14,   20,    0,    0,   21,   38,   11,   12,    0,    0,    0,    0,   56,   60,   57,   58,   59,   35,   36,   99,  100,    0,   34,   37,  123,  125,  127,    0,    0,    0,    0,    0,    0,    0,    0,  122,  124,  126,    0,    0,    0,    0,    0,    0,   31,  168,    0,    0,    0,  164,   46,  179,    0,    0,    0,  175,   47,  144,  143,  146,  147,  145,    0,    0,    0,    6,    5,    0,    0,    0,    8,    7,    0,    0,    0,   25,    0,    0,    0,   22,    0,    0,    0,    0,   32,    0,    0,    0,    0,    0,    0,  134,  135,    0,    0,    0,   39,  141,  149,  165,  166,  169,    0,  176,  177,  180,    0,  103,    0,   16,   15,   18,   13,    0,    0,   53,   55,   52,   54,  130,    0,  167,    0,  178,    0,   26,   27,    0,  170,  181,  131,};const short yydgoto[] = {                                       1,  159,  197,  124,  194,   80,   81,  195,   82,   83,  139,  140,  141,   84,   85,  180,  112,   87,  156,  157,  116,  117,  113,  127,    2,   90,   91,   92,   93,   94,  167,  168,  220,   95,  173,  174,  224,  107,  105,};const short yysindex[] = {                                      0,    0,  284, -288, -277, -271,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0, -282, -265, -258, -249, -273, -252,    0,    0,    0,    0,    0,    0,  -40,  -40,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,  366,    0, -294,    0,    0,   43,  -19,  119,    0,  -31,    0,  284,  284,    0,    0,    0,    0,   40,  677,    0,    0,   54,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,  -40,    0,    0,  -31,  366,    0,    0,  178,  178,    0,    0,  -37,   38,    0,    0,    0,    0,   43,   43, -235, -216,    0,    0,    0,    0,    0,    0,    0,    0,    0,  -91,    0,    0,    0,    0,    0,  366,  366,  366,  366,  366,  366,  366,  366,    0,    0,    0,  366,  366,  366,  -38,   12,   62,    0,    0, -185, -183, -181,    0,    0,    0, -169, -166, -157,    0,    0,    0,    0,    0,    0,    0, -141,   62,  673,    0,    0,    0,  178,  178,    0,    0, -153, -134, -125,    0,  128, -294,   62,    0,  -87,  -82,  -80,  -73,    0,  140,  140,  -20,  -14,   -7,   -7,    0,    0,  673,  673,  158,    0,    0,    0,    0,    0,    0,  -36,    0,    0,    0,  -34,    0,   62,    0,    0,    0,    0,   43,   43,    0,    0,    0,    0,    0, -102,    0, -181,    0, -157,    0,    0,   96,    0,    0,    0,};const short yyrindex[] = {                                      0,    0,  141,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    6,    9,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,  190,    0,    0,    0,    0,    0,    0,    4,    0,  511,  511,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,  511,  511,    0,    0,   14,   16,    0,    0,    0,    0,    0,    0,  446,  499,    0,    0,    0,    0,    0,    0,    0,    0,    0,  134,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,  621,  661,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    1,  511,  511,    0,    0,    0,    0,    0,    0, -214,    0, -207,    0,    0,    0,    0,    0,    0,   26,   82,   93,   70,   11,   36,    0,    0,   24,   34,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,  236,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,};const short yygindex[] = {                                      0,  189,   -4, -118,    0,   10,    0,    0,    0,    0,    0,   56,    0,  710,  -76,    0,  104,  727,   53,   64,    3, -129,  725,  120,    0,    0,    0,    0,    0,    0, -151,    0,    0,    0, -152,    0,    0,    0,    0,};#define YYTABLESIZE 982const short yytable[] = {                                      78,   12,   96,  214,   40,  239,  107,  241,  193,  109,  191,  132,  160,   97,   17,  219,   19,  103,  148,   98,  223,   99,  151,  149,   41,  150,  138,  152,  151,  149,  104,  150,  101,  152,   42,  151,  133,  160,  100,  128,  152,  102,   12,  128,  128,   40,  128,  107,  128,  132,  109,  106,  132,  215,  132,   17,  132,   19,  114,  115,  158,  128,  128,  128,  138,   41,  232,  138,  193,  132,  136,  132,  132,  132,  133,   42,   76,  133,  123,  133,   78,  133,  139,   78,  138,  192,  138,  138,  138,  246,  247,  240,  176,  137,  133,  242,  133,  133,  133,  162,  155,  154,  153,  216,  132,  217,   86,  218,  136,  163,  160,  136,  183,  188,  179,  178,  177,  198,  199,  138,  139,  221,   89,  139,  222,  128,  184,  189,  136,  133,  136,  136,  136,  169,  137,  132,  200,  201,   29,   29,  139,    2,  139,  139,  139,   28,   28,  164,  170,  225,  138,  137,  227,  137,  137,  137,  228,  148,  165,  171,  133,  151,  149,  136,  150,  229,  152,   33,  130,  230,  132,  233,  133,  134,   33,  139,  234,  235,  175,  155,  154,  153,  151,  149,  236,  150,  137,  152,  245,  248,    1,   79,   86,   86,  136,  202,  148,  162,  231,    0,  151,  149,    0,  150,    0,  152,  139,    0,   89,   89,    0,   76,    0,    0,    0,    0,  238,  137,   78,    0,   86,   86,    0,   77,    0,  190,    0,  243,  244,    0,    0,    0,    0,    0,    0,    0,  187,  187,  128,  129,  130,  131,  132,  147,  133,  134,    0,    0,  135,  136,   24,  237,    0,    0,    0,    0,    0,    0,    0,    0,    0,   48,   48,   48,   48,   48,    0,   48,   48,  137,  138,   48,   48,    0,  128,    0,    0,    0,  128,  128,    0,  128,  147,  128,    0,    0,    0,    0,  145,  146,   86,   86,   48,   48,  145,  146,  128,  128,  128,    0,    0,  128,  128,  128,    0,    0,  187,  187,    0,  128,  128,  132,  132,  132,  114,  115,  114,   76,  114,  132,  132,    0,    0,    0,   78,    0,  138,  138,  138,   77,  163,    0,    0,   24,  138,  138,  133,  133,  133,    0,  142,  143,  144,    0,  133,  133,  118,  119,  120,  121,  122,    0,    0,   12,   12,    0,   40,   40,  107,  107,  128,  109,  109,  132,  132,    0,   17,   17,   19,   19,  136,  136,  136,    0,    0,    0,   41,   41,  138,  138,    0,    0,  139,  139,  139,    0,   42,   42,  133,  133,  139,  139,    0,  137,  137,  137,    0,    0,   49,   49,   49,   49,   49,    0,   49,   49,   78,    0,   49,   49,    0,   77,    0,    0,    0,    0,    0,    0,    0,  142,  143,  144,  136,  136,   33,    0,    0,  145,  146,   49,   49,    0,    0,    0,  139,  139,    0,   33,   33,   33,   33,   33,    0,    3,    4,  137,  137,    5,    6,    7,    8,    9,   10,   11,   12,   13,   14,   15,   16,   17,   18,   19,   20,   21,   22,   23,  145,  146,   24,   25,   26,   27,   28,   29,   30,   31,   32,   33,    0,   51,    0,  118,  119,  120,  121,  122,   51,    0,   34,   35,   36,   37,   38,   39,   40,   41,   42,   43,   44,   45,   46,   47,   48,   49,   50,   51,   52,   53,   54,   55,   56,   57,   58,   59,   60,   61,   62,   63,   64,   65,   66,   67,   68,   69,   70,   71,   72,   73,   74,   75,    0,    0,   50,    0,    0,    0,  128,  128,  128,   50,    0,    0,    0,    0,  128,  128,    0,    0,    0,    3,    4,    0,    0,    5,    6,    7,    8,    9,   10,   11,   12,   13,   14,   15,   16,   17,   18,   19,   20,   21,   22,   23,    0,    0,   24,   25,   26,   27,   28,   29,   30,   31,   32,   33,    0,    0,    0,    0,   28,   28,    0,    0,    0,    0,   34,   35,   36,   37,   38,   39,   40,   41,   42,   43,   44,   45,   46,   47,   48,   49,   50,   51,   52,   53,   54,   55,   56,   57,   58,   59,   60,   61,   62,   63,   64,   65,   66,   67,   68,   69,   70,   71,   72,   73,   74,   75,    6,    7,    8,    9,   10,   11,   12,   13,   14,   15,   16,   17,   18,   19,   20,   21,   22,   23,    0,    0,   24,    0,    0,  129,    0,    0,    0,  129,  129,   33,  129,    0,  129,    0,    0,    0,    0,    0,    0,    0,   34,   35,   36,   37,   38,  129,  129,  129,    0,   43,   44,   45,   46,   47,   48,   49,   50,   51,   52,   53,   54,   55,   56,  128,    0,    0,    0,  128,  128,   51,  128,   51,  128,   51,   51,  148,    0,   71,    0,  151,  149,   78,  150,    0,  152,  128,  128,  128,    0,    0,    0,   88,    0,    0,    0,    0,    0,    0,    0,    0,   51,  155,  154,  153,    0,    0,    0,    0,    0,  129,    0,    0,    0,   51,   51,   51,   51,   51,    0,    0,    0,    0,   50,    0,   50,    0,   50,   50,  109,  109,  108,  110,   49,   49,   49,   49,   49,    0,   49,   49,    0,    0,   49,   49,    0,    0,    0,    0,    0,  128,    0,  111,    0,   50,    0,    0,    0,    0,    0,    0,    0,  147,    0,   49,   49,    0,   50,   50,   50,   50,   50,  126,    0,  125,    0,    0,    0,   88,   88,  161,    0,    0,    0,  166,  172,    0,    0,  182,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,  109,    0,  181,    0,    0,    0,  161,  186,  186,  185,  185,    0,    0,    0,    0,    0,    0,  109,  126,  196,  125,  203,  204,  205,  206,  207,  208,  209,  210,    0,    0,    0,  211,  212,  213,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,   88,  186,  226,  185,    0,    0,    0,    0,    0,    0,  129,  129,  129,    0,    0,    0,    0,    0,  129,  129,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?