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