libnl  3.2.11
ematch_syntax.c
1 /* A Bison parser, made by GNU Bison 2.5.1. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34  simplifying the original so-called "semantic" parser. */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37  infringing on user name space. This should be done even for local
38  variables, as they might otherwise be expanded by user macros.
39  There are some unavoidable exceptions within include files to
40  define necessary library symbols; they are noted "INFRINGES ON
41  USER NAME SPACE" below. */
42 
43 /* Identify Bison output. */
44 #define YYBISON 1
45 
46 /* Bison version. */
47 #define YYBISON_VERSION "2.5.1"
48 
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers. */
53 #define YYPURE 1
54 
55 /* Push parsers. */
56 #define YYPUSH 0
57 
58 /* Pull parsers. */
59 #define YYPULL 1
60 
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
63 
64 /* Substitute the variable and function names. */
65 #define yyparse ematch_parse
66 #define yylex ematch_lex
67 #define yyerror ematch_error
68 #define yylval ematch_lval
69 #define yychar ematch_char
70 #define yydebug ematch_debug
71 #define yynerrs ematch_nerrs
72 
73 
74 /* Copy the first part of user declarations. */
75 
76 /* Line 268 of yacc.c */
77 #line 12 "route/cls/ematch_syntax.y"
78 
79 #include <netlink-local.h>
80 #include <netlink-tc.h>
81 #include <netlink/netlink.h>
82 #include <netlink/utils.h>
83 #include <netlink/route/pktloc.h>
84 #include <netlink/route/cls/ematch.h>
85 #include <netlink/route/cls/ematch/cmp.h>
86 #include <netlink/route/cls/ematch/nbyte.h>
87 #include <netlink/route/cls/ematch/text.h>
88 #include <netlink/route/cls/ematch/meta.h>
89 
90 #define META_ALLOC rtnl_meta_value_alloc_id
91 #define META_ID(name) TCF_META_ID_##name
92 #define META_INT TCF_META_TYPE_INT
93 #define META_VAR TCF_META_TYPE_VAR
94 
95 
96 /* Line 268 of yacc.c */
97 #line 98 "route/cls/ematch_syntax.c"
98 
99 # ifndef YY_NULL
100 # if defined __cplusplus && 201103L <= __cplusplus
101 # define YY_NULL nullptr
102 # else
103 # define YY_NULL 0
104 # endif
105 # endif
106 
107 /* Enabling traces. */
108 #ifndef YYDEBUG
109 # define YYDEBUG 0
110 #endif
111 
112 /* Enabling verbose error messages. */
113 #ifdef YYERROR_VERBOSE
114 # undef YYERROR_VERBOSE
115 # define YYERROR_VERBOSE 1
116 #else
117 # define YYERROR_VERBOSE 1
118 #endif
119 
120 /* Enabling the token table. */
121 #ifndef YYTOKEN_TABLE
122 # define YYTOKEN_TABLE 0
123 #endif
124 
125 
126 /* Tokens. */
127 #ifndef YYTOKENTYPE
128 # define YYTOKENTYPE
129  /* Put the tokens into the symbol table, so that GDB and other debuggers
130  know about them. */
131  enum yytokentype {
132  ERROR = 258,
133  LOGIC = 259,
134  NOT = 260,
135  OPERAND = 261,
136  NUMBER = 262,
137  ALIGN = 263,
138  LAYER = 264,
139  KW_OPEN = 265,
140  KW_CLOSE = 266,
141  KW_PLUS = 267,
142  KW_MASK = 268,
143  KW_SHIFT = 269,
144  KW_AT = 270,
145  EMATCH_CMP = 271,
146  EMATCH_NBYTE = 272,
147  EMATCH_TEXT = 273,
148  EMATCH_META = 274,
149  KW_EQ = 275,
150  KW_GT = 276,
151  KW_LT = 277,
152  KW_FROM = 278,
153  KW_TO = 279,
154  META_RANDOM = 280,
155  META_LOADAVG_0 = 281,
156  META_LOADAVG_1 = 282,
157  META_LOADAVG_2 = 283,
158  META_DEV = 284,
159  META_PRIO = 285,
160  META_PROTO = 286,
161  META_PKTTYPE = 287,
162  META_PKTLEN = 288,
163  META_DATALEN = 289,
164  META_MACLEN = 290,
165  META_MARK = 291,
166  META_TCINDEX = 292,
167  META_RTCLASSID = 293,
168  META_RTIIF = 294,
169  META_SK_FAMILY = 295,
170  META_SK_STATE = 296,
171  META_SK_REUSE = 297,
172  META_SK_REFCNT = 298,
173  META_SK_RCVBUF = 299,
174  META_SK_SNDBUF = 300,
175  META_SK_SHUTDOWN = 301,
176  META_SK_PROTO = 302,
177  META_SK_TYPE = 303,
178  META_SK_RMEM_ALLOC = 304,
179  META_SK_WMEM_ALLOC = 305,
180  META_SK_WMEM_QUEUED = 306,
181  META_SK_RCV_QLEN = 307,
182  META_SK_SND_QLEN = 308,
183  META_SK_ERR_QLEN = 309,
184  META_SK_FORWARD_ALLOCS = 310,
185  META_SK_ALLOCS = 311,
186  META_SK_ROUTE_CAPS = 312,
187  META_SK_HASH = 313,
188  META_SK_LINGERTIME = 314,
189  META_SK_ACK_BACKLOG = 315,
190  META_SK_MAX_ACK_BACKLOG = 316,
191  META_SK_PRIO = 317,
192  META_SK_RCVLOWAT = 318,
193  META_SK_RCVTIMEO = 319,
194  META_SK_SNDTIMEO = 320,
195  META_SK_SENDMSG_OFF = 321,
196  META_SK_WRITE_PENDING = 322,
197  META_VLAN = 323,
198  META_RXHASH = 324,
199  META_DEVNAME = 325,
200  META_SK_BOUND_IF = 326,
201  STR = 327,
202  QUOTED = 328
203  };
204 #endif
205 /* Tokens. */
206 #define ERROR 258
207 #define LOGIC 259
208 #define NOT 260
209 #define OPERAND 261
210 #define NUMBER 262
211 #define ALIGN 263
212 #define LAYER 264
213 #define KW_OPEN 265
214 #define KW_CLOSE 266
215 #define KW_PLUS 267
216 #define KW_MASK 268
217 #define KW_SHIFT 269
218 #define KW_AT 270
219 #define EMATCH_CMP 271
220 #define EMATCH_NBYTE 272
221 #define EMATCH_TEXT 273
222 #define EMATCH_META 274
223 #define KW_EQ 275
224 #define KW_GT 276
225 #define KW_LT 277
226 #define KW_FROM 278
227 #define KW_TO 279
228 #define META_RANDOM 280
229 #define META_LOADAVG_0 281
230 #define META_LOADAVG_1 282
231 #define META_LOADAVG_2 283
232 #define META_DEV 284
233 #define META_PRIO 285
234 #define META_PROTO 286
235 #define META_PKTTYPE 287
236 #define META_PKTLEN 288
237 #define META_DATALEN 289
238 #define META_MACLEN 290
239 #define META_MARK 291
240 #define META_TCINDEX 292
241 #define META_RTCLASSID 293
242 #define META_RTIIF 294
243 #define META_SK_FAMILY 295
244 #define META_SK_STATE 296
245 #define META_SK_REUSE 297
246 #define META_SK_REFCNT 298
247 #define META_SK_RCVBUF 299
248 #define META_SK_SNDBUF 300
249 #define META_SK_SHUTDOWN 301
250 #define META_SK_PROTO 302
251 #define META_SK_TYPE 303
252 #define META_SK_RMEM_ALLOC 304
253 #define META_SK_WMEM_ALLOC 305
254 #define META_SK_WMEM_QUEUED 306
255 #define META_SK_RCV_QLEN 307
256 #define META_SK_SND_QLEN 308
257 #define META_SK_ERR_QLEN 309
258 #define META_SK_FORWARD_ALLOCS 310
259 #define META_SK_ALLOCS 311
260 #define META_SK_ROUTE_CAPS 312
261 #define META_SK_HASH 313
262 #define META_SK_LINGERTIME 314
263 #define META_SK_ACK_BACKLOG 315
264 #define META_SK_MAX_ACK_BACKLOG 316
265 #define META_SK_PRIO 317
266 #define META_SK_RCVLOWAT 318
267 #define META_SK_RCVTIMEO 319
268 #define META_SK_SNDTIMEO 320
269 #define META_SK_SENDMSG_OFF 321
270 #define META_SK_WRITE_PENDING 322
271 #define META_VLAN 323
272 #define META_RXHASH 324
273 #define META_DEVNAME 325
274 #define META_SK_BOUND_IF 326
275 #define STR 327
276 #define QUOTED 328
277 
278 
279 
280 
281 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
282 typedef union YYSTYPE
283 {
284 
285 /* Line 295 of yacc.c */
286 #line 39 "route/cls/ematch_syntax.y"
287 
288  struct tcf_em_cmp cmp;
289  struct ematch_quoted q;
290  struct rtnl_ematch * e;
291  struct rtnl_pktloc * loc;
292  struct rtnl_meta_value *mv;
293  uint32_t i;
294  uint64_t i64;
295  char * s;
296 
297 
298 
299 /* Line 295 of yacc.c */
300 #line 301 "route/cls/ematch_syntax.c"
301 } YYSTYPE;
302 # define YYSTYPE_IS_TRIVIAL 1
303 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
304 # define YYSTYPE_IS_DECLARED 1
305 #endif
306 
307 
308 /* Copy the second part of user declarations. */
309 
310 /* Line 345 of yacc.c */
311 #line 50 "route/cls/ematch_syntax.y"
312 
313 extern int ematch_lex(YYSTYPE *, void *);
314 
315 static void yyerror(void *scanner, char **errp, struct nl_list_head *root, const char *msg)
316 {
317  if (msg)
318  asprintf(errp, "%s", msg);
319 }
320 
321 
322 /* Line 345 of yacc.c */
323 #line 324 "route/cls/ematch_syntax.c"
324 
325 #ifdef short
326 # undef short
327 #endif
328 
329 #ifdef YYTYPE_UINT8
330 typedef YYTYPE_UINT8 yytype_uint8;
331 #else
332 typedef unsigned char yytype_uint8;
333 #endif
334 
335 #ifdef YYTYPE_INT8
336 typedef YYTYPE_INT8 yytype_int8;
337 #elif (defined __STDC__ || defined __C99__FUNC__ \
338  || defined __cplusplus || defined _MSC_VER)
339 typedef signed char yytype_int8;
340 #else
341 typedef short int yytype_int8;
342 #endif
343 
344 #ifdef YYTYPE_UINT16
345 typedef YYTYPE_UINT16 yytype_uint16;
346 #else
347 typedef unsigned short int yytype_uint16;
348 #endif
349 
350 #ifdef YYTYPE_INT16
351 typedef YYTYPE_INT16 yytype_int16;
352 #else
353 typedef short int yytype_int16;
354 #endif
355 
356 #ifndef YYSIZE_T
357 # ifdef __SIZE_TYPE__
358 # define YYSIZE_T __SIZE_TYPE__
359 # elif defined size_t
360 # define YYSIZE_T size_t
361 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
362  || defined __cplusplus || defined _MSC_VER)
363 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
364 # define YYSIZE_T size_t
365 # else
366 # define YYSIZE_T unsigned int
367 # endif
368 #endif
369 
370 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
371 
372 #ifndef YY_
373 # if defined YYENABLE_NLS && YYENABLE_NLS
374 # if ENABLE_NLS
375 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
376 # define YY_(msgid) dgettext ("bison-runtime", msgid)
377 # endif
378 # endif
379 # ifndef YY_
380 # define YY_(msgid) msgid
381 # endif
382 #endif
383 
384 /* Suppress unused-variable warnings by "using" E. */
385 #if ! defined lint || defined __GNUC__
386 # define YYUSE(e) ((void) (e))
387 #else
388 # define YYUSE(e) /* empty */
389 #endif
390 
391 /* Identity function, used to suppress warnings about constant conditions. */
392 #ifndef lint
393 # define YYID(n) (n)
394 #else
395 #if (defined __STDC__ || defined __C99__FUNC__ \
396  || defined __cplusplus || defined _MSC_VER)
397 static int
398 YYID (int yyi)
399 #else
400 static int
401 YYID (yyi)
402  int yyi;
403 #endif
404 {
405  return yyi;
406 }
407 #endif
408 
409 #if ! defined yyoverflow || YYERROR_VERBOSE
410 
411 /* The parser invokes alloca or malloc; define the necessary symbols. */
412 
413 # ifdef YYSTACK_USE_ALLOCA
414 # if YYSTACK_USE_ALLOCA
415 # ifdef __GNUC__
416 # define YYSTACK_ALLOC __builtin_alloca
417 # elif defined __BUILTIN_VA_ARG_INCR
418 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
419 # elif defined _AIX
420 # define YYSTACK_ALLOC __alloca
421 # elif defined _MSC_VER
422 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
423 # define alloca _alloca
424 # else
425 # define YYSTACK_ALLOC alloca
426 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
427  || defined __cplusplus || defined _MSC_VER)
428 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
429  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
430 # ifndef EXIT_SUCCESS
431 # define EXIT_SUCCESS 0
432 # endif
433 # endif
434 # endif
435 # endif
436 # endif
437 
438 # ifdef YYSTACK_ALLOC
439  /* Pacify GCC's `empty if-body' warning. */
440 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
441 # ifndef YYSTACK_ALLOC_MAXIMUM
442  /* The OS might guarantee only one guard page at the bottom of the stack,
443  and a page size can be as small as 4096 bytes. So we cannot safely
444  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
445  to allow for a few compiler-allocated temporary stack slots. */
446 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
447 # endif
448 # else
449 # define YYSTACK_ALLOC YYMALLOC
450 # define YYSTACK_FREE YYFREE
451 # ifndef YYSTACK_ALLOC_MAXIMUM
452 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
453 # endif
454 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
455  && ! ((defined YYMALLOC || defined malloc) \
456  && (defined YYFREE || defined free)))
457 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
458 # ifndef EXIT_SUCCESS
459 # define EXIT_SUCCESS 0
460 # endif
461 # endif
462 # ifndef YYMALLOC
463 # define YYMALLOC malloc
464 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
465  || defined __cplusplus || defined _MSC_VER)
466 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
467 # endif
468 # endif
469 # ifndef YYFREE
470 # define YYFREE free
471 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
472  || defined __cplusplus || defined _MSC_VER)
473 void free (void *); /* INFRINGES ON USER NAME SPACE */
474 # endif
475 # endif
476 # endif
477 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
478 
479 
480 #if (! defined yyoverflow \
481  && (! defined __cplusplus \
482  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
483 
484 /* A type that is properly aligned for any stack member. */
485 union yyalloc
486 {
487  yytype_int16 yyss_alloc;
488  YYSTYPE yyvs_alloc;
489 };
490 
491 /* The size of the maximum gap between one aligned stack and the next. */
492 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
493 
494 /* The size of an array large to enough to hold all stacks, each with
495  N elements. */
496 # define YYSTACK_BYTES(N) \
497  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
498  + YYSTACK_GAP_MAXIMUM)
499 
500 # define YYCOPY_NEEDED 1
501 
502 /* Relocate STACK from its old location to the new one. The
503  local variables YYSIZE and YYSTACKSIZE give the old and new number of
504  elements in the stack, and YYPTR gives the new location of the
505  stack. Advance YYPTR to a properly aligned location for the next
506  stack. */
507 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
508  do \
509  { \
510  YYSIZE_T yynewbytes; \
511  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
512  Stack = &yyptr->Stack_alloc; \
513  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
514  yyptr += yynewbytes / sizeof (*yyptr); \
515  } \
516  while (YYID (0))
517 
518 #endif
519 
520 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
521 /* Copy COUNT objects from SRC to DST. The source and destination do
522  not overlap. */
523 # ifndef YYCOPY
524 # if defined __GNUC__ && 1 < __GNUC__
525 # define YYCOPY(Dst, Src, Count) \
526  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
527 # else
528 # define YYCOPY(Dst, Src, Count) \
529  do \
530  { \
531  YYSIZE_T yyi; \
532  for (yyi = 0; yyi < (Count); yyi++) \
533  (Dst)[yyi] = (Src)[yyi]; \
534  } \
535  while (YYID (0))
536 # endif
537 # endif
538 #endif /* !YYCOPY_NEEDED */
539 
540 /* YYFINAL -- State number of the termination state. */
541 #define YYFINAL 26
542 /* YYLAST -- Last index in YYTABLE. */
543 #define YYLAST 138
544 
545 /* YYNTOKENS -- Number of terminals. */
546 #define YYNTOKENS 74
547 /* YYNNTS -- Number of nonterminals. */
548 #define YYNNTS 18
549 /* YYNRULES -- Number of rules. */
550 #define YYNRULES 84
551 /* YYNRULES -- Number of states. */
552 #define YYNSTATES 118
553 
554 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
555 #define YYUNDEFTOK 2
556 #define YYMAXUTOK 328
557 
558 #define YYTRANSLATE(YYX) \
559  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
560 
561 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
562 static const yytype_uint8 yytranslate[] =
563 {
564  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
590  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
591  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
592  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
593  35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
594  45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
595  55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
596  65, 66, 67, 68, 69, 70, 71, 72, 73
597 };
598 
599 #if YYDEBUG
600 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
601  YYRHS. */
602 static const yytype_uint8 yyprhs[] =
603 {
604  0, 0, 3, 4, 6, 8, 12, 15, 17, 19,
605  26, 34, 41, 45, 50, 52, 56, 57, 60, 61,
606  64, 66, 68, 72, 75, 77, 79, 81, 83, 85,
607  87, 89, 91, 93, 95, 97, 99, 101, 103, 105,
608  107, 109, 111, 113, 115, 117, 119, 121, 123, 125,
609  127, 129, 131, 133, 135, 137, 139, 141, 143, 145,
610  147, 149, 151, 153, 155, 157, 159, 161, 163, 165,
611  167, 169, 171, 173, 175, 181, 182, 185, 188, 189,
612  192, 193, 196, 198, 200
613 };
614 
615 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
616 static const yytype_int8 yyrhs[] =
617 {
618  75, 0, -1, -1, 76, -1, 77, -1, 77, 4,
619  76, -1, 5, 78, -1, 78, -1, 79, -1, 17,
620  10, 87, 20, 86, 11, -1, 18, 10, 72, 73,
621  81, 82, 11, -1, 19, 10, 83, 91, 83, 11,
622  -1, 10, 76, 11, -1, 16, 10, 80, 11, -1,
623  80, -1, 87, 91, 7, -1, -1, 23, 87, -1,
624  -1, 24, 87, -1, 73, -1, 7, -1, 84, 90,
625  89, -1, 85, 90, -1, 25, -1, 26, -1, 27,
626  -1, 28, -1, 29, -1, 30, -1, 31, -1, 32,
627  -1, 33, -1, 34, -1, 35, -1, 36, -1, 37,
628  -1, 38, -1, 39, -1, 40, -1, 41, -1, 42,
629  -1, 43, -1, 44, -1, 45, -1, 46, -1, 47,
630  -1, 48, -1, 49, -1, 50, -1, 51, -1, 52,
631  -1, 53, -1, 54, -1, 55, -1, 56, -1, 57,
632  -1, 58, -1, 59, -1, 60, -1, 61, -1, 62,
633  -1, 63, -1, 64, -1, 65, -1, 66, -1, 67,
634  -1, 68, -1, 69, -1, 70, -1, 71, -1, 73,
635  -1, 72, -1, 72, -1, 88, 9, 12, 7, 89,
636  -1, -1, 8, 15, -1, 7, 15, -1, -1, 13,
637  7, -1, -1, 14, 7, -1, 20, -1, 21, -1,
638  22, -1
639 };
640 
641 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
642 static const yytype_uint16 yyrline[] =
643 {
644  0, 146, 146, 148, 155, 159, 171, 176, 184, 199,
645  217, 244, 263, 291, 293, 298, 319, 320, 326, 327,
646  332, 334, 336, 338, 343, 344, 345, 346, 347, 348,
647  349, 350, 351, 352, 353, 354, 355, 356, 357, 358,
648  359, 360, 361, 362, 363, 364, 365, 366, 367, 368,
649  369, 370, 371, 372, 373, 374, 375, 376, 377, 378,
650  379, 380, 381, 382, 383, 384, 385, 386, 387, 391,
651  392, 399, 403, 431, 443, 469, 470, 472, 478, 479,
652  485, 486, 491, 493, 495
653 };
654 #endif
655 
656 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
657 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
658  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
659 static const char *const yytname[] =
660 {
661  "$end", "error", "$undefined", "ERROR", "LOGIC", "NOT", "OPERAND",
662  "NUMBER", "ALIGN", "LAYER", "\"(\"", "\")\"", "\"+\"", "\"mask\"",
663  "\">>\"", "\"at\"", "\"cmp\"", "\"pattern\"", "\"text\"", "\"meta\"",
664  "\"=\"", "\">\"", "\"<\"", "\"from\"", "\"to\"", "\"random\"",
665  "\"loadavg_0\"", "\"loadavg_1\"", "\"loadavg_2\"", "\"dev\"", "\"prio\"",
666  "\"proto\"", "\"pkttype\"", "\"pktlen\"", "\"datalen\"", "\"maclen\"",
667  "\"mark\"", "\"tcindex\"", "\"rtclassid\"", "\"rtiif\"", "\"sk_family\"",
668  "\"sk_state\"", "\"sk_reuse\"", "\"sk_refcnt\"", "\"sk_rcvbuf\"",
669  "\"sk_sndbuf\"", "\"sk_shutdown\"", "\"sk_proto\"", "\"sk_type\"",
670  "\"sk_rmem_alloc\"", "\"sk_wmem_alloc\"", "\"sk_wmem_queued\"",
671  "\"sk_rcv_qlen\"", "\"sk_snd_qlen\"", "\"sk_err_qlen\"",
672  "\"sk_forward_allocs\"", "\"sk_allocs\"", "\"sk_route_caps\"",
673  "\"sk_hash\"", "\"sk_lingertime\"", "\"sk_ack_backlog\"",
674  "\"sk_max_ack_backlog\"", "\"sk_prio\"", "\"sk_rcvlowat\"",
675  "\"sk_rcvtimeo\"", "\"sk_sndtimeo\"", "\"sk_sendmsg_off\"",
676  "\"sk_write_pending\"", "\"vlan\"", "\"rxhash\"", "\"devname\"",
677  "\"sk_bound_if\"", "STR", "QUOTED", "$accept", "input", "expr", "match",
678  "ematch", "cmp_match", "cmp_expr", "text_from", "text_to", "meta_value",
679  "meta_int_id", "meta_var_id", "pattern", "pktloc", "align", "mask",
680  "shift", "operand", YY_NULL
681 };
682 #endif
683 
684 # ifdef YYPRINT
685 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
686  token YYLEX-NUM. */
687 static const yytype_uint16 yytoknum[] =
688 {
689  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
690  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
691  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
692  285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
693  295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
694  305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
695  315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
696  325, 326, 327, 328
697 };
698 # endif
699 
700 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
701 static const yytype_uint8 yyr1[] =
702 {
703  0, 74, 75, 75, 76, 76, 77, 77, 78, 78,
704  78, 78, 78, 79, 79, 80, 81, 81, 82, 82,
705  83, 83, 83, 83, 84, 84, 84, 84, 84, 84,
706  84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
707  84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
708  84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
709  84, 84, 84, 84, 84, 84, 84, 84, 84, 85,
710  85, 86, 86, 87, 87, 88, 88, 88, 89, 89,
711  90, 90, 91, 91, 91
712 };
713 
714 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
715 static const yytype_uint8 yyr2[] =
716 {
717  0, 2, 0, 1, 1, 3, 2, 1, 1, 6,
718  7, 6, 3, 4, 1, 3, 0, 2, 0, 2,
719  1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
720  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
721  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
722  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
723  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
724  1, 1, 1, 1, 5, 0, 2, 2, 0, 2,
725  0, 2, 1, 1, 1
726 };
727 
728 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
729  Performed when YYTABLE doesn't specify something else to do. Zero
730  means the default is an error. */
731 static const yytype_uint8 yydefact[] =
732 {
733  2, 75, 0, 0, 75, 0, 0, 0, 0, 73,
734  0, 3, 4, 7, 8, 14, 0, 0, 6, 77,
735  76, 0, 75, 75, 0, 0, 1, 75, 82, 83,
736  84, 0, 0, 12, 0, 0, 0, 21, 24, 25,
737  26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
738  36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
739  46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
740  56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
741  66, 67, 68, 69, 70, 20, 0, 80, 80, 5,
742  15, 0, 13, 0, 16, 0, 0, 78, 23, 78,
743  72, 71, 0, 75, 18, 0, 81, 0, 22, 74,
744  9, 17, 75, 0, 11, 79, 19, 10
745 };
746 
747 /* YYDEFGOTO[NTERM-NUM]. */
748 static const yytype_int8 yydefgoto[] =
749 {
750  -1, 10, 11, 12, 13, 14, 15, 104, 113, 86,
751  87, 88, 102, 16, 17, 108, 97, 31
752 };
753 
754 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
755  STATE-NUM. */
756 #define YYPACT_NINF -63
757 static const yytype_int8 yypact[] =
758 {
759  -4, 15, -13, -8, 11, 10, 14, 25, 29, -63,
760  26, -63, 37, -63, -63, -63, 16, 33, -63, -63,
761  -63, 32, 1, 1, -28, 65, -63, 11, -63, -63,
762  -63, 38, 34, -63, 36, 28, -24, -63, -63, -63,
763  -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
764  -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
765  -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
766  -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
767  -63, -63, -63, -63, -63, -63, 16, 39, 39, -63,
768  -63, 43, -63, -62, 31, 65, 44, 42, -63, 42,
769  -63, -63, 41, 1, 35, 45, -63, 50, -63, -63,
770  -63, -63, 1, 47, -63, -63, -63, -63
771 };
772 
773 /* YYPGOTO[NTERM-NUM]. */
774 static const yytype_int8 yypgoto[] =
775 {
776  -63, -63, 13, -63, 59, -63, 40, -63, -63, -34,
777  -63, -63, -63, -23, -63, -36, -22, -21
778 };
779 
780 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
781  positive, shift that token. If negative, reduce the rule which
782  number is the opposite. If YYTABLE_NINF, syntax error. */
783 #define YYTABLE_NINF -76
784 static const yytype_int8 yytable[] =
785 {
786  35, 1, 19, 2, 3, -75, 4, 20, 2, 3,
787  100, 101, 5, 6, 7, 8, 1, 21, 2, 3,
788  22, 4, 2, 3, 23, 4, 26, 5, 6, 7,
789  8, 5, 6, 7, 8, 24, 28, 29, 30, 25,
790  89, 27, 32, 33, 36, 90, 91, 92, 93, 94,
791  99, 106, 110, 96, 103, 107, 114, 115, 117, 112,
792  18, 105, 34, 109, 0, 95, 98, 0, 9, 0,
793  0, 0, 37, 9, 0, 0, 0, 0, 0, 0,
794  111, 0, 0, 9, 0, 0, 0, 9, 0, 116,
795  38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
796  48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
797  58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
798  68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
799  78, 79, 80, 81, 82, 83, 84, 0, 85
800 };
801 
802 #define yypact_value_is_default(yystate) \
803  ((yystate) == (-63))
804 
805 #define yytable_value_is_error(yytable_value) \
806  YYID (0)
807 
808 static const yytype_int8 yycheck[] =
809 {
810  23, 5, 15, 7, 8, 9, 10, 15, 7, 8,
811  72, 73, 16, 17, 18, 19, 5, 4, 7, 8,
812  10, 10, 7, 8, 10, 10, 0, 16, 17, 18,
813  19, 16, 17, 18, 19, 10, 20, 21, 22, 10,
814  27, 4, 9, 11, 72, 7, 12, 11, 20, 73,
815  7, 7, 11, 14, 23, 13, 11, 7, 11, 24,
816  1, 95, 22, 99, -1, 86, 88, -1, 72, -1,
817  -1, -1, 7, 72, -1, -1, -1, -1, -1, -1,
818  103, -1, -1, 72, -1, -1, -1, 72, -1, 112,
819  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
820  35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
821  45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
822  55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
823  65, 66, 67, 68, 69, 70, 71, -1, 73
824 };
825 
826 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
827  symbol of state STATE-NUM. */
828 static const yytype_uint8 yystos[] =
829 {
830  0, 5, 7, 8, 10, 16, 17, 18, 19, 72,
831  75, 76, 77, 78, 79, 80, 87, 88, 78, 15,
832  15, 76, 10, 10, 10, 10, 0, 4, 20, 21,
833  22, 91, 9, 11, 80, 87, 72, 7, 25, 26,
834  27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
835  37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
836  47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
837  57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
838  67, 68, 69, 70, 71, 73, 83, 84, 85, 76,
839  7, 12, 11, 20, 73, 91, 14, 90, 90, 7,
840  72, 73, 86, 23, 81, 83, 7, 13, 89, 89,
841  11, 87, 24, 82, 11, 7, 87, 11
842 };
843 
844 #define yyerrok (yyerrstatus = 0)
845 #define yyclearin (yychar = YYEMPTY)
846 #define YYEMPTY (-2)
847 #define YYEOF 0
848 
849 #define YYACCEPT goto yyacceptlab
850 #define YYABORT goto yyabortlab
851 #define YYERROR goto yyerrorlab
852 
853 
854 /* Like YYERROR except do call yyerror. This remains here temporarily
855  to ease the transition to the new meaning of YYERROR, for GCC.
856  Once GCC version 2 has supplanted version 1, this can go. However,
857  YYFAIL appears to be in use. Nevertheless, it is formally deprecated
858  in Bison 2.4.2's NEWS entry, where a plan to phase it out is
859  discussed. */
860 
861 #define YYFAIL goto yyerrlab
862 #if defined YYFAIL
863  /* This is here to suppress warnings from the GCC cpp's
864  -Wunused-macros. Normally we don't worry about that warning, but
865  some users do, and we want to make it easy for users to remove
866  YYFAIL uses, which will produce warnings from Bison 2.5. */
867 #endif
868 
869 #define YYRECOVERING() (!!yyerrstatus)
870 
871 #define YYBACKUP(Token, Value) \
872 do \
873  if (yychar == YYEMPTY) \
874  { \
875  yychar = (Token); \
876  yylval = (Value); \
877  YYPOPSTACK (yylen); \
878  yystate = *yyssp; \
879  goto yybackup; \
880  } \
881  else \
882  { \
883  yyerror (scanner, errp, root, YY_("syntax error: cannot back up")); \
884  YYERROR; \
885  } \
886 while (YYID (0))
887 
888 
889 #define YYTERROR 1
890 #define YYERRCODE 256
891 
892 
893 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
894  If N is 0, then set CURRENT to the empty location which ends
895  the previous symbol: RHS[0] (always defined). */
896 
897 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
898 #ifndef YYLLOC_DEFAULT
899 # define YYLLOC_DEFAULT(Current, Rhs, N) \
900  do \
901  if (YYID (N)) \
902  { \
903  (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
904  (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
905  (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
906  (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
907  } \
908  else \
909  { \
910  (Current).first_line = (Current).last_line = \
911  YYRHSLOC (Rhs, 0).last_line; \
912  (Current).first_column = (Current).last_column = \
913  YYRHSLOC (Rhs, 0).last_column; \
914  } \
915  while (YYID (0))
916 #endif
917 
918 
919 /* This macro is provided for backward compatibility. */
920 
921 #ifndef YY_LOCATION_PRINT
922 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
923 #endif
924 
925 
926 /* YYLEX -- calling `yylex' with the right arguments. */
927 
928 #ifdef YYLEX_PARAM
929 # define YYLEX yylex (&yylval, YYLEX_PARAM)
930 #else
931 # define YYLEX yylex (&yylval, scanner)
932 #endif
933 
934 /* Enable debugging if requested. */
935 #if YYDEBUG
936 
937 # ifndef YYFPRINTF
938 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
939 # define YYFPRINTF fprintf
940 # endif
941 
942 # define YYDPRINTF(Args) \
943 do { \
944  if (yydebug) \
945  YYFPRINTF Args; \
946 } while (YYID (0))
947 
948 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
949 do { \
950  if (yydebug) \
951  { \
952  YYFPRINTF (stderr, "%s ", Title); \
953  yy_symbol_print (stderr, \
954  Type, Value, scanner, errp, root); \
955  YYFPRINTF (stderr, "\n"); \
956  } \
957 } while (YYID (0))
958 
959 
960 /*--------------------------------.
961 | Print this symbol on YYOUTPUT. |
962 `--------------------------------*/
963 
964 /*ARGSUSED*/
965 #if (defined __STDC__ || defined __C99__FUNC__ \
966  || defined __cplusplus || defined _MSC_VER)
967 static void
968 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, char **errp, struct nl_list_head *root)
969 #else
970 static void
971 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
972  FILE *yyoutput;
973  int yytype;
974  YYSTYPE const * const yyvaluep;
975  void *scanner;
976  char **errp;
977  struct nl_list_head *root;
978 #endif
979 {
980  FILE *yyo = yyoutput;
981  YYUSE (yyo);
982  if (!yyvaluep)
983  return;
984  YYUSE (scanner);
985  YYUSE (errp);
986  YYUSE (root);
987 # ifdef YYPRINT
988  if (yytype < YYNTOKENS)
989  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
990 # else
991  YYUSE (yyoutput);
992 # endif
993  switch (yytype)
994  {
995  default:
996  break;
997  }
998 }
999 
1000 
1001 /*--------------------------------.
1002 | Print this symbol on YYOUTPUT. |
1003 `--------------------------------*/
1004 
1005 #if (defined __STDC__ || defined __C99__FUNC__ \
1006  || defined __cplusplus || defined _MSC_VER)
1007 static void
1008 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, char **errp, struct nl_list_head *root)
1009 #else
1010 static void
1011 yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
1012  FILE *yyoutput;
1013  int yytype;
1014  YYSTYPE const * const yyvaluep;
1015  void *scanner;
1016  char **errp;
1017  struct nl_list_head *root;
1018 #endif
1019 {
1020  if (yytype < YYNTOKENS)
1021  YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1022  else
1023  YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1024 
1025  yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root);
1026  YYFPRINTF (yyoutput, ")");
1027 }
1028 
1029 /*------------------------------------------------------------------.
1030 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1031 | TOP (included). |
1032 `------------------------------------------------------------------*/
1033 
1034 #if (defined __STDC__ || defined __C99__FUNC__ \
1035  || defined __cplusplus || defined _MSC_VER)
1036 static void
1037 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1038 #else
1039 static void
1040 yy_stack_print (yybottom, yytop)
1041  yytype_int16 *yybottom;
1042  yytype_int16 *yytop;
1043 #endif
1044 {
1045  YYFPRINTF (stderr, "Stack now");
1046  for (; yybottom <= yytop; yybottom++)
1047  {
1048  int yybot = *yybottom;
1049  YYFPRINTF (stderr, " %d", yybot);
1050  }
1051  YYFPRINTF (stderr, "\n");
1052 }
1053 
1054 # define YY_STACK_PRINT(Bottom, Top) \
1055 do { \
1056  if (yydebug) \
1057  yy_stack_print ((Bottom), (Top)); \
1058 } while (YYID (0))
1059 
1060 
1061 /*------------------------------------------------.
1062 | Report that the YYRULE is going to be reduced. |
1063 `------------------------------------------------*/
1064 
1065 #if (defined __STDC__ || defined __C99__FUNC__ \
1066  || defined __cplusplus || defined _MSC_VER)
1067 static void
1068 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *scanner, char **errp, struct nl_list_head *root)
1069 #else
1070 static void
1071 yy_reduce_print (yyvsp, yyrule, scanner, errp, root)
1072  YYSTYPE *yyvsp;
1073  int yyrule;
1074  void *scanner;
1075  char **errp;
1076  struct nl_list_head *root;
1077 #endif
1078 {
1079  int yynrhs = yyr2[yyrule];
1080  int yyi;
1081  unsigned long int yylno = yyrline[yyrule];
1082  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1083  yyrule - 1, yylno);
1084  /* The symbols being reduced. */
1085  for (yyi = 0; yyi < yynrhs; yyi++)
1086  {
1087  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1088  yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1089  &(yyvsp[(yyi + 1) - (yynrhs)])
1090  , scanner, errp, root);
1091  YYFPRINTF (stderr, "\n");
1092  }
1093 }
1094 
1095 # define YY_REDUCE_PRINT(Rule) \
1096 do { \
1097  if (yydebug) \
1098  yy_reduce_print (yyvsp, Rule, scanner, errp, root); \
1099 } while (YYID (0))
1100 
1101 /* Nonzero means print parse trace. It is left uninitialized so that
1102  multiple parsers can coexist. */
1103 int yydebug;
1104 #else /* !YYDEBUG */
1105 # define YYDPRINTF(Args)
1106 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1107 # define YY_STACK_PRINT(Bottom, Top)
1108 # define YY_REDUCE_PRINT(Rule)
1109 #endif /* !YYDEBUG */
1110 
1111 
1112 /* YYINITDEPTH -- initial size of the parser's stacks. */
1113 #ifndef YYINITDEPTH
1114 # define YYINITDEPTH 200
1115 #endif
1116 
1117 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1118  if the built-in stack extension method is used).
1119 
1120  Do not make this value too large; the results are undefined if
1121  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1122  evaluated with infinite-precision integer arithmetic. */
1123 
1124 #ifndef YYMAXDEPTH
1125 # define YYMAXDEPTH 10000
1126 #endif
1127 
1128 
1129 #if YYERROR_VERBOSE
1130 
1131 # ifndef yystrlen
1132 # if defined __GLIBC__ && defined _STRING_H
1133 # define yystrlen strlen
1134 # else
1135 /* Return the length of YYSTR. */
1136 #if (defined __STDC__ || defined __C99__FUNC__ \
1137  || defined __cplusplus || defined _MSC_VER)
1138 static YYSIZE_T
1139 yystrlen (const char *yystr)
1140 #else
1141 static YYSIZE_T
1142 yystrlen (yystr)
1143  const char *yystr;
1144 #endif
1145 {
1146  YYSIZE_T yylen;
1147  for (yylen = 0; yystr[yylen]; yylen++)
1148  continue;
1149  return yylen;
1150 }
1151 # endif
1152 # endif
1153 
1154 # ifndef yystpcpy
1155 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1156 # define yystpcpy stpcpy
1157 # else
1158 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1159  YYDEST. */
1160 #if (defined __STDC__ || defined __C99__FUNC__ \
1161  || defined __cplusplus || defined _MSC_VER)
1162 static char *
1163 yystpcpy (char *yydest, const char *yysrc)
1164 #else
1165 static char *
1166 yystpcpy (yydest, yysrc)
1167  char *yydest;
1168  const char *yysrc;
1169 #endif
1170 {
1171  char *yyd = yydest;
1172  const char *yys = yysrc;
1173 
1174  while ((*yyd++ = *yys++) != '\0')
1175  continue;
1176 
1177  return yyd - 1;
1178 }
1179 # endif
1180 # endif
1181 
1182 # ifndef yytnamerr
1183 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1184  quotes and backslashes, so that it's suitable for yyerror. The
1185  heuristic is that double-quoting is unnecessary unless the string
1186  contains an apostrophe, a comma, or backslash (other than
1187  backslash-backslash). YYSTR is taken from yytname. If YYRES is
1188  null, do not copy; instead, return the length of what the result
1189  would have been. */
1190 static YYSIZE_T
1191 yytnamerr (char *yyres, const char *yystr)
1192 {
1193  if (*yystr == '"')
1194  {
1195  YYSIZE_T yyn = 0;
1196  char const *yyp = yystr;
1197 
1198  for (;;)
1199  switch (*++yyp)
1200  {
1201  case '\'':
1202  case ',':
1203  goto do_not_strip_quotes;
1204 
1205  case '\\':
1206  if (*++yyp != '\\')
1207  goto do_not_strip_quotes;
1208  /* Fall through. */
1209  default:
1210  if (yyres)
1211  yyres[yyn] = *yyp;
1212  yyn++;
1213  break;
1214 
1215  case '"':
1216  if (yyres)
1217  yyres[yyn] = '\0';
1218  return yyn;
1219  }
1220  do_not_strip_quotes: ;
1221  }
1222 
1223  if (! yyres)
1224  return yystrlen (yystr);
1225 
1226  return yystpcpy (yyres, yystr) - yyres;
1227 }
1228 # endif
1229 
1230 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1231  about the unexpected token YYTOKEN for the state stack whose top is
1232  YYSSP.
1233 
1234  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1235  not large enough to hold the message. In that case, also set
1236  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1237  required number of bytes is too large to store. */
1238 static int
1239 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1240  yytype_int16 *yyssp, int yytoken)
1241 {
1242  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1243  YYSIZE_T yysize = yysize0;
1244  YYSIZE_T yysize1;
1245  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1246  /* Internationalized format string. */
1247  const char *yyformat = YY_NULL;
1248  /* Arguments of yyformat. */
1249  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1250  /* Number of reported tokens (one for the "unexpected", one per
1251  "expected"). */
1252  int yycount = 0;
1253 
1254  /* There are many possibilities here to consider:
1255  - Assume YYFAIL is not used. It's too flawed to consider. See
1256  <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1257  for details. YYERROR is fine as it does not invoke this
1258  function.
1259  - If this state is a consistent state with a default action, then
1260  the only way this function was invoked is if the default action
1261  is an error action. In that case, don't check for expected
1262  tokens because there are none.
1263  - The only way there can be no lookahead present (in yychar) is if
1264  this state is a consistent state with a default action. Thus,
1265  detecting the absence of a lookahead is sufficient to determine
1266  that there is no unexpected or expected token to report. In that
1267  case, just report a simple "syntax error".
1268  - Don't assume there isn't a lookahead just because this state is a
1269  consistent state with a default action. There might have been a
1270  previous inconsistent state, consistent state with a non-default
1271  action, or user semantic action that manipulated yychar.
1272  - Of course, the expected token list depends on states to have
1273  correct lookahead information, and it depends on the parser not
1274  to perform extra reductions after fetching a lookahead from the
1275  scanner and before detecting a syntax error. Thus, state merging
1276  (from LALR or IELR) and default reductions corrupt the expected
1277  token list. However, the list is correct for canonical LR with
1278  one exception: it will still contain any token that will not be
1279  accepted due to an error action in a later state.
1280  */
1281  if (yytoken != YYEMPTY)
1282  {
1283  int yyn = yypact[*yyssp];
1284  yyarg[yycount++] = yytname[yytoken];
1285  if (!yypact_value_is_default (yyn))
1286  {
1287  /* Start YYX at -YYN if negative to avoid negative indexes in
1288  YYCHECK. In other words, skip the first -YYN actions for
1289  this state because they are default actions. */
1290  int yyxbegin = yyn < 0 ? -yyn : 0;
1291  /* Stay within bounds of both yycheck and yytname. */
1292  int yychecklim = YYLAST - yyn + 1;
1293  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1294  int yyx;
1295 
1296  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1297  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1298  && !yytable_value_is_error (yytable[yyx + yyn]))
1299  {
1300  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1301  {
1302  yycount = 1;
1303  yysize = yysize0;
1304  break;
1305  }
1306  yyarg[yycount++] = yytname[yyx];
1307  yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1308  if (! (yysize <= yysize1
1309  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1310  return 2;
1311  yysize = yysize1;
1312  }
1313  }
1314  }
1315 
1316  switch (yycount)
1317  {
1318 # define YYCASE_(N, S) \
1319  case N: \
1320  yyformat = S; \
1321  break
1322  YYCASE_(0, YY_("syntax error"));
1323  YYCASE_(1, YY_("syntax error, unexpected %s"));
1324  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1325  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1326  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1327  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1328 # undef YYCASE_
1329  }
1330 
1331  yysize1 = yysize + yystrlen (yyformat);
1332  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1333  return 2;
1334  yysize = yysize1;
1335 
1336  if (*yymsg_alloc < yysize)
1337  {
1338  *yymsg_alloc = 2 * yysize;
1339  if (! (yysize <= *yymsg_alloc
1340  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1341  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1342  return 1;
1343  }
1344 
1345  /* Avoid sprintf, as that infringes on the user's name space.
1346  Don't have undefined behavior even if the translation
1347  produced a string with the wrong number of "%s"s. */
1348  {
1349  char *yyp = *yymsg;
1350  int yyi = 0;
1351  while ((*yyp = *yyformat) != '\0')
1352  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1353  {
1354  yyp += yytnamerr (yyp, yyarg[yyi++]);
1355  yyformat += 2;
1356  }
1357  else
1358  {
1359  yyp++;
1360  yyformat++;
1361  }
1362  }
1363  return 0;
1364 }
1365 #endif /* YYERROR_VERBOSE */
1366 
1367 /*-----------------------------------------------.
1368 | Release the memory associated to this symbol. |
1369 `-----------------------------------------------*/
1370 
1371 /*ARGSUSED*/
1372 #if (defined __STDC__ || defined __C99__FUNC__ \
1373  || defined __cplusplus || defined _MSC_VER)
1374 static void
1375 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *scanner, char **errp, struct nl_list_head *root)
1376 #else
1377 static void
1378 yydestruct (yymsg, yytype, yyvaluep, scanner, errp, root)
1379  const char *yymsg;
1380  int yytype;
1381  YYSTYPE *yyvaluep;
1382  void *scanner;
1383  char **errp;
1384  struct nl_list_head *root;
1385 #endif
1386 {
1387  YYUSE (yyvaluep);
1388  YYUSE (scanner);
1389  YYUSE (errp);
1390  YYUSE (root);
1391 
1392  if (!yymsg)
1393  yymsg = "Deleting";
1394  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1395 
1396  switch (yytype)
1397  {
1398  case 72: /* "STR" */
1399 
1400 /* Line 1395 of yacc.c */
1401 #line 137 "route/cls/ematch_syntax.y"
1402  { free((yyvaluep->s)); NL_DBG(2, "string destructor\n"); };
1403 
1404 /* Line 1395 of yacc.c */
1405 #line 1406 "route/cls/ematch_syntax.c"
1406  break;
1407  case 73: /* "QUOTED" */
1408 
1409 /* Line 1395 of yacc.c */
1410 #line 139 "route/cls/ematch_syntax.y"
1411  { free((yyvaluep->q).data); NL_DBG(2, "quoted destructor\n"); };
1412 
1413 /* Line 1395 of yacc.c */
1414 #line 1415 "route/cls/ematch_syntax.c"
1415  break;
1416  case 81: /* "text_from" */
1417 
1418 /* Line 1395 of yacc.c */
1419 #line 138 "route/cls/ematch_syntax.y"
1420  { rtnl_pktloc_put((yyvaluep->loc)); NL_DBG(2, "pktloc destructor\n"); };
1421 
1422 /* Line 1395 of yacc.c */
1423 #line 1424 "route/cls/ematch_syntax.c"
1424  break;
1425  case 82: /* "text_to" */
1426 
1427 /* Line 1395 of yacc.c */
1428 #line 138 "route/cls/ematch_syntax.y"
1429  { rtnl_pktloc_put((yyvaluep->loc)); NL_DBG(2, "pktloc destructor\n"); };
1430 
1431 /* Line 1395 of yacc.c */
1432 #line 1433 "route/cls/ematch_syntax.c"
1433  break;
1434  case 83: /* "meta_value" */
1435 
1436 /* Line 1395 of yacc.c */
1437 #line 140 "route/cls/ematch_syntax.y"
1438  { rtnl_meta_value_put((yyvaluep->mv)); NL_DBG(2, "meta value destructor\n"); };
1439 
1440 /* Line 1395 of yacc.c */
1441 #line 1442 "route/cls/ematch_syntax.c"
1442  break;
1443  case 86: /* "pattern" */
1444 
1445 /* Line 1395 of yacc.c */
1446 #line 139 "route/cls/ematch_syntax.y"
1447  { free((yyvaluep->q).data); NL_DBG(2, "quoted destructor\n"); };
1448 
1449 /* Line 1395 of yacc.c */
1450 #line 1451 "route/cls/ematch_syntax.c"
1451  break;
1452  case 87: /* "pktloc" */
1453 
1454 /* Line 1395 of yacc.c */
1455 #line 138 "route/cls/ematch_syntax.y"
1456  { rtnl_pktloc_put((yyvaluep->loc)); NL_DBG(2, "pktloc destructor\n"); };
1457 
1458 /* Line 1395 of yacc.c */
1459 #line 1460 "route/cls/ematch_syntax.c"
1460  break;
1461 
1462  default:
1463  break;
1464  }
1465 }
1466 
1467 
1468 /* Prevent warnings from -Wmissing-prototypes. */
1469 #ifdef YYPARSE_PARAM
1470 #if defined __STDC__ || defined __cplusplus
1471 int yyparse (void *YYPARSE_PARAM);
1472 #else
1473 int yyparse ();
1474 #endif
1475 #else /* ! YYPARSE_PARAM */
1476 #if defined __STDC__ || defined __cplusplus
1477 int yyparse (void *scanner, char **errp, struct nl_list_head *root);
1478 #else
1479 int yyparse ();
1480 #endif
1481 #endif /* ! YYPARSE_PARAM */
1482 
1483 
1484 /*----------.
1485 | yyparse. |
1486 `----------*/
1487 
1488 #ifdef YYPARSE_PARAM
1489 #if (defined __STDC__ || defined __C99__FUNC__ \
1490  || defined __cplusplus || defined _MSC_VER)
1491 int
1492 yyparse (void *YYPARSE_PARAM)
1493 #else
1494 int
1495 yyparse (YYPARSE_PARAM)
1496  void *YYPARSE_PARAM;
1497 #endif
1498 #else /* ! YYPARSE_PARAM */
1499 #if (defined __STDC__ || defined __C99__FUNC__ \
1500  || defined __cplusplus || defined _MSC_VER)
1501 int
1502 yyparse (void *scanner, char **errp, struct nl_list_head *root)
1503 #else
1504 int
1505 yyparse (scanner, errp, root)
1506  void *scanner;
1507  char **errp;
1508  struct nl_list_head *root;
1509 #endif
1510 #endif
1511 {
1512 /* The lookahead symbol. */
1513 int yychar;
1514 
1515 /* The semantic value of the lookahead symbol. */
1516 YYSTYPE yylval;
1517 
1518  /* Number of syntax errors so far. */
1519  int yynerrs;
1520 
1521  int yystate;
1522  /* Number of tokens to shift before error messages enabled. */
1523  int yyerrstatus;
1524 
1525  /* The stacks and their tools:
1526  `yyss': related to states.
1527  `yyvs': related to semantic values.
1528 
1529  Refer to the stacks through separate pointers, to allow yyoverflow
1530  to reallocate them elsewhere. */
1531 
1532  /* The state stack. */
1533  yytype_int16 yyssa[YYINITDEPTH];
1534  yytype_int16 *yyss;
1535  yytype_int16 *yyssp;
1536 
1537  /* The semantic value stack. */
1538  YYSTYPE yyvsa[YYINITDEPTH];
1539  YYSTYPE *yyvs;
1540  YYSTYPE *yyvsp;
1541 
1542  YYSIZE_T yystacksize;
1543 
1544  int yyn;
1545  int yyresult;
1546  /* Lookahead token as an internal (translated) token number. */
1547  int yytoken;
1548  /* The variables used to return semantic value and location from the
1549  action routines. */
1550  YYSTYPE yyval;
1551 
1552 #if YYERROR_VERBOSE
1553  /* Buffer for error messages, and its allocated size. */
1554  char yymsgbuf[128];
1555  char *yymsg = yymsgbuf;
1556  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1557 #endif
1558 
1559 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1560 
1561  /* The number of symbols on the RHS of the reduced rule.
1562  Keep to zero when no symbol should be popped. */
1563  int yylen = 0;
1564 
1565  yytoken = 0;
1566  yyss = yyssa;
1567  yyvs = yyvsa;
1568  yystacksize = YYINITDEPTH;
1569 
1570  YYDPRINTF ((stderr, "Starting parse\n"));
1571 
1572  yystate = 0;
1573  yyerrstatus = 0;
1574  yynerrs = 0;
1575  yychar = YYEMPTY; /* Cause a token to be read. */
1576 
1577  /* Initialize stack pointers.
1578  Waste one element of value and location stack
1579  so that they stay on the same level as the state stack.
1580  The wasted elements are never initialized. */
1581  yyssp = yyss;
1582  yyvsp = yyvs;
1583 
1584  goto yysetstate;
1585 
1586 /*------------------------------------------------------------.
1587 | yynewstate -- Push a new state, which is found in yystate. |
1588 `------------------------------------------------------------*/
1589  yynewstate:
1590  /* In all cases, when you get here, the value and location stacks
1591  have just been pushed. So pushing a state here evens the stacks. */
1592  yyssp++;
1593 
1594  yysetstate:
1595  *yyssp = yystate;
1596 
1597  if (yyss + yystacksize - 1 <= yyssp)
1598  {
1599  /* Get the current used size of the three stacks, in elements. */
1600  YYSIZE_T yysize = yyssp - yyss + 1;
1601 
1602 #ifdef yyoverflow
1603  {
1604  /* Give user a chance to reallocate the stack. Use copies of
1605  these so that the &'s don't force the real ones into
1606  memory. */
1607  YYSTYPE *yyvs1 = yyvs;
1608  yytype_int16 *yyss1 = yyss;
1609 
1610  /* Each stack pointer address is followed by the size of the
1611  data in use in that stack, in bytes. This used to be a
1612  conditional around just the two extra args, but that might
1613  be undefined if yyoverflow is a macro. */
1614  yyoverflow (YY_("memory exhausted"),
1615  &yyss1, yysize * sizeof (*yyssp),
1616  &yyvs1, yysize * sizeof (*yyvsp),
1617  &yystacksize);
1618 
1619  yyss = yyss1;
1620  yyvs = yyvs1;
1621  }
1622 #else /* no yyoverflow */
1623 # ifndef YYSTACK_RELOCATE
1624  goto yyexhaustedlab;
1625 # else
1626  /* Extend the stack our own way. */
1627  if (YYMAXDEPTH <= yystacksize)
1628  goto yyexhaustedlab;
1629  yystacksize *= 2;
1630  if (YYMAXDEPTH < yystacksize)
1631  yystacksize = YYMAXDEPTH;
1632 
1633  {
1634  yytype_int16 *yyss1 = yyss;
1635  union yyalloc *yyptr =
1636  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1637  if (! yyptr)
1638  goto yyexhaustedlab;
1639  YYSTACK_RELOCATE (yyss_alloc, yyss);
1640  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1641 # undef YYSTACK_RELOCATE
1642  if (yyss1 != yyssa)
1643  YYSTACK_FREE (yyss1);
1644  }
1645 # endif
1646 #endif /* no yyoverflow */
1647 
1648  yyssp = yyss + yysize - 1;
1649  yyvsp = yyvs + yysize - 1;
1650 
1651  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1652  (unsigned long int) yystacksize));
1653 
1654  if (yyss + yystacksize - 1 <= yyssp)
1655  YYABORT;
1656  }
1657 
1658  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1659 
1660  if (yystate == YYFINAL)
1661  YYACCEPT;
1662 
1663  goto yybackup;
1664 
1665 /*-----------.
1666 | yybackup. |
1667 `-----------*/
1668 yybackup:
1669 
1670  /* Do appropriate processing given the current state. Read a
1671  lookahead token if we need one and don't already have one. */
1672 
1673  /* First try to decide what to do without reference to lookahead token. */
1674  yyn = yypact[yystate];
1675  if (yypact_value_is_default (yyn))
1676  goto yydefault;
1677 
1678  /* Not known => get a lookahead token if don't already have one. */
1679 
1680  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1681  if (yychar == YYEMPTY)
1682  {
1683  YYDPRINTF ((stderr, "Reading a token: "));
1684  yychar = YYLEX;
1685  }
1686 
1687  if (yychar <= YYEOF)
1688  {
1689  yychar = yytoken = YYEOF;
1690  YYDPRINTF ((stderr, "Now at end of input.\n"));
1691  }
1692  else
1693  {
1694  yytoken = YYTRANSLATE (yychar);
1695  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1696  }
1697 
1698  /* If the proper action on seeing token YYTOKEN is to reduce or to
1699  detect an error, take that action. */
1700  yyn += yytoken;
1701  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1702  goto yydefault;
1703  yyn = yytable[yyn];
1704  if (yyn <= 0)
1705  {
1706  if (yytable_value_is_error (yyn))
1707  goto yyerrlab;
1708  yyn = -yyn;
1709  goto yyreduce;
1710  }
1711 
1712  /* Count tokens shifted since error; after three, turn off error
1713  status. */
1714  if (yyerrstatus)
1715  yyerrstatus--;
1716 
1717  /* Shift the lookahead token. */
1718  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1719 
1720  /* Discard the shifted token. */
1721  yychar = YYEMPTY;
1722 
1723  yystate = yyn;
1724  *++yyvsp = yylval;
1725 
1726  goto yynewstate;
1727 
1728 
1729 /*-----------------------------------------------------------.
1730 | yydefault -- do the default action for the current state. |
1731 `-----------------------------------------------------------*/
1732 yydefault:
1733  yyn = yydefact[yystate];
1734  if (yyn == 0)
1735  goto yyerrlab;
1736  goto yyreduce;
1737 
1738 
1739 /*-----------------------------.
1740 | yyreduce -- Do a reduction. |
1741 `-----------------------------*/
1742 yyreduce:
1743  /* yyn is the number of a rule to reduce with. */
1744  yylen = yyr2[yyn];
1745 
1746  /* If YYLEN is nonzero, implement the default value of the action:
1747  `$$ = $1'.
1748 
1749  Otherwise, the following line sets YYVAL to garbage.
1750  This behavior is undocumented and Bison
1751  users should not rely upon it. Assigning to YYVAL
1752  unconditionally makes the parser a bit smaller, and it avoids a
1753  GCC warning that YYVAL may be used uninitialized. */
1754  yyval = yyvsp[1-yylen];
1755 
1756 
1757  YY_REDUCE_PRINT (yyn);
1758  switch (yyn)
1759  {
1760  case 3:
1761 
1762 /* Line 1810 of yacc.c */
1763 #line 149 "route/cls/ematch_syntax.y"
1764  {
1765  nl_list_add_tail(root, &(yyvsp[(1) - (1)].e)->e_list);
1766  }
1767  break;
1768 
1769  case 4:
1770 
1771 /* Line 1810 of yacc.c */
1772 #line 156 "route/cls/ematch_syntax.y"
1773  {
1774  (yyval.e) = (yyvsp[(1) - (1)].e);
1775  }
1776  break;
1777 
1778  case 5:
1779 
1780 /* Line 1810 of yacc.c */
1781 #line 160 "route/cls/ematch_syntax.y"
1782  {
1783  rtnl_ematch_set_flags((yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].i));
1784 
1785  /* make ematch new head */
1786  nl_list_add_tail(&(yyvsp[(1) - (3)].e)->e_list, &(yyvsp[(3) - (3)].e)->e_list);
1787 
1788  (yyval.e) = (yyvsp[(1) - (3)].e);
1789  }
1790  break;
1791 
1792  case 6:
1793 
1794 /* Line 1810 of yacc.c */
1795 #line 172 "route/cls/ematch_syntax.y"
1796  {
1797  rtnl_ematch_set_flags((yyvsp[(2) - (2)].e), TCF_EM_INVERT);
1798  (yyval.e) = (yyvsp[(2) - (2)].e);
1799  }
1800  break;
1801 
1802  case 7:
1803 
1804 /* Line 1810 of yacc.c */
1805 #line 177 "route/cls/ematch_syntax.y"
1806  {
1807  (yyval.e) = (yyvsp[(1) - (1)].e);
1808  }
1809  break;
1810 
1811  case 8:
1812 
1813 /* Line 1810 of yacc.c */
1814 #line 185 "route/cls/ematch_syntax.y"
1815  {
1816  struct rtnl_ematch *e;
1817 
1818  if (!(e = rtnl_ematch_alloc())) {
1819  asprintf(errp, "Unable to allocate ematch object");
1820  YYABORT;
1821  }
1822 
1823  if (rtnl_ematch_set_kind(e, TCF_EM_CMP) < 0)
1824  BUG();
1825 
1826  rtnl_ematch_cmp_set(e, &(yyvsp[(1) - (1)].cmp));
1827  (yyval.e) = e;
1828  }
1829  break;
1830 
1831  case 9:
1832 
1833 /* Line 1810 of yacc.c */
1834 #line 200 "route/cls/ematch_syntax.y"
1835  {
1836  struct rtnl_ematch *e;
1837 
1838  if (!(e = rtnl_ematch_alloc())) {
1839  asprintf(errp, "Unable to allocate ematch object");
1840  YYABORT;
1841  }
1842 
1843  if (rtnl_ematch_set_kind(e, TCF_EM_NBYTE) < 0)
1844  BUG();
1845 
1846  rtnl_ematch_nbyte_set_offset(e, (yyvsp[(3) - (6)].loc)->layer, (yyvsp[(3) - (6)].loc)->offset);
1847  rtnl_pktloc_put((yyvsp[(3) - (6)].loc));
1848  rtnl_ematch_nbyte_set_pattern(e, (uint8_t *) (yyvsp[(5) - (6)].q).data, (yyvsp[(5) - (6)].q).index);
1849 
1850  (yyval.e) = e;
1851  }
1852  break;
1853 
1854  case 10:
1855 
1856 /* Line 1810 of yacc.c */
1857 #line 218 "route/cls/ematch_syntax.y"
1858  {
1859  struct rtnl_ematch *e;
1860 
1861  if (!(e = rtnl_ematch_alloc())) {
1862  asprintf(errp, "Unable to allocate ematch object");
1863  YYABORT;
1864  }
1865 
1866  if (rtnl_ematch_set_kind(e, TCF_EM_TEXT) < 0)
1867  BUG();
1868 
1869  rtnl_ematch_text_set_algo(e, (yyvsp[(3) - (7)].s));
1870  rtnl_ematch_text_set_pattern(e, (yyvsp[(4) - (7)].q).data, (yyvsp[(4) - (7)].q).index);
1871 
1872  if ((yyvsp[(5) - (7)].loc)) {
1873  rtnl_ematch_text_set_from(e, (yyvsp[(5) - (7)].loc)->layer, (yyvsp[(5) - (7)].loc)->offset);
1874  rtnl_pktloc_put((yyvsp[(5) - (7)].loc));
1875  }
1876 
1877  if ((yyvsp[(6) - (7)].loc)) {
1878  rtnl_ematch_text_set_to(e, (yyvsp[(6) - (7)].loc)->layer, (yyvsp[(6) - (7)].loc)->offset);
1879  rtnl_pktloc_put((yyvsp[(6) - (7)].loc));
1880  }
1881 
1882  (yyval.e) = e;
1883  }
1884  break;
1885 
1886  case 11:
1887 
1888 /* Line 1810 of yacc.c */
1889 #line 245 "route/cls/ematch_syntax.y"
1890  {
1891  struct rtnl_ematch *e;
1892 
1893  if (!(e = rtnl_ematch_alloc())) {
1894  asprintf(errp, "Unable to allocate ematch object");
1895  YYABORT;
1896  }
1897 
1898  if (rtnl_ematch_set_kind(e, TCF_EM_META) < 0)
1899  BUG();
1900 
1901  rtnl_ematch_meta_set_lvalue(e, (yyvsp[(3) - (6)].mv));
1902  rtnl_ematch_meta_set_rvalue(e, (yyvsp[(5) - (6)].mv));
1903  rtnl_ematch_meta_set_operand(e, (yyvsp[(4) - (6)].i));
1904 
1905  (yyval.e) = e;
1906  }
1907  break;
1908 
1909  case 12:
1910 
1911 /* Line 1810 of yacc.c */
1912 #line 264 "route/cls/ematch_syntax.y"
1913  {
1914  struct rtnl_ematch *e;
1915 
1916  if (!(e = rtnl_ematch_alloc())) {
1917  asprintf(errp, "Unable to allocate ematch object");
1918  YYABORT;
1919  }
1920 
1921  if (rtnl_ematch_set_kind(e, TCF_EM_CONTAINER) < 0)
1922  BUG();
1923 
1924  /* Make e->childs the list head of a the ematch sequence */
1925  nl_list_add_tail(&e->e_childs, &(yyvsp[(2) - (3)].e)->e_list);
1926 
1927  (yyval.e) = e;
1928  }
1929  break;
1930 
1931  case 13:
1932 
1933 /* Line 1810 of yacc.c */
1934 #line 292 "route/cls/ematch_syntax.y"
1935  { (yyval.cmp) = (yyvsp[(3) - (4)].cmp); }
1936  break;
1937 
1938  case 14:
1939 
1940 /* Line 1810 of yacc.c */
1941 #line 294 "route/cls/ematch_syntax.y"
1942  { (yyval.cmp) = (yyvsp[(1) - (1)].cmp); }
1943  break;
1944 
1945  case 15:
1946 
1947 /* Line 1810 of yacc.c */
1948 #line 299 "route/cls/ematch_syntax.y"
1949  {
1950  if ((yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U16 ||
1951  (yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U32)
1952  (yyval.cmp).flags = TCF_EM_CMP_TRANS;
1953 
1954  memset(&(yyval.cmp), 0, sizeof((yyval.cmp)));
1955 
1956  (yyval.cmp).mask = (yyvsp[(1) - (3)].loc)->mask;
1957  (yyval.cmp).off = (yyvsp[(1) - (3)].loc)->offset;
1958  (yyval.cmp).align = (yyvsp[(1) - (3)].loc)->align;
1959  (yyval.cmp).layer = (yyvsp[(1) - (3)].loc)->layer;
1960  (yyval.cmp).opnd = (yyvsp[(2) - (3)].i);
1961  (yyval.cmp).val = (yyvsp[(3) - (3)].i);
1962 
1963  rtnl_pktloc_put((yyvsp[(1) - (3)].loc));
1964  }
1965  break;
1966 
1967  case 16:
1968 
1969 /* Line 1810 of yacc.c */
1970 #line 319 "route/cls/ematch_syntax.y"
1971  { (yyval.loc) = NULL; }
1972  break;
1973 
1974  case 17:
1975 
1976 /* Line 1810 of yacc.c */
1977 #line 321 "route/cls/ematch_syntax.y"
1978  { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
1979  break;
1980 
1981  case 18:
1982 
1983 /* Line 1810 of yacc.c */
1984 #line 326 "route/cls/ematch_syntax.y"
1985  { (yyval.loc) = NULL; }
1986  break;
1987 
1988  case 19:
1989 
1990 /* Line 1810 of yacc.c */
1991 #line 328 "route/cls/ematch_syntax.y"
1992  { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
1993  break;
1994 
1995  case 20:
1996 
1997 /* Line 1810 of yacc.c */
1998 #line 333 "route/cls/ematch_syntax.y"
1999  { (yyval.mv) = rtnl_meta_value_alloc_var((yyvsp[(1) - (1)].q).data, (yyvsp[(1) - (1)].q).len); }
2000  break;
2001 
2002  case 21:
2003 
2004 /* Line 1810 of yacc.c */
2005 #line 335 "route/cls/ematch_syntax.y"
2006  { (yyval.mv) = rtnl_meta_value_alloc_int((yyvsp[(1) - (1)].i)); }
2007  break;
2008 
2009  case 22:
2010 
2011 /* Line 1810 of yacc.c */
2012 #line 337 "route/cls/ematch_syntax.y"
2013  { (yyval.mv) = META_ALLOC(META_INT, (yyvsp[(1) - (3)].i), (yyvsp[(2) - (3)].i), (yyvsp[(3) - (3)].i64)); }
2014  break;
2015 
2016  case 23:
2017 
2018 /* Line 1810 of yacc.c */
2019 #line 339 "route/cls/ematch_syntax.y"
2020  { (yyval.mv) = META_ALLOC(META_VAR, (yyvsp[(1) - (2)].i), (yyvsp[(2) - (2)].i), 0); }
2021  break;
2022 
2023  case 24:
2024 
2025 /* Line 1810 of yacc.c */
2026 #line 343 "route/cls/ematch_syntax.y"
2027  { (yyval.i) = META_ID(RANDOM); }
2028  break;
2029 
2030  case 25:
2031 
2032 /* Line 1810 of yacc.c */
2033 #line 344 "route/cls/ematch_syntax.y"
2034  { (yyval.i) = META_ID(LOADAVG_0); }
2035  break;
2036 
2037  case 26:
2038 
2039 /* Line 1810 of yacc.c */
2040 #line 345 "route/cls/ematch_syntax.y"
2041  { (yyval.i) = META_ID(LOADAVG_1); }
2042  break;
2043 
2044  case 27:
2045 
2046 /* Line 1810 of yacc.c */
2047 #line 346 "route/cls/ematch_syntax.y"
2048  { (yyval.i) = META_ID(LOADAVG_2); }
2049  break;
2050 
2051  case 28:
2052 
2053 /* Line 1810 of yacc.c */
2054 #line 347 "route/cls/ematch_syntax.y"
2055  { (yyval.i) = META_ID(DEV); }
2056  break;
2057 
2058  case 29:
2059 
2060 /* Line 1810 of yacc.c */
2061 #line 348 "route/cls/ematch_syntax.y"
2062  { (yyval.i) = META_ID(PRIORITY); }
2063  break;
2064 
2065  case 30:
2066 
2067 /* Line 1810 of yacc.c */
2068 #line 349 "route/cls/ematch_syntax.y"
2069  { (yyval.i) = META_ID(PROTOCOL); }
2070  break;
2071 
2072  case 31:
2073 
2074 /* Line 1810 of yacc.c */
2075 #line 350 "route/cls/ematch_syntax.y"
2076  { (yyval.i) = META_ID(PKTTYPE); }
2077  break;
2078 
2079  case 32:
2080 
2081 /* Line 1810 of yacc.c */
2082 #line 351 "route/cls/ematch_syntax.y"
2083  { (yyval.i) = META_ID(PKTLEN); }
2084  break;
2085 
2086  case 33:
2087 
2088 /* Line 1810 of yacc.c */
2089 #line 352 "route/cls/ematch_syntax.y"
2090  { (yyval.i) = META_ID(DATALEN); }
2091  break;
2092 
2093  case 34:
2094 
2095 /* Line 1810 of yacc.c */
2096 #line 353 "route/cls/ematch_syntax.y"
2097  { (yyval.i) = META_ID(MACLEN); }
2098  break;
2099 
2100  case 35:
2101 
2102 /* Line 1810 of yacc.c */
2103 #line 354 "route/cls/ematch_syntax.y"
2104  { (yyval.i) = META_ID(NFMARK); }
2105  break;
2106 
2107  case 36:
2108 
2109 /* Line 1810 of yacc.c */
2110 #line 355 "route/cls/ematch_syntax.y"
2111  { (yyval.i) = META_ID(TCINDEX); }
2112  break;
2113 
2114  case 37:
2115 
2116 /* Line 1810 of yacc.c */
2117 #line 356 "route/cls/ematch_syntax.y"
2118  { (yyval.i) = META_ID(RTCLASSID); }
2119  break;
2120 
2121  case 38:
2122 
2123 /* Line 1810 of yacc.c */
2124 #line 357 "route/cls/ematch_syntax.y"
2125  { (yyval.i) = META_ID(RTIIF); }
2126  break;
2127 
2128  case 39:
2129 
2130 /* Line 1810 of yacc.c */
2131 #line 358 "route/cls/ematch_syntax.y"
2132  { (yyval.i) = META_ID(SK_FAMILY); }
2133  break;
2134 
2135  case 40:
2136 
2137 /* Line 1810 of yacc.c */
2138 #line 359 "route/cls/ematch_syntax.y"
2139  { (yyval.i) = META_ID(SK_STATE); }
2140  break;
2141 
2142  case 41:
2143 
2144 /* Line 1810 of yacc.c */
2145 #line 360 "route/cls/ematch_syntax.y"
2146  { (yyval.i) = META_ID(SK_REUSE); }
2147  break;
2148 
2149  case 42:
2150 
2151 /* Line 1810 of yacc.c */
2152 #line 361 "route/cls/ematch_syntax.y"
2153  { (yyval.i) = META_ID(SK_REFCNT); }
2154  break;
2155 
2156  case 43:
2157 
2158 /* Line 1810 of yacc.c */
2159 #line 362 "route/cls/ematch_syntax.y"
2160  { (yyval.i) = META_ID(SK_RCVBUF); }
2161  break;
2162 
2163  case 44:
2164 
2165 /* Line 1810 of yacc.c */
2166 #line 363 "route/cls/ematch_syntax.y"
2167  { (yyval.i) = META_ID(SK_SNDBUF); }
2168  break;
2169 
2170  case 45:
2171 
2172 /* Line 1810 of yacc.c */
2173 #line 364 "route/cls/ematch_syntax.y"
2174  { (yyval.i) = META_ID(SK_SHUTDOWN); }
2175  break;
2176 
2177  case 46:
2178 
2179 /* Line 1810 of yacc.c */
2180 #line 365 "route/cls/ematch_syntax.y"
2181  { (yyval.i) = META_ID(SK_PROTO); }
2182  break;
2183 
2184  case 47:
2185 
2186 /* Line 1810 of yacc.c */
2187 #line 366 "route/cls/ematch_syntax.y"
2188  { (yyval.i) = META_ID(SK_TYPE); }
2189  break;
2190 
2191  case 48:
2192 
2193 /* Line 1810 of yacc.c */
2194 #line 367 "route/cls/ematch_syntax.y"
2195  { (yyval.i) = META_ID(SK_RMEM_ALLOC); }
2196  break;
2197 
2198  case 49:
2199 
2200 /* Line 1810 of yacc.c */
2201 #line 368 "route/cls/ematch_syntax.y"
2202  { (yyval.i) = META_ID(SK_WMEM_ALLOC); }
2203  break;
2204 
2205  case 50:
2206 
2207 /* Line 1810 of yacc.c */
2208 #line 369 "route/cls/ematch_syntax.y"
2209  { (yyval.i) = META_ID(SK_WMEM_QUEUED); }
2210  break;
2211 
2212  case 51:
2213 
2214 /* Line 1810 of yacc.c */
2215 #line 370 "route/cls/ematch_syntax.y"
2216  { (yyval.i) = META_ID(SK_RCV_QLEN); }
2217  break;
2218 
2219  case 52:
2220 
2221 /* Line 1810 of yacc.c */
2222 #line 371 "route/cls/ematch_syntax.y"
2223  { (yyval.i) = META_ID(SK_SND_QLEN); }
2224  break;
2225 
2226  case 53:
2227 
2228 /* Line 1810 of yacc.c */
2229 #line 372 "route/cls/ematch_syntax.y"
2230  { (yyval.i) = META_ID(SK_ERR_QLEN); }
2231  break;
2232 
2233  case 54:
2234 
2235 /* Line 1810 of yacc.c */
2236 #line 373 "route/cls/ematch_syntax.y"
2237  { (yyval.i) = META_ID(SK_FORWARD_ALLOCS); }
2238  break;
2239 
2240  case 55:
2241 
2242 /* Line 1810 of yacc.c */
2243 #line 374 "route/cls/ematch_syntax.y"
2244  { (yyval.i) = META_ID(SK_ALLOCS); }
2245  break;
2246 
2247  case 56:
2248 
2249 /* Line 1810 of yacc.c */
2250 #line 375 "route/cls/ematch_syntax.y"
2251  { (yyval.i) = META_ID(SK_ROUTE_CAPS); }
2252  break;
2253 
2254  case 57:
2255 
2256 /* Line 1810 of yacc.c */
2257 #line 376 "route/cls/ematch_syntax.y"
2258  { (yyval.i) = META_ID(SK_HASH); }
2259  break;
2260 
2261  case 58:
2262 
2263 /* Line 1810 of yacc.c */
2264 #line 377 "route/cls/ematch_syntax.y"
2265  { (yyval.i) = META_ID(SK_LINGERTIME); }
2266  break;
2267 
2268  case 59:
2269 
2270 /* Line 1810 of yacc.c */
2271 #line 378 "route/cls/ematch_syntax.y"
2272  { (yyval.i) = META_ID(SK_ACK_BACKLOG); }
2273  break;
2274 
2275  case 60:
2276 
2277 /* Line 1810 of yacc.c */
2278 #line 379 "route/cls/ematch_syntax.y"
2279  { (yyval.i) = META_ID(SK_MAX_ACK_BACKLOG); }
2280  break;
2281 
2282  case 61:
2283 
2284 /* Line 1810 of yacc.c */
2285 #line 380 "route/cls/ematch_syntax.y"
2286  { (yyval.i) = META_ID(SK_PRIO); }
2287  break;
2288 
2289  case 62:
2290 
2291 /* Line 1810 of yacc.c */
2292 #line 381 "route/cls/ematch_syntax.y"
2293  { (yyval.i) = META_ID(SK_RCVLOWAT); }
2294  break;
2295 
2296  case 63:
2297 
2298 /* Line 1810 of yacc.c */
2299 #line 382 "route/cls/ematch_syntax.y"
2300  { (yyval.i) = META_ID(SK_RCVTIMEO); }
2301  break;
2302 
2303  case 64:
2304 
2305 /* Line 1810 of yacc.c */
2306 #line 383 "route/cls/ematch_syntax.y"
2307  { (yyval.i) = META_ID(SK_SNDTIMEO); }
2308  break;
2309 
2310  case 65:
2311 
2312 /* Line 1810 of yacc.c */
2313 #line 384 "route/cls/ematch_syntax.y"
2314  { (yyval.i) = META_ID(SK_SENDMSG_OFF); }
2315  break;
2316 
2317  case 66:
2318 
2319 /* Line 1810 of yacc.c */
2320 #line 385 "route/cls/ematch_syntax.y"
2321  { (yyval.i) = META_ID(SK_WRITE_PENDING); }
2322  break;
2323 
2324  case 67:
2325 
2326 /* Line 1810 of yacc.c */
2327 #line 386 "route/cls/ematch_syntax.y"
2328  { (yyval.i) = META_ID(VLAN_TAG); }
2329  break;
2330 
2331  case 68:
2332 
2333 /* Line 1810 of yacc.c */
2334 #line 387 "route/cls/ematch_syntax.y"
2335  { (yyval.i) = META_ID(RXHASH); }
2336  break;
2337 
2338  case 69:
2339 
2340 /* Line 1810 of yacc.c */
2341 #line 391 "route/cls/ematch_syntax.y"
2342  { (yyval.i) = META_ID(DEV); }
2343  break;
2344 
2345  case 70:
2346 
2347 /* Line 1810 of yacc.c */
2348 #line 392 "route/cls/ematch_syntax.y"
2349  { (yyval.i) = META_ID(SK_BOUND_IF); }
2350  break;
2351 
2352  case 71:
2353 
2354 /* Line 1810 of yacc.c */
2355 #line 400 "route/cls/ematch_syntax.y"
2356  {
2357  (yyval.q) = (yyvsp[(1) - (1)].q);
2358  }
2359  break;
2360 
2361  case 72:
2362 
2363 /* Line 1810 of yacc.c */
2364 #line 404 "route/cls/ematch_syntax.y"
2365  {
2366  struct nl_addr *addr;
2367 
2368  if (nl_addr_parse((yyvsp[(1) - (1)].s), AF_UNSPEC, &addr) == 0) {
2369  (yyval.q).len = nl_addr_get_len(addr);
2370 
2371  (yyval.q).index = min_t(int, (yyval.q).len, nl_addr_get_prefixlen(addr)/8);
2372 
2373  if (!((yyval.q).data = calloc(1, (yyval.q).len))) {
2374  nl_addr_put(addr);
2375  YYABORT;
2376  }
2377 
2378  memcpy((yyval.q).data, nl_addr_get_binary_addr(addr), (yyval.q).len);
2379  nl_addr_put(addr);
2380  } else {
2381  asprintf(errp, "invalid pattern \"%s\"", (yyvsp[(1) - (1)].s));
2382  YYABORT;
2383  }
2384  }
2385  break;
2386 
2387  case 73:
2388 
2389 /* Line 1810 of yacc.c */
2390 #line 432 "route/cls/ematch_syntax.y"
2391  {
2392  struct rtnl_pktloc *loc;
2393 
2394  if (rtnl_pktloc_lookup((yyvsp[(1) - (1)].s), &loc) < 0) {
2395  asprintf(errp, "Packet location \"%s\" not found", (yyvsp[(1) - (1)].s));
2396  YYABORT;
2397  }
2398 
2399  (yyval.loc) = loc;
2400  }
2401  break;
2402 
2403  case 74:
2404 
2405 /* Line 1810 of yacc.c */
2406 #line 444 "route/cls/ematch_syntax.y"
2407  {
2408  struct rtnl_pktloc *loc;
2409 
2410  if ((yyvsp[(5) - (5)].i64) && (!(yyvsp[(1) - (5)].i) || (yyvsp[(1) - (5)].i) > TCF_EM_ALIGN_U32)) {
2411  asprintf(errp, "mask only allowed for alignments u8|u16|u32");
2412  YYABORT;
2413  }
2414 
2415  if (!(loc = rtnl_pktloc_alloc())) {
2416  asprintf(errp, "Unable to allocate packet location object");
2417  YYABORT;
2418  }
2419 
2420  loc->name = strdup("<USER-DEFINED>");
2421  loc->align = (yyvsp[(1) - (5)].i);
2422  loc->layer = (yyvsp[(2) - (5)].i);
2423  loc->offset = (yyvsp[(4) - (5)].i);
2424  loc->mask = (yyvsp[(5) - (5)].i64);
2425 
2426  (yyval.loc) = loc;
2427  }
2428  break;
2429 
2430  case 75:
2431 
2432 /* Line 1810 of yacc.c */
2433 #line 469 "route/cls/ematch_syntax.y"
2434  { (yyval.i) = 0; }
2435  break;
2436 
2437  case 76:
2438 
2439 /* Line 1810 of yacc.c */
2440 #line 471 "route/cls/ematch_syntax.y"
2441  { (yyval.i) = (yyvsp[(1) - (2)].i); }
2442  break;
2443 
2444  case 77:
2445 
2446 /* Line 1810 of yacc.c */
2447 #line 473 "route/cls/ematch_syntax.y"
2448  { (yyval.i) = (yyvsp[(1) - (2)].i); }
2449  break;
2450 
2451  case 78:
2452 
2453 /* Line 1810 of yacc.c */
2454 #line 478 "route/cls/ematch_syntax.y"
2455  { (yyval.i64) = 0; }
2456  break;
2457 
2458  case 79:
2459 
2460 /* Line 1810 of yacc.c */
2461 #line 480 "route/cls/ematch_syntax.y"
2462  { (yyval.i64) = (yyvsp[(2) - (2)].i); }
2463  break;
2464 
2465  case 80:
2466 
2467 /* Line 1810 of yacc.c */
2468 #line 485 "route/cls/ematch_syntax.y"
2469  { (yyval.i) = 0; }
2470  break;
2471 
2472  case 81:
2473 
2474 /* Line 1810 of yacc.c */
2475 #line 487 "route/cls/ematch_syntax.y"
2476  { (yyval.i) = (yyvsp[(2) - (2)].i); }
2477  break;
2478 
2479  case 82:
2480 
2481 /* Line 1810 of yacc.c */
2482 #line 492 "route/cls/ematch_syntax.y"
2483  { (yyval.i) = TCF_EM_OPND_EQ; }
2484  break;
2485 
2486  case 83:
2487 
2488 /* Line 1810 of yacc.c */
2489 #line 494 "route/cls/ematch_syntax.y"
2490  { (yyval.i) = TCF_EM_OPND_GT; }
2491  break;
2492 
2493  case 84:
2494 
2495 /* Line 1810 of yacc.c */
2496 #line 496 "route/cls/ematch_syntax.y"
2497  { (yyval.i) = TCF_EM_OPND_LT; }
2498  break;
2499 
2500 
2501 
2502 /* Line 1810 of yacc.c */
2503 #line 2504 "route/cls/ematch_syntax.c"
2504  default: break;
2505  }
2506  /* User semantic actions sometimes alter yychar, and that requires
2507  that yytoken be updated with the new translation. We take the
2508  approach of translating immediately before every use of yytoken.
2509  One alternative is translating here after every semantic action,
2510  but that translation would be missed if the semantic action invokes
2511  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2512  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2513  incorrect destructor might then be invoked immediately. In the
2514  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2515  to an incorrect destructor call or verbose syntax error message
2516  before the lookahead is translated. */
2517  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2518 
2519  YYPOPSTACK (yylen);
2520  yylen = 0;
2521  YY_STACK_PRINT (yyss, yyssp);
2522 
2523  *++yyvsp = yyval;
2524 
2525  /* Now `shift' the result of the reduction. Determine what state
2526  that goes to, based on the state we popped back to and the rule
2527  number reduced by. */
2528 
2529  yyn = yyr1[yyn];
2530 
2531  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2532  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2533  yystate = yytable[yystate];
2534  else
2535  yystate = yydefgoto[yyn - YYNTOKENS];
2536 
2537  goto yynewstate;
2538 
2539 
2540 /*------------------------------------.
2541 | yyerrlab -- here on detecting error |
2542 `------------------------------------*/
2543 yyerrlab:
2544  /* Make sure we have latest lookahead translation. See comments at
2545  user semantic actions for why this is necessary. */
2546  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2547 
2548  /* If not already recovering from an error, report this error. */
2549  if (!yyerrstatus)
2550  {
2551  ++yynerrs;
2552 #if ! YYERROR_VERBOSE
2553  yyerror (scanner, errp, root, YY_("syntax error"));
2554 #else
2555 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2556  yyssp, yytoken)
2557  {
2558  char const *yymsgp = YY_("syntax error");
2559  int yysyntax_error_status;
2560  yysyntax_error_status = YYSYNTAX_ERROR;
2561  if (yysyntax_error_status == 0)
2562  yymsgp = yymsg;
2563  else if (yysyntax_error_status == 1)
2564  {
2565  if (yymsg != yymsgbuf)
2566  YYSTACK_FREE (yymsg);
2567  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2568  if (!yymsg)
2569  {
2570  yymsg = yymsgbuf;
2571  yymsg_alloc = sizeof yymsgbuf;
2572  yysyntax_error_status = 2;
2573  }
2574  else
2575  {
2576  yysyntax_error_status = YYSYNTAX_ERROR;
2577  yymsgp = yymsg;
2578  }
2579  }
2580  yyerror (scanner, errp, root, yymsgp);
2581  if (yysyntax_error_status == 2)
2582  goto yyexhaustedlab;
2583  }
2584 # undef YYSYNTAX_ERROR
2585 #endif
2586  }
2587 
2588 
2589 
2590  if (yyerrstatus == 3)
2591  {
2592  /* If just tried and failed to reuse lookahead token after an
2593  error, discard it. */
2594 
2595  if (yychar <= YYEOF)
2596  {
2597  /* Return failure if at end of input. */
2598  if (yychar == YYEOF)
2599  YYABORT;
2600  }
2601  else
2602  {
2603  yydestruct ("Error: discarding",
2604  yytoken, &yylval, scanner, errp, root);
2605  yychar = YYEMPTY;
2606  }
2607  }
2608 
2609  /* Else will try to reuse lookahead token after shifting the error
2610  token. */
2611  goto yyerrlab1;
2612 
2613 
2614 /*---------------------------------------------------.
2615 | yyerrorlab -- error raised explicitly by YYERROR. |
2616 `---------------------------------------------------*/
2617 yyerrorlab:
2618 
2619  /* Pacify compilers like GCC when the user code never invokes
2620  YYERROR and the label yyerrorlab therefore never appears in user
2621  code. */
2622  if (/*CONSTCOND*/ 0)
2623  goto yyerrorlab;
2624 
2625  /* Do not reclaim the symbols of the rule which action triggered
2626  this YYERROR. */
2627  YYPOPSTACK (yylen);
2628  yylen = 0;
2629  YY_STACK_PRINT (yyss, yyssp);
2630  yystate = *yyssp;
2631  goto yyerrlab1;
2632 
2633 
2634 /*-------------------------------------------------------------.
2635 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2636 `-------------------------------------------------------------*/
2637 yyerrlab1:
2638  yyerrstatus = 3; /* Each real token shifted decrements this. */
2639 
2640  for (;;)
2641  {
2642  yyn = yypact[yystate];
2643  if (!yypact_value_is_default (yyn))
2644  {
2645  yyn += YYTERROR;
2646  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2647  {
2648  yyn = yytable[yyn];
2649  if (0 < yyn)
2650  break;
2651  }
2652  }
2653 
2654  /* Pop the current state because it cannot handle the error token. */
2655  if (yyssp == yyss)
2656  YYABORT;
2657 
2658 
2659  yydestruct ("Error: popping",
2660  yystos[yystate], yyvsp, scanner, errp, root);
2661  YYPOPSTACK (1);
2662  yystate = *yyssp;
2663  YY_STACK_PRINT (yyss, yyssp);
2664  }
2665 
2666  *++yyvsp = yylval;
2667 
2668 
2669  /* Shift the error token. */
2670  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2671 
2672  yystate = yyn;
2673  goto yynewstate;
2674 
2675 
2676 /*-------------------------------------.
2677 | yyacceptlab -- YYACCEPT comes here. |
2678 `-------------------------------------*/
2679 yyacceptlab:
2680  yyresult = 0;
2681  goto yyreturn;
2682 
2683 /*-----------------------------------.
2684 | yyabortlab -- YYABORT comes here. |
2685 `-----------------------------------*/
2686 yyabortlab:
2687  yyresult = 1;
2688  goto yyreturn;
2689 
2690 #if !defined yyoverflow || YYERROR_VERBOSE
2691 /*-------------------------------------------------.
2692 | yyexhaustedlab -- memory exhaustion comes here. |
2693 `-------------------------------------------------*/
2694 yyexhaustedlab:
2695  yyerror (scanner, errp, root, YY_("memory exhausted"));
2696  yyresult = 2;
2697  /* Fall through. */
2698 #endif
2699 
2700 yyreturn:
2701  if (yychar != YYEMPTY)
2702  {
2703  /* Make sure we have latest lookahead translation. See comments at
2704  user semantic actions for why this is necessary. */
2705  yytoken = YYTRANSLATE (yychar);
2706  yydestruct ("Cleanup: discarding lookahead",
2707  yytoken, &yylval, scanner, errp, root);
2708  }
2709  /* Do not reclaim the symbols of the rule which action triggered
2710  this YYABORT or YYACCEPT. */
2711  YYPOPSTACK (yylen);
2712  YY_STACK_PRINT (yyss, yyssp);
2713  while (yyssp != yyss)
2714  {
2715  yydestruct ("Cleanup: popping",
2716  yystos[*yyssp], yyvsp, scanner, errp, root);
2717  YYPOPSTACK (1);
2718  }
2719 #ifndef yyoverflow
2720  if (yyss != yyssa)
2721  YYSTACK_FREE (yyss);
2722 #endif
2723 #if YYERROR_VERBOSE
2724  if (yymsg != yymsgbuf)
2725  YYSTACK_FREE (yymsg);
2726 #endif
2727  /* Make sure YYID is used. */
2728  return YYID (yyresult);
2729 }
2730 
2731 
2732