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