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