libnl  3.2.7
/builddir/build/BUILD/libnl-3.2.7/lib/route/cls/ematch_syntax.c
00001 /* A Bison parser, made by GNU Bison 2.5.  */
00002 
00003 /* Bison implementation for Yacc-like parsers in C
00004    
00005       Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
00006    
00007    This program is free software: you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation, either version 3 of the License, or
00010    (at your option) any later version.
00011    
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016    
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 /* As a special exception, you may create a larger work that contains
00021    part or all of the Bison parser skeleton and distribute that work
00022    under terms of your choice, so long as that work isn't itself a
00023    parser generator using the skeleton or a modified version thereof
00024    as a parser skeleton.  Alternatively, if you modify or redistribute
00025    the parser skeleton itself, you may (at your option) remove this
00026    special exception, which will cause the skeleton and the resulting
00027    Bison output files to be licensed under the GNU General Public
00028    License without this special exception.
00029    
00030    This special exception was added by the Free Software Foundation in
00031    version 2.2 of Bison.  */
00032 
00033 /* C LALR(1) parser skeleton written by Richard Stallman, by
00034    simplifying the original so-called "semantic" parser.  */
00035 
00036 /* All symbols defined below should begin with yy or YY, to avoid
00037    infringing on user name space.  This should be done even for local
00038    variables, as they might otherwise be expanded by user macros.
00039    There are some unavoidable exceptions within include files to
00040    define necessary library symbols; they are noted "INFRINGES ON
00041    USER NAME SPACE" below.  */
00042 
00043 /* Identify Bison output.  */
00044 #define YYBISON 1
00045 
00046 /* Bison version.  */
00047 #define YYBISON_VERSION "2.5"
00048 
00049 /* Skeleton name.  */
00050 #define YYSKELETON_NAME "yacc.c"
00051 
00052 /* Pure parsers.  */
00053 #define YYPURE 1
00054 
00055 /* Push parsers.  */
00056 #define YYPUSH 0
00057 
00058 /* Pull parsers.  */
00059 #define YYPULL 1
00060 
00061 /* Using locations.  */
00062 #define YYLSP_NEEDED 0
00063 
00064 /* Substitute the variable and function names.  */
00065 #define yyparse         ematch_parse
00066 #define yylex           ematch_lex
00067 #define yyerror         ematch_error
00068 #define yylval          ematch_lval
00069 #define yychar          ematch_char
00070 #define yydebug         ematch_debug
00071 #define yynerrs         ematch_nerrs
00072 
00073 
00074 /* Copy the first part of user declarations.  */
00075 
00076 /* Line 268 of yacc.c  */
00077 #line 12 "route/cls/ematch_syntax.y"
00078 
00079 #include <netlink-local.h>
00080 #include <netlink-tc.h>
00081 #include <netlink/netlink.h>
00082 #include <netlink/utils.h>
00083 #include <netlink/route/pktloc.h>
00084 #include <netlink/route/cls/ematch.h>
00085 #include <netlink/route/cls/ematch/cmp.h>
00086 #include <netlink/route/cls/ematch/nbyte.h>
00087 #include <netlink/route/cls/ematch/text.h>
00088 #include <netlink/route/cls/ematch/meta.h>
00089 
00090 #define META_ALLOC rtnl_meta_value_alloc_id
00091 #define META_ID(name) TCF_META_ID_##name
00092 #define META_INT TCF_META_TYPE_INT
00093 #define META_VAR TCF_META_TYPE_VAR
00094 
00095 
00096 /* Line 268 of yacc.c  */
00097 #line 98 "route/cls/ematch_syntax.c"
00098 
00099 /* Enabling traces.  */
00100 #ifndef YYDEBUG
00101 # define YYDEBUG 0
00102 #endif
00103 
00104 /* Enabling verbose error messages.  */
00105 #ifdef YYERROR_VERBOSE
00106 # undef YYERROR_VERBOSE
00107 # define YYERROR_VERBOSE 1
00108 #else
00109 # define YYERROR_VERBOSE 1
00110 #endif
00111 
00112 /* Enabling the token table.  */
00113 #ifndef YYTOKEN_TABLE
00114 # define YYTOKEN_TABLE 0
00115 #endif
00116 
00117 
00118 /* Tokens.  */
00119 #ifndef YYTOKENTYPE
00120 # define YYTOKENTYPE
00121    /* Put the tokens into the symbol table, so that GDB and other debuggers
00122       know about them.  */
00123    enum yytokentype {
00124      ERROR = 258,
00125      LOGIC = 259,
00126      NOT = 260,
00127      OPERAND = 261,
00128      NUMBER = 262,
00129      ALIGN = 263,
00130      LAYER = 264,
00131      KW_OPEN = 265,
00132      KW_CLOSE = 266,
00133      KW_PLUS = 267,
00134      KW_MASK = 268,
00135      KW_SHIFT = 269,
00136      KW_AT = 270,
00137      EMATCH_CMP = 271,
00138      EMATCH_NBYTE = 272,
00139      EMATCH_TEXT = 273,
00140      EMATCH_META = 274,
00141      KW_EQ = 275,
00142      KW_GT = 276,
00143      KW_LT = 277,
00144      KW_FROM = 278,
00145      KW_TO = 279,
00146      META_RANDOM = 280,
00147      META_LOADAVG_0 = 281,
00148      META_LOADAVG_1 = 282,
00149      META_LOADAVG_2 = 283,
00150      META_DEV = 284,
00151      META_PRIO = 285,
00152      META_PROTO = 286,
00153      META_PKTTYPE = 287,
00154      META_PKTLEN = 288,
00155      META_DATALEN = 289,
00156      META_MACLEN = 290,
00157      META_MARK = 291,
00158      META_TCINDEX = 292,
00159      META_RTCLASSID = 293,
00160      META_RTIIF = 294,
00161      META_SK_FAMILY = 295,
00162      META_SK_STATE = 296,
00163      META_SK_REUSE = 297,
00164      META_SK_REFCNT = 298,
00165      META_SK_RCVBUF = 299,
00166      META_SK_SNDBUF = 300,
00167      META_SK_SHUTDOWN = 301,
00168      META_SK_PROTO = 302,
00169      META_SK_TYPE = 303,
00170      META_SK_RMEM_ALLOC = 304,
00171      META_SK_WMEM_ALLOC = 305,
00172      META_SK_WMEM_QUEUED = 306,
00173      META_SK_RCV_QLEN = 307,
00174      META_SK_SND_QLEN = 308,
00175      META_SK_ERR_QLEN = 309,
00176      META_SK_FORWARD_ALLOCS = 310,
00177      META_SK_ALLOCS = 311,
00178      META_SK_ROUTE_CAPS = 312,
00179      META_SK_HASH = 313,
00180      META_SK_LINGERTIME = 314,
00181      META_SK_ACK_BACKLOG = 315,
00182      META_SK_MAX_ACK_BACKLOG = 316,
00183      META_SK_PRIO = 317,
00184      META_SK_RCVLOWAT = 318,
00185      META_SK_RCVTIMEO = 319,
00186      META_SK_SNDTIMEO = 320,
00187      META_SK_SENDMSG_OFF = 321,
00188      META_SK_WRITE_PENDING = 322,
00189      META_VLAN = 323,
00190      META_RXHASH = 324,
00191      META_DEVNAME = 325,
00192      META_SK_BOUND_IF = 326,
00193      STR = 327,
00194      QUOTED = 328
00195    };
00196 #endif
00197 /* Tokens.  */
00198 #define ERROR 258
00199 #define LOGIC 259
00200 #define NOT 260
00201 #define OPERAND 261
00202 #define NUMBER 262
00203 #define ALIGN 263
00204 #define LAYER 264
00205 #define KW_OPEN 265
00206 #define KW_CLOSE 266
00207 #define KW_PLUS 267
00208 #define KW_MASK 268
00209 #define KW_SHIFT 269
00210 #define KW_AT 270
00211 #define EMATCH_CMP 271
00212 #define EMATCH_NBYTE 272
00213 #define EMATCH_TEXT 273
00214 #define EMATCH_META 274
00215 #define KW_EQ 275
00216 #define KW_GT 276
00217 #define KW_LT 277
00218 #define KW_FROM 278
00219 #define KW_TO 279
00220 #define META_RANDOM 280
00221 #define META_LOADAVG_0 281
00222 #define META_LOADAVG_1 282
00223 #define META_LOADAVG_2 283
00224 #define META_DEV 284
00225 #define META_PRIO 285
00226 #define META_PROTO 286
00227 #define META_PKTTYPE 287
00228 #define META_PKTLEN 288
00229 #define META_DATALEN 289
00230 #define META_MACLEN 290
00231 #define META_MARK 291
00232 #define META_TCINDEX 292
00233 #define META_RTCLASSID 293
00234 #define META_RTIIF 294
00235 #define META_SK_FAMILY 295
00236 #define META_SK_STATE 296
00237 #define META_SK_REUSE 297
00238 #define META_SK_REFCNT 298
00239 #define META_SK_RCVBUF 299
00240 #define META_SK_SNDBUF 300
00241 #define META_SK_SHUTDOWN 301
00242 #define META_SK_PROTO 302
00243 #define META_SK_TYPE 303
00244 #define META_SK_RMEM_ALLOC 304
00245 #define META_SK_WMEM_ALLOC 305
00246 #define META_SK_WMEM_QUEUED 306
00247 #define META_SK_RCV_QLEN 307
00248 #define META_SK_SND_QLEN 308
00249 #define META_SK_ERR_QLEN 309
00250 #define META_SK_FORWARD_ALLOCS 310
00251 #define META_SK_ALLOCS 311
00252 #define META_SK_ROUTE_CAPS 312
00253 #define META_SK_HASH 313
00254 #define META_SK_LINGERTIME 314
00255 #define META_SK_ACK_BACKLOG 315
00256 #define META_SK_MAX_ACK_BACKLOG 316
00257 #define META_SK_PRIO 317
00258 #define META_SK_RCVLOWAT 318
00259 #define META_SK_RCVTIMEO 319
00260 #define META_SK_SNDTIMEO 320
00261 #define META_SK_SENDMSG_OFF 321
00262 #define META_SK_WRITE_PENDING 322
00263 #define META_VLAN 323
00264 #define META_RXHASH 324
00265 #define META_DEVNAME 325
00266 #define META_SK_BOUND_IF 326
00267 #define STR 327
00268 #define QUOTED 328
00269 
00270 
00271 
00272 
00273 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
00274 typedef union YYSTYPE
00275 {
00276 
00277 /* Line 293 of yacc.c  */
00278 #line 39 "route/cls/ematch_syntax.y"
00279 
00280         struct tcf_em_cmp       cmp;
00281         struct ematch_quoted    q;
00282         struct rtnl_ematch *    e;
00283         struct rtnl_pktloc *    loc;
00284         struct rtnl_meta_value *mv;
00285         uint32_t                i;
00286         uint64_t                i64;
00287         char *                  s;
00288 
00289 
00290 
00291 /* Line 293 of yacc.c  */
00292 #line 293 "route/cls/ematch_syntax.c"
00293 } YYSTYPE;
00294 # define YYSTYPE_IS_TRIVIAL 1
00295 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
00296 # define YYSTYPE_IS_DECLARED 1
00297 #endif
00298 
00299 
00300 /* Copy the second part of user declarations.  */
00301 
00302 /* Line 343 of yacc.c  */
00303 #line 50 "route/cls/ematch_syntax.y"
00304 
00305 extern int ematch_lex(YYSTYPE *, void *);
00306 
00307 static void yyerror(void *scanner, char **errp, struct nl_list_head *root, const char *msg)
00308 {
00309         if (msg)
00310                 asprintf(errp, "%s", msg);
00311 }
00312 
00313 
00314 /* Line 343 of yacc.c  */
00315 #line 316 "route/cls/ematch_syntax.c"
00316 
00317 #ifdef short
00318 # undef short
00319 #endif
00320 
00321 #ifdef YYTYPE_UINT8
00322 typedef YYTYPE_UINT8 yytype_uint8;
00323 #else
00324 typedef unsigned char yytype_uint8;
00325 #endif
00326 
00327 #ifdef YYTYPE_INT8
00328 typedef YYTYPE_INT8 yytype_int8;
00329 #elif (defined __STDC__ || defined __C99__FUNC__ \
00330      || defined __cplusplus || defined _MSC_VER)
00331 typedef signed char yytype_int8;
00332 #else
00333 typedef short int yytype_int8;
00334 #endif
00335 
00336 #ifdef YYTYPE_UINT16
00337 typedef YYTYPE_UINT16 yytype_uint16;
00338 #else
00339 typedef unsigned short int yytype_uint16;
00340 #endif
00341 
00342 #ifdef YYTYPE_INT16
00343 typedef YYTYPE_INT16 yytype_int16;
00344 #else
00345 typedef short int yytype_int16;
00346 #endif
00347 
00348 #ifndef YYSIZE_T
00349 # ifdef __SIZE_TYPE__
00350 #  define YYSIZE_T __SIZE_TYPE__
00351 # elif defined size_t
00352 #  define YYSIZE_T size_t
00353 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00354      || defined __cplusplus || defined _MSC_VER)
00355 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
00356 #  define YYSIZE_T size_t
00357 # else
00358 #  define YYSIZE_T unsigned int
00359 # endif
00360 #endif
00361 
00362 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
00363 
00364 #ifndef YY_
00365 # if defined YYENABLE_NLS && YYENABLE_NLS
00366 #  if ENABLE_NLS
00367 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
00368 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
00369 #  endif
00370 # endif
00371 # ifndef YY_
00372 #  define YY_(msgid) msgid
00373 # endif
00374 #endif
00375 
00376 /* Suppress unused-variable warnings by "using" E.  */
00377 #if ! defined lint || defined __GNUC__
00378 # define YYUSE(e) ((void) (e))
00379 #else
00380 # define YYUSE(e) /* empty */
00381 #endif
00382 
00383 /* Identity function, used to suppress warnings about constant conditions.  */
00384 #ifndef lint
00385 # define YYID(n) (n)
00386 #else
00387 #if (defined __STDC__ || defined __C99__FUNC__ \
00388      || defined __cplusplus || defined _MSC_VER)
00389 static int
00390 YYID (int yyi)
00391 #else
00392 static int
00393 YYID (yyi)
00394     int yyi;
00395 #endif
00396 {
00397   return yyi;
00398 }
00399 #endif
00400 
00401 #if ! defined yyoverflow || YYERROR_VERBOSE
00402 
00403 /* The parser invokes alloca or malloc; define the necessary symbols.  */
00404 
00405 # ifdef YYSTACK_USE_ALLOCA
00406 #  if YYSTACK_USE_ALLOCA
00407 #   ifdef __GNUC__
00408 #    define YYSTACK_ALLOC __builtin_alloca
00409 #   elif defined __BUILTIN_VA_ARG_INCR
00410 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
00411 #   elif defined _AIX
00412 #    define YYSTACK_ALLOC __alloca
00413 #   elif defined _MSC_VER
00414 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
00415 #    define alloca _alloca
00416 #   else
00417 #    define YYSTACK_ALLOC alloca
00418 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
00419      || defined __cplusplus || defined _MSC_VER)
00420 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00421 #     ifndef EXIT_SUCCESS
00422 #      define EXIT_SUCCESS 0
00423 #     endif
00424 #    endif
00425 #   endif
00426 #  endif
00427 # endif
00428 
00429 # ifdef YYSTACK_ALLOC
00430    /* Pacify GCC's `empty if-body' warning.  */
00431 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
00432 #  ifndef YYSTACK_ALLOC_MAXIMUM
00433     /* The OS might guarantee only one guard page at the bottom of the stack,
00434        and a page size can be as small as 4096 bytes.  So we cannot safely
00435        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
00436        to allow for a few compiler-allocated temporary stack slots.  */
00437 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
00438 #  endif
00439 # else
00440 #  define YYSTACK_ALLOC YYMALLOC
00441 #  define YYSTACK_FREE YYFREE
00442 #  ifndef YYSTACK_ALLOC_MAXIMUM
00443 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
00444 #  endif
00445 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
00446        && ! ((defined YYMALLOC || defined malloc) \
00447              && (defined YYFREE || defined free)))
00448 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00449 #   ifndef EXIT_SUCCESS
00450 #    define EXIT_SUCCESS 0
00451 #   endif
00452 #  endif
00453 #  ifndef YYMALLOC
00454 #   define YYMALLOC malloc
00455 #   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
00456      || defined __cplusplus || defined _MSC_VER)
00457 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
00458 #   endif
00459 #  endif
00460 #  ifndef YYFREE
00461 #   define YYFREE free
00462 #   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
00463      || defined __cplusplus || defined _MSC_VER)
00464 void free (void *); /* INFRINGES ON USER NAME SPACE */
00465 #   endif
00466 #  endif
00467 # endif
00468 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
00469 
00470 
00471 #if (! defined yyoverflow \
00472      && (! defined __cplusplus \
00473          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00474 
00475 /* A type that is properly aligned for any stack member.  */
00476 union yyalloc
00477 {
00478   yytype_int16 yyss_alloc;
00479   YYSTYPE yyvs_alloc;
00480 };
00481 
00482 /* The size of the maximum gap between one aligned stack and the next.  */
00483 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00484 
00485 /* The size of an array large to enough to hold all stacks, each with
00486    N elements.  */
00487 # define YYSTACK_BYTES(N) \
00488      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
00489       + YYSTACK_GAP_MAXIMUM)
00490 
00491 # define YYCOPY_NEEDED 1
00492 
00493 /* Relocate STACK from its old location to the new one.  The
00494    local variables YYSIZE and YYSTACKSIZE give the old and new number of
00495    elements in the stack, and YYPTR gives the new location of the
00496    stack.  Advance YYPTR to a properly aligned location for the next
00497    stack.  */
00498 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
00499     do                                                                  \
00500       {                                                                 \
00501         YYSIZE_T yynewbytes;                                            \
00502         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
00503         Stack = &yyptr->Stack_alloc;                                    \
00504         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
00505         yyptr += yynewbytes / sizeof (*yyptr);                          \
00506       }                                                                 \
00507     while (YYID (0))
00508 
00509 #endif
00510 
00511 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
00512 /* Copy COUNT objects from FROM to TO.  The source and destination do
00513    not overlap.  */
00514 # ifndef YYCOPY
00515 #  if defined __GNUC__ && 1 < __GNUC__
00516 #   define YYCOPY(To, From, Count) \
00517       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00518 #  else
00519 #   define YYCOPY(To, From, Count)              \
00520       do                                        \
00521         {                                       \
00522           YYSIZE_T yyi;                         \
00523           for (yyi = 0; yyi < (Count); yyi++)   \
00524             (To)[yyi] = (From)[yyi];            \
00525         }                                       \
00526       while (YYID (0))
00527 #  endif
00528 # endif
00529 #endif /* !YYCOPY_NEEDED */
00530 
00531 /* YYFINAL -- State number of the termination state.  */
00532 #define YYFINAL  26
00533 /* YYLAST -- Last index in YYTABLE.  */
00534 #define YYLAST   138
00535 
00536 /* YYNTOKENS -- Number of terminals.  */
00537 #define YYNTOKENS  74
00538 /* YYNNTS -- Number of nonterminals.  */
00539 #define YYNNTS  18
00540 /* YYNRULES -- Number of rules.  */
00541 #define YYNRULES  84
00542 /* YYNRULES -- Number of states.  */
00543 #define YYNSTATES  118
00544 
00545 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
00546 #define YYUNDEFTOK  2
00547 #define YYMAXUTOK   328
00548 
00549 #define YYTRANSLATE(YYX)                                                \
00550   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00551 
00552 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
00553 static const yytype_uint8 yytranslate[] =
00554 {
00555        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00556        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00557        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00558        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00559        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00560        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00561        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00562        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00563        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00564        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00565        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00566        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00567        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00568        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00569        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00570        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00571        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00572        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00573        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00574        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00575        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00576        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00577        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00578        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00579        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00580        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
00581        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
00582       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
00583       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
00584       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
00585       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
00586       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
00587       65,    66,    67,    68,    69,    70,    71,    72,    73
00588 };
00589 
00590 #if YYDEBUG
00591 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
00592    YYRHS.  */
00593 static const yytype_uint8 yyprhs[] =
00594 {
00595        0,     0,     3,     4,     6,     8,    12,    15,    17,    19,
00596       26,    34,    41,    45,    50,    52,    56,    57,    60,    61,
00597       64,    66,    68,    72,    75,    77,    79,    81,    83,    85,
00598       87,    89,    91,    93,    95,    97,    99,   101,   103,   105,
00599      107,   109,   111,   113,   115,   117,   119,   121,   123,   125,
00600      127,   129,   131,   133,   135,   137,   139,   141,   143,   145,
00601      147,   149,   151,   153,   155,   157,   159,   161,   163,   165,
00602      167,   169,   171,   173,   175,   181,   182,   185,   188,   189,
00603      192,   193,   196,   198,   200
00604 };
00605 
00606 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
00607 static const yytype_int8 yyrhs[] =
00608 {
00609       75,     0,    -1,    -1,    76,    -1,    77,    -1,    77,     4,
00610       76,    -1,     5,    78,    -1,    78,    -1,    79,    -1,    17,
00611       10,    87,    20,    86,    11,    -1,    18,    10,    72,    73,
00612       81,    82,    11,    -1,    19,    10,    83,    91,    83,    11,
00613       -1,    10,    76,    11,    -1,    16,    10,    80,    11,    -1,
00614       80,    -1,    87,    91,     7,    -1,    -1,    23,    87,    -1,
00615       -1,    24,    87,    -1,    73,    -1,     7,    -1,    84,    90,
00616       89,    -1,    85,    90,    -1,    25,    -1,    26,    -1,    27,
00617       -1,    28,    -1,    29,    -1,    30,    -1,    31,    -1,    32,
00618       -1,    33,    -1,    34,    -1,    35,    -1,    36,    -1,    37,
00619       -1,    38,    -1,    39,    -1,    40,    -1,    41,    -1,    42,
00620       -1,    43,    -1,    44,    -1,    45,    -1,    46,    -1,    47,
00621       -1,    48,    -1,    49,    -1,    50,    -1,    51,    -1,    52,
00622       -1,    53,    -1,    54,    -1,    55,    -1,    56,    -1,    57,
00623       -1,    58,    -1,    59,    -1,    60,    -1,    61,    -1,    62,
00624       -1,    63,    -1,    64,    -1,    65,    -1,    66,    -1,    67,
00625       -1,    68,    -1,    69,    -1,    70,    -1,    71,    -1,    73,
00626       -1,    72,    -1,    72,    -1,    88,     9,    12,     7,    89,
00627       -1,    -1,     8,    15,    -1,     7,    15,    -1,    -1,    13,
00628        7,    -1,    -1,    14,     7,    -1,    20,    -1,    21,    -1,
00629       22,    -1
00630 };
00631 
00632 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
00633 static const yytype_uint16 yyrline[] =
00634 {
00635        0,   146,   146,   148,   155,   159,   171,   176,   184,   199,
00636      217,   244,   263,   291,   293,   298,   319,   320,   326,   327,
00637      332,   334,   336,   338,   343,   344,   345,   346,   347,   348,
00638      349,   350,   351,   352,   353,   354,   355,   356,   357,   358,
00639      359,   360,   361,   362,   363,   364,   365,   366,   367,   368,
00640      369,   370,   371,   372,   373,   374,   375,   376,   377,   378,
00641      379,   380,   381,   382,   383,   384,   385,   386,   387,   391,
00642      392,   399,   403,   431,   443,   469,   470,   472,   478,   479,
00643      485,   486,   491,   493,   495
00644 };
00645 #endif
00646 
00647 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00648 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
00649    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
00650 static const char *const yytname[] =
00651 {
00652   "$end", "error", "$undefined", "ERROR", "LOGIC", "NOT", "OPERAND",
00653   "NUMBER", "ALIGN", "LAYER", "\"(\"", "\")\"", "\"+\"", "\"mask\"",
00654   "\">>\"", "\"at\"", "\"cmp\"", "\"pattern\"", "\"text\"", "\"meta\"",
00655   "\"=\"", "\">\"", "\"<\"", "\"from\"", "\"to\"", "\"random\"",
00656   "\"loadavg_0\"", "\"loadavg_1\"", "\"loadavg_2\"", "\"dev\"", "\"prio\"",
00657   "\"proto\"", "\"pkttype\"", "\"pktlen\"", "\"datalen\"", "\"maclen\"",
00658   "\"mark\"", "\"tcindex\"", "\"rtclassid\"", "\"rtiif\"", "\"sk_family\"",
00659   "\"sk_state\"", "\"sk_reuse\"", "\"sk_refcnt\"", "\"sk_rcvbuf\"",
00660   "\"sk_sndbuf\"", "\"sk_shutdown\"", "\"sk_proto\"", "\"sk_type\"",
00661   "\"sk_rmem_alloc\"", "\"sk_wmem_alloc\"", "\"sk_wmem_queued\"",
00662   "\"sk_rcv_qlen\"", "\"sk_snd_qlen\"", "\"sk_err_qlen\"",
00663   "\"sk_forward_allocs\"", "\"sk_allocs\"", "\"sk_route_caps\"",
00664   "\"sk_hash\"", "\"sk_lingertime\"", "\"sk_ack_backlog\"",
00665   "\"sk_max_ack_backlog\"", "\"sk_prio\"", "\"sk_rcvlowat\"",
00666   "\"sk_rcvtimeo\"", "\"sk_sndtimeo\"", "\"sk_sendmsg_off\"",
00667   "\"sk_write_pending\"", "\"vlan\"", "\"rxhash\"", "\"devname\"",
00668   "\"sk_bound_if\"", "STR", "QUOTED", "$accept", "input", "expr", "match",
00669   "ematch", "cmp_match", "cmp_expr", "text_from", "text_to", "meta_value",
00670   "meta_int_id", "meta_var_id", "pattern", "pktloc", "align", "mask",
00671   "shift", "operand", 0
00672 };
00673 #endif
00674 
00675 # ifdef YYPRINT
00676 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
00677    token YYLEX-NUM.  */
00678 static const yytype_uint16 yytoknum[] =
00679 {
00680        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
00681      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
00682      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
00683      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
00684      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
00685      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
00686      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
00687      325,   326,   327,   328
00688 };
00689 # endif
00690 
00691 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
00692 static const yytype_uint8 yyr1[] =
00693 {
00694        0,    74,    75,    75,    76,    76,    77,    77,    78,    78,
00695       78,    78,    78,    79,    79,    80,    81,    81,    82,    82,
00696       83,    83,    83,    83,    84,    84,    84,    84,    84,    84,
00697       84,    84,    84,    84,    84,    84,    84,    84,    84,    84,
00698       84,    84,    84,    84,    84,    84,    84,    84,    84,    84,
00699       84,    84,    84,    84,    84,    84,    84,    84,    84,    84,
00700       84,    84,    84,    84,    84,    84,    84,    84,    84,    85,
00701       85,    86,    86,    87,    87,    88,    88,    88,    89,    89,
00702       90,    90,    91,    91,    91
00703 };
00704 
00705 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
00706 static const yytype_uint8 yyr2[] =
00707 {
00708        0,     2,     0,     1,     1,     3,     2,     1,     1,     6,
00709        7,     6,     3,     4,     1,     3,     0,     2,     0,     2,
00710        1,     1,     3,     2,     1,     1,     1,     1,     1,     1,
00711        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
00712        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
00713        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
00714        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
00715        1,     1,     1,     1,     5,     0,     2,     2,     0,     2,
00716        0,     2,     1,     1,     1
00717 };
00718 
00719 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
00720    Performed when YYTABLE doesn't specify something else to do.  Zero
00721    means the default is an error.  */
00722 static const yytype_uint8 yydefact[] =
00723 {
00724        2,    75,     0,     0,    75,     0,     0,     0,     0,    73,
00725        0,     3,     4,     7,     8,    14,     0,     0,     6,    77,
00726       76,     0,    75,    75,     0,     0,     1,    75,    82,    83,
00727       84,     0,     0,    12,     0,     0,     0,    21,    24,    25,
00728       26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
00729       36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
00730       46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
00731       56,    57,    58,    59,    60,    61,    62,    63,    64,    65,
00732       66,    67,    68,    69,    70,    20,     0,    80,    80,     5,
00733       15,     0,    13,     0,    16,     0,     0,    78,    23,    78,
00734       72,    71,     0,    75,    18,     0,    81,     0,    22,    74,
00735        9,    17,    75,     0,    11,    79,    19,    10
00736 };
00737 
00738 /* YYDEFGOTO[NTERM-NUM].  */
00739 static const yytype_int8 yydefgoto[] =
00740 {
00741       -1,    10,    11,    12,    13,    14,    15,   104,   113,    86,
00742       87,    88,   102,    16,    17,   108,    97,    31
00743 };
00744 
00745 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
00746    STATE-NUM.  */
00747 #define YYPACT_NINF -63
00748 static const yytype_int8 yypact[] =
00749 {
00750       -4,    15,   -13,    -8,    11,    10,    14,    25,    29,   -63,
00751       26,   -63,    37,   -63,   -63,   -63,    16,    33,   -63,   -63,
00752      -63,    32,     1,     1,   -28,    65,   -63,    11,   -63,   -63,
00753      -63,    38,    34,   -63,    36,    28,   -24,   -63,   -63,   -63,
00754      -63,   -63,   -63,   -63,   -63,   -63,   -63,   -63,   -63,   -63,
00755      -63,   -63,   -63,   -63,   -63,   -63,   -63,   -63,   -63,   -63,
00756      -63,   -63,   -63,   -63,   -63,   -63,   -63,   -63,   -63,   -63,
00757      -63,   -63,   -63,   -63,   -63,   -63,   -63,   -63,   -63,   -63,
00758      -63,   -63,   -63,   -63,   -63,   -63,    16,    39,    39,   -63,
00759      -63,    43,   -63,   -62,    31,    65,    44,    42,   -63,    42,
00760      -63,   -63,    41,     1,    35,    45,   -63,    50,   -63,   -63,
00761      -63,   -63,     1,    47,   -63,   -63,   -63,   -63
00762 };
00763 
00764 /* YYPGOTO[NTERM-NUM].  */
00765 static const yytype_int8 yypgoto[] =
00766 {
00767      -63,   -63,    13,   -63,    59,   -63,    40,   -63,   -63,   -34,
00768      -63,   -63,   -63,   -23,   -63,   -36,   -22,   -21
00769 };
00770 
00771 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
00772    positive, shift that token.  If negative, reduce the rule which
00773    number is the opposite.  If YYTABLE_NINF, syntax error.  */
00774 #define YYTABLE_NINF -76
00775 static const yytype_int8 yytable[] =
00776 {
00777       35,     1,    19,     2,     3,   -75,     4,    20,     2,     3,
00778      100,   101,     5,     6,     7,     8,     1,    21,     2,     3,
00779       22,     4,     2,     3,    23,     4,    26,     5,     6,     7,
00780        8,     5,     6,     7,     8,    24,    28,    29,    30,    25,
00781       89,    27,    32,    33,    36,    90,    91,    92,    93,    94,
00782       99,   106,   110,    96,   103,   107,   114,   115,   117,   112,
00783       18,   105,    34,   109,     0,    95,    98,     0,     9,     0,
00784        0,     0,    37,     9,     0,     0,     0,     0,     0,     0,
00785      111,     0,     0,     9,     0,     0,     0,     9,     0,   116,
00786       38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
00787       48,    49,    50,    51,    52,    53,    54,    55,    56,    57,
00788       58,    59,    60,    61,    62,    63,    64,    65,    66,    67,
00789       68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
00790       78,    79,    80,    81,    82,    83,    84,     0,    85
00791 };
00792 
00793 #define yypact_value_is_default(yystate) \
00794   ((yystate) == (-63))
00795 
00796 #define yytable_value_is_error(yytable_value) \
00797   YYID (0)
00798 
00799 static const yytype_int8 yycheck[] =
00800 {
00801       23,     5,    15,     7,     8,     9,    10,    15,     7,     8,
00802       72,    73,    16,    17,    18,    19,     5,     4,     7,     8,
00803       10,    10,     7,     8,    10,    10,     0,    16,    17,    18,
00804       19,    16,    17,    18,    19,    10,    20,    21,    22,    10,
00805       27,     4,     9,    11,    72,     7,    12,    11,    20,    73,
00806        7,     7,    11,    14,    23,    13,    11,     7,    11,    24,
00807        1,    95,    22,    99,    -1,    86,    88,    -1,    72,    -1,
00808       -1,    -1,     7,    72,    -1,    -1,    -1,    -1,    -1,    -1,
00809      103,    -1,    -1,    72,    -1,    -1,    -1,    72,    -1,   112,
00810       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
00811       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
00812       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
00813       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
00814       65,    66,    67,    68,    69,    70,    71,    -1,    73
00815 };
00816 
00817 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
00818    symbol of state STATE-NUM.  */
00819 static const yytype_uint8 yystos[] =
00820 {
00821        0,     5,     7,     8,    10,    16,    17,    18,    19,    72,
00822       75,    76,    77,    78,    79,    80,    87,    88,    78,    15,
00823       15,    76,    10,    10,    10,    10,     0,     4,    20,    21,
00824       22,    91,     9,    11,    80,    87,    72,     7,    25,    26,
00825       27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
00826       37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
00827       47,    48,    49,    50,    51,    52,    53,    54,    55,    56,
00828       57,    58,    59,    60,    61,    62,    63,    64,    65,    66,
00829       67,    68,    69,    70,    71,    73,    83,    84,    85,    76,
00830        7,    12,    11,    20,    73,    91,    14,    90,    90,     7,
00831       72,    73,    86,    23,    81,    83,     7,    13,    89,    89,
00832       11,    87,    24,    82,    11,     7,    87,    11
00833 };
00834 
00835 #define yyerrok         (yyerrstatus = 0)
00836 #define yyclearin       (yychar = YYEMPTY)
00837 #define YYEMPTY         (-2)
00838 #define YYEOF           0
00839 
00840 #define YYACCEPT        goto yyacceptlab
00841 #define YYABORT         goto yyabortlab
00842 #define YYERROR         goto yyerrorlab
00843 
00844 
00845 /* Like YYERROR except do call yyerror.  This remains here temporarily
00846    to ease the transition to the new meaning of YYERROR, for GCC.
00847    Once GCC version 2 has supplanted version 1, this can go.  However,
00848    YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
00849    in Bison 2.4.2's NEWS entry, where a plan to phase it out is
00850    discussed.  */
00851 
00852 #define YYFAIL          goto yyerrlab
00853 #if defined YYFAIL
00854   /* This is here to suppress warnings from the GCC cpp's
00855      -Wunused-macros.  Normally we don't worry about that warning, but
00856      some users do, and we want to make it easy for users to remove
00857      YYFAIL uses, which will produce warnings from Bison 2.5.  */
00858 #endif
00859 
00860 #define YYRECOVERING()  (!!yyerrstatus)
00861 
00862 #define YYBACKUP(Token, Value)                                  \
00863 do                                                              \
00864   if (yychar == YYEMPTY && yylen == 1)                          \
00865     {                                                           \
00866       yychar = (Token);                                         \
00867       yylval = (Value);                                         \
00868       YYPOPSTACK (1);                                           \
00869       goto yybackup;                                            \
00870     }                                                           \
00871   else                                                          \
00872     {                                                           \
00873       yyerror (scanner, errp, root, YY_("syntax error: cannot back up")); \
00874       YYERROR;                                                  \
00875     }                                                           \
00876 while (YYID (0))
00877 
00878 
00879 #define YYTERROR        1
00880 #define YYERRCODE       256
00881 
00882 
00883 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
00884    If N is 0, then set CURRENT to the empty location which ends
00885    the previous symbol: RHS[0] (always defined).  */
00886 
00887 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
00888 #ifndef YYLLOC_DEFAULT
00889 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
00890     do                                                                  \
00891       if (YYID (N))                                                    \
00892         {                                                               \
00893           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
00894           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
00895           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
00896           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
00897         }                                                               \
00898       else                                                              \
00899         {                                                               \
00900           (Current).first_line   = (Current).last_line   =              \
00901             YYRHSLOC (Rhs, 0).last_line;                                \
00902           (Current).first_column = (Current).last_column =              \
00903             YYRHSLOC (Rhs, 0).last_column;                              \
00904         }                                                               \
00905     while (YYID (0))
00906 #endif
00907 
00908 
00909 /* This macro is provided for backward compatibility. */
00910 
00911 #ifndef YY_LOCATION_PRINT
00912 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
00913 #endif
00914 
00915 
00916 /* YYLEX -- calling `yylex' with the right arguments.  */
00917 
00918 #ifdef YYLEX_PARAM
00919 # define YYLEX yylex (&yylval, YYLEX_PARAM)
00920 #else
00921 # define YYLEX yylex (&yylval, scanner)
00922 #endif
00923 
00924 /* Enable debugging if requested.  */
00925 #if YYDEBUG
00926 
00927 # ifndef YYFPRINTF
00928 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
00929 #  define YYFPRINTF fprintf
00930 # endif
00931 
00932 # define YYDPRINTF(Args)                        \
00933 do {                                            \
00934   if (yydebug)                                  \
00935     YYFPRINTF Args;                             \
00936 } while (YYID (0))
00937 
00938 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
00939 do {                                                                      \
00940   if (yydebug)                                                            \
00941     {                                                                     \
00942       YYFPRINTF (stderr, "%s ", Title);                                   \
00943       yy_symbol_print (stderr,                                            \
00944                   Type, Value, scanner, errp, root); \
00945       YYFPRINTF (stderr, "\n");                                           \
00946     }                                                                     \
00947 } while (YYID (0))
00948 
00949 
00950 /*--------------------------------.
00951 | Print this symbol on YYOUTPUT.  |
00952 `--------------------------------*/
00953 
00954 /*ARGSUSED*/
00955 #if (defined __STDC__ || defined __C99__FUNC__ \
00956      || defined __cplusplus || defined _MSC_VER)
00957 static void
00958 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, char **errp, struct nl_list_head *root)
00959 #else
00960 static void
00961 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
00962     FILE *yyoutput;
00963     int yytype;
00964     YYSTYPE const * const yyvaluep;
00965     void *scanner;
00966     char **errp;
00967     struct nl_list_head *root;
00968 #endif
00969 {
00970   if (!yyvaluep)
00971     return;
00972   YYUSE (scanner);
00973   YYUSE (errp);
00974   YYUSE (root);
00975 # ifdef YYPRINT
00976   if (yytype < YYNTOKENS)
00977     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
00978 # else
00979   YYUSE (yyoutput);
00980 # endif
00981   switch (yytype)
00982     {
00983       default:
00984         break;
00985     }
00986 }
00987 
00988 
00989 /*--------------------------------.
00990 | Print this symbol on YYOUTPUT.  |
00991 `--------------------------------*/
00992 
00993 #if (defined __STDC__ || defined __C99__FUNC__ \
00994      || defined __cplusplus || defined _MSC_VER)
00995 static void
00996 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, char **errp, struct nl_list_head *root)
00997 #else
00998 static void
00999 yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
01000     FILE *yyoutput;
01001     int yytype;
01002     YYSTYPE const * const yyvaluep;
01003     void *scanner;
01004     char **errp;
01005     struct nl_list_head *root;
01006 #endif
01007 {
01008   if (yytype < YYNTOKENS)
01009     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
01010   else
01011     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
01012 
01013   yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root);
01014   YYFPRINTF (yyoutput, ")");
01015 }
01016 
01017 /*------------------------------------------------------------------.
01018 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
01019 | TOP (included).                                                   |
01020 `------------------------------------------------------------------*/
01021 
01022 #if (defined __STDC__ || defined __C99__FUNC__ \
01023      || defined __cplusplus || defined _MSC_VER)
01024 static void
01025 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
01026 #else
01027 static void
01028 yy_stack_print (yybottom, yytop)
01029     yytype_int16 *yybottom;
01030     yytype_int16 *yytop;
01031 #endif
01032 {
01033   YYFPRINTF (stderr, "Stack now");
01034   for (; yybottom <= yytop; yybottom++)
01035     {
01036       int yybot = *yybottom;
01037       YYFPRINTF (stderr, " %d", yybot);
01038     }
01039   YYFPRINTF (stderr, "\n");
01040 }
01041 
01042 # define YY_STACK_PRINT(Bottom, Top)                            \
01043 do {                                                            \
01044   if (yydebug)                                                  \
01045     yy_stack_print ((Bottom), (Top));                           \
01046 } while (YYID (0))
01047 
01048 
01049 /*------------------------------------------------.
01050 | Report that the YYRULE is going to be reduced.  |
01051 `------------------------------------------------*/
01052 
01053 #if (defined __STDC__ || defined __C99__FUNC__ \
01054      || defined __cplusplus || defined _MSC_VER)
01055 static void
01056 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *scanner, char **errp, struct nl_list_head *root)
01057 #else
01058 static void
01059 yy_reduce_print (yyvsp, yyrule, scanner, errp, root)
01060     YYSTYPE *yyvsp;
01061     int yyrule;
01062     void *scanner;
01063     char **errp;
01064     struct nl_list_head *root;
01065 #endif
01066 {
01067   int yynrhs = yyr2[yyrule];
01068   int yyi;
01069   unsigned long int yylno = yyrline[yyrule];
01070   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
01071              yyrule - 1, yylno);
01072   /* The symbols being reduced.  */
01073   for (yyi = 0; yyi < yynrhs; yyi++)
01074     {
01075       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
01076       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
01077                        &(yyvsp[(yyi + 1) - (yynrhs)])
01078                                        , scanner, errp, root);
01079       YYFPRINTF (stderr, "\n");
01080     }
01081 }
01082 
01083 # define YY_REDUCE_PRINT(Rule)          \
01084 do {                                    \
01085   if (yydebug)                          \
01086     yy_reduce_print (yyvsp, Rule, scanner, errp, root); \
01087 } while (YYID (0))
01088 
01089 /* Nonzero means print parse trace.  It is left uninitialized so that
01090    multiple parsers can coexist.  */
01091 int yydebug;
01092 #else /* !YYDEBUG */
01093 # define YYDPRINTF(Args)
01094 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
01095 # define YY_STACK_PRINT(Bottom, Top)
01096 # define YY_REDUCE_PRINT(Rule)
01097 #endif /* !YYDEBUG */
01098 
01099 
01100 /* YYINITDEPTH -- initial size of the parser's stacks.  */
01101 #ifndef YYINITDEPTH
01102 # define YYINITDEPTH 200
01103 #endif
01104 
01105 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
01106    if the built-in stack extension method is used).
01107 
01108    Do not make this value too large; the results are undefined if
01109    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
01110    evaluated with infinite-precision integer arithmetic.  */
01111 
01112 #ifndef YYMAXDEPTH
01113 # define YYMAXDEPTH 10000
01114 #endif
01115 
01116 
01117 #if YYERROR_VERBOSE
01118 
01119 # ifndef yystrlen
01120 #  if defined __GLIBC__ && defined _STRING_H
01121 #   define yystrlen strlen
01122 #  else
01123 /* Return the length of YYSTR.  */
01124 #if (defined __STDC__ || defined __C99__FUNC__ \
01125      || defined __cplusplus || defined _MSC_VER)
01126 static YYSIZE_T
01127 yystrlen (const char *yystr)
01128 #else
01129 static YYSIZE_T
01130 yystrlen (yystr)
01131     const char *yystr;
01132 #endif
01133 {
01134   YYSIZE_T yylen;
01135   for (yylen = 0; yystr[yylen]; yylen++)
01136     continue;
01137   return yylen;
01138 }
01139 #  endif
01140 # endif
01141 
01142 # ifndef yystpcpy
01143 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
01144 #   define yystpcpy stpcpy
01145 #  else
01146 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
01147    YYDEST.  */
01148 #if (defined __STDC__ || defined __C99__FUNC__ \
01149      || defined __cplusplus || defined _MSC_VER)
01150 static char *
01151 yystpcpy (char *yydest, const char *yysrc)
01152 #else
01153 static char *
01154 yystpcpy (yydest, yysrc)
01155     char *yydest;
01156     const char *yysrc;
01157 #endif
01158 {
01159   char *yyd = yydest;
01160   const char *yys = yysrc;
01161 
01162   while ((*yyd++ = *yys++) != '\0')
01163     continue;
01164 
01165   return yyd - 1;
01166 }
01167 #  endif
01168 # endif
01169 
01170 # ifndef yytnamerr
01171 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
01172    quotes and backslashes, so that it's suitable for yyerror.  The
01173    heuristic is that double-quoting is unnecessary unless the string
01174    contains an apostrophe, a comma, or backslash (other than
01175    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
01176    null, do not copy; instead, return the length of what the result
01177    would have been.  */
01178 static YYSIZE_T
01179 yytnamerr (char *yyres, const char *yystr)
01180 {
01181   if (*yystr == '"')
01182     {
01183       YYSIZE_T yyn = 0;
01184       char const *yyp = yystr;
01185 
01186       for (;;)
01187         switch (*++yyp)
01188           {
01189           case '\'':
01190           case ',':
01191             goto do_not_strip_quotes;
01192 
01193           case '\\':
01194             if (*++yyp != '\\')
01195               goto do_not_strip_quotes;
01196             /* Fall through.  */
01197           default:
01198             if (yyres)
01199               yyres[yyn] = *yyp;
01200             yyn++;
01201             break;
01202 
01203           case '"':
01204             if (yyres)
01205               yyres[yyn] = '\0';
01206             return yyn;
01207           }
01208     do_not_strip_quotes: ;
01209     }
01210 
01211   if (! yyres)
01212     return yystrlen (yystr);
01213 
01214   return yystpcpy (yyres, yystr) - yyres;
01215 }
01216 # endif
01217 
01218 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
01219    about the unexpected token YYTOKEN for the state stack whose top is
01220    YYSSP.
01221 
01222    Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
01223    not large enough to hold the message.  In that case, also set
01224    *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
01225    required number of bytes is too large to store.  */
01226 static int
01227 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
01228                 yytype_int16 *yyssp, int yytoken)
01229 {
01230   YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
01231   YYSIZE_T yysize = yysize0;
01232   YYSIZE_T yysize1;
01233   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
01234   /* Internationalized format string. */
01235   const char *yyformat = 0;
01236   /* Arguments of yyformat. */
01237   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
01238   /* Number of reported tokens (one for the "unexpected", one per
01239      "expected"). */
01240   int yycount = 0;
01241 
01242   /* There are many possibilities here to consider:
01243      - Assume YYFAIL is not used.  It's too flawed to consider.  See
01244        <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
01245        for details.  YYERROR is fine as it does not invoke this
01246        function.
01247      - If this state is a consistent state with a default action, then
01248        the only way this function was invoked is if the default action
01249        is an error action.  In that case, don't check for expected
01250        tokens because there are none.
01251      - The only way there can be no lookahead present (in yychar) is if
01252        this state is a consistent state with a default action.  Thus,
01253        detecting the absence of a lookahead is sufficient to determine
01254        that there is no unexpected or expected token to report.  In that
01255        case, just report a simple "syntax error".
01256      - Don't assume there isn't a lookahead just because this state is a
01257        consistent state with a default action.  There might have been a
01258        previous inconsistent state, consistent state with a non-default
01259        action, or user semantic action that manipulated yychar.
01260      - Of course, the expected token list depends on states to have
01261        correct lookahead information, and it depends on the parser not
01262        to perform extra reductions after fetching a lookahead from the
01263        scanner and before detecting a syntax error.  Thus, state merging
01264        (from LALR or IELR) and default reductions corrupt the expected
01265        token list.  However, the list is correct for canonical LR with
01266        one exception: it will still contain any token that will not be
01267        accepted due to an error action in a later state.
01268   */
01269   if (yytoken != YYEMPTY)
01270     {
01271       int yyn = yypact[*yyssp];
01272       yyarg[yycount++] = yytname[yytoken];
01273       if (!yypact_value_is_default (yyn))
01274         {
01275           /* Start YYX at -YYN if negative to avoid negative indexes in
01276              YYCHECK.  In other words, skip the first -YYN actions for
01277              this state because they are default actions.  */
01278           int yyxbegin = yyn < 0 ? -yyn : 0;
01279           /* Stay within bounds of both yycheck and yytname.  */
01280           int yychecklim = YYLAST - yyn + 1;
01281           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
01282           int yyx;
01283 
01284           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
01285             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
01286                 && !yytable_value_is_error (yytable[yyx + yyn]))
01287               {
01288                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
01289                   {
01290                     yycount = 1;
01291                     yysize = yysize0;
01292                     break;
01293                   }
01294                 yyarg[yycount++] = yytname[yyx];
01295                 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
01296                 if (! (yysize <= yysize1
01297                        && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
01298                   return 2;
01299                 yysize = yysize1;
01300               }
01301         }
01302     }
01303 
01304   switch (yycount)
01305     {
01306 # define YYCASE_(N, S)                      \
01307       case N:                               \
01308         yyformat = S;                       \
01309       break
01310       YYCASE_(0, YY_("syntax error"));
01311       YYCASE_(1, YY_("syntax error, unexpected %s"));
01312       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
01313       YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
01314       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
01315       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
01316 # undef YYCASE_
01317     }
01318 
01319   yysize1 = yysize + yystrlen (yyformat);
01320   if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
01321     return 2;
01322   yysize = yysize1;
01323 
01324   if (*yymsg_alloc < yysize)
01325     {
01326       *yymsg_alloc = 2 * yysize;
01327       if (! (yysize <= *yymsg_alloc
01328              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
01329         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
01330       return 1;
01331     }
01332 
01333   /* Avoid sprintf, as that infringes on the user's name space.
01334      Don't have undefined behavior even if the translation
01335      produced a string with the wrong number of "%s"s.  */
01336   {
01337     char *yyp = *yymsg;
01338     int yyi = 0;
01339     while ((*yyp = *yyformat) != '\0')
01340       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
01341         {
01342           yyp += yytnamerr (yyp, yyarg[yyi++]);
01343           yyformat += 2;
01344         }
01345       else
01346         {
01347           yyp++;
01348           yyformat++;
01349         }
01350   }
01351   return 0;
01352 }
01353 #endif /* YYERROR_VERBOSE */
01354 
01355 /*-----------------------------------------------.
01356 | Release the memory associated to this symbol.  |
01357 `-----------------------------------------------*/
01358 
01359 /*ARGSUSED*/
01360 #if (defined __STDC__ || defined __C99__FUNC__ \
01361      || defined __cplusplus || defined _MSC_VER)
01362 static void
01363 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *scanner, char **errp, struct nl_list_head *root)
01364 #else
01365 static void
01366 yydestruct (yymsg, yytype, yyvaluep, scanner, errp, root)
01367     const char *yymsg;
01368     int yytype;
01369     YYSTYPE *yyvaluep;
01370     void *scanner;
01371     char **errp;
01372     struct nl_list_head *root;
01373 #endif
01374 {
01375   YYUSE (yyvaluep);
01376   YYUSE (scanner);
01377   YYUSE (errp);
01378   YYUSE (root);
01379 
01380   if (!yymsg)
01381     yymsg = "Deleting";
01382   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
01383 
01384   switch (yytype)
01385     {
01386       case 72: /* "STR" */
01387 
01388 /* Line 1391 of yacc.c  */
01389 #line 137 "route/cls/ematch_syntax.y"
01390         { free((yyvaluep->s)); NL_DBG(2, "string destructor\n"); };
01391 
01392 /* Line 1391 of yacc.c  */
01393 #line 1394 "route/cls/ematch_syntax.c"
01394         break;
01395       case 73: /* "QUOTED" */
01396 
01397 /* Line 1391 of yacc.c  */
01398 #line 139 "route/cls/ematch_syntax.y"
01399         { free((yyvaluep->q).data); NL_DBG(2, "quoted destructor\n"); };
01400 
01401 /* Line 1391 of yacc.c  */
01402 #line 1403 "route/cls/ematch_syntax.c"
01403         break;
01404       case 81: /* "text_from" */
01405 
01406 /* Line 1391 of yacc.c  */
01407 #line 138 "route/cls/ematch_syntax.y"
01408         { rtnl_pktloc_put((yyvaluep->loc)); NL_DBG(2, "pktloc destructor\n"); };
01409 
01410 /* Line 1391 of yacc.c  */
01411 #line 1412 "route/cls/ematch_syntax.c"
01412         break;
01413       case 82: /* "text_to" */
01414 
01415 /* Line 1391 of yacc.c  */
01416 #line 138 "route/cls/ematch_syntax.y"
01417         { rtnl_pktloc_put((yyvaluep->loc)); NL_DBG(2, "pktloc destructor\n"); };
01418 
01419 /* Line 1391 of yacc.c  */
01420 #line 1421 "route/cls/ematch_syntax.c"
01421         break;
01422       case 83: /* "meta_value" */
01423 
01424 /* Line 1391 of yacc.c  */
01425 #line 140 "route/cls/ematch_syntax.y"
01426         { rtnl_meta_value_put((yyvaluep->mv)); NL_DBG(2, "meta value destructor\n"); };
01427 
01428 /* Line 1391 of yacc.c  */
01429 #line 1430 "route/cls/ematch_syntax.c"
01430         break;
01431       case 86: /* "pattern" */
01432 
01433 /* Line 1391 of yacc.c  */
01434 #line 139 "route/cls/ematch_syntax.y"
01435         { free((yyvaluep->q).data); NL_DBG(2, "quoted destructor\n"); };
01436 
01437 /* Line 1391 of yacc.c  */
01438 #line 1439 "route/cls/ematch_syntax.c"
01439         break;
01440       case 87: /* "pktloc" */
01441 
01442 /* Line 1391 of yacc.c  */
01443 #line 138 "route/cls/ematch_syntax.y"
01444         { rtnl_pktloc_put((yyvaluep->loc)); NL_DBG(2, "pktloc destructor\n"); };
01445 
01446 /* Line 1391 of yacc.c  */
01447 #line 1448 "route/cls/ematch_syntax.c"
01448         break;
01449 
01450       default:
01451         break;
01452     }
01453 }
01454 
01455 
01456 /* Prevent warnings from -Wmissing-prototypes.  */
01457 #ifdef YYPARSE_PARAM
01458 #if defined __STDC__ || defined __cplusplus
01459 int yyparse (void *YYPARSE_PARAM);
01460 #else
01461 int yyparse ();
01462 #endif
01463 #else /* ! YYPARSE_PARAM */
01464 #if defined __STDC__ || defined __cplusplus
01465 int yyparse (void *scanner, char **errp, struct nl_list_head *root);
01466 #else
01467 int yyparse ();
01468 #endif
01469 #endif /* ! YYPARSE_PARAM */
01470 
01471 
01472 /*----------.
01473 | yyparse.  |
01474 `----------*/
01475 
01476 #ifdef YYPARSE_PARAM
01477 #if (defined __STDC__ || defined __C99__FUNC__ \
01478      || defined __cplusplus || defined _MSC_VER)
01479 int
01480 yyparse (void *YYPARSE_PARAM)
01481 #else
01482 int
01483 yyparse (YYPARSE_PARAM)
01484     void *YYPARSE_PARAM;
01485 #endif
01486 #else /* ! YYPARSE_PARAM */
01487 #if (defined __STDC__ || defined __C99__FUNC__ \
01488      || defined __cplusplus || defined _MSC_VER)
01489 int
01490 yyparse (void *scanner, char **errp, struct nl_list_head *root)
01491 #else
01492 int
01493 yyparse (scanner, errp, root)
01494     void *scanner;
01495     char **errp;
01496     struct nl_list_head *root;
01497 #endif
01498 #endif
01499 {
01500 /* The lookahead symbol.  */
01501 int yychar;
01502 
01503 /* The semantic value of the lookahead symbol.  */
01504 YYSTYPE yylval;
01505 
01506     /* Number of syntax errors so far.  */
01507     int yynerrs;
01508 
01509     int yystate;
01510     /* Number of tokens to shift before error messages enabled.  */
01511     int yyerrstatus;
01512 
01513     /* The stacks and their tools:
01514        `yyss': related to states.
01515        `yyvs': related to semantic values.
01516 
01517        Refer to the stacks thru separate pointers, to allow yyoverflow
01518        to reallocate them elsewhere.  */
01519 
01520     /* The state stack.  */
01521     yytype_int16 yyssa[YYINITDEPTH];
01522     yytype_int16 *yyss;
01523     yytype_int16 *yyssp;
01524 
01525     /* The semantic value stack.  */
01526     YYSTYPE yyvsa[YYINITDEPTH];
01527     YYSTYPE *yyvs;
01528     YYSTYPE *yyvsp;
01529 
01530     YYSIZE_T yystacksize;
01531 
01532   int yyn;
01533   int yyresult;
01534   /* Lookahead token as an internal (translated) token number.  */
01535   int yytoken;
01536   /* The variables used to return semantic value and location from the
01537      action routines.  */
01538   YYSTYPE yyval;
01539 
01540 #if YYERROR_VERBOSE
01541   /* Buffer for error messages, and its allocated size.  */
01542   char yymsgbuf[128];
01543   char *yymsg = yymsgbuf;
01544   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01545 #endif
01546 
01547 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
01548 
01549   /* The number of symbols on the RHS of the reduced rule.
01550      Keep to zero when no symbol should be popped.  */
01551   int yylen = 0;
01552 
01553   yytoken = 0;
01554   yyss = yyssa;
01555   yyvs = yyvsa;
01556   yystacksize = YYINITDEPTH;
01557 
01558   YYDPRINTF ((stderr, "Starting parse\n"));
01559 
01560   yystate = 0;
01561   yyerrstatus = 0;
01562   yynerrs = 0;
01563   yychar = YYEMPTY; /* Cause a token to be read.  */
01564 
01565   /* Initialize stack pointers.
01566      Waste one element of value and location stack
01567      so that they stay on the same level as the state stack.
01568      The wasted elements are never initialized.  */
01569   yyssp = yyss;
01570   yyvsp = yyvs;
01571 
01572   goto yysetstate;
01573 
01574 /*------------------------------------------------------------.
01575 | yynewstate -- Push a new state, which is found in yystate.  |
01576 `------------------------------------------------------------*/
01577  yynewstate:
01578   /* In all cases, when you get here, the value and location stacks
01579      have just been pushed.  So pushing a state here evens the stacks.  */
01580   yyssp++;
01581 
01582  yysetstate:
01583   *yyssp = yystate;
01584 
01585   if (yyss + yystacksize - 1 <= yyssp)
01586     {
01587       /* Get the current used size of the three stacks, in elements.  */
01588       YYSIZE_T yysize = yyssp - yyss + 1;
01589 
01590 #ifdef yyoverflow
01591       {
01592         /* Give user a chance to reallocate the stack.  Use copies of
01593            these so that the &'s don't force the real ones into
01594            memory.  */
01595         YYSTYPE *yyvs1 = yyvs;
01596         yytype_int16 *yyss1 = yyss;
01597 
01598         /* Each stack pointer address is followed by the size of the
01599            data in use in that stack, in bytes.  This used to be a
01600            conditional around just the two extra args, but that might
01601            be undefined if yyoverflow is a macro.  */
01602         yyoverflow (YY_("memory exhausted"),
01603                     &yyss1, yysize * sizeof (*yyssp),
01604                     &yyvs1, yysize * sizeof (*yyvsp),
01605                     &yystacksize);
01606 
01607         yyss = yyss1;
01608         yyvs = yyvs1;
01609       }
01610 #else /* no yyoverflow */
01611 # ifndef YYSTACK_RELOCATE
01612       goto yyexhaustedlab;
01613 # else
01614       /* Extend the stack our own way.  */
01615       if (YYMAXDEPTH <= yystacksize)
01616         goto yyexhaustedlab;
01617       yystacksize *= 2;
01618       if (YYMAXDEPTH < yystacksize)
01619         yystacksize = YYMAXDEPTH;
01620 
01621       {
01622         yytype_int16 *yyss1 = yyss;
01623         union yyalloc *yyptr =
01624           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01625         if (! yyptr)
01626           goto yyexhaustedlab;
01627         YYSTACK_RELOCATE (yyss_alloc, yyss);
01628         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
01629 #  undef YYSTACK_RELOCATE
01630         if (yyss1 != yyssa)
01631           YYSTACK_FREE (yyss1);
01632       }
01633 # endif
01634 #endif /* no yyoverflow */
01635 
01636       yyssp = yyss + yysize - 1;
01637       yyvsp = yyvs + yysize - 1;
01638 
01639       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01640                   (unsigned long int) yystacksize));
01641 
01642       if (yyss + yystacksize - 1 <= yyssp)
01643         YYABORT;
01644     }
01645 
01646   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01647 
01648   if (yystate == YYFINAL)
01649     YYACCEPT;
01650 
01651   goto yybackup;
01652 
01653 /*-----------.
01654 | yybackup.  |
01655 `-----------*/
01656 yybackup:
01657 
01658   /* Do appropriate processing given the current state.  Read a
01659      lookahead token if we need one and don't already have one.  */
01660 
01661   /* First try to decide what to do without reference to lookahead token.  */
01662   yyn = yypact[yystate];
01663   if (yypact_value_is_default (yyn))
01664     goto yydefault;
01665 
01666   /* Not known => get a lookahead token if don't already have one.  */
01667 
01668   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
01669   if (yychar == YYEMPTY)
01670     {
01671       YYDPRINTF ((stderr, "Reading a token: "));
01672       yychar = YYLEX;
01673     }
01674 
01675   if (yychar <= YYEOF)
01676     {
01677       yychar = yytoken = YYEOF;
01678       YYDPRINTF ((stderr, "Now at end of input.\n"));
01679     }
01680   else
01681     {
01682       yytoken = YYTRANSLATE (yychar);
01683       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01684     }
01685 
01686   /* If the proper action on seeing token YYTOKEN is to reduce or to
01687      detect an error, take that action.  */
01688   yyn += yytoken;
01689   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01690     goto yydefault;
01691   yyn = yytable[yyn];
01692   if (yyn <= 0)
01693     {
01694       if (yytable_value_is_error (yyn))
01695         goto yyerrlab;
01696       yyn = -yyn;
01697       goto yyreduce;
01698     }
01699 
01700   /* Count tokens shifted since error; after three, turn off error
01701      status.  */
01702   if (yyerrstatus)
01703     yyerrstatus--;
01704 
01705   /* Shift the lookahead token.  */
01706   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01707 
01708   /* Discard the shifted token.  */
01709   yychar = YYEMPTY;
01710 
01711   yystate = yyn;
01712   *++yyvsp = yylval;
01713 
01714   goto yynewstate;
01715 
01716 
01717 /*-----------------------------------------------------------.
01718 | yydefault -- do the default action for the current state.  |
01719 `-----------------------------------------------------------*/
01720 yydefault:
01721   yyn = yydefact[yystate];
01722   if (yyn == 0)
01723     goto yyerrlab;
01724   goto yyreduce;
01725 
01726 
01727 /*-----------------------------.
01728 | yyreduce -- Do a reduction.  |
01729 `-----------------------------*/
01730 yyreduce:
01731   /* yyn is the number of a rule to reduce with.  */
01732   yylen = yyr2[yyn];
01733 
01734   /* If YYLEN is nonzero, implement the default value of the action:
01735      `$$ = $1'.
01736 
01737      Otherwise, the following line sets YYVAL to garbage.
01738      This behavior is undocumented and Bison
01739      users should not rely upon it.  Assigning to YYVAL
01740      unconditionally makes the parser a bit smaller, and it avoids a
01741      GCC warning that YYVAL may be used uninitialized.  */
01742   yyval = yyvsp[1-yylen];
01743 
01744 
01745   YY_REDUCE_PRINT (yyn);
01746   switch (yyn)
01747     {
01748         case 3:
01749 
01750 /* Line 1806 of yacc.c  */
01751 #line 149 "route/cls/ematch_syntax.y"
01752     {
01753                         nl_list_add_tail(root, &(yyvsp[(1) - (1)].e)->e_list);
01754                 }
01755     break;
01756 
01757   case 4:
01758 
01759 /* Line 1806 of yacc.c  */
01760 #line 156 "route/cls/ematch_syntax.y"
01761     {
01762                         (yyval.e) = (yyvsp[(1) - (1)].e);
01763                 }
01764     break;
01765 
01766   case 5:
01767 
01768 /* Line 1806 of yacc.c  */
01769 #line 160 "route/cls/ematch_syntax.y"
01770     {
01771                         rtnl_ematch_set_flags((yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].i));
01772 
01773                         /* make ematch new head */
01774                         nl_list_add_tail(&(yyvsp[(1) - (3)].e)->e_list, &(yyvsp[(3) - (3)].e)->e_list);
01775 
01776                         (yyval.e) = (yyvsp[(1) - (3)].e);
01777                 }
01778     break;
01779 
01780   case 6:
01781 
01782 /* Line 1806 of yacc.c  */
01783 #line 172 "route/cls/ematch_syntax.y"
01784     {
01785                         rtnl_ematch_set_flags((yyvsp[(2) - (2)].e), TCF_EM_INVERT);
01786                         (yyval.e) = (yyvsp[(2) - (2)].e);
01787                 }
01788     break;
01789 
01790   case 7:
01791 
01792 /* Line 1806 of yacc.c  */
01793 #line 177 "route/cls/ematch_syntax.y"
01794     {
01795                         (yyval.e) = (yyvsp[(1) - (1)].e);
01796                 }
01797     break;
01798 
01799   case 8:
01800 
01801 /* Line 1806 of yacc.c  */
01802 #line 185 "route/cls/ematch_syntax.y"
01803     {
01804                         struct rtnl_ematch *e;
01805 
01806                         if (!(e = rtnl_ematch_alloc())) {
01807                                 asprintf(errp, "Unable to allocate ematch object");
01808                                 YYABORT;
01809                         }
01810 
01811                         if (rtnl_ematch_set_kind(e, TCF_EM_CMP) < 0)
01812                                 BUG();
01813 
01814                         rtnl_ematch_cmp_set(e, &(yyvsp[(1) - (1)].cmp));
01815                         (yyval.e) = e;
01816                 }
01817     break;
01818 
01819   case 9:
01820 
01821 /* Line 1806 of yacc.c  */
01822 #line 200 "route/cls/ematch_syntax.y"
01823     {
01824                         struct rtnl_ematch *e;
01825 
01826                         if (!(e = rtnl_ematch_alloc())) {
01827                                 asprintf(errp, "Unable to allocate ematch object");
01828                                 YYABORT;
01829                         }
01830 
01831                         if (rtnl_ematch_set_kind(e, TCF_EM_NBYTE) < 0)
01832                                 BUG();
01833 
01834                         rtnl_ematch_nbyte_set_offset(e, (yyvsp[(3) - (6)].loc)->layer, (yyvsp[(3) - (6)].loc)->offset);
01835                         rtnl_pktloc_put((yyvsp[(3) - (6)].loc));
01836                         rtnl_ematch_nbyte_set_pattern(e, (uint8_t *) (yyvsp[(5) - (6)].q).data, (yyvsp[(5) - (6)].q).index);
01837 
01838                         (yyval.e) = e;
01839                 }
01840     break;
01841 
01842   case 10:
01843 
01844 /* Line 1806 of yacc.c  */
01845 #line 218 "route/cls/ematch_syntax.y"
01846     {
01847                         struct rtnl_ematch *e;
01848 
01849                         if (!(e = rtnl_ematch_alloc())) {
01850                                 asprintf(errp, "Unable to allocate ematch object");
01851                                 YYABORT;
01852                         }
01853 
01854                         if (rtnl_ematch_set_kind(e, TCF_EM_TEXT) < 0)
01855                                 BUG();
01856 
01857                         rtnl_ematch_text_set_algo(e, (yyvsp[(3) - (7)].s));
01858                         rtnl_ematch_text_set_pattern(e, (yyvsp[(4) - (7)].q).data, (yyvsp[(4) - (7)].q).index);
01859 
01860                         if ((yyvsp[(5) - (7)].loc)) {
01861                                 rtnl_ematch_text_set_from(e, (yyvsp[(5) - (7)].loc)->layer, (yyvsp[(5) - (7)].loc)->offset);
01862                                 rtnl_pktloc_put((yyvsp[(5) - (7)].loc));
01863                         }
01864 
01865                         if ((yyvsp[(6) - (7)].loc)) {
01866                                 rtnl_ematch_text_set_to(e, (yyvsp[(6) - (7)].loc)->layer, (yyvsp[(6) - (7)].loc)->offset);
01867                                 rtnl_pktloc_put((yyvsp[(6) - (7)].loc));
01868                         }
01869 
01870                         (yyval.e) = e;
01871                 }
01872     break;
01873 
01874   case 11:
01875 
01876 /* Line 1806 of yacc.c  */
01877 #line 245 "route/cls/ematch_syntax.y"
01878     {
01879                         struct rtnl_ematch *e;
01880 
01881                         if (!(e = rtnl_ematch_alloc())) {
01882                                 asprintf(errp, "Unable to allocate ematch object");
01883                                 YYABORT;
01884                         }
01885 
01886                         if (rtnl_ematch_set_kind(e, TCF_EM_META) < 0)
01887                                 BUG();
01888 
01889                         rtnl_ematch_meta_set_lvalue(e, (yyvsp[(3) - (6)].mv));
01890                         rtnl_ematch_meta_set_rvalue(e, (yyvsp[(5) - (6)].mv));
01891                         rtnl_ematch_meta_set_operand(e, (yyvsp[(4) - (6)].i));
01892 
01893                         (yyval.e) = e;
01894                 }
01895     break;
01896 
01897   case 12:
01898 
01899 /* Line 1806 of yacc.c  */
01900 #line 264 "route/cls/ematch_syntax.y"
01901     {
01902                         struct rtnl_ematch *e;
01903 
01904                         if (!(e = rtnl_ematch_alloc())) {
01905                                 asprintf(errp, "Unable to allocate ematch object");
01906                                 YYABORT;
01907                         }
01908 
01909                         if (rtnl_ematch_set_kind(e, TCF_EM_CONTAINER) < 0)
01910                                 BUG();
01911 
01912                         /* Make e->childs the list head of a the ematch sequence */
01913                         nl_list_add_tail(&e->e_childs, &(yyvsp[(2) - (3)].e)->e_list);
01914 
01915                         (yyval.e) = e;
01916                 }
01917     break;
01918 
01919   case 13:
01920 
01921 /* Line 1806 of yacc.c  */
01922 #line 292 "route/cls/ematch_syntax.y"
01923     { (yyval.cmp) = (yyvsp[(3) - (4)].cmp); }
01924     break;
01925 
01926   case 14:
01927 
01928 /* Line 1806 of yacc.c  */
01929 #line 294 "route/cls/ematch_syntax.y"
01930     { (yyval.cmp) = (yyvsp[(1) - (1)].cmp); }
01931     break;
01932 
01933   case 15:
01934 
01935 /* Line 1806 of yacc.c  */
01936 #line 299 "route/cls/ematch_syntax.y"
01937     {
01938                         if ((yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U16 ||
01939                             (yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U32)
01940                                 (yyval.cmp).flags = TCF_EM_CMP_TRANS;
01941 
01942                         memset(&(yyval.cmp), 0, sizeof((yyval.cmp)));
01943 
01944                         (yyval.cmp).mask = (yyvsp[(1) - (3)].loc)->mask;
01945                         (yyval.cmp).off = (yyvsp[(1) - (3)].loc)->offset;
01946                         (yyval.cmp).align = (yyvsp[(1) - (3)].loc)->align;
01947                         (yyval.cmp).layer = (yyvsp[(1) - (3)].loc)->layer;
01948                         (yyval.cmp).opnd = (yyvsp[(2) - (3)].i);
01949                         (yyval.cmp).val = (yyvsp[(3) - (3)].i);
01950 
01951                         rtnl_pktloc_put((yyvsp[(1) - (3)].loc));
01952                 }
01953     break;
01954 
01955   case 16:
01956 
01957 /* Line 1806 of yacc.c  */
01958 #line 319 "route/cls/ematch_syntax.y"
01959     { (yyval.loc) = NULL; }
01960     break;
01961 
01962   case 17:
01963 
01964 /* Line 1806 of yacc.c  */
01965 #line 321 "route/cls/ematch_syntax.y"
01966     { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
01967     break;
01968 
01969   case 18:
01970 
01971 /* Line 1806 of yacc.c  */
01972 #line 326 "route/cls/ematch_syntax.y"
01973     { (yyval.loc) = NULL; }
01974     break;
01975 
01976   case 19:
01977 
01978 /* Line 1806 of yacc.c  */
01979 #line 328 "route/cls/ematch_syntax.y"
01980     { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
01981     break;
01982 
01983   case 20:
01984 
01985 /* Line 1806 of yacc.c  */
01986 #line 333 "route/cls/ematch_syntax.y"
01987     { (yyval.mv) = rtnl_meta_value_alloc_var((yyvsp[(1) - (1)].q).data, (yyvsp[(1) - (1)].q).len); }
01988     break;
01989 
01990   case 21:
01991 
01992 /* Line 1806 of yacc.c  */
01993 #line 335 "route/cls/ematch_syntax.y"
01994     { (yyval.mv) = rtnl_meta_value_alloc_int((yyvsp[(1) - (1)].i)); }
01995     break;
01996 
01997   case 22:
01998 
01999 /* Line 1806 of yacc.c  */
02000 #line 337 "route/cls/ematch_syntax.y"
02001     { (yyval.mv) = META_ALLOC(META_INT, (yyvsp[(1) - (3)].i), (yyvsp[(2) - (3)].i), (yyvsp[(3) - (3)].i64)); }
02002     break;
02003 
02004   case 23:
02005 
02006 /* Line 1806 of yacc.c  */
02007 #line 339 "route/cls/ematch_syntax.y"
02008     { (yyval.mv) = META_ALLOC(META_VAR, (yyvsp[(1) - (2)].i), (yyvsp[(2) - (2)].i), 0); }
02009     break;
02010 
02011   case 24:
02012 
02013 /* Line 1806 of yacc.c  */
02014 #line 343 "route/cls/ematch_syntax.y"
02015     { (yyval.i) = META_ID(RANDOM); }
02016     break;
02017 
02018   case 25:
02019 
02020 /* Line 1806 of yacc.c  */
02021 #line 344 "route/cls/ematch_syntax.y"
02022     { (yyval.i) = META_ID(LOADAVG_0); }
02023     break;
02024 
02025   case 26:
02026 
02027 /* Line 1806 of yacc.c  */
02028 #line 345 "route/cls/ematch_syntax.y"
02029     { (yyval.i) = META_ID(LOADAVG_1); }
02030     break;
02031 
02032   case 27:
02033 
02034 /* Line 1806 of yacc.c  */
02035 #line 346 "route/cls/ematch_syntax.y"
02036     { (yyval.i) = META_ID(LOADAVG_2); }
02037     break;
02038 
02039   case 28:
02040 
02041 /* Line 1806 of yacc.c  */
02042 #line 347 "route/cls/ematch_syntax.y"
02043     { (yyval.i) = META_ID(DEV); }
02044     break;
02045 
02046   case 29:
02047 
02048 /* Line 1806 of yacc.c  */
02049 #line 348 "route/cls/ematch_syntax.y"
02050     { (yyval.i) = META_ID(PRIORITY); }
02051     break;
02052 
02053   case 30:
02054 
02055 /* Line 1806 of yacc.c  */
02056 #line 349 "route/cls/ematch_syntax.y"
02057     { (yyval.i) = META_ID(PROTOCOL); }
02058     break;
02059 
02060   case 31:
02061 
02062 /* Line 1806 of yacc.c  */
02063 #line 350 "route/cls/ematch_syntax.y"
02064     { (yyval.i) = META_ID(PKTTYPE); }
02065     break;
02066 
02067   case 32:
02068 
02069 /* Line 1806 of yacc.c  */
02070 #line 351 "route/cls/ematch_syntax.y"
02071     { (yyval.i) = META_ID(PKTLEN); }
02072     break;
02073 
02074   case 33:
02075 
02076 /* Line 1806 of yacc.c  */
02077 #line 352 "route/cls/ematch_syntax.y"
02078     { (yyval.i) = META_ID(DATALEN); }
02079     break;
02080 
02081   case 34:
02082 
02083 /* Line 1806 of yacc.c  */
02084 #line 353 "route/cls/ematch_syntax.y"
02085     { (yyval.i) = META_ID(MACLEN); }
02086     break;
02087 
02088   case 35:
02089 
02090 /* Line 1806 of yacc.c  */
02091 #line 354 "route/cls/ematch_syntax.y"
02092     { (yyval.i) = META_ID(NFMARK); }
02093     break;
02094 
02095   case 36:
02096 
02097 /* Line 1806 of yacc.c  */
02098 #line 355 "route/cls/ematch_syntax.y"
02099     { (yyval.i) = META_ID(TCINDEX); }
02100     break;
02101 
02102   case 37:
02103 
02104 /* Line 1806 of yacc.c  */
02105 #line 356 "route/cls/ematch_syntax.y"
02106     { (yyval.i) = META_ID(RTCLASSID); }
02107     break;
02108 
02109   case 38:
02110 
02111 /* Line 1806 of yacc.c  */
02112 #line 357 "route/cls/ematch_syntax.y"
02113     { (yyval.i) = META_ID(RTIIF); }
02114     break;
02115 
02116   case 39:
02117 
02118 /* Line 1806 of yacc.c  */
02119 #line 358 "route/cls/ematch_syntax.y"
02120     { (yyval.i) = META_ID(SK_FAMILY); }
02121     break;
02122 
02123   case 40:
02124 
02125 /* Line 1806 of yacc.c  */
02126 #line 359 "route/cls/ematch_syntax.y"
02127     { (yyval.i) = META_ID(SK_STATE); }
02128     break;
02129 
02130   case 41:
02131 
02132 /* Line 1806 of yacc.c  */
02133 #line 360 "route/cls/ematch_syntax.y"
02134     { (yyval.i) = META_ID(SK_REUSE); }
02135     break;
02136 
02137   case 42:
02138 
02139 /* Line 1806 of yacc.c  */
02140 #line 361 "route/cls/ematch_syntax.y"
02141     { (yyval.i) = META_ID(SK_REFCNT); }
02142     break;
02143 
02144   case 43:
02145 
02146 /* Line 1806 of yacc.c  */
02147 #line 362 "route/cls/ematch_syntax.y"
02148     { (yyval.i) = META_ID(SK_RCVBUF); }
02149     break;
02150 
02151   case 44:
02152 
02153 /* Line 1806 of yacc.c  */
02154 #line 363 "route/cls/ematch_syntax.y"
02155     { (yyval.i) = META_ID(SK_SNDBUF); }
02156     break;
02157 
02158   case 45:
02159 
02160 /* Line 1806 of yacc.c  */
02161 #line 364 "route/cls/ematch_syntax.y"
02162     { (yyval.i) = META_ID(SK_SHUTDOWN); }
02163     break;
02164 
02165   case 46:
02166 
02167 /* Line 1806 of yacc.c  */
02168 #line 365 "route/cls/ematch_syntax.y"
02169     { (yyval.i) = META_ID(SK_PROTO); }
02170     break;
02171 
02172   case 47:
02173 
02174 /* Line 1806 of yacc.c  */
02175 #line 366 "route/cls/ematch_syntax.y"
02176     { (yyval.i) = META_ID(SK_TYPE); }
02177     break;
02178 
02179   case 48:
02180 
02181 /* Line 1806 of yacc.c  */
02182 #line 367 "route/cls/ematch_syntax.y"
02183     { (yyval.i) = META_ID(SK_RMEM_ALLOC); }
02184     break;
02185 
02186   case 49:
02187 
02188 /* Line 1806 of yacc.c  */
02189 #line 368 "route/cls/ematch_syntax.y"
02190     { (yyval.i) = META_ID(SK_WMEM_ALLOC); }
02191     break;
02192 
02193   case 50:
02194 
02195 /* Line 1806 of yacc.c  */
02196 #line 369 "route/cls/ematch_syntax.y"
02197     { (yyval.i) = META_ID(SK_WMEM_QUEUED); }
02198     break;
02199 
02200   case 51:
02201 
02202 /* Line 1806 of yacc.c  */
02203 #line 370 "route/cls/ematch_syntax.y"
02204     { (yyval.i) = META_ID(SK_RCV_QLEN); }
02205     break;
02206 
02207   case 52:
02208 
02209 /* Line 1806 of yacc.c  */
02210 #line 371 "route/cls/ematch_syntax.y"
02211     { (yyval.i) = META_ID(SK_SND_QLEN); }
02212     break;
02213 
02214   case 53:
02215 
02216 /* Line 1806 of yacc.c  */
02217 #line 372 "route/cls/ematch_syntax.y"
02218     { (yyval.i) = META_ID(SK_ERR_QLEN); }
02219     break;
02220 
02221   case 54:
02222 
02223 /* Line 1806 of yacc.c  */
02224 #line 373 "route/cls/ematch_syntax.y"
02225     { (yyval.i) = META_ID(SK_FORWARD_ALLOCS); }
02226     break;
02227 
02228   case 55:
02229 
02230 /* Line 1806 of yacc.c  */
02231 #line 374 "route/cls/ematch_syntax.y"
02232     { (yyval.i) = META_ID(SK_ALLOCS); }
02233     break;
02234 
02235   case 56:
02236 
02237 /* Line 1806 of yacc.c  */
02238 #line 375 "route/cls/ematch_syntax.y"
02239     { (yyval.i) = META_ID(SK_ROUTE_CAPS); }
02240     break;
02241 
02242   case 57:
02243 
02244 /* Line 1806 of yacc.c  */
02245 #line 376 "route/cls/ematch_syntax.y"
02246     { (yyval.i) = META_ID(SK_HASH); }
02247     break;
02248 
02249   case 58:
02250 
02251 /* Line 1806 of yacc.c  */
02252 #line 377 "route/cls/ematch_syntax.y"
02253     { (yyval.i) = META_ID(SK_LINGERTIME); }
02254     break;
02255 
02256   case 59:
02257 
02258 /* Line 1806 of yacc.c  */
02259 #line 378 "route/cls/ematch_syntax.y"
02260     { (yyval.i) = META_ID(SK_ACK_BACKLOG); }
02261     break;
02262 
02263   case 60:
02264 
02265 /* Line 1806 of yacc.c  */
02266 #line 379 "route/cls/ematch_syntax.y"
02267     { (yyval.i) = META_ID(SK_MAX_ACK_BACKLOG); }
02268     break;
02269 
02270   case 61:
02271 
02272 /* Line 1806 of yacc.c  */
02273 #line 380 "route/cls/ematch_syntax.y"
02274     { (yyval.i) = META_ID(SK_PRIO); }
02275     break;
02276 
02277   case 62:
02278 
02279 /* Line 1806 of yacc.c  */
02280 #line 381 "route/cls/ematch_syntax.y"
02281     { (yyval.i) = META_ID(SK_RCVLOWAT); }
02282     break;
02283 
02284   case 63:
02285 
02286 /* Line 1806 of yacc.c  */
02287 #line 382 "route/cls/ematch_syntax.y"
02288     { (yyval.i) = META_ID(SK_RCVTIMEO); }
02289     break;
02290 
02291   case 64:
02292 
02293 /* Line 1806 of yacc.c  */
02294 #line 383 "route/cls/ematch_syntax.y"
02295     { (yyval.i) = META_ID(SK_SNDTIMEO); }
02296     break;
02297 
02298   case 65:
02299 
02300 /* Line 1806 of yacc.c  */
02301 #line 384 "route/cls/ematch_syntax.y"
02302     { (yyval.i) = META_ID(SK_SENDMSG_OFF); }
02303     break;
02304 
02305   case 66:
02306 
02307 /* Line 1806 of yacc.c  */
02308 #line 385 "route/cls/ematch_syntax.y"
02309     { (yyval.i) = META_ID(SK_WRITE_PENDING); }
02310     break;
02311 
02312   case 67:
02313 
02314 /* Line 1806 of yacc.c  */
02315 #line 386 "route/cls/ematch_syntax.y"
02316     { (yyval.i) = META_ID(VLAN_TAG); }
02317     break;
02318 
02319   case 68:
02320 
02321 /* Line 1806 of yacc.c  */
02322 #line 387 "route/cls/ematch_syntax.y"
02323     { (yyval.i) = META_ID(RXHASH); }
02324     break;
02325 
02326   case 69:
02327 
02328 /* Line 1806 of yacc.c  */
02329 #line 391 "route/cls/ematch_syntax.y"
02330     { (yyval.i) = META_ID(DEV); }
02331     break;
02332 
02333   case 70:
02334 
02335 /* Line 1806 of yacc.c  */
02336 #line 392 "route/cls/ematch_syntax.y"
02337     { (yyval.i) = META_ID(SK_BOUND_IF); }
02338     break;
02339 
02340   case 71:
02341 
02342 /* Line 1806 of yacc.c  */
02343 #line 400 "route/cls/ematch_syntax.y"
02344     {
02345                         (yyval.q) = (yyvsp[(1) - (1)].q);
02346                 }
02347     break;
02348 
02349   case 72:
02350 
02351 /* Line 1806 of yacc.c  */
02352 #line 404 "route/cls/ematch_syntax.y"
02353     {
02354                         struct nl_addr *addr;
02355 
02356                         if (nl_addr_parse((yyvsp[(1) - (1)].s), AF_UNSPEC, &addr) == 0) {
02357                                 (yyval.q).len = nl_addr_get_len(addr);
02358 
02359                                 (yyval.q).index = min_t(int, (yyval.q).len, nl_addr_get_prefixlen(addr)/8);
02360 
02361                                 if (!((yyval.q).data = calloc(1, (yyval.q).len))) {
02362                                         nl_addr_put(addr);
02363                                         YYABORT;
02364                                 }
02365 
02366                                 memcpy((yyval.q).data, nl_addr_get_binary_addr(addr), (yyval.q).len);
02367                                 nl_addr_put(addr);
02368                         } else {
02369                                 asprintf(errp, "invalid pattern \"%s\"", (yyvsp[(1) - (1)].s));
02370                                 YYABORT;
02371                         }
02372                 }
02373     break;
02374 
02375   case 73:
02376 
02377 /* Line 1806 of yacc.c  */
02378 #line 432 "route/cls/ematch_syntax.y"
02379     {
02380                         struct rtnl_pktloc *loc;
02381 
02382                         if (rtnl_pktloc_lookup((yyvsp[(1) - (1)].s), &loc) < 0) {
02383                                 asprintf(errp, "Packet location \"%s\" not found", (yyvsp[(1) - (1)].s));
02384                                 YYABORT;
02385                         }
02386 
02387                         (yyval.loc) = loc;
02388                 }
02389     break;
02390 
02391   case 74:
02392 
02393 /* Line 1806 of yacc.c  */
02394 #line 444 "route/cls/ematch_syntax.y"
02395     {
02396                         struct rtnl_pktloc *loc;
02397 
02398                         if ((yyvsp[(5) - (5)].i64) && (!(yyvsp[(1) - (5)].i) || (yyvsp[(1) - (5)].i) > TCF_EM_ALIGN_U32)) {
02399                                 asprintf(errp, "mask only allowed for alignments u8|u16|u32");
02400                                 YYABORT;
02401                         }
02402 
02403                         if (!(loc = rtnl_pktloc_alloc())) {
02404                                 asprintf(errp, "Unable to allocate packet location object");
02405                                 YYABORT;
02406                         }
02407 
02408                         loc->name = strdup("<USER-DEFINED>");
02409                         loc->align = (yyvsp[(1) - (5)].i);
02410                         loc->layer = (yyvsp[(2) - (5)].i);
02411                         loc->offset = (yyvsp[(4) - (5)].i);
02412                         loc->mask = (yyvsp[(5) - (5)].i64);
02413 
02414                         (yyval.loc) = loc;
02415                 }
02416     break;
02417 
02418   case 75:
02419 
02420 /* Line 1806 of yacc.c  */
02421 #line 469 "route/cls/ematch_syntax.y"
02422     { (yyval.i) = 0; }
02423     break;
02424 
02425   case 76:
02426 
02427 /* Line 1806 of yacc.c  */
02428 #line 471 "route/cls/ematch_syntax.y"
02429     { (yyval.i) = (yyvsp[(1) - (2)].i); }
02430     break;
02431 
02432   case 77:
02433 
02434 /* Line 1806 of yacc.c  */
02435 #line 473 "route/cls/ematch_syntax.y"
02436     { (yyval.i) = (yyvsp[(1) - (2)].i); }
02437     break;
02438 
02439   case 78:
02440 
02441 /* Line 1806 of yacc.c  */
02442 #line 478 "route/cls/ematch_syntax.y"
02443     { (yyval.i64) = 0; }
02444     break;
02445 
02446   case 79:
02447 
02448 /* Line 1806 of yacc.c  */
02449 #line 480 "route/cls/ematch_syntax.y"
02450     { (yyval.i64) = (yyvsp[(2) - (2)].i); }
02451     break;
02452 
02453   case 80:
02454 
02455 /* Line 1806 of yacc.c  */
02456 #line 485 "route/cls/ematch_syntax.y"
02457     { (yyval.i) = 0; }
02458     break;
02459 
02460   case 81:
02461 
02462 /* Line 1806 of yacc.c  */
02463 #line 487 "route/cls/ematch_syntax.y"
02464     { (yyval.i) = (yyvsp[(2) - (2)].i); }
02465     break;
02466 
02467   case 82:
02468 
02469 /* Line 1806 of yacc.c  */
02470 #line 492 "route/cls/ematch_syntax.y"
02471     { (yyval.i) = TCF_EM_OPND_EQ; }
02472     break;
02473 
02474   case 83:
02475 
02476 /* Line 1806 of yacc.c  */
02477 #line 494 "route/cls/ematch_syntax.y"
02478     { (yyval.i) = TCF_EM_OPND_GT; }
02479     break;
02480 
02481   case 84:
02482 
02483 /* Line 1806 of yacc.c  */
02484 #line 496 "route/cls/ematch_syntax.y"
02485     { (yyval.i) = TCF_EM_OPND_LT; }
02486     break;
02487 
02488 
02489 
02490 /* Line 1806 of yacc.c  */
02491 #line 2492 "route/cls/ematch_syntax.c"
02492       default: break;
02493     }
02494   /* User semantic actions sometimes alter yychar, and that requires
02495      that yytoken be updated with the new translation.  We take the
02496      approach of translating immediately before every use of yytoken.
02497      One alternative is translating here after every semantic action,
02498      but that translation would be missed if the semantic action invokes
02499      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
02500      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
02501      incorrect destructor might then be invoked immediately.  In the
02502      case of YYERROR or YYBACKUP, subsequent parser actions might lead
02503      to an incorrect destructor call or verbose syntax error message
02504      before the lookahead is translated.  */
02505   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
02506 
02507   YYPOPSTACK (yylen);
02508   yylen = 0;
02509   YY_STACK_PRINT (yyss, yyssp);
02510 
02511   *++yyvsp = yyval;
02512 
02513   /* Now `shift' the result of the reduction.  Determine what state
02514      that goes to, based on the state we popped back to and the rule
02515      number reduced by.  */
02516 
02517   yyn = yyr1[yyn];
02518 
02519   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
02520   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
02521     yystate = yytable[yystate];
02522   else
02523     yystate = yydefgoto[yyn - YYNTOKENS];
02524 
02525   goto yynewstate;
02526 
02527 
02528 /*------------------------------------.
02529 | yyerrlab -- here on detecting error |
02530 `------------------------------------*/
02531 yyerrlab:
02532   /* Make sure we have latest lookahead translation.  See comments at
02533      user semantic actions for why this is necessary.  */
02534   yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
02535 
02536   /* If not already recovering from an error, report this error.  */
02537   if (!yyerrstatus)
02538     {
02539       ++yynerrs;
02540 #if ! YYERROR_VERBOSE
02541       yyerror (scanner, errp, root, YY_("syntax error"));
02542 #else
02543 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
02544                                         yyssp, yytoken)
02545       {
02546         char const *yymsgp = YY_("syntax error");
02547         int yysyntax_error_status;
02548         yysyntax_error_status = YYSYNTAX_ERROR;
02549         if (yysyntax_error_status == 0)
02550           yymsgp = yymsg;
02551         else if (yysyntax_error_status == 1)
02552           {
02553             if (yymsg != yymsgbuf)
02554               YYSTACK_FREE (yymsg);
02555             yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
02556             if (!yymsg)
02557               {
02558                 yymsg = yymsgbuf;
02559                 yymsg_alloc = sizeof yymsgbuf;
02560                 yysyntax_error_status = 2;
02561               }
02562             else
02563               {
02564                 yysyntax_error_status = YYSYNTAX_ERROR;
02565                 yymsgp = yymsg;
02566               }
02567           }
02568         yyerror (scanner, errp, root, yymsgp);
02569         if (yysyntax_error_status == 2)
02570           goto yyexhaustedlab;
02571       }
02572 # undef YYSYNTAX_ERROR
02573 #endif
02574     }
02575 
02576 
02577 
02578   if (yyerrstatus == 3)
02579     {
02580       /* If just tried and failed to reuse lookahead token after an
02581          error, discard it.  */
02582 
02583       if (yychar <= YYEOF)
02584         {
02585           /* Return failure if at end of input.  */
02586           if (yychar == YYEOF)
02587             YYABORT;
02588         }
02589       else
02590         {
02591           yydestruct ("Error: discarding",
02592                       yytoken, &yylval, scanner, errp, root);
02593           yychar = YYEMPTY;
02594         }
02595     }
02596 
02597   /* Else will try to reuse lookahead token after shifting the error
02598      token.  */
02599   goto yyerrlab1;
02600 
02601 
02602 /*---------------------------------------------------.
02603 | yyerrorlab -- error raised explicitly by YYERROR.  |
02604 `---------------------------------------------------*/
02605 yyerrorlab:
02606 
02607   /* Pacify compilers like GCC when the user code never invokes
02608      YYERROR and the label yyerrorlab therefore never appears in user
02609      code.  */
02610   if (/*CONSTCOND*/ 0)
02611      goto yyerrorlab;
02612 
02613   /* Do not reclaim the symbols of the rule which action triggered
02614      this YYERROR.  */
02615   YYPOPSTACK (yylen);
02616   yylen = 0;
02617   YY_STACK_PRINT (yyss, yyssp);
02618   yystate = *yyssp;
02619   goto yyerrlab1;
02620 
02621 
02622 /*-------------------------------------------------------------.
02623 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
02624 `-------------------------------------------------------------*/
02625 yyerrlab1:
02626   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
02627 
02628   for (;;)
02629     {
02630       yyn = yypact[yystate];
02631       if (!yypact_value_is_default (yyn))
02632         {
02633           yyn += YYTERROR;
02634           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
02635             {
02636               yyn = yytable[yyn];
02637               if (0 < yyn)
02638                 break;
02639             }
02640         }
02641 
02642       /* Pop the current state because it cannot handle the error token.  */
02643       if (yyssp == yyss)
02644         YYABORT;
02645 
02646 
02647       yydestruct ("Error: popping",
02648                   yystos[yystate], yyvsp, scanner, errp, root);
02649       YYPOPSTACK (1);
02650       yystate = *yyssp;
02651       YY_STACK_PRINT (yyss, yyssp);
02652     }
02653 
02654   *++yyvsp = yylval;
02655 
02656 
02657   /* Shift the error token.  */
02658   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
02659 
02660   yystate = yyn;
02661   goto yynewstate;
02662 
02663 
02664 /*-------------------------------------.
02665 | yyacceptlab -- YYACCEPT comes here.  |
02666 `-------------------------------------*/
02667 yyacceptlab:
02668   yyresult = 0;
02669   goto yyreturn;
02670 
02671 /*-----------------------------------.
02672 | yyabortlab -- YYABORT comes here.  |
02673 `-----------------------------------*/
02674 yyabortlab:
02675   yyresult = 1;
02676   goto yyreturn;
02677 
02678 #if !defined(yyoverflow) || YYERROR_VERBOSE
02679 /*-------------------------------------------------.
02680 | yyexhaustedlab -- memory exhaustion comes here.  |
02681 `-------------------------------------------------*/
02682 yyexhaustedlab:
02683   yyerror (scanner, errp, root, YY_("memory exhausted"));
02684   yyresult = 2;
02685   /* Fall through.  */
02686 #endif
02687 
02688 yyreturn:
02689   if (yychar != YYEMPTY)
02690     {
02691       /* Make sure we have latest lookahead translation.  See comments at
02692          user semantic actions for why this is necessary.  */
02693       yytoken = YYTRANSLATE (yychar);
02694       yydestruct ("Cleanup: discarding lookahead",
02695                   yytoken, &yylval, scanner, errp, root);
02696     }
02697   /* Do not reclaim the symbols of the rule which action triggered
02698      this YYABORT or YYACCEPT.  */
02699   YYPOPSTACK (yylen);
02700   YY_STACK_PRINT (yyss, yyssp);
02701   while (yyssp != yyss)
02702     {
02703       yydestruct ("Cleanup: popping",
02704                   yystos[*yyssp], yyvsp, scanner, errp, root);
02705       YYPOPSTACK (1);
02706     }
02707 #ifndef yyoverflow
02708   if (yyss != yyssa)
02709     YYSTACK_FREE (yyss);
02710 #endif
02711 #if YYERROR_VERBOSE
02712   if (yymsg != yymsgbuf)
02713     YYSTACK_FREE (yymsg);
02714 #endif
02715   /* Make sure YYID is used.  */
02716   return YYID (yyresult);
02717 }
02718 
02719 
02720