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