⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sf_attribute_table.c

📁 著名的入侵检测系统snort的最新版本的源码
💻 C
📖 第 1 页 / 共 5 页
字号:
/* A Bison parser, made by GNU Bison 2.3.  *//* Skeleton implementation for Bison's Yacc-like parsers in C   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006   Free Software Foundation, Inc.   This program is free software; you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 2, or (at your option)   any later version.   This program is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   GNU General Public License for more details.   You should have received a copy of the GNU General Public License   along with this program; if not, write to the Free Software   Foundation, Inc., 51 Franklin Street, Fifth Floor,   Boston, MA 02110-1301, USA.  *//* As a special exception, you may create a larger work that contains   part or all of the Bison parser skeleton and distribute that work   under terms of your choice, so long as that work isn't itself a   parser generator using the skeleton or a modified version thereof   as a parser skeleton.  Alternatively, if you modify or redistribute   the parser skeleton itself, you may (at your option) remove this   special exception, which will cause the skeleton and the resulting   Bison output files to be licensed under the GNU General Public   License without this special exception.   This special exception was added by the Free Software Foundation in   version 2.2 of Bison.  *//* C LALR(1) parser skeleton written by Richard Stallman, by   simplifying the original so-called "semantic" parser.  *//* All symbols defined below should begin with yy or YY, to avoid   infringing on user name space.  This should be done even for local   variables, as they might otherwise be expanded by user macros.   There are some unavoidable exceptions within include files to   define necessary library symbols; they are noted "INFRINGES ON   USER NAME SPACE" below.  *//* Identify Bison output.  */#define YYBISON 1/* Bison version.  */#define YYBISON_VERSION "2.3"/* Skeleton name.  */#define YYSKELETON_NAME "yacc.c"/* Pure parsers.  */#define YYPURE 0/* Using locations.  */#define YYLSP_NEEDED 0/* Substitute the variable and function names.  */#define yyparse sfat_parse#define yylex   sfat_lex#define yyerror sfat_error#define yylval  sfat_lval#define yychar  sfat_char#define yydebug sfat_debug#define yynerrs sfat_nerrs/* Tokens.  */#ifndef YYTOKENTYPE# define YYTOKENTYPE   /* Put the tokens into the symbol table, so that GDB and other debuggers      know about them.  */   enum yytokentype {     SF_AT_COMMENT = 258,     SF_AT_WHITESPACE = 259,     SF_START_SNORT_ATTRIBUTES = 260,     SF_END_SNORT_ATTRIBUTES = 261,     SF_AT_START_MAP_TABLE = 262,     SF_AT_END_MAP_TABLE = 263,     SF_AT_START_ENTRY = 264,     SF_AT_END_ENTRY = 265,     SF_AT_START_ENTRY_ID = 266,     SF_AT_END_ENTRY_ID = 267,     SF_AT_START_ENTRY_VALUE = 268,     SF_AT_END_ENTRY_VALUE = 269,     SF_AT_START_ATTRIBUTE_TABLE = 270,     SF_AT_END_ATTRIBUTE_TABLE = 271,     SF_AT_START_HOST = 272,     SF_AT_END_HOST = 273,     SF_AT_START_HOST_IP = 274,     SF_AT_END_HOST_IP = 275,     SF_AT_STRING = 276,     SF_AT_NUMERIC = 277,     SF_AT_IPv6 = 278,     SF_AT_IPv6Cidr = 279,     SF_AT_START_OS = 280,     SF_AT_END_OS = 281,     SF_AT_START_ATTRIBUTE_VALUE = 282,     SF_AT_END_ATTRIBUTE_VALUE = 283,     SF_AT_START_ATTRIBUTE_ID = 284,     SF_AT_END_ATTRIBUTE_ID = 285,     SF_AT_START_CONFIDENCE = 286,     SF_AT_END_CONFIDENCE = 287,     SF_AT_START_NAME = 288,     SF_AT_END_NAME = 289,     SF_AT_START_VENDOR = 290,     SF_AT_END_VENDOR = 291,     SF_AT_START_VERSION = 292,     SF_AT_END_VERSION = 293,     SF_AT_START_FRAG_POLICY = 294,     SF_AT_END_FRAG_POLICY = 295,     SF_AT_START_STREAM_POLICY = 296,     SF_AT_END_STREAM_POLICY = 297,     SF_AT_START_SERVICES = 298,     SF_AT_END_SERVICES = 299,     SF_AT_START_SERVICE = 300,     SF_AT_END_SERVICE = 301,     SF_AT_START_CLIENTS = 302,     SF_AT_END_CLIENTS = 303,     SF_AT_START_CLIENT = 304,     SF_AT_END_CLIENT = 305,     SF_AT_START_IPPROTO = 306,     SF_AT_END_IPPROTO = 307,     SF_AT_START_PORT = 308,     SF_AT_END_PORT = 309,     SF_AT_START_PROTOCOL = 310,     SF_AT_END_PROTOCOL = 311,     SF_AT_START_APPLICATION = 312,     SF_AT_END_APPLICATION = 313   };#endif/* Tokens.  */#define SF_AT_COMMENT 258#define SF_AT_WHITESPACE 259#define SF_START_SNORT_ATTRIBUTES 260#define SF_END_SNORT_ATTRIBUTES 261#define SF_AT_START_MAP_TABLE 262#define SF_AT_END_MAP_TABLE 263#define SF_AT_START_ENTRY 264#define SF_AT_END_ENTRY 265#define SF_AT_START_ENTRY_ID 266#define SF_AT_END_ENTRY_ID 267#define SF_AT_START_ENTRY_VALUE 268#define SF_AT_END_ENTRY_VALUE 269#define SF_AT_START_ATTRIBUTE_TABLE 270#define SF_AT_END_ATTRIBUTE_TABLE 271#define SF_AT_START_HOST 272#define SF_AT_END_HOST 273#define SF_AT_START_HOST_IP 274#define SF_AT_END_HOST_IP 275#define SF_AT_STRING 276#define SF_AT_NUMERIC 277#define SF_AT_IPv6 278#define SF_AT_IPv6Cidr 279#define SF_AT_START_OS 280#define SF_AT_END_OS 281#define SF_AT_START_ATTRIBUTE_VALUE 282#define SF_AT_END_ATTRIBUTE_VALUE 283#define SF_AT_START_ATTRIBUTE_ID 284#define SF_AT_END_ATTRIBUTE_ID 285#define SF_AT_START_CONFIDENCE 286#define SF_AT_END_CONFIDENCE 287#define SF_AT_START_NAME 288#define SF_AT_END_NAME 289#define SF_AT_START_VENDOR 290#define SF_AT_END_VENDOR 291#define SF_AT_START_VERSION 292#define SF_AT_END_VERSION 293#define SF_AT_START_FRAG_POLICY 294#define SF_AT_END_FRAG_POLICY 295#define SF_AT_START_STREAM_POLICY 296#define SF_AT_END_STREAM_POLICY 297#define SF_AT_START_SERVICES 298#define SF_AT_END_SERVICES 299#define SF_AT_START_SERVICE 300#define SF_AT_END_SERVICE 301#define SF_AT_START_CLIENTS 302#define SF_AT_END_CLIENTS 303#define SF_AT_START_CLIENT 304#define SF_AT_END_CLIENT 305#define SF_AT_START_IPPROTO 306#define SF_AT_END_IPPROTO 307#define SF_AT_START_PORT 308#define SF_AT_END_PORT 309#define SF_AT_START_PROTOCOL 310#define SF_AT_END_PROTOCOL 311#define SF_AT_START_APPLICATION 312#define SF_AT_END_APPLICATION 313/* Copy the first part of user declarations.  */#line 32 "sf_attribute_table.y"#ifdef TARGET_BASED#include <stdlib.h>#include <string.h>#include "snort.h"#include "util.h"#include "sftarget_reader.h"#include "log.h"#include "debug.h"#define YY_ACCEPT return 1;#define YY_ABORT return 0;extern ServiceClient sfat_client_or_service;extern char *sfat_grammar_error;extern int sfat_lex();extern void sfat_error(char*);/* Enabling traces.  */#ifndef YYDEBUG# define YYDEBUG 0#endif/* Enabling verbose error messages.  */#ifdef YYERROR_VERBOSE# undef YYERROR_VERBOSE# define YYERROR_VERBOSE 1#else# define YYERROR_VERBOSE 0#endif/* Enabling the token table.  */#ifndef YYTOKEN_TABLE# define YYTOKEN_TABLE 0#endif#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLAREDtypedef union YYSTYPE#line 53 "sf_attribute_table.y"{  char stringValue[STD_BUF];  u_int32_t numericValue;  AttributeData data;  MapData mapEntry;}/* Line 187 of yacc.c.  */#line 247 "sf_attribute_table.c"	YYSTYPE;# define yystype YYSTYPE /* obsolescent; will be withdrawn */# define YYSTYPE_IS_DECLARED 1# define YYSTYPE_IS_TRIVIAL 1#endif/* Copy the second part of user declarations.  *//* Line 216 of yacc.c.  */#line 260 "sf_attribute_table.c"#ifdef short# undef short#endif#ifdef YYTYPE_UINT8typedef YYTYPE_UINT8 yytype_uint8;#elsetypedef unsigned char yytype_uint8;#endif#ifdef YYTYPE_INT8typedef YYTYPE_INT8 yytype_int8;#elif (defined __STDC__ || defined __C99__FUNC__ \     || defined __cplusplus || defined _MSC_VER)typedef signed char yytype_int8;#elsetypedef short int yytype_int8;#endif#ifdef YYTYPE_UINT16typedef YYTYPE_UINT16 yytype_uint16;#elsetypedef unsigned short int yytype_uint16;#endif#ifdef YYTYPE_INT16typedef YYTYPE_INT16 yytype_int16;#elsetypedef short int yytype_int16;#endif#ifndef YYSIZE_T# ifdef __SIZE_TYPE__#  define YYSIZE_T __SIZE_TYPE__# elif defined size_t#  define YYSIZE_T size_t# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \     || defined __cplusplus || defined _MSC_VER)#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */#  define YYSIZE_T size_t# else#  define YYSIZE_T unsigned int# endif#endif#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)#ifndef YY_# if YYENABLE_NLS#  if ENABLE_NLS#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */#   define YY_(msgid) dgettext ("bison-runtime", msgid)#  endif# endif# ifndef YY_#  define YY_(msgid) msgid# endif#endif/* Suppress unused-variable warnings by "using" E.  */#if ! defined lint || defined __GNUC__# define YYUSE(e) ((void) (e))#else# define YYUSE(e) /* empty */#endif/* Identity function, used to suppress warnings about constant conditions.  */#ifndef lint# define YYID(n) (n)#else#if (defined __STDC__ || defined __C99__FUNC__ \     || defined __cplusplus || defined _MSC_VER)static intYYID (int i)#elsestatic intYYID (i)    int i;#endif{  return i;}#endif#if ! defined yyoverflow || YYERROR_VERBOSE/* The parser invokes alloca or malloc; define the necessary symbols.  */# ifdef YYSTACK_USE_ALLOCA#  if YYSTACK_USE_ALLOCA#   ifdef __GNUC__#    define YYSTACK_ALLOC __builtin_alloca#   elif defined __BUILTIN_VA_ARG_INCR#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */#   elif defined _AIX#    define YYSTACK_ALLOC __alloca#   elif defined _MSC_VER#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */#    define alloca _alloca#   else#    define YYSTACK_ALLOC alloca#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \     || defined __cplusplus || defined _MSC_VER)#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */#     ifndef _STDLIB_H#      define _STDLIB_H 1#     endif#    endif#   endif#  endif# endif# ifdef YYSTACK_ALLOC   /* Pacify GCC's `empty if-body' warning.  */#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))#  ifndef YYSTACK_ALLOC_MAXIMUM    /* The OS might guarantee only one guard page at the bottom of the stack,       and a page size can be as small as 4096 bytes.  So we cannot safely       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number       to allow for a few compiler-allocated temporary stack slots.  */#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */#  endif# else#  define YYSTACK_ALLOC YYMALLOC#  define YYSTACK_FREE YYFREE#  ifndef YYSTACK_ALLOC_MAXIMUM#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM#  endif#  if (defined __cplusplus && ! defined _STDLIB_H \       && ! ((defined YYMALLOC || defined malloc) \	     && (defined YYFREE || defined free)))#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */#   ifndef _STDLIB_H#    define _STDLIB_H 1#   endif#  endif#  ifndef YYMALLOC#   define YYMALLOC malloc#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \     || defined __cplusplus || defined _MSC_VER)void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */#   endif#  endif#  ifndef YYFREE#   define YYFREE free#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \     || defined __cplusplus || defined _MSC_VER)void free (void *); /* INFRINGES ON USER NAME SPACE */#   endif#  endif# endif#endif /* ! defined yyoverflow || YYERROR_VERBOSE */#if (! defined yyoverflow \     && (! defined __cplusplus \	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))/* A type that is properly aligned for any stack member.  */union yyalloc{  yytype_int16 yyss;  YYSTYPE yyvs;  };/* The size of the maximum gap between one aligned stack and the next.  */# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)/* The size of an array large to enough to hold all stacks, each with   N elements.  */# define YYSTACK_BYTES(N) \     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \      + YYSTACK_GAP_MAXIMUM)/* Copy COUNT objects from FROM to TO.  The source and destination do   not overlap.  */

⌨️ 快捷键说明

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