libnl  3.5.0
ematch_syntax.c
1 /* A Bison parser, made by GNU Bison 3.0.5. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015, 2018 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.5"
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  default: /* Avoid compiler warnings. */
1183  YYCASE_(0, YY_("syntax error"));
1184  YYCASE_(1, YY_("syntax error, unexpected %s"));
1185  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1186  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1187  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1188  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1189 # undef YYCASE_
1190  }
1191 
1192  {
1193  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1194  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1195  return 2;
1196  yysize = yysize1;
1197  }
1198 
1199  if (*yymsg_alloc < yysize)
1200  {
1201  *yymsg_alloc = 2 * yysize;
1202  if (! (yysize <= *yymsg_alloc
1203  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1204  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1205  return 1;
1206  }
1207 
1208  /* Avoid sprintf, as that infringes on the user's name space.
1209  Don't have undefined behavior even if the translation
1210  produced a string with the wrong number of "%s"s. */
1211  {
1212  char *yyp = *yymsg;
1213  int yyi = 0;
1214  while ((*yyp = *yyformat) != '\0')
1215  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1216  {
1217  yyp += yytnamerr (yyp, yyarg[yyi++]);
1218  yyformat += 2;
1219  }
1220  else
1221  {
1222  yyp++;
1223  yyformat++;
1224  }
1225  }
1226  return 0;
1227 }
1228 #endif /* YYERROR_VERBOSE */
1229 
1230 /*-----------------------------------------------.
1231 | Release the memory associated to this symbol. |
1232 `-----------------------------------------------*/
1233 
1234 static void
1235 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *scanner, char **errp, struct nl_list_head *root)
1236 {
1237  YYUSE (yyvaluep);
1238  YYUSE (scanner);
1239  YYUSE (errp);
1240  YYUSE (root);
1241  if (!yymsg)
1242  yymsg = "Deleting";
1243  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1244 
1245  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1246  switch (yytype)
1247  {
1248  case 72: /* STR */
1249 #line 141 "lib/route/cls/ematch_syntax.y" /* yacc.c:1258 */
1250  { free(((*yyvaluep).s)); NL_DBG(2, "string destructor\n"); }
1251 #line 1252 "lib/route/cls/ematch_syntax.c" /* yacc.c:1258 */
1252  break;
1253 
1254  case 73: /* QUOTED */
1255 #line 143 "lib/route/cls/ematch_syntax.y" /* yacc.c:1258 */
1256  { free(((*yyvaluep).q).data); NL_DBG(2, "quoted destructor\n"); }
1257 #line 1258 "lib/route/cls/ematch_syntax.c" /* yacc.c:1258 */
1258  break;
1259 
1260  case 81: /* text_from */
1261 #line 142 "lib/route/cls/ematch_syntax.y" /* yacc.c:1258 */
1262  { rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2, "pktloc destructor\n"); }
1263 #line 1264 "lib/route/cls/ematch_syntax.c" /* yacc.c:1258 */
1264  break;
1265 
1266  case 82: /* text_to */
1267 #line 142 "lib/route/cls/ematch_syntax.y" /* yacc.c:1258 */
1268  { rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2, "pktloc destructor\n"); }
1269 #line 1270 "lib/route/cls/ematch_syntax.c" /* yacc.c:1258 */
1270  break;
1271 
1272  case 83: /* meta_value */
1273 #line 144 "lib/route/cls/ematch_syntax.y" /* yacc.c:1258 */
1274  { rtnl_meta_value_put(((*yyvaluep).mv)); NL_DBG(2, "meta value destructor\n"); }
1275 #line 1276 "lib/route/cls/ematch_syntax.c" /* yacc.c:1258 */
1276  break;
1277 
1278  case 86: /* pattern */
1279 #line 143 "lib/route/cls/ematch_syntax.y" /* yacc.c:1258 */
1280  { free(((*yyvaluep).q).data); NL_DBG(2, "quoted destructor\n"); }
1281 #line 1282 "lib/route/cls/ematch_syntax.c" /* yacc.c:1258 */
1282  break;
1283 
1284  case 87: /* pktloc */
1285 #line 142 "lib/route/cls/ematch_syntax.y" /* yacc.c:1258 */
1286  { rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2, "pktloc destructor\n"); }
1287 #line 1288 "lib/route/cls/ematch_syntax.c" /* yacc.c:1258 */
1288  break;
1289 
1290 
1291  default:
1292  break;
1293  }
1294  YY_IGNORE_MAYBE_UNINITIALIZED_END
1295 }
1296 
1297 
1298 
1299 
1300 /*----------.
1301 | yyparse. |
1302 `----------*/
1303 
1304 int
1305 yyparse (void *scanner, char **errp, struct nl_list_head *root)
1306 {
1307 /* The lookahead symbol. */
1308 int yychar;
1309 
1310 
1311 /* The semantic value of the lookahead symbol. */
1312 /* Default value used for initialization, for pacifying older GCCs
1313  or non-GCC compilers. */
1314 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1315 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1316 
1317  /* Number of syntax errors so far. */
1318  int yynerrs;
1319 
1320  int yystate;
1321  /* Number of tokens to shift before error messages enabled. */
1322  int yyerrstatus;
1323 
1324  /* The stacks and their tools:
1325  'yyss': related to states.
1326  'yyvs': related to semantic values.
1327 
1328  Refer to the stacks through separate pointers, to allow yyoverflow
1329  to reallocate them elsewhere. */
1330 
1331  /* The state stack. */
1332  yytype_int16 yyssa[YYINITDEPTH];
1333  yytype_int16 *yyss;
1334  yytype_int16 *yyssp;
1335 
1336  /* The semantic value stack. */
1337  YYSTYPE yyvsa[YYINITDEPTH];
1338  YYSTYPE *yyvs;
1339  YYSTYPE *yyvsp;
1340 
1341  YYSIZE_T yystacksize;
1342 
1343  int yyn;
1344  int yyresult;
1345  /* Lookahead token as an internal (translated) token number. */
1346  int yytoken = 0;
1347  /* The variables used to return semantic value and location from the
1348  action routines. */
1349  YYSTYPE yyval;
1350 
1351 #if YYERROR_VERBOSE
1352  /* Buffer for error messages, and its allocated size. */
1353  char yymsgbuf[128];
1354  char *yymsg = yymsgbuf;
1355  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1356 #endif
1357 
1358 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1359 
1360  /* The number of symbols on the RHS of the reduced rule.
1361  Keep to zero when no symbol should be popped. */
1362  int yylen = 0;
1363 
1364  yyssp = yyss = yyssa;
1365  yyvsp = yyvs = yyvsa;
1366  yystacksize = YYINITDEPTH;
1367 
1368  YYDPRINTF ((stderr, "Starting parse\n"));
1369 
1370  yystate = 0;
1371  yyerrstatus = 0;
1372  yynerrs = 0;
1373  yychar = YYEMPTY; /* Cause a token to be read. */
1374  goto yysetstate;
1375 
1376 /*------------------------------------------------------------.
1377 | yynewstate -- Push a new state, which is found in yystate. |
1378 `------------------------------------------------------------*/
1379  yynewstate:
1380  /* In all cases, when you get here, the value and location stacks
1381  have just been pushed. So pushing a state here evens the stacks. */
1382  yyssp++;
1383 
1384  yysetstate:
1385  *yyssp = yystate;
1386 
1387  if (yyss + yystacksize - 1 <= yyssp)
1388  {
1389  /* Get the current used size of the three stacks, in elements. */
1390  YYSIZE_T yysize = yyssp - yyss + 1;
1391 
1392 #ifdef yyoverflow
1393  {
1394  /* Give user a chance to reallocate the stack. Use copies of
1395  these so that the &'s don't force the real ones into
1396  memory. */
1397  YYSTYPE *yyvs1 = yyvs;
1398  yytype_int16 *yyss1 = yyss;
1399 
1400  /* Each stack pointer address is followed by the size of the
1401  data in use in that stack, in bytes. This used to be a
1402  conditional around just the two extra args, but that might
1403  be undefined if yyoverflow is a macro. */
1404  yyoverflow (YY_("memory exhausted"),
1405  &yyss1, yysize * sizeof (*yyssp),
1406  &yyvs1, yysize * sizeof (*yyvsp),
1407  &yystacksize);
1408 
1409  yyss = yyss1;
1410  yyvs = yyvs1;
1411  }
1412 #else /* no yyoverflow */
1413 # ifndef YYSTACK_RELOCATE
1414  goto yyexhaustedlab;
1415 # else
1416  /* Extend the stack our own way. */
1417  if (YYMAXDEPTH <= yystacksize)
1418  goto yyexhaustedlab;
1419  yystacksize *= 2;
1420  if (YYMAXDEPTH < yystacksize)
1421  yystacksize = YYMAXDEPTH;
1422 
1423  {
1424  yytype_int16 *yyss1 = yyss;
1425  union yyalloc *yyptr =
1426  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1427  if (! yyptr)
1428  goto yyexhaustedlab;
1429  YYSTACK_RELOCATE (yyss_alloc, yyss);
1430  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1431 # undef YYSTACK_RELOCATE
1432  if (yyss1 != yyssa)
1433  YYSTACK_FREE (yyss1);
1434  }
1435 # endif
1436 #endif /* no yyoverflow */
1437 
1438  yyssp = yyss + yysize - 1;
1439  yyvsp = yyvs + yysize - 1;
1440 
1441  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1442  (unsigned long int) yystacksize));
1443 
1444  if (yyss + yystacksize - 1 <= yyssp)
1445  YYABORT;
1446  }
1447 
1448  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1449 
1450  if (yystate == YYFINAL)
1451  YYACCEPT;
1452 
1453  goto yybackup;
1454 
1455 /*-----------.
1456 | yybackup. |
1457 `-----------*/
1458 yybackup:
1459 
1460  /* Do appropriate processing given the current state. Read a
1461  lookahead token if we need one and don't already have one. */
1462 
1463  /* First try to decide what to do without reference to lookahead token. */
1464  yyn = yypact[yystate];
1465  if (yypact_value_is_default (yyn))
1466  goto yydefault;
1467 
1468  /* Not known => get a lookahead token if don't already have one. */
1469 
1470  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1471  if (yychar == YYEMPTY)
1472  {
1473  YYDPRINTF ((stderr, "Reading a token: "));
1474  yychar = yylex (&yylval, scanner);
1475  }
1476 
1477  if (yychar <= YYEOF)
1478  {
1479  yychar = yytoken = YYEOF;
1480  YYDPRINTF ((stderr, "Now at end of input.\n"));
1481  }
1482  else
1483  {
1484  yytoken = YYTRANSLATE (yychar);
1485  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1486  }
1487 
1488  /* If the proper action on seeing token YYTOKEN is to reduce or to
1489  detect an error, take that action. */
1490  yyn += yytoken;
1491  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1492  goto yydefault;
1493  yyn = yytable[yyn];
1494  if (yyn <= 0)
1495  {
1496  if (yytable_value_is_error (yyn))
1497  goto yyerrlab;
1498  yyn = -yyn;
1499  goto yyreduce;
1500  }
1501 
1502  /* Count tokens shifted since error; after three, turn off error
1503  status. */
1504  if (yyerrstatus)
1505  yyerrstatus--;
1506 
1507  /* Shift the lookahead token. */
1508  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1509 
1510  /* Discard the shifted token. */
1511  yychar = YYEMPTY;
1512 
1513  yystate = yyn;
1514  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1515  *++yyvsp = yylval;
1516  YY_IGNORE_MAYBE_UNINITIALIZED_END
1517 
1518  goto yynewstate;
1519 
1520 
1521 /*-----------------------------------------------------------.
1522 | yydefault -- do the default action for the current state. |
1523 `-----------------------------------------------------------*/
1524 yydefault:
1525  yyn = yydefact[yystate];
1526  if (yyn == 0)
1527  goto yyerrlab;
1528  goto yyreduce;
1529 
1530 
1531 /*-----------------------------.
1532 | yyreduce -- Do a reduction. |
1533 `-----------------------------*/
1534 yyreduce:
1535  /* yyn is the number of a rule to reduce with. */
1536  yylen = yyr2[yyn];
1537 
1538  /* If YYLEN is nonzero, implement the default value of the action:
1539  '$$ = $1'.
1540 
1541  Otherwise, the following line sets YYVAL to garbage.
1542  This behavior is undocumented and Bison
1543  users should not rely upon it. Assigning to YYVAL
1544  unconditionally makes the parser a bit smaller, and it avoids a
1545  GCC warning that YYVAL may be used uninitialized. */
1546  yyval = yyvsp[1-yylen];
1547 
1548 
1549  YY_REDUCE_PRINT (yyn);
1550  switch (yyn)
1551  {
1552  case 3:
1553 #line 153 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1554  {
1555  nl_list_add_tail(root, &(yyvsp[0].e)->e_list);
1556  }
1557 #line 1558 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1558  break;
1559 
1560  case 4:
1561 #line 160 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1562  {
1563  (yyval.e) = (yyvsp[0].e);
1564  }
1565 #line 1566 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1566  break;
1567 
1568  case 5:
1569 #line 164 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1570  {
1571  rtnl_ematch_set_flags((yyvsp[-2].e), (yyvsp[-1].i));
1572 
1573  /* make ematch new head */
1574  nl_list_add_tail(&(yyvsp[-2].e)->e_list, &(yyvsp[0].e)->e_list);
1575 
1576  (yyval.e) = (yyvsp[-2].e);
1577  }
1578 #line 1579 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1579  break;
1580 
1581  case 6:
1582 #line 176 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1583  {
1584  rtnl_ematch_set_flags((yyvsp[0].e), TCF_EM_INVERT);
1585  (yyval.e) = (yyvsp[0].e);
1586  }
1587 #line 1588 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1588  break;
1589 
1590  case 7:
1591 #line 181 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1592  {
1593  (yyval.e) = (yyvsp[0].e);
1594  }
1595 #line 1596 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1596  break;
1597 
1598  case 8:
1599 #line 189 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1600  {
1601  struct rtnl_ematch *e;
1602 
1603  if (!(e = rtnl_ematch_alloc())) {
1604  *errp = strdup("Unable to allocate ematch object");
1605  YYABORT;
1606  }
1607 
1608  if (rtnl_ematch_set_kind(e, TCF_EM_CMP) < 0)
1609  BUG();
1610 
1611  rtnl_ematch_cmp_set(e, &(yyvsp[0].cmp));
1612  (yyval.e) = e;
1613  }
1614 #line 1615 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1615  break;
1616 
1617  case 9:
1618 #line 204 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1619  {
1620  struct rtnl_ematch *e;
1621 
1622  if (!(e = rtnl_ematch_alloc())) {
1623  *errp = strdup("Unable to allocate ematch object");
1624  YYABORT;
1625  }
1626 
1627  if (rtnl_ematch_set_kind(e, TCF_EM_NBYTE) < 0)
1628  BUG();
1629 
1630  rtnl_ematch_nbyte_set_offset(e, (yyvsp[-3].loc)->layer, (yyvsp[-3].loc)->offset);
1631  rtnl_pktloc_put((yyvsp[-3].loc));
1632  rtnl_ematch_nbyte_set_pattern(e, (uint8_t *) (yyvsp[-1].q).data, (yyvsp[-1].q).index);
1633 
1634  (yyval.e) = e;
1635  }
1636 #line 1637 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1637  break;
1638 
1639  case 10:
1640 #line 222 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1641  {
1642  struct rtnl_ematch *e;
1643 
1644  if (!(e = rtnl_ematch_alloc())) {
1645  *errp = strdup("Unable to allocate ematch object");
1646  YYABORT;
1647  }
1648 
1649  if (rtnl_ematch_set_kind(e, TCF_EM_TEXT) < 0)
1650  BUG();
1651 
1652  rtnl_ematch_text_set_algo(e, (yyvsp[-4].s));
1653  rtnl_ematch_text_set_pattern(e, (yyvsp[-3].q).data, (yyvsp[-3].q).index);
1654 
1655  if ((yyvsp[-2].loc)) {
1656  rtnl_ematch_text_set_from(e, (yyvsp[-2].loc)->layer, (yyvsp[-2].loc)->offset);
1657  rtnl_pktloc_put((yyvsp[-2].loc));
1658  }
1659 
1660  if ((yyvsp[-1].loc)) {
1661  rtnl_ematch_text_set_to(e, (yyvsp[-1].loc)->layer, (yyvsp[-1].loc)->offset);
1662  rtnl_pktloc_put((yyvsp[-1].loc));
1663  }
1664 
1665  (yyval.e) = e;
1666  }
1667 #line 1668 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1668  break;
1669 
1670  case 11:
1671 #line 249 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1672  {
1673  struct rtnl_ematch *e;
1674 
1675  if (!(e = rtnl_ematch_alloc())) {
1676  *errp = strdup("Unable to allocate ematch object");
1677  YYABORT;
1678  }
1679 
1680  if (rtnl_ematch_set_kind(e, TCF_EM_META) < 0)
1681  BUG();
1682 
1683  rtnl_ematch_meta_set_lvalue(e, (yyvsp[-3].mv));
1684  rtnl_ematch_meta_set_rvalue(e, (yyvsp[-1].mv));
1685  rtnl_ematch_meta_set_operand(e, (yyvsp[-2].i));
1686 
1687  (yyval.e) = e;
1688  }
1689 #line 1690 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1690  break;
1691 
1692  case 12:
1693 #line 268 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1694  {
1695  struct rtnl_ematch *e;
1696 
1697  if (!(e = rtnl_ematch_alloc())) {
1698  *errp = strdup("Unable to allocate ematch object");
1699  YYABORT;
1700  }
1701 
1702  if (rtnl_ematch_set_kind(e, TCF_EM_CONTAINER) < 0)
1703  BUG();
1704 
1705  /* Make e->childs the list head of a the ematch sequence */
1706  nl_list_add_tail(&e->e_childs, &(yyvsp[-1].e)->e_list);
1707 
1708  (yyval.e) = e;
1709  }
1710 #line 1711 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1711  break;
1712 
1713  case 13:
1714 #line 296 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1715  { (yyval.cmp) = (yyvsp[-1].cmp); }
1716 #line 1717 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1717  break;
1718 
1719  case 14:
1720 #line 298 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1721  { (yyval.cmp) = (yyvsp[0].cmp); }
1722 #line 1723 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1723  break;
1724 
1725  case 15:
1726 #line 303 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1727  {
1728  if ((yyvsp[-2].loc)->align == TCF_EM_ALIGN_U16 ||
1729  (yyvsp[-2].loc)->align == TCF_EM_ALIGN_U32)
1730  (yyval.cmp).flags = TCF_EM_CMP_TRANS;
1731 
1732  memset(&(yyval.cmp), 0, sizeof((yyval.cmp)));
1733 
1734  (yyval.cmp).mask = (yyvsp[-2].loc)->mask;
1735  (yyval.cmp).off = (yyvsp[-2].loc)->offset;
1736  (yyval.cmp).align = (yyvsp[-2].loc)->align;
1737  (yyval.cmp).layer = (yyvsp[-2].loc)->layer;
1738  (yyval.cmp).opnd = (yyvsp[-1].i);
1739  (yyval.cmp).val = (yyvsp[0].i);
1740 
1741  rtnl_pktloc_put((yyvsp[-2].loc));
1742  }
1743 #line 1744 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1744  break;
1745 
1746  case 16:
1747 #line 323 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1748  { (yyval.loc) = NULL; }
1749 #line 1750 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1750  break;
1751 
1752  case 17:
1753 #line 325 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1754  { (yyval.loc) = (yyvsp[0].loc); }
1755 #line 1756 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1756  break;
1757 
1758  case 18:
1759 #line 330 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1760  { (yyval.loc) = NULL; }
1761 #line 1762 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1762  break;
1763 
1764  case 19:
1765 #line 332 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1766  { (yyval.loc) = (yyvsp[0].loc); }
1767 #line 1768 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1768  break;
1769 
1770  case 20:
1771 #line 337 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1772  { (yyval.mv) = rtnl_meta_value_alloc_var((yyvsp[0].q).data, (yyvsp[0].q).len); }
1773 #line 1774 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1774  break;
1775 
1776  case 21:
1777 #line 339 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1778  { (yyval.mv) = rtnl_meta_value_alloc_int((yyvsp[0].i)); }
1779 #line 1780 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1780  break;
1781 
1782  case 22:
1783 #line 341 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1784  { (yyval.mv) = META_ALLOC(META_INT, (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i64)); }
1785 #line 1786 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1786  break;
1787 
1788  case 23:
1789 #line 343 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1790  { (yyval.mv) = META_ALLOC(META_VAR, (yyvsp[-1].i), (yyvsp[0].i), 0); }
1791 #line 1792 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1792  break;
1793 
1794  case 24:
1795 #line 347 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1796  { (yyval.i) = META_ID(RANDOM); }
1797 #line 1798 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1798  break;
1799 
1800  case 25:
1801 #line 348 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1802  { (yyval.i) = META_ID(LOADAVG_0); }
1803 #line 1804 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1804  break;
1805 
1806  case 26:
1807 #line 349 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1808  { (yyval.i) = META_ID(LOADAVG_1); }
1809 #line 1810 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1810  break;
1811 
1812  case 27:
1813 #line 350 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1814  { (yyval.i) = META_ID(LOADAVG_2); }
1815 #line 1816 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1816  break;
1817 
1818  case 28:
1819 #line 351 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1820  { (yyval.i) = META_ID(DEV); }
1821 #line 1822 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1822  break;
1823 
1824  case 29:
1825 #line 352 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1826  { (yyval.i) = META_ID(PRIORITY); }
1827 #line 1828 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1828  break;
1829 
1830  case 30:
1831 #line 353 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1832  { (yyval.i) = META_ID(PROTOCOL); }
1833 #line 1834 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1834  break;
1835 
1836  case 31:
1837 #line 354 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1838  { (yyval.i) = META_ID(PKTTYPE); }
1839 #line 1840 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1840  break;
1841 
1842  case 32:
1843 #line 355 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1844  { (yyval.i) = META_ID(PKTLEN); }
1845 #line 1846 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1846  break;
1847 
1848  case 33:
1849 #line 356 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1850  { (yyval.i) = META_ID(DATALEN); }
1851 #line 1852 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1852  break;
1853 
1854  case 34:
1855 #line 357 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1856  { (yyval.i) = META_ID(MACLEN); }
1857 #line 1858 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1858  break;
1859 
1860  case 35:
1861 #line 358 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1862  { (yyval.i) = META_ID(NFMARK); }
1863 #line 1864 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1864  break;
1865 
1866  case 36:
1867 #line 359 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1868  { (yyval.i) = META_ID(TCINDEX); }
1869 #line 1870 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1870  break;
1871 
1872  case 37:
1873 #line 360 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1874  { (yyval.i) = META_ID(RTCLASSID); }
1875 #line 1876 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1876  break;
1877 
1878  case 38:
1879 #line 361 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1880  { (yyval.i) = META_ID(RTIIF); }
1881 #line 1882 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1882  break;
1883 
1884  case 39:
1885 #line 362 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1886  { (yyval.i) = META_ID(SK_FAMILY); }
1887 #line 1888 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1888  break;
1889 
1890  case 40:
1891 #line 363 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1892  { (yyval.i) = META_ID(SK_STATE); }
1893 #line 1894 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1894  break;
1895 
1896  case 41:
1897 #line 364 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1898  { (yyval.i) = META_ID(SK_REUSE); }
1899 #line 1900 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1900  break;
1901 
1902  case 42:
1903 #line 365 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1904  { (yyval.i) = META_ID(SK_REFCNT); }
1905 #line 1906 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1906  break;
1907 
1908  case 43:
1909 #line 366 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1910  { (yyval.i) = META_ID(SK_RCVBUF); }
1911 #line 1912 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1912  break;
1913 
1914  case 44:
1915 #line 367 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1916  { (yyval.i) = META_ID(SK_SNDBUF); }
1917 #line 1918 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1918  break;
1919 
1920  case 45:
1921 #line 368 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1922  { (yyval.i) = META_ID(SK_SHUTDOWN); }
1923 #line 1924 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1924  break;
1925 
1926  case 46:
1927 #line 369 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1928  { (yyval.i) = META_ID(SK_PROTO); }
1929 #line 1930 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1930  break;
1931 
1932  case 47:
1933 #line 370 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1934  { (yyval.i) = META_ID(SK_TYPE); }
1935 #line 1936 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1936  break;
1937 
1938  case 48:
1939 #line 371 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1940  { (yyval.i) = META_ID(SK_RMEM_ALLOC); }
1941 #line 1942 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1942  break;
1943 
1944  case 49:
1945 #line 372 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1946  { (yyval.i) = META_ID(SK_WMEM_ALLOC); }
1947 #line 1948 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1948  break;
1949 
1950  case 50:
1951 #line 373 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1952  { (yyval.i) = META_ID(SK_WMEM_QUEUED); }
1953 #line 1954 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1954  break;
1955 
1956  case 51:
1957 #line 374 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1958  { (yyval.i) = META_ID(SK_RCV_QLEN); }
1959 #line 1960 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1960  break;
1961 
1962  case 52:
1963 #line 375 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1964  { (yyval.i) = META_ID(SK_SND_QLEN); }
1965 #line 1966 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1966  break;
1967 
1968  case 53:
1969 #line 376 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1970  { (yyval.i) = META_ID(SK_ERR_QLEN); }
1971 #line 1972 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1972  break;
1973 
1974  case 54:
1975 #line 377 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1976  { (yyval.i) = META_ID(SK_FORWARD_ALLOCS); }
1977 #line 1978 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1978  break;
1979 
1980  case 55:
1981 #line 378 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1982  { (yyval.i) = META_ID(SK_ALLOCS); }
1983 #line 1984 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1984  break;
1985 
1986  case 56:
1987 #line 379 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1988  { (yyval.i) = __TCF_META_ID_SK_ROUTE_CAPS; }
1989 #line 1990 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1990  break;
1991 
1992  case 57:
1993 #line 380 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
1994  { (yyval.i) = META_ID(SK_HASH); }
1995 #line 1996 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
1996  break;
1997 
1998  case 58:
1999 #line 381 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2000  { (yyval.i) = META_ID(SK_LINGERTIME); }
2001 #line 2002 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2002  break;
2003 
2004  case 59:
2005 #line 382 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2006  { (yyval.i) = META_ID(SK_ACK_BACKLOG); }
2007 #line 2008 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2008  break;
2009 
2010  case 60:
2011 #line 383 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2012  { (yyval.i) = META_ID(SK_MAX_ACK_BACKLOG); }
2013 #line 2014 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2014  break;
2015 
2016  case 61:
2017 #line 384 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2018  { (yyval.i) = META_ID(SK_PRIO); }
2019 #line 2020 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2020  break;
2021 
2022  case 62:
2023 #line 385 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2024  { (yyval.i) = META_ID(SK_RCVLOWAT); }
2025 #line 2026 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2026  break;
2027 
2028  case 63:
2029 #line 386 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2030  { (yyval.i) = META_ID(SK_RCVTIMEO); }
2031 #line 2032 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2032  break;
2033 
2034  case 64:
2035 #line 387 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2036  { (yyval.i) = META_ID(SK_SNDTIMEO); }
2037 #line 2038 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2038  break;
2039 
2040  case 65:
2041 #line 388 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2042  { (yyval.i) = META_ID(SK_SENDMSG_OFF); }
2043 #line 2044 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2044  break;
2045 
2046  case 66:
2047 #line 389 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2048  { (yyval.i) = META_ID(SK_WRITE_PENDING); }
2049 #line 2050 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2050  break;
2051 
2052  case 67:
2053 #line 390 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2054  { (yyval.i) = META_ID(VLAN_TAG); }
2055 #line 2056 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2056  break;
2057 
2058  case 68:
2059 #line 391 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2060  { (yyval.i) = META_ID(RXHASH); }
2061 #line 2062 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2062  break;
2063 
2064  case 69:
2065 #line 395 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2066  { (yyval.i) = META_ID(DEV); }
2067 #line 2068 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2068  break;
2069 
2070  case 70:
2071 #line 396 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2072  { (yyval.i) = META_ID(SK_BOUND_IF); }
2073 #line 2074 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2074  break;
2075 
2076  case 71:
2077 #line 404 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2078  {
2079  (yyval.q) = (yyvsp[0].q);
2080  }
2081 #line 2082 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2082  break;
2083 
2084  case 72:
2085 #line 408 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2086  {
2087  struct nl_addr *addr;
2088 
2089  if (nl_addr_parse((yyvsp[0].s), AF_UNSPEC, &addr) == 0) {
2090  (yyval.q).len = nl_addr_get_len(addr);
2091 
2092  (yyval.q).index = min_t(int, (yyval.q).len, nl_addr_get_prefixlen(addr)/8);
2093 
2094  if (!((yyval.q).data = calloc(1, (yyval.q).len))) {
2095  nl_addr_put(addr);
2096  YYABORT;
2097  }
2098 
2099  memcpy((yyval.q).data, nl_addr_get_binary_addr(addr), (yyval.q).len);
2100  nl_addr_put(addr);
2101  } else {
2102  if (asprintf(errp, "invalid pattern \"%s\"", (yyvsp[0].s)) == -1)
2103  *errp = NULL;
2104  YYABORT;
2105  }
2106  }
2107 #line 2108 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2108  break;
2109 
2110  case 73:
2111 #line 437 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2112  {
2113  struct rtnl_pktloc *loc;
2114 
2115  if (rtnl_pktloc_lookup((yyvsp[0].s), &loc) < 0) {
2116  if (asprintf(errp, "Packet location \"%s\" not found", (yyvsp[0].s)) == -1)
2117  *errp = NULL;
2118  YYABORT;
2119  }
2120 
2121  (yyval.loc) = loc;
2122  }
2123 #line 2124 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2124  break;
2125 
2126  case 74:
2127 #line 450 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2128  {
2129  struct rtnl_pktloc *loc;
2130 
2131  if ((yyvsp[0].i64) && (!(yyvsp[-4].i) || (yyvsp[-4].i) > TCF_EM_ALIGN_U32)) {
2132  *errp = strdup("mask only allowed for alignments u8|u16|u32");
2133  YYABORT;
2134  }
2135 
2136  if (!(loc = rtnl_pktloc_alloc())) {
2137  *errp = strdup("Unable to allocate packet location object");
2138  YYABORT;
2139  }
2140 
2141  loc->name = strdup("<USER-DEFINED>");
2142  loc->align = (yyvsp[-4].i);
2143  loc->layer = (yyvsp[-3].i);
2144  loc->offset = (yyvsp[-1].i);
2145  loc->mask = (yyvsp[0].i64);
2146 
2147  (yyval.loc) = loc;
2148  }
2149 #line 2150 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2150  break;
2151 
2152  case 75:
2153 #line 475 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2154  { (yyval.i) = 0; }
2155 #line 2156 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2156  break;
2157 
2158  case 76:
2159 #line 477 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2160  { (yyval.i) = (yyvsp[-1].i); }
2161 #line 2162 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2162  break;
2163 
2164  case 77:
2165 #line 479 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2166  { (yyval.i) = (yyvsp[-1].i); }
2167 #line 2168 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2168  break;
2169 
2170  case 78:
2171 #line 484 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2172  { (yyval.i64) = 0; }
2173 #line 2174 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2174  break;
2175 
2176  case 79:
2177 #line 486 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2178  { (yyval.i64) = (yyvsp[0].i); }
2179 #line 2180 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2180  break;
2181 
2182  case 80:
2183 #line 491 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2184  { (yyval.i) = 0; }
2185 #line 2186 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2186  break;
2187 
2188  case 81:
2189 #line 493 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2190  { (yyval.i) = (yyvsp[0].i); }
2191 #line 2192 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2192  break;
2193 
2194  case 82:
2195 #line 498 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2196  { (yyval.i) = TCF_EM_OPND_EQ; }
2197 #line 2198 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2198  break;
2199 
2200  case 83:
2201 #line 500 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2202  { (yyval.i) = TCF_EM_OPND_GT; }
2203 #line 2204 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2204  break;
2205 
2206  case 84:
2207 #line 502 "lib/route/cls/ematch_syntax.y" /* yacc.c:1648 */
2208  { (yyval.i) = TCF_EM_OPND_LT; }
2209 #line 2210 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2210  break;
2211 
2212 
2213 #line 2214 "lib/route/cls/ematch_syntax.c" /* yacc.c:1648 */
2214  default: break;
2215  }
2216  /* User semantic actions sometimes alter yychar, and that requires
2217  that yytoken be updated with the new translation. We take the
2218  approach of translating immediately before every use of yytoken.
2219  One alternative is translating here after every semantic action,
2220  but that translation would be missed if the semantic action invokes
2221  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2222  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2223  incorrect destructor might then be invoked immediately. In the
2224  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2225  to an incorrect destructor call or verbose syntax error message
2226  before the lookahead is translated. */
2227  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2228 
2229  YYPOPSTACK (yylen);
2230  yylen = 0;
2231  YY_STACK_PRINT (yyss, yyssp);
2232 
2233  *++yyvsp = yyval;
2234 
2235  /* Now 'shift' the result of the reduction. Determine what state
2236  that goes to, based on the state we popped back to and the rule
2237  number reduced by. */
2238 
2239  yyn = yyr1[yyn];
2240 
2241  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2242  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2243  yystate = yytable[yystate];
2244  else
2245  yystate = yydefgoto[yyn - YYNTOKENS];
2246 
2247  goto yynewstate;
2248 
2249 
2250 /*--------------------------------------.
2251 | yyerrlab -- here on detecting error. |
2252 `--------------------------------------*/
2253 yyerrlab:
2254  /* Make sure we have latest lookahead translation. See comments at
2255  user semantic actions for why this is necessary. */
2256  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2257 
2258  /* If not already recovering from an error, report this error. */
2259  if (!yyerrstatus)
2260  {
2261  ++yynerrs;
2262 #if ! YYERROR_VERBOSE
2263  yyerror (scanner, errp, root, YY_("syntax error"));
2264 #else
2265 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2266  yyssp, yytoken)
2267  {
2268  char const *yymsgp = YY_("syntax error");
2269  int yysyntax_error_status;
2270  yysyntax_error_status = YYSYNTAX_ERROR;
2271  if (yysyntax_error_status == 0)
2272  yymsgp = yymsg;
2273  else if (yysyntax_error_status == 1)
2274  {
2275  if (yymsg != yymsgbuf)
2276  YYSTACK_FREE (yymsg);
2277  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2278  if (!yymsg)
2279  {
2280  yymsg = yymsgbuf;
2281  yymsg_alloc = sizeof yymsgbuf;
2282  yysyntax_error_status = 2;
2283  }
2284  else
2285  {
2286  yysyntax_error_status = YYSYNTAX_ERROR;
2287  yymsgp = yymsg;
2288  }
2289  }
2290  yyerror (scanner, errp, root, yymsgp);
2291  if (yysyntax_error_status == 2)
2292  goto yyexhaustedlab;
2293  }
2294 # undef YYSYNTAX_ERROR
2295 #endif
2296  }
2297 
2298 
2299 
2300  if (yyerrstatus == 3)
2301  {
2302  /* If just tried and failed to reuse lookahead token after an
2303  error, discard it. */
2304 
2305  if (yychar <= YYEOF)
2306  {
2307  /* Return failure if at end of input. */
2308  if (yychar == YYEOF)
2309  YYABORT;
2310  }
2311  else
2312  {
2313  yydestruct ("Error: discarding",
2314  yytoken, &yylval, scanner, errp, root);
2315  yychar = YYEMPTY;
2316  }
2317  }
2318 
2319  /* Else will try to reuse lookahead token after shifting the error
2320  token. */
2321  goto yyerrlab1;
2322 
2323 
2324 /*---------------------------------------------------.
2325 | yyerrorlab -- error raised explicitly by YYERROR. |
2326 `---------------------------------------------------*/
2327 yyerrorlab:
2328 
2329  /* Pacify compilers like GCC when the user code never invokes
2330  YYERROR and the label yyerrorlab therefore never appears in user
2331  code. */
2332  if (/*CONSTCOND*/ 0)
2333  goto yyerrorlab;
2334 
2335  /* Do not reclaim the symbols of the rule whose action triggered
2336  this YYERROR. */
2337  YYPOPSTACK (yylen);
2338  yylen = 0;
2339  YY_STACK_PRINT (yyss, yyssp);
2340  yystate = *yyssp;
2341  goto yyerrlab1;
2342 
2343 
2344 /*-------------------------------------------------------------.
2345 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2346 `-------------------------------------------------------------*/
2347 yyerrlab1:
2348  yyerrstatus = 3; /* Each real token shifted decrements this. */
2349 
2350  for (;;)
2351  {
2352  yyn = yypact[yystate];
2353  if (!yypact_value_is_default (yyn))
2354  {
2355  yyn += YYTERROR;
2356  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2357  {
2358  yyn = yytable[yyn];
2359  if (0 < yyn)
2360  break;
2361  }
2362  }
2363 
2364  /* Pop the current state because it cannot handle the error token. */
2365  if (yyssp == yyss)
2366  YYABORT;
2367 
2368 
2369  yydestruct ("Error: popping",
2370  yystos[yystate], yyvsp, scanner, errp, root);
2371  YYPOPSTACK (1);
2372  yystate = *yyssp;
2373  YY_STACK_PRINT (yyss, yyssp);
2374  }
2375 
2376  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2377  *++yyvsp = yylval;
2378  YY_IGNORE_MAYBE_UNINITIALIZED_END
2379 
2380 
2381  /* Shift the error token. */
2382  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2383 
2384  yystate = yyn;
2385  goto yynewstate;
2386 
2387 
2388 /*-------------------------------------.
2389 | yyacceptlab -- YYACCEPT comes here. |
2390 `-------------------------------------*/
2391 yyacceptlab:
2392  yyresult = 0;
2393  goto yyreturn;
2394 
2395 /*-----------------------------------.
2396 | yyabortlab -- YYABORT comes here. |
2397 `-----------------------------------*/
2398 yyabortlab:
2399  yyresult = 1;
2400  goto yyreturn;
2401 
2402 #if !defined yyoverflow || YYERROR_VERBOSE
2403 /*-------------------------------------------------.
2404 | yyexhaustedlab -- memory exhaustion comes here. |
2405 `-------------------------------------------------*/
2406 yyexhaustedlab:
2407  yyerror (scanner, errp, root, YY_("memory exhausted"));
2408  yyresult = 2;
2409  /* Fall through. */
2410 #endif
2411 
2412 yyreturn:
2413  if (yychar != YYEMPTY)
2414  {
2415  /* Make sure we have latest lookahead translation. See comments at
2416  user semantic actions for why this is necessary. */
2417  yytoken = YYTRANSLATE (yychar);
2418  yydestruct ("Cleanup: discarding lookahead",
2419  yytoken, &yylval, scanner, errp, root);
2420  }
2421  /* Do not reclaim the symbols of the rule whose action triggered
2422  this YYABORT or YYACCEPT. */
2423  YYPOPSTACK (yylen);
2424  YY_STACK_PRINT (yyss, yyssp);
2425  while (yyssp != yyss)
2426  {
2427  yydestruct ("Cleanup: popping",
2428  yystos[*yyssp], yyvsp, scanner, errp, root);
2429  YYPOPSTACK (1);
2430  }
2431 #ifndef yyoverflow
2432  if (yyss != yyssa)
2433  YYSTACK_FREE (yyss);
2434 #endif
2435 #if YYERROR_VERBOSE
2436  if (yymsg != yymsgbuf)
2437  YYSTACK_FREE (yymsg);
2438 #endif
2439  return yyresult;
2440 }
unsigned int nl_addr_get_prefixlen(const struct nl_addr *addr)
Return prefix length of abstract address object.
Definition: addr.c:977
int nl_addr_parse(const char *addrstr, int hint, struct nl_addr **result)
Allocate abstract address based on character string.
Definition: addr.c:299
struct rtnl_pktloc * rtnl_pktloc_alloc(void)
Allocate packet location object.
Definition: pktloc.c:187
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:204
void nl_addr_put(struct nl_addr *addr)
Decrease the reference counter of an abstract address.
Definition: addr.c:540
int rtnl_pktloc_lookup(const char *name, struct rtnl_pktloc **result)
Lookup packet location alias.
Definition: pktloc.c:174
unsigned int nl_addr_get_len(const struct nl_addr *addr)
Get length of binary address of abstract address object.
Definition: addr.c:954
void * nl_addr_get_binary_addr(const struct nl_addr *addr)
Get binary address of abstract address object.
Definition: addr.c:942