47 #define YYBISON_VERSION "2.5.1"
50 #define YYSKELETON_NAME "yacc.c"
62 #define YYLSP_NEEDED 0
65 #define yyparse ematch_parse
66 #define yylex ematch_lex
67 #define yyerror ematch_error
68 #define yylval ematch_lval
69 #define yychar ematch_char
70 #define yydebug ematch_debug
71 #define yynerrs ematch_nerrs
77 #line 12 "route/cls/ematch_syntax.y"
79 #include <netlink-local.h>
80 #include <netlink-tc.h>
81 #include <netlink/netlink.h>
82 #include <netlink/utils.h>
83 #include <netlink/route/pktloc.h>
84 #include <netlink/route/cls/ematch.h>
85 #include <netlink/route/cls/ematch/cmp.h>
86 #include <netlink/route/cls/ematch/nbyte.h>
87 #include <netlink/route/cls/ematch/text.h>
88 #include <netlink/route/cls/ematch/meta.h>
90 #define META_ALLOC rtnl_meta_value_alloc_id
91 #define META_ID(name) TCF_META_ID_##name
92 #define META_INT TCF_META_TYPE_INT
93 #define META_VAR TCF_META_TYPE_VAR
97 #line 98 "route/cls/ematch_syntax.c"
100 # if defined __cplusplus && 201103L <= __cplusplus
101 # define YY_NULL nullptr
113 #ifdef YYERROR_VERBOSE
114 # undef YYERROR_VERBOSE
115 # define YYERROR_VERBOSE 1
117 # define YYERROR_VERBOSE 1
121 #ifndef YYTOKEN_TABLE
122 # define YYTOKEN_TABLE 0
155 META_LOADAVG_0 = 281,
156 META_LOADAVG_1 = 282,
157 META_LOADAVG_2 = 283,
167 META_RTCLASSID = 293,
169 META_SK_FAMILY = 295,
172 META_SK_REFCNT = 298,
173 META_SK_RCVBUF = 299,
174 META_SK_SNDBUF = 300,
175 META_SK_SHUTDOWN = 301,
178 META_SK_RMEM_ALLOC = 304,
179 META_SK_WMEM_ALLOC = 305,
180 META_SK_WMEM_QUEUED = 306,
181 META_SK_RCV_QLEN = 307,
182 META_SK_SND_QLEN = 308,
183 META_SK_ERR_QLEN = 309,
184 META_SK_FORWARD_ALLOCS = 310,
185 META_SK_ALLOCS = 311,
186 META_SK_ROUTE_CAPS = 312,
188 META_SK_LINGERTIME = 314,
189 META_SK_ACK_BACKLOG = 315,
190 META_SK_MAX_ACK_BACKLOG = 316,
192 META_SK_RCVLOWAT = 318,
193 META_SK_RCVTIMEO = 319,
194 META_SK_SNDTIMEO = 320,
195 META_SK_SENDMSG_OFF = 321,
196 META_SK_WRITE_PENDING = 322,
200 META_SK_BOUND_IF = 326,
219 #define EMATCH_CMP 271
220 #define EMATCH_NBYTE 272
221 #define EMATCH_TEXT 273
222 #define EMATCH_META 274
228 #define META_RANDOM 280
229 #define META_LOADAVG_0 281
230 #define META_LOADAVG_1 282
231 #define META_LOADAVG_2 283
233 #define META_PRIO 285
234 #define META_PROTO 286
235 #define META_PKTTYPE 287
236 #define META_PKTLEN 288
237 #define META_DATALEN 289
238 #define META_MACLEN 290
239 #define META_MARK 291
240 #define META_TCINDEX 292
241 #define META_RTCLASSID 293
242 #define META_RTIIF 294
243 #define META_SK_FAMILY 295
244 #define META_SK_STATE 296
245 #define META_SK_REUSE 297
246 #define META_SK_REFCNT 298
247 #define META_SK_RCVBUF 299
248 #define META_SK_SNDBUF 300
249 #define META_SK_SHUTDOWN 301
250 #define META_SK_PROTO 302
251 #define META_SK_TYPE 303
252 #define META_SK_RMEM_ALLOC 304
253 #define META_SK_WMEM_ALLOC 305
254 #define META_SK_WMEM_QUEUED 306
255 #define META_SK_RCV_QLEN 307
256 #define META_SK_SND_QLEN 308
257 #define META_SK_ERR_QLEN 309
258 #define META_SK_FORWARD_ALLOCS 310
259 #define META_SK_ALLOCS 311
260 #define META_SK_ROUTE_CAPS 312
261 #define META_SK_HASH 313
262 #define META_SK_LINGERTIME 314
263 #define META_SK_ACK_BACKLOG 315
264 #define META_SK_MAX_ACK_BACKLOG 316
265 #define META_SK_PRIO 317
266 #define META_SK_RCVLOWAT 318
267 #define META_SK_RCVTIMEO 319
268 #define META_SK_SNDTIMEO 320
269 #define META_SK_SENDMSG_OFF 321
270 #define META_SK_WRITE_PENDING 322
271 #define META_VLAN 323
272 #define META_RXHASH 324
273 #define META_DEVNAME 325
274 #define META_SK_BOUND_IF 326
281 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
286 #line 39 "route/cls/ematch_syntax.y"
288 struct tcf_em_cmp cmp;
289 struct ematch_quoted q;
290 struct rtnl_ematch * e;
300 #line 301 "route/cls/ematch_syntax.c"
302 # define YYSTYPE_IS_TRIVIAL 1
303 # define yystype YYSTYPE
304 # define YYSTYPE_IS_DECLARED 1
311 #line 50 "route/cls/ematch_syntax.y"
313 extern int ematch_lex(
YYSTYPE *,
void *);
315 static void yyerror(
void *scanner,
char **errp,
struct nl_list_head *root,
const char *msg)
318 asprintf(errp,
"%s", msg);
323 #line 324 "route/cls/ematch_syntax.c"
330 typedef YYTYPE_UINT8 yytype_uint8;
332 typedef unsigned char yytype_uint8;
336 typedef YYTYPE_INT8 yytype_int8;
337 #elif (defined __STDC__ || defined __C99__FUNC__ \
338 || defined __cplusplus || defined _MSC_VER)
339 typedef signed char yytype_int8;
341 typedef short int yytype_int8;
345 typedef YYTYPE_UINT16 yytype_uint16;
347 typedef unsigned short int yytype_uint16;
351 typedef YYTYPE_INT16 yytype_int16;
353 typedef short int yytype_int16;
357 # ifdef __SIZE_TYPE__
358 # define YYSIZE_T __SIZE_TYPE__
359 # elif defined size_t
360 # define YYSIZE_T size_t
361 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
362 || defined __cplusplus || defined _MSC_VER)
364 # define YYSIZE_T size_t
366 # define YYSIZE_T unsigned int
370 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
373 # if defined YYENABLE_NLS && YYENABLE_NLS
375 # include <libintl.h>
376 # define YY_(msgid) dgettext ("bison-runtime", msgid)
380 # define YY_(msgid) msgid
385 #if ! defined lint || defined __GNUC__
386 # define YYUSE(e) ((void) (e))
395 #if (defined __STDC__ || defined __C99__FUNC__ \
396 || defined __cplusplus || defined _MSC_VER)
409 #if ! defined yyoverflow || YYERROR_VERBOSE
413 # ifdef YYSTACK_USE_ALLOCA
414 # if YYSTACK_USE_ALLOCA
416 # define YYSTACK_ALLOC __builtin_alloca
417 # elif defined __BUILTIN_VA_ARG_INCR
420 # define YYSTACK_ALLOC __alloca
421 # elif defined _MSC_VER
423 # define alloca _alloca
425 # define YYSTACK_ALLOC alloca
426 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
427 || defined __cplusplus || defined _MSC_VER)
430 # ifndef EXIT_SUCCESS
431 # define EXIT_SUCCESS 0
438 # ifdef YYSTACK_ALLOC
440 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
441 # ifndef YYSTACK_ALLOC_MAXIMUM
446 # define YYSTACK_ALLOC_MAXIMUM 4032
449 # define YYSTACK_ALLOC YYMALLOC
450 # define YYSTACK_FREE YYFREE
451 # ifndef YYSTACK_ALLOC_MAXIMUM
452 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
454 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
455 && ! ((defined YYMALLOC || defined malloc) \
456 && (defined YYFREE || defined free)))
458 # ifndef EXIT_SUCCESS
459 # define EXIT_SUCCESS 0
463 # define YYMALLOC malloc
464 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
465 || defined __cplusplus || defined _MSC_VER)
466 void *malloc (YYSIZE_T);
471 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
472 || defined __cplusplus || defined _MSC_VER)
480 #if (! defined yyoverflow \
481 && (! defined __cplusplus \
482 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
487 yytype_int16 yyss_alloc;
492 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
496 # define YYSTACK_BYTES(N) \
497 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
498 + YYSTACK_GAP_MAXIMUM)
500 # define YYCOPY_NEEDED 1
507 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
510 YYSIZE_T yynewbytes; \
511 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
512 Stack = &yyptr->Stack_alloc; \
513 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
514 yyptr += yynewbytes / sizeof (*yyptr); \
520 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
524 # if defined __GNUC__ && 1 < __GNUC__
525 # define YYCOPY(Dst, Src, Count) \
526 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
528 # define YYCOPY(Dst, Src, Count) \
532 for (yyi = 0; yyi < (Count); yyi++) \
533 (Dst)[yyi] = (Src)[yyi]; \
552 #define YYNSTATES 118
556 #define YYMAXUTOK 328
558 #define YYTRANSLATE(YYX) \
559 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
562 static const yytype_uint8 yytranslate[] =
564 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
590 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
591 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
592 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
593 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
594 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
595 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
596 65, 66, 67, 68, 69, 70, 71, 72, 73
602 static const yytype_uint8 yyprhs[] =
604 0, 0, 3, 4, 6, 8, 12, 15, 17, 19,
605 26, 34, 41, 45, 50, 52, 56, 57, 60, 61,
606 64, 66, 68, 72, 75, 77, 79, 81, 83, 85,
607 87, 89, 91, 93, 95, 97, 99, 101, 103, 105,
608 107, 109, 111, 113, 115, 117, 119, 121, 123, 125,
609 127, 129, 131, 133, 135, 137, 139, 141, 143, 145,
610 147, 149, 151, 153, 155, 157, 159, 161, 163, 165,
611 167, 169, 171, 173, 175, 181, 182, 185, 188, 189,
612 192, 193, 196, 198, 200
616 static const yytype_int8 yyrhs[] =
618 75, 0, -1, -1, 76, -1, 77, -1, 77, 4,
619 76, -1, 5, 78, -1, 78, -1, 79, -1, 17,
620 10, 87, 20, 86, 11, -1, 18, 10, 72, 73,
621 81, 82, 11, -1, 19, 10, 83, 91, 83, 11,
622 -1, 10, 76, 11, -1, 16, 10, 80, 11, -1,
623 80, -1, 87, 91, 7, -1, -1, 23, 87, -1,
624 -1, 24, 87, -1, 73, -1, 7, -1, 84, 90,
625 89, -1, 85, 90, -1, 25, -1, 26, -1, 27,
626 -1, 28, -1, 29, -1, 30, -1, 31, -1, 32,
627 -1, 33, -1, 34, -1, 35, -1, 36, -1, 37,
628 -1, 38, -1, 39, -1, 40, -1, 41, -1, 42,
629 -1, 43, -1, 44, -1, 45, -1, 46, -1, 47,
630 -1, 48, -1, 49, -1, 50, -1, 51, -1, 52,
631 -1, 53, -1, 54, -1, 55, -1, 56, -1, 57,
632 -1, 58, -1, 59, -1, 60, -1, 61, -1, 62,
633 -1, 63, -1, 64, -1, 65, -1, 66, -1, 67,
634 -1, 68, -1, 69, -1, 70, -1, 71, -1, 73,
635 -1, 72, -1, 72, -1, 88, 9, 12, 7, 89,
636 -1, -1, 8, 15, -1, 7, 15, -1, -1, 13,
637 7, -1, -1, 14, 7, -1, 20, -1, 21, -1,
642 static const yytype_uint16 yyrline[] =
644 0, 146, 146, 148, 155, 159, 171, 176, 184, 199,
645 217, 244, 263, 291, 293, 298, 319, 320, 326, 327,
646 332, 334, 336, 338, 343, 344, 345, 346, 347, 348,
647 349, 350, 351, 352, 353, 354, 355, 356, 357, 358,
648 359, 360, 361, 362, 363, 364, 365, 366, 367, 368,
649 369, 370, 371, 372, 373, 374, 375, 376, 377, 378,
650 379, 380, 381, 382, 383, 384, 385, 386, 387, 391,
651 392, 399, 403, 431, 443, 469, 470, 472, 478, 479,
652 485, 486, 491, 493, 495
656 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
659 static const char *
const yytname[] =
661 "$end",
"error",
"$undefined",
"ERROR",
"LOGIC",
"NOT",
"OPERAND",
662 "NUMBER",
"ALIGN",
"LAYER",
"\"(\"",
"\")\"",
"\"+\"",
"\"mask\"",
663 "\">>\"",
"\"at\"",
"\"cmp\"",
"\"pattern\"",
"\"text\"",
"\"meta\"",
664 "\"=\"",
"\">\"",
"\"<\"",
"\"from\"",
"\"to\"",
"\"random\"",
665 "\"loadavg_0\"",
"\"loadavg_1\"",
"\"loadavg_2\"",
"\"dev\"",
"\"prio\"",
666 "\"proto\"",
"\"pkttype\"",
"\"pktlen\"",
"\"datalen\"",
"\"maclen\"",
667 "\"mark\"",
"\"tcindex\"",
"\"rtclassid\"",
"\"rtiif\"",
"\"sk_family\"",
668 "\"sk_state\"",
"\"sk_reuse\"",
"\"sk_refcnt\"",
"\"sk_rcvbuf\"",
669 "\"sk_sndbuf\"",
"\"sk_shutdown\"",
"\"sk_proto\"",
"\"sk_type\"",
670 "\"sk_rmem_alloc\"",
"\"sk_wmem_alloc\"",
"\"sk_wmem_queued\"",
671 "\"sk_rcv_qlen\"",
"\"sk_snd_qlen\"",
"\"sk_err_qlen\"",
672 "\"sk_forward_allocs\"",
"\"sk_allocs\"",
"\"sk_route_caps\"",
673 "\"sk_hash\"",
"\"sk_lingertime\"",
"\"sk_ack_backlog\"",
674 "\"sk_max_ack_backlog\"",
"\"sk_prio\"",
"\"sk_rcvlowat\"",
675 "\"sk_rcvtimeo\"",
"\"sk_sndtimeo\"",
"\"sk_sendmsg_off\"",
676 "\"sk_write_pending\"",
"\"vlan\"",
"\"rxhash\"",
"\"devname\"",
677 "\"sk_bound_if\"",
"STR",
"QUOTED",
"$accept",
"input",
"expr",
"match",
678 "ematch",
"cmp_match",
"cmp_expr",
"text_from",
"text_to",
"meta_value",
679 "meta_int_id",
"meta_var_id",
"pattern",
"pktloc",
"align",
"mask",
680 "shift",
"operand", YY_NULL
687 static const yytype_uint16 yytoknum[] =
689 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
690 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
691 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
692 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
693 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
694 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
695 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
701 static const yytype_uint8 yyr1[] =
703 0, 74, 75, 75, 76, 76, 77, 77, 78, 78,
704 78, 78, 78, 79, 79, 80, 81, 81, 82, 82,
705 83, 83, 83, 83, 84, 84, 84, 84, 84, 84,
706 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
707 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
708 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
709 84, 84, 84, 84, 84, 84, 84, 84, 84, 85,
710 85, 86, 86, 87, 87, 88, 88, 88, 89, 89,
715 static const yytype_uint8 yyr2[] =
717 0, 2, 0, 1, 1, 3, 2, 1, 1, 6,
718 7, 6, 3, 4, 1, 3, 0, 2, 0, 2,
719 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
720 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
721 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
722 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
723 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
724 1, 1, 1, 1, 5, 0, 2, 2, 0, 2,
731 static const yytype_uint8 yydefact[] =
733 2, 75, 0, 0, 75, 0, 0, 0, 0, 73,
734 0, 3, 4, 7, 8, 14, 0, 0, 6, 77,
735 76, 0, 75, 75, 0, 0, 1, 75, 82, 83,
736 84, 0, 0, 12, 0, 0, 0, 21, 24, 25,
737 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
738 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
739 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
740 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
741 66, 67, 68, 69, 70, 20, 0, 80, 80, 5,
742 15, 0, 13, 0, 16, 0, 0, 78, 23, 78,
743 72, 71, 0, 75, 18, 0, 81, 0, 22, 74,
744 9, 17, 75, 0, 11, 79, 19, 10
748 static const yytype_int8 yydefgoto[] =
750 -1, 10, 11, 12, 13, 14, 15, 104, 113, 86,
751 87, 88, 102, 16, 17, 108, 97, 31
756 #define YYPACT_NINF -63
757 static const yytype_int8 yypact[] =
759 -4, 15, -13, -8, 11, 10, 14, 25, 29, -63,
760 26, -63, 37, -63, -63, -63, 16, 33, -63, -63,
761 -63, 32, 1, 1, -28, 65, -63, 11, -63, -63,
762 -63, 38, 34, -63, 36, 28, -24, -63, -63, -63,
763 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
764 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
765 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
766 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
767 -63, -63, -63, -63, -63, -63, 16, 39, 39, -63,
768 -63, 43, -63, -62, 31, 65, 44, 42, -63, 42,
769 -63, -63, 41, 1, 35, 45, -63, 50, -63, -63,
770 -63, -63, 1, 47, -63, -63, -63, -63
774 static const yytype_int8 yypgoto[] =
776 -63, -63, 13, -63, 59, -63, 40, -63, -63, -34,
777 -63, -63, -63, -23, -63, -36, -22, -21
783 #define YYTABLE_NINF -76
784 static const yytype_int8 yytable[] =
786 35, 1, 19, 2, 3, -75, 4, 20, 2, 3,
787 100, 101, 5, 6, 7, 8, 1, 21, 2, 3,
788 22, 4, 2, 3, 23, 4, 26, 5, 6, 7,
789 8, 5, 6, 7, 8, 24, 28, 29, 30, 25,
790 89, 27, 32, 33, 36, 90, 91, 92, 93, 94,
791 99, 106, 110, 96, 103, 107, 114, 115, 117, 112,
792 18, 105, 34, 109, 0, 95, 98, 0, 9, 0,
793 0, 0, 37, 9, 0, 0, 0, 0, 0, 0,
794 111, 0, 0, 9, 0, 0, 0, 9, 0, 116,
795 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
796 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
797 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
798 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
799 78, 79, 80, 81, 82, 83, 84, 0, 85
802 #define yypact_value_is_default(yystate) \
805 #define yytable_value_is_error(yytable_value) \
808 static const yytype_int8 yycheck[] =
810 23, 5, 15, 7, 8, 9, 10, 15, 7, 8,
811 72, 73, 16, 17, 18, 19, 5, 4, 7, 8,
812 10, 10, 7, 8, 10, 10, 0, 16, 17, 18,
813 19, 16, 17, 18, 19, 10, 20, 21, 22, 10,
814 27, 4, 9, 11, 72, 7, 12, 11, 20, 73,
815 7, 7, 11, 14, 23, 13, 11, 7, 11, 24,
816 1, 95, 22, 99, -1, 86, 88, -1, 72, -1,
817 -1, -1, 7, 72, -1, -1, -1, -1, -1, -1,
818 103, -1, -1, 72, -1, -1, -1, 72, -1, 112,
819 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
820 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
821 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
822 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
823 65, 66, 67, 68, 69, 70, 71, -1, 73
828 static const yytype_uint8 yystos[] =
830 0, 5, 7, 8, 10, 16, 17, 18, 19, 72,
831 75, 76, 77, 78, 79, 80, 87, 88, 78, 15,
832 15, 76, 10, 10, 10, 10, 0, 4, 20, 21,
833 22, 91, 9, 11, 80, 87, 72, 7, 25, 26,
834 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
835 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
836 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
837 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
838 67, 68, 69, 70, 71, 73, 83, 84, 85, 76,
839 7, 12, 11, 20, 73, 91, 14, 90, 90, 7,
840 72, 73, 86, 23, 81, 83, 7, 13, 89, 89,
841 11, 87, 24, 82, 11, 7, 87, 11
844 #define yyerrok (yyerrstatus = 0)
845 #define yyclearin (yychar = YYEMPTY)
849 #define YYACCEPT goto yyacceptlab
850 #define YYABORT goto yyabortlab
851 #define YYERROR goto yyerrorlab
861 #define YYFAIL goto yyerrlab
869 #define YYRECOVERING() (!!yyerrstatus)
871 #define YYBACKUP(Token, Value) \
873 if (yychar == YYEMPTY) \
877 YYPOPSTACK (yylen); \
883 yyerror (scanner, errp, root, YY_("syntax error: cannot back up")); \
890 #define YYERRCODE 256
897 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
898 #ifndef YYLLOC_DEFAULT
899 # define YYLLOC_DEFAULT(Current, Rhs, N) \
903 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
904 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
905 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
906 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
910 (Current).first_line = (Current).last_line = \
911 YYRHSLOC (Rhs, 0).last_line; \
912 (Current).first_column = (Current).last_column = \
913 YYRHSLOC (Rhs, 0).last_column; \
921 #ifndef YY_LOCATION_PRINT
922 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
929 # define YYLEX yylex (&yylval, YYLEX_PARAM)
931 # define YYLEX yylex (&yylval, scanner)
939 # define YYFPRINTF fprintf
942 # define YYDPRINTF(Args) \
948 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
952 YYFPRINTF (stderr, "%s ", Title); \
953 yy_symbol_print (stderr, \
954 Type, Value, scanner, errp, root); \
955 YYFPRINTF (stderr, "\n"); \
965 #if (defined __STDC__ || defined __C99__FUNC__ \
966 || defined __cplusplus || defined _MSC_VER)
968 yy_symbol_value_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
971 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
974 YYSTYPE const * const yyvaluep;
980 FILE *yyo = yyoutput;
988 if (yytype < YYNTOKENS)
989 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1005 #if (defined __STDC__ || defined __C99__FUNC__ \
1006 || defined __cplusplus || defined _MSC_VER)
1008 yy_symbol_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
1011 yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
1014 YYSTYPE const * const yyvaluep;
1020 if (yytype < YYNTOKENS)
1021 YYFPRINTF (yyoutput,
"token %s (", yytname[yytype]);
1023 YYFPRINTF (yyoutput,
"nterm %s (", yytname[yytype]);
1025 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root);
1026 YYFPRINTF (yyoutput,
")");
1034 #if (defined __STDC__ || defined __C99__FUNC__ \
1035 || defined __cplusplus || defined _MSC_VER)
1037 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1040 yy_stack_print (yybottom, yytop)
1041 yytype_int16 *yybottom;
1042 yytype_int16 *yytop;
1045 YYFPRINTF (stderr,
"Stack now");
1046 for (; yybottom <= yytop; yybottom++)
1048 int yybot = *yybottom;
1049 YYFPRINTF (stderr,
" %d", yybot);
1051 YYFPRINTF (stderr,
"\n");
1054 # define YY_STACK_PRINT(Bottom, Top) \
1057 yy_stack_print ((Bottom), (Top)); \
1065 #if (defined __STDC__ || defined __C99__FUNC__ \
1066 || defined __cplusplus || defined _MSC_VER)
1068 yy_reduce_print (
YYSTYPE *yyvsp,
int yyrule,
void *scanner,
char **errp,
struct nl_list_head *root)
1071 yy_reduce_print (yyvsp, yyrule, scanner, errp, root)
1079 int yynrhs = yyr2[yyrule];
1081 unsigned long int yylno = yyrline[yyrule];
1082 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
1085 for (yyi = 0; yyi < yynrhs; yyi++)
1087 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
1088 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1089 &(yyvsp[(yyi + 1) - (yynrhs)])
1090 , scanner, errp, root);
1091 YYFPRINTF (stderr,
"\n");
1095 # define YY_REDUCE_PRINT(Rule) \
1098 yy_reduce_print (yyvsp, Rule, scanner, errp, root); \
1105 # define YYDPRINTF(Args)
1106 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1107 # define YY_STACK_PRINT(Bottom, Top)
1108 # define YY_REDUCE_PRINT(Rule)
1114 # define YYINITDEPTH 200
1125 # define YYMAXDEPTH 10000
1132 # if defined __GLIBC__ && defined _STRING_H
1133 # define yystrlen strlen
1136 #if (defined __STDC__ || defined __C99__FUNC__ \
1137 || defined __cplusplus || defined _MSC_VER)
1139 yystrlen (
const char *yystr)
1147 for (yylen = 0; yystr[yylen]; yylen++)
1155 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1156 # define yystpcpy stpcpy
1160 #if (defined __STDC__ || defined __C99__FUNC__ \
1161 || defined __cplusplus || defined _MSC_VER)
1163 yystpcpy (
char *yydest,
const char *yysrc)
1166 yystpcpy (yydest, yysrc)
1172 const char *yys = yysrc;
1174 while ((*yyd++ = *yys++) !=
'\0')
1191 yytnamerr (
char *yyres,
const char *yystr)
1196 char const *yyp = yystr;
1203 goto do_not_strip_quotes;
1207 goto do_not_strip_quotes;
1220 do_not_strip_quotes: ;
1224 return yystrlen (yystr);
1226 return yystpcpy (yyres, yystr) - yyres;
1239 yysyntax_error (YYSIZE_T *yymsg_alloc,
char **yymsg,
1240 yytype_int16 *yyssp,
int yytoken)
1242 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1243 YYSIZE_T yysize = yysize0;
1245 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1247 const char *yyformat = YY_NULL;
1249 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1281 if (yytoken != YYEMPTY)
1283 int yyn = yypact[*yyssp];
1284 yyarg[yycount++] = yytname[yytoken];
1285 if (!yypact_value_is_default (yyn))
1290 int yyxbegin = yyn < 0 ? -yyn : 0;
1292 int yychecklim = YYLAST - yyn + 1;
1293 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1296 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1297 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1298 && !yytable_value_is_error (yytable[yyx + yyn]))
1300 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1306 yyarg[yycount++] = yytname[yyx];
1307 yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1308 if (! (yysize <= yysize1
1309 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1318 # define YYCASE_(N, S) \
1322 YYCASE_(0, YY_(
"syntax error"));
1323 YYCASE_(1, YY_(
"syntax error, unexpected %s"));
1324 YYCASE_(2, YY_(
"syntax error, unexpected %s, expecting %s"));
1325 YYCASE_(3, YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1326 YYCASE_(4, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1327 YYCASE_(5, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1331 yysize1 = yysize + yystrlen (yyformat);
1332 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1336 if (*yymsg_alloc < yysize)
1338 *yymsg_alloc = 2 * yysize;
1339 if (! (yysize <= *yymsg_alloc
1340 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1341 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1351 while ((*yyp = *yyformat) !=
'\0')
1352 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1354 yyp += yytnamerr (yyp, yyarg[yyi++]);
1372 #if (defined __STDC__ || defined __C99__FUNC__ \
1373 || defined __cplusplus || defined _MSC_VER)
1375 yydestruct (
const char *yymsg,
int yytype,
YYSTYPE *yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
1378 yydestruct (yymsg, yytype, yyvaluep, scanner, errp, root)
1394 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1401 #line 137 "route/cls/ematch_syntax.y"
1402 { free((yyvaluep->s)); NL_DBG(2,
"string destructor\n"); };
1405 #line 1406 "route/cls/ematch_syntax.c"
1410 #line 139 "route/cls/ematch_syntax.y"
1411 { free((yyvaluep->q).data); NL_DBG(2,
"quoted destructor\n"); };
1414 #line 1415 "route/cls/ematch_syntax.c"
1419 #line 138 "route/cls/ematch_syntax.y"
1420 {
rtnl_pktloc_put((yyvaluep->loc)); NL_DBG(2,
"pktloc destructor\n"); };
1423 #line 1424 "route/cls/ematch_syntax.c"
1428 #line 138 "route/cls/ematch_syntax.y"
1429 {
rtnl_pktloc_put((yyvaluep->loc)); NL_DBG(2,
"pktloc destructor\n"); };
1432 #line 1433 "route/cls/ematch_syntax.c"
1437 #line 140 "route/cls/ematch_syntax.y"
1438 { rtnl_meta_value_put((yyvaluep->mv)); NL_DBG(2,
"meta value destructor\n"); };
1441 #line 1442 "route/cls/ematch_syntax.c"
1446 #line 139 "route/cls/ematch_syntax.y"
1447 { free((yyvaluep->q).data); NL_DBG(2,
"quoted destructor\n"); };
1450 #line 1451 "route/cls/ematch_syntax.c"
1455 #line 138 "route/cls/ematch_syntax.y"
1456 {
rtnl_pktloc_put((yyvaluep->loc)); NL_DBG(2,
"pktloc destructor\n"); };
1459 #line 1460 "route/cls/ematch_syntax.c"
1469 #ifdef YYPARSE_PARAM
1470 #if defined __STDC__ || defined __cplusplus
1471 int yyparse (
void *YYPARSE_PARAM);
1476 #if defined __STDC__ || defined __cplusplus
1477 int yyparse (
void *scanner,
char **errp,
struct nl_list_head *root);
1488 #ifdef YYPARSE_PARAM
1489 #if (defined __STDC__ || defined __C99__FUNC__ \
1490 || defined __cplusplus || defined _MSC_VER)
1492 yyparse (
void *YYPARSE_PARAM)
1495 yyparse (YYPARSE_PARAM)
1496 void *YYPARSE_PARAM;
1499 #if (defined __STDC__ || defined __C99__FUNC__ \
1500 || defined __cplusplus || defined _MSC_VER)
1502 yyparse (
void *scanner,
char **errp,
struct nl_list_head *root)
1505 yyparse (scanner, errp, root)
1533 yytype_int16 yyssa[YYINITDEPTH];
1535 yytype_int16 *yyssp;
1542 YYSIZE_T yystacksize;
1555 char *yymsg = yymsgbuf;
1556 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1559 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1568 yystacksize = YYINITDEPTH;
1570 YYDPRINTF ((stderr,
"Starting parse\n"));
1597 if (yyss + yystacksize - 1 <= yyssp)
1600 YYSIZE_T yysize = yyssp - yyss + 1;
1608 yytype_int16 *yyss1 = yyss;
1614 yyoverflow (YY_(
"memory exhausted"),
1615 &yyss1, yysize *
sizeof (*yyssp),
1616 &yyvs1, yysize *
sizeof (*yyvsp),
1623 # ifndef YYSTACK_RELOCATE
1624 goto yyexhaustedlab;
1627 if (YYMAXDEPTH <= yystacksize)
1628 goto yyexhaustedlab;
1630 if (YYMAXDEPTH < yystacksize)
1631 yystacksize = YYMAXDEPTH;
1634 yytype_int16 *yyss1 = yyss;
1636 (
union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1638 goto yyexhaustedlab;
1639 YYSTACK_RELOCATE (yyss_alloc, yyss);
1640 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1641 # undef YYSTACK_RELOCATE
1643 YYSTACK_FREE (yyss1);
1648 yyssp = yyss + yysize - 1;
1649 yyvsp = yyvs + yysize - 1;
1651 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1652 (
unsigned long int) yystacksize));
1654 if (yyss + yystacksize - 1 <= yyssp)
1658 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1660 if (yystate == YYFINAL)
1674 yyn = yypact[yystate];
1675 if (yypact_value_is_default (yyn))
1681 if (yychar == YYEMPTY)
1683 YYDPRINTF ((stderr,
"Reading a token: "));
1687 if (yychar <= YYEOF)
1689 yychar = yytoken = YYEOF;
1690 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1694 yytoken = YYTRANSLATE (yychar);
1695 YY_SYMBOL_PRINT (
"Next token is", yytoken, &yylval, &yylloc);
1701 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1706 if (yytable_value_is_error (yyn))
1718 YY_SYMBOL_PRINT (
"Shifting", yytoken, &yylval, &yylloc);
1733 yyn = yydefact[yystate];
1754 yyval = yyvsp[1-yylen];
1757 YY_REDUCE_PRINT (yyn);
1763 #line 149 "route/cls/ematch_syntax.y"
1765 nl_list_add_tail(root, &(yyvsp[(1) - (1)].e)->e_list);
1772 #line 156 "route/cls/ematch_syntax.y"
1774 (yyval.e) = (yyvsp[(1) - (1)].e);
1781 #line 160 "route/cls/ematch_syntax.y"
1783 rtnl_ematch_set_flags((yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].i));
1786 nl_list_add_tail(&(yyvsp[(1) - (3)].e)->e_list, &(yyvsp[(3) - (3)].e)->e_list);
1788 (yyval.e) = (yyvsp[(1) - (3)].e);
1795 #line 172 "route/cls/ematch_syntax.y"
1797 rtnl_ematch_set_flags((yyvsp[(2) - (2)].e), TCF_EM_INVERT);
1798 (yyval.e) = (yyvsp[(2) - (2)].e);
1805 #line 177 "route/cls/ematch_syntax.y"
1807 (yyval.e) = (yyvsp[(1) - (1)].e);
1814 #line 185 "route/cls/ematch_syntax.y"
1816 struct rtnl_ematch *e;
1819 asprintf(errp,
"Unable to allocate ematch object");
1823 if (rtnl_ematch_set_kind(e, TCF_EM_CMP) < 0)
1826 rtnl_ematch_cmp_set(e, &(yyvsp[(1) - (1)].cmp));
1834 #line 200 "route/cls/ematch_syntax.y"
1836 struct rtnl_ematch *e;
1839 asprintf(errp,
"Unable to allocate ematch object");
1843 if (rtnl_ematch_set_kind(e, TCF_EM_NBYTE) < 0)
1846 rtnl_ematch_nbyte_set_offset(e, (yyvsp[(3) - (6)].loc)->layer, (yyvsp[(3) - (6)].loc)->offset);
1848 rtnl_ematch_nbyte_set_pattern(e, (uint8_t *) (yyvsp[(5) - (6)].q).data, (yyvsp[(5) - (6)].q).index);
1857 #line 218 "route/cls/ematch_syntax.y"
1859 struct rtnl_ematch *e;
1862 asprintf(errp,
"Unable to allocate ematch object");
1866 if (rtnl_ematch_set_kind(e, TCF_EM_TEXT) < 0)
1869 rtnl_ematch_text_set_algo(e, (yyvsp[(3) - (7)].s));
1870 rtnl_ematch_text_set_pattern(e, (yyvsp[(4) - (7)].q).data, (yyvsp[(4) - (7)].q).index);
1872 if ((yyvsp[(5) - (7)].loc)) {
1873 rtnl_ematch_text_set_from(e, (yyvsp[(5) - (7)].loc)->layer, (yyvsp[(5) - (7)].loc)->offset);
1877 if ((yyvsp[(6) - (7)].loc)) {
1878 rtnl_ematch_text_set_to(e, (yyvsp[(6) - (7)].loc)->layer, (yyvsp[(6) - (7)].loc)->offset);
1889 #line 245 "route/cls/ematch_syntax.y"
1891 struct rtnl_ematch *e;
1894 asprintf(errp,
"Unable to allocate ematch object");
1898 if (rtnl_ematch_set_kind(e, TCF_EM_META) < 0)
1901 rtnl_ematch_meta_set_lvalue(e, (yyvsp[(3) - (6)].mv));
1902 rtnl_ematch_meta_set_rvalue(e, (yyvsp[(5) - (6)].mv));
1903 rtnl_ematch_meta_set_operand(e, (yyvsp[(4) - (6)].i));
1912 #line 264 "route/cls/ematch_syntax.y"
1914 struct rtnl_ematch *e;
1917 asprintf(errp,
"Unable to allocate ematch object");
1921 if (rtnl_ematch_set_kind(e, TCF_EM_CONTAINER) < 0)
1925 nl_list_add_tail(&e->e_childs, &(yyvsp[(2) - (3)].e)->e_list);
1934 #line 292 "route/cls/ematch_syntax.y"
1935 { (yyval.cmp) = (yyvsp[(3) - (4)].cmp); }
1941 #line 294 "route/cls/ematch_syntax.y"
1942 { (yyval.cmp) = (yyvsp[(1) - (1)].cmp); }
1948 #line 299 "route/cls/ematch_syntax.y"
1950 if ((yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U16 ||
1951 (yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U32)
1952 (yyval.cmp).flags = TCF_EM_CMP_TRANS;
1954 memset(&(yyval.cmp), 0,
sizeof((yyval.cmp)));
1956 (yyval.cmp).mask = (yyvsp[(1) - (3)].loc)->mask;
1957 (yyval.cmp).off = (yyvsp[(1) - (3)].loc)->offset;
1958 (yyval.cmp).align = (yyvsp[(1) - (3)].loc)->align;
1959 (yyval.cmp).layer = (yyvsp[(1) - (3)].loc)->layer;
1960 (yyval.cmp).opnd = (yyvsp[(2) - (3)].i);
1961 (yyval.cmp).val = (yyvsp[(3) - (3)].i);
1970 #line 319 "route/cls/ematch_syntax.y"
1971 { (yyval.loc) = NULL; }
1977 #line 321 "route/cls/ematch_syntax.y"
1978 { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
1984 #line 326 "route/cls/ematch_syntax.y"
1985 { (yyval.loc) = NULL; }
1991 #line 328 "route/cls/ematch_syntax.y"
1992 { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
1998 #line 333 "route/cls/ematch_syntax.y"
1999 { (yyval.mv) = rtnl_meta_value_alloc_var((yyvsp[(1) - (1)].q).data, (yyvsp[(1) - (1)].q).len); }
2005 #line 335 "route/cls/ematch_syntax.y"
2006 { (yyval.mv) = rtnl_meta_value_alloc_int((yyvsp[(1) - (1)].i)); }
2012 #line 337 "route/cls/ematch_syntax.y"
2013 { (yyval.mv) = META_ALLOC(META_INT, (yyvsp[(1) - (3)].i), (yyvsp[(2) - (3)].i), (yyvsp[(3) - (3)].i64)); }
2019 #line 339 "route/cls/ematch_syntax.y"
2020 { (yyval.mv) = META_ALLOC(META_VAR, (yyvsp[(1) - (2)].i), (yyvsp[(2) - (2)].i), 0); }
2026 #line 343 "route/cls/ematch_syntax.y"
2027 { (yyval.i) = META_ID(RANDOM); }
2033 #line 344 "route/cls/ematch_syntax.y"
2034 { (yyval.i) = META_ID(LOADAVG_0); }
2040 #line 345 "route/cls/ematch_syntax.y"
2041 { (yyval.i) = META_ID(LOADAVG_1); }
2047 #line 346 "route/cls/ematch_syntax.y"
2048 { (yyval.i) = META_ID(LOADAVG_2); }
2054 #line 347 "route/cls/ematch_syntax.y"
2055 { (yyval.i) = META_ID(DEV); }
2061 #line 348 "route/cls/ematch_syntax.y"
2062 { (yyval.i) = META_ID(PRIORITY); }
2068 #line 349 "route/cls/ematch_syntax.y"
2069 { (yyval.i) = META_ID(PROTOCOL); }
2075 #line 350 "route/cls/ematch_syntax.y"
2076 { (yyval.i) = META_ID(PKTTYPE); }
2082 #line 351 "route/cls/ematch_syntax.y"
2083 { (yyval.i) = META_ID(PKTLEN); }
2089 #line 352 "route/cls/ematch_syntax.y"
2090 { (yyval.i) = META_ID(DATALEN); }
2096 #line 353 "route/cls/ematch_syntax.y"
2097 { (yyval.i) = META_ID(MACLEN); }
2103 #line 354 "route/cls/ematch_syntax.y"
2104 { (yyval.i) = META_ID(NFMARK); }
2110 #line 355 "route/cls/ematch_syntax.y"
2111 { (yyval.i) = META_ID(TCINDEX); }
2117 #line 356 "route/cls/ematch_syntax.y"
2118 { (yyval.i) = META_ID(RTCLASSID); }
2124 #line 357 "route/cls/ematch_syntax.y"
2125 { (yyval.i) = META_ID(RTIIF); }
2131 #line 358 "route/cls/ematch_syntax.y"
2132 { (yyval.i) = META_ID(SK_FAMILY); }
2138 #line 359 "route/cls/ematch_syntax.y"
2139 { (yyval.i) = META_ID(SK_STATE); }
2145 #line 360 "route/cls/ematch_syntax.y"
2146 { (yyval.i) = META_ID(SK_REUSE); }
2152 #line 361 "route/cls/ematch_syntax.y"
2153 { (yyval.i) = META_ID(SK_REFCNT); }
2159 #line 362 "route/cls/ematch_syntax.y"
2160 { (yyval.i) = META_ID(SK_RCVBUF); }
2166 #line 363 "route/cls/ematch_syntax.y"
2167 { (yyval.i) = META_ID(SK_SNDBUF); }
2173 #line 364 "route/cls/ematch_syntax.y"
2174 { (yyval.i) = META_ID(SK_SHUTDOWN); }
2180 #line 365 "route/cls/ematch_syntax.y"
2181 { (yyval.i) = META_ID(SK_PROTO); }
2187 #line 366 "route/cls/ematch_syntax.y"
2188 { (yyval.i) = META_ID(SK_TYPE); }
2194 #line 367 "route/cls/ematch_syntax.y"
2195 { (yyval.i) = META_ID(SK_RMEM_ALLOC); }
2201 #line 368 "route/cls/ematch_syntax.y"
2202 { (yyval.i) = META_ID(SK_WMEM_ALLOC); }
2208 #line 369 "route/cls/ematch_syntax.y"
2209 { (yyval.i) = META_ID(SK_WMEM_QUEUED); }
2215 #line 370 "route/cls/ematch_syntax.y"
2216 { (yyval.i) = META_ID(SK_RCV_QLEN); }
2222 #line 371 "route/cls/ematch_syntax.y"
2223 { (yyval.i) = META_ID(SK_SND_QLEN); }
2229 #line 372 "route/cls/ematch_syntax.y"
2230 { (yyval.i) = META_ID(SK_ERR_QLEN); }
2236 #line 373 "route/cls/ematch_syntax.y"
2237 { (yyval.i) = META_ID(SK_FORWARD_ALLOCS); }
2243 #line 374 "route/cls/ematch_syntax.y"
2244 { (yyval.i) = META_ID(SK_ALLOCS); }
2250 #line 375 "route/cls/ematch_syntax.y"
2251 { (yyval.i) = META_ID(SK_ROUTE_CAPS); }
2257 #line 376 "route/cls/ematch_syntax.y"
2258 { (yyval.i) = META_ID(SK_HASH); }
2264 #line 377 "route/cls/ematch_syntax.y"
2265 { (yyval.i) = META_ID(SK_LINGERTIME); }
2271 #line 378 "route/cls/ematch_syntax.y"
2272 { (yyval.i) = META_ID(SK_ACK_BACKLOG); }
2278 #line 379 "route/cls/ematch_syntax.y"
2279 { (yyval.i) = META_ID(SK_MAX_ACK_BACKLOG); }
2285 #line 380 "route/cls/ematch_syntax.y"
2286 { (yyval.i) = META_ID(SK_PRIO); }
2292 #line 381 "route/cls/ematch_syntax.y"
2293 { (yyval.i) = META_ID(SK_RCVLOWAT); }
2299 #line 382 "route/cls/ematch_syntax.y"
2300 { (yyval.i) = META_ID(SK_RCVTIMEO); }
2306 #line 383 "route/cls/ematch_syntax.y"
2307 { (yyval.i) = META_ID(SK_SNDTIMEO); }
2313 #line 384 "route/cls/ematch_syntax.y"
2314 { (yyval.i) = META_ID(SK_SENDMSG_OFF); }
2320 #line 385 "route/cls/ematch_syntax.y"
2321 { (yyval.i) = META_ID(SK_WRITE_PENDING); }
2327 #line 386 "route/cls/ematch_syntax.y"
2328 { (yyval.i) = META_ID(VLAN_TAG); }
2334 #line 387 "route/cls/ematch_syntax.y"
2335 { (yyval.i) = META_ID(RXHASH); }
2341 #line 391 "route/cls/ematch_syntax.y"
2342 { (yyval.i) = META_ID(DEV); }
2348 #line 392 "route/cls/ematch_syntax.y"
2349 { (yyval.i) = META_ID(SK_BOUND_IF); }
2355 #line 400 "route/cls/ematch_syntax.y"
2357 (yyval.q) = (yyvsp[(1) - (1)].q);
2364 #line 404 "route/cls/ematch_syntax.y"
2366 struct nl_addr *addr;
2368 if (
nl_addr_parse((yyvsp[(1) - (1)].s), AF_UNSPEC, &addr) == 0) {
2373 if (!((yyval.q).data = calloc(1, (yyval.q).len))) {
2381 asprintf(errp,
"invalid pattern \"%s\"", (yyvsp[(1) - (1)].s));
2390 #line 432 "route/cls/ematch_syntax.y"
2395 asprintf(errp,
"Packet location \"%s\" not found", (yyvsp[(1) - (1)].s));
2406 #line 444 "route/cls/ematch_syntax.y"
2410 if ((yyvsp[(5) - (5)].i64) && (!(yyvsp[(1) - (5)].i) || (yyvsp[(1) - (5)].i) > TCF_EM_ALIGN_U32)) {
2411 asprintf(errp,
"mask only allowed for alignments u8|u16|u32");
2416 asprintf(errp,
"Unable to allocate packet location object");
2420 loc->name = strdup(
"<USER-DEFINED>");
2421 loc->align = (yyvsp[(1) - (5)].i);
2422 loc->layer = (yyvsp[(2) - (5)].i);
2423 loc->offset = (yyvsp[(4) - (5)].i);
2424 loc->mask = (yyvsp[(5) - (5)].i64);
2433 #line 469 "route/cls/ematch_syntax.y"
2440 #line 471 "route/cls/ematch_syntax.y"
2441 { (yyval.i) = (yyvsp[(1) - (2)].i); }
2447 #line 473 "route/cls/ematch_syntax.y"
2448 { (yyval.i) = (yyvsp[(1) - (2)].i); }
2454 #line 478 "route/cls/ematch_syntax.y"
2455 { (yyval.i64) = 0; }
2461 #line 480 "route/cls/ematch_syntax.y"
2462 { (yyval.i64) = (yyvsp[(2) - (2)].i); }
2468 #line 485 "route/cls/ematch_syntax.y"
2475 #line 487 "route/cls/ematch_syntax.y"
2476 { (yyval.i) = (yyvsp[(2) - (2)].i); }
2482 #line 492 "route/cls/ematch_syntax.y"
2483 { (yyval.i) = TCF_EM_OPND_EQ; }
2489 #line 494 "route/cls/ematch_syntax.y"
2490 { (yyval.i) = TCF_EM_OPND_GT; }
2496 #line 496 "route/cls/ematch_syntax.y"
2497 { (yyval.i) = TCF_EM_OPND_LT; }
2503 #line 2504 "route/cls/ematch_syntax.c"
2517 YY_SYMBOL_PRINT (
"-> $$ =", yyr1[yyn], &yyval, &yyloc);
2521 YY_STACK_PRINT (yyss, yyssp);
2531 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2532 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2533 yystate = yytable[yystate];
2535 yystate = yydefgoto[yyn - YYNTOKENS];
2546 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2552 #if ! YYERROR_VERBOSE
2553 yyerror (scanner, errp, root, YY_(
"syntax error"));
2555 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2558 char const *yymsgp = YY_(
"syntax error");
2559 int yysyntax_error_status;
2560 yysyntax_error_status = YYSYNTAX_ERROR;
2561 if (yysyntax_error_status == 0)
2563 else if (yysyntax_error_status == 1)
2565 if (yymsg != yymsgbuf)
2566 YYSTACK_FREE (yymsg);
2567 yymsg = (
char *) YYSTACK_ALLOC (yymsg_alloc);
2571 yymsg_alloc =
sizeof yymsgbuf;
2572 yysyntax_error_status = 2;
2576 yysyntax_error_status = YYSYNTAX_ERROR;
2580 yyerror (scanner, errp, root, yymsgp);
2581 if (yysyntax_error_status == 2)
2582 goto yyexhaustedlab;
2584 # undef YYSYNTAX_ERROR
2590 if (yyerrstatus == 3)
2595 if (yychar <= YYEOF)
2598 if (yychar == YYEOF)
2603 yydestruct (
"Error: discarding",
2604 yytoken, &yylval, scanner, errp, root);
2629 YY_STACK_PRINT (yyss, yyssp);
2642 yyn = yypact[yystate];
2643 if (!yypact_value_is_default (yyn))
2646 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2659 yydestruct (
"Error: popping",
2660 yystos[yystate], yyvsp, scanner, errp, root);
2663 YY_STACK_PRINT (yyss, yyssp);
2670 YY_SYMBOL_PRINT (
"Shifting", yystos[yyn], yyvsp, yylsp);
2690 #if !defined yyoverflow || YYERROR_VERBOSE
2695 yyerror (scanner, errp, root, YY_(
"memory exhausted"));
2701 if (yychar != YYEMPTY)
2705 yytoken = YYTRANSLATE (yychar);
2706 yydestruct (
"Cleanup: discarding lookahead",
2707 yytoken, &yylval, scanner, errp, root);
2712 YY_STACK_PRINT (yyss, yyssp);
2713 while (yyssp != yyss)
2715 yydestruct (
"Cleanup: popping",
2716 yystos[*yyssp], yyvsp, scanner, errp, root);
2721 YYSTACK_FREE (yyss);
2724 if (yymsg != yymsgbuf)
2725 YYSTACK_FREE (yymsg);
2728 return YYID (yyresult);