47 #define YYBISON_VERSION "2.6.4"
50 #define YYSKELETON_NAME "yacc.c"
63 #define yyparse ematch_parse
64 #define yylex ematch_lex
65 #define yyerror ematch_error
66 #define yylval ematch_lval
67 #define yychar ematch_char
68 #define yydebug ematch_debug
69 #define yynerrs ematch_nerrs
73 #line 12 "route/cls/ematch_syntax.y"
75 #include <netlink-private/netlink.h>
76 #include <netlink-private/tc.h>
77 #include <netlink/netlink.h>
78 #include <netlink/utils.h>
79 #include <netlink/route/pktloc.h>
80 #include <netlink/route/cls/ematch.h>
81 #include <netlink/route/cls/ematch/cmp.h>
82 #include <netlink/route/cls/ematch/nbyte.h>
83 #include <netlink/route/cls/ematch/text.h>
84 #include <netlink/route/cls/ematch/meta.h>
86 #define META_ALLOC rtnl_meta_value_alloc_id
87 #define META_ID(name) TCF_META_ID_##name
88 #define META_INT TCF_META_TYPE_INT
89 #define META_VAR TCF_META_TYPE_VAR
92 #line 93 "route/cls/ematch_syntax.c"
95 # if defined __cplusplus && 201103L <= __cplusplus
96 # define YY_NULL nullptr
103 #ifdef YYERROR_VERBOSE
104 # undef YYERROR_VERBOSE
105 # define YYERROR_VERBOSE 1
107 # define YYERROR_VERBOSE 1
112 #ifndef YY_EMATCH_ROUTE_CLS_EMATCH_SYNTAX_H_INCLUDED
113 # define YY_EMATCH_ROUTE_CLS_EMATCH_SYNTAX_H_INCLUDED
119 extern int ematch_debug;
151 META_LOADAVG_0 = 281,
152 META_LOADAVG_1 = 282,
153 META_LOADAVG_2 = 283,
163 META_RTCLASSID = 293,
165 META_SK_FAMILY = 295,
168 META_SK_REFCNT = 298,
169 META_SK_RCVBUF = 299,
170 META_SK_SNDBUF = 300,
171 META_SK_SHUTDOWN = 301,
174 META_SK_RMEM_ALLOC = 304,
175 META_SK_WMEM_ALLOC = 305,
176 META_SK_WMEM_QUEUED = 306,
177 META_SK_RCV_QLEN = 307,
178 META_SK_SND_QLEN = 308,
179 META_SK_ERR_QLEN = 309,
180 META_SK_FORWARD_ALLOCS = 310,
181 META_SK_ALLOCS = 311,
182 META_SK_ROUTE_CAPS = 312,
184 META_SK_LINGERTIME = 314,
185 META_SK_ACK_BACKLOG = 315,
186 META_SK_MAX_ACK_BACKLOG = 316,
188 META_SK_RCVLOWAT = 318,
189 META_SK_RCVTIMEO = 319,
190 META_SK_SNDTIMEO = 320,
191 META_SK_SENDMSG_OFF = 321,
192 META_SK_WRITE_PENDING = 322,
196 META_SK_BOUND_IF = 326,
215 #define EMATCH_CMP 271
216 #define EMATCH_NBYTE 272
217 #define EMATCH_TEXT 273
218 #define EMATCH_META 274
224 #define META_RANDOM 280
225 #define META_LOADAVG_0 281
226 #define META_LOADAVG_1 282
227 #define META_LOADAVG_2 283
229 #define META_PRIO 285
230 #define META_PROTO 286
231 #define META_PKTTYPE 287
232 #define META_PKTLEN 288
233 #define META_DATALEN 289
234 #define META_MACLEN 290
235 #define META_MARK 291
236 #define META_TCINDEX 292
237 #define META_RTCLASSID 293
238 #define META_RTIIF 294
239 #define META_SK_FAMILY 295
240 #define META_SK_STATE 296
241 #define META_SK_REUSE 297
242 #define META_SK_REFCNT 298
243 #define META_SK_RCVBUF 299
244 #define META_SK_SNDBUF 300
245 #define META_SK_SHUTDOWN 301
246 #define META_SK_PROTO 302
247 #define META_SK_TYPE 303
248 #define META_SK_RMEM_ALLOC 304
249 #define META_SK_WMEM_ALLOC 305
250 #define META_SK_WMEM_QUEUED 306
251 #define META_SK_RCV_QLEN 307
252 #define META_SK_SND_QLEN 308
253 #define META_SK_ERR_QLEN 309
254 #define META_SK_FORWARD_ALLOCS 310
255 #define META_SK_ALLOCS 311
256 #define META_SK_ROUTE_CAPS 312
257 #define META_SK_HASH 313
258 #define META_SK_LINGERTIME 314
259 #define META_SK_ACK_BACKLOG 315
260 #define META_SK_MAX_ACK_BACKLOG 316
261 #define META_SK_PRIO 317
262 #define META_SK_RCVLOWAT 318
263 #define META_SK_RCVTIMEO 319
264 #define META_SK_SNDTIMEO 320
265 #define META_SK_SENDMSG_OFF 321
266 #define META_SK_WRITE_PENDING 322
267 #define META_VLAN 323
268 #define META_RXHASH 324
269 #define META_DEVNAME 325
270 #define META_SK_BOUND_IF 326
276 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
280 #line 39 "route/cls/ematch_syntax.y"
282 struct tcf_em_cmp cmp;
283 struct ematch_quoted q;
284 struct rtnl_ematch * e;
293 #line 294 "route/cls/ematch_syntax.c"
295 # define YYSTYPE_IS_TRIVIAL 1
296 # define yystype YYSTYPE
297 # define YYSTYPE_IS_DECLARED 1
302 #if defined __STDC__ || defined __cplusplus
303 int ematch_parse (
void *YYPARSE_PARAM);
308 #if defined __STDC__ || defined __cplusplus
309 int ematch_parse (
void *scanner,
char **errp,
struct nl_list_head *root);
319 #line 50 "route/cls/ematch_syntax.y"
321 extern int ematch_lex(
YYSTYPE *,
void *);
323 static void yyerror(
void *scanner,
char **errp,
struct nl_list_head *root,
const char *msg)
332 #line 333 "route/cls/ematch_syntax.c"
339 typedef YYTYPE_UINT8 yytype_uint8;
341 typedef unsigned char yytype_uint8;
345 typedef YYTYPE_INT8 yytype_int8;
346 #elif (defined __STDC__ || defined __C99__FUNC__ \
347 || defined __cplusplus || defined _MSC_VER)
348 typedef signed char yytype_int8;
350 typedef short int yytype_int8;
354 typedef YYTYPE_UINT16 yytype_uint16;
356 typedef unsigned short int yytype_uint16;
360 typedef YYTYPE_INT16 yytype_int16;
362 typedef short int yytype_int16;
366 # ifdef __SIZE_TYPE__
367 # define YYSIZE_T __SIZE_TYPE__
368 # elif defined size_t
369 # define YYSIZE_T size_t
370 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
371 || defined __cplusplus || defined _MSC_VER)
373 # define YYSIZE_T size_t
375 # define YYSIZE_T unsigned int
379 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
382 # if defined YYENABLE_NLS && YYENABLE_NLS
384 # include <libintl.h>
385 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
389 # define YY_(Msgid) Msgid
394 #if ! defined lint || defined __GNUC__
395 # define YYUSE(E) ((void) (E))
404 #if (defined __STDC__ || defined __C99__FUNC__ \
405 || defined __cplusplus || defined _MSC_VER)
418 #if ! defined yyoverflow || YYERROR_VERBOSE
422 # ifdef YYSTACK_USE_ALLOCA
423 # if YYSTACK_USE_ALLOCA
425 # define YYSTACK_ALLOC __builtin_alloca
426 # elif defined __BUILTIN_VA_ARG_INCR
429 # define YYSTACK_ALLOC __alloca
430 # elif defined _MSC_VER
432 # define alloca _alloca
434 # define YYSTACK_ALLOC alloca
435 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
436 || defined __cplusplus || defined _MSC_VER)
439 # ifndef EXIT_SUCCESS
440 # define EXIT_SUCCESS 0
447 # ifdef YYSTACK_ALLOC
449 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
450 # ifndef YYSTACK_ALLOC_MAXIMUM
455 # define YYSTACK_ALLOC_MAXIMUM 4032
458 # define YYSTACK_ALLOC YYMALLOC
459 # define YYSTACK_FREE YYFREE
460 # ifndef YYSTACK_ALLOC_MAXIMUM
461 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
463 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
464 && ! ((defined YYMALLOC || defined malloc) \
465 && (defined YYFREE || defined free)))
467 # ifndef EXIT_SUCCESS
468 # define EXIT_SUCCESS 0
472 # define YYMALLOC malloc
473 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
474 || defined __cplusplus || defined _MSC_VER)
475 void *malloc (YYSIZE_T);
480 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
481 || defined __cplusplus || defined _MSC_VER)
489 #if (! defined yyoverflow \
490 && (! defined __cplusplus \
491 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
496 yytype_int16 yyss_alloc;
501 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
505 # define YYSTACK_BYTES(N) \
506 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
507 + YYSTACK_GAP_MAXIMUM)
509 # define YYCOPY_NEEDED 1
516 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
519 YYSIZE_T yynewbytes; \
520 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
521 Stack = &yyptr->Stack_alloc; \
522 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
523 yyptr += yynewbytes / sizeof (*yyptr); \
529 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
533 # if defined __GNUC__ && 1 < __GNUC__
534 # define YYCOPY(Dst, Src, Count) \
535 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
537 # define YYCOPY(Dst, Src, Count) \
541 for (yyi = 0; yyi < (Count); yyi++) \
542 (Dst)[yyi] = (Src)[yyi]; \
561 #define YYNSTATES 118
565 #define YYMAXUTOK 328
567 #define YYTRANSLATE(YYX) \
568 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
571 static const yytype_uint8 yytranslate[] =
573 0, 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, 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, 1, 2, 3, 4,
599 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
600 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
601 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
602 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
603 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
604 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
605 65, 66, 67, 68, 69, 70, 71, 72, 73
611 static const yytype_uint8 yyprhs[] =
613 0, 0, 3, 4, 6, 8, 12, 15, 17, 19,
614 26, 34, 41, 45, 50, 52, 56, 57, 60, 61,
615 64, 66, 68, 72, 75, 77, 79, 81, 83, 85,
616 87, 89, 91, 93, 95, 97, 99, 101, 103, 105,
617 107, 109, 111, 113, 115, 117, 119, 121, 123, 125,
618 127, 129, 131, 133, 135, 137, 139, 141, 143, 145,
619 147, 149, 151, 153, 155, 157, 159, 161, 163, 165,
620 167, 169, 171, 173, 175, 181, 182, 185, 188, 189,
621 192, 193, 196, 198, 200
625 static const yytype_int8 yyrhs[] =
627 75, 0, -1, -1, 76, -1, 77, -1, 77, 4,
628 76, -1, 5, 78, -1, 78, -1, 79, -1, 17,
629 10, 87, 20, 86, 11, -1, 18, 10, 72, 73,
630 81, 82, 11, -1, 19, 10, 83, 91, 83, 11,
631 -1, 10, 76, 11, -1, 16, 10, 80, 11, -1,
632 80, -1, 87, 91, 7, -1, -1, 23, 87, -1,
633 -1, 24, 87, -1, 73, -1, 7, -1, 84, 90,
634 89, -1, 85, 90, -1, 25, -1, 26, -1, 27,
635 -1, 28, -1, 29, -1, 30, -1, 31, -1, 32,
636 -1, 33, -1, 34, -1, 35, -1, 36, -1, 37,
637 -1, 38, -1, 39, -1, 40, -1, 41, -1, 42,
638 -1, 43, -1, 44, -1, 45, -1, 46, -1, 47,
639 -1, 48, -1, 49, -1, 50, -1, 51, -1, 52,
640 -1, 53, -1, 54, -1, 55, -1, 56, -1, 57,
641 -1, 58, -1, 59, -1, 60, -1, 61, -1, 62,
642 -1, 63, -1, 64, -1, 65, -1, 66, -1, 67,
643 -1, 68, -1, 69, -1, 70, -1, 71, -1, 73,
644 -1, 72, -1, 72, -1, 88, 9, 12, 7, 89,
645 -1, -1, 8, 15, -1, 7, 15, -1, -1, 13,
646 7, -1, -1, 14, 7, -1, 20, -1, 21, -1,
651 static const yytype_uint16 yyrline[] =
653 0, 148, 148, 150, 157, 161, 173, 178, 186, 201,
654 219, 246, 265, 293, 295, 300, 321, 322, 328, 329,
655 334, 336, 338, 340, 345, 346, 347, 348, 349, 350,
656 351, 352, 353, 354, 355, 356, 357, 358, 359, 360,
657 361, 362, 363, 364, 365, 366, 367, 368, 369, 370,
658 371, 372, 373, 374, 375, 376, 377, 378, 379, 380,
659 381, 382, 383, 384, 385, 386, 387, 388, 389, 393,
660 394, 401, 405, 434, 447, 473, 474, 476, 482, 483,
661 489, 490, 495, 497, 499
665 #if YYDEBUG || YYERROR_VERBOSE || 1
668 static const char *
const yytname[] =
670 "$end",
"error",
"$undefined",
"ERROR",
"LOGIC",
"NOT",
"OPERAND",
671 "NUMBER",
"ALIGN",
"LAYER",
"\"(\"",
"\")\"",
"\"+\"",
"\"mask\"",
672 "\">>\"",
"\"at\"",
"\"cmp\"",
"\"pattern\"",
"\"text\"",
"\"meta\"",
673 "\"=\"",
"\">\"",
"\"<\"",
"\"from\"",
"\"to\"",
"\"random\"",
674 "\"loadavg_0\"",
"\"loadavg_1\"",
"\"loadavg_2\"",
"\"dev\"",
"\"prio\"",
675 "\"proto\"",
"\"pkttype\"",
"\"pktlen\"",
"\"datalen\"",
"\"maclen\"",
676 "\"mark\"",
"\"tcindex\"",
"\"rtclassid\"",
"\"rtiif\"",
"\"sk_family\"",
677 "\"sk_state\"",
"\"sk_reuse\"",
"\"sk_refcnt\"",
"\"sk_rcvbuf\"",
678 "\"sk_sndbuf\"",
"\"sk_shutdown\"",
"\"sk_proto\"",
"\"sk_type\"",
679 "\"sk_rmem_alloc\"",
"\"sk_wmem_alloc\"",
"\"sk_wmem_queued\"",
680 "\"sk_rcv_qlen\"",
"\"sk_snd_qlen\"",
"\"sk_err_qlen\"",
681 "\"sk_forward_allocs\"",
"\"sk_allocs\"",
"\"sk_route_caps\"",
682 "\"sk_hash\"",
"\"sk_lingertime\"",
"\"sk_ack_backlog\"",
683 "\"sk_max_ack_backlog\"",
"\"sk_prio\"",
"\"sk_rcvlowat\"",
684 "\"sk_rcvtimeo\"",
"\"sk_sndtimeo\"",
"\"sk_sendmsg_off\"",
685 "\"sk_write_pending\"",
"\"vlan\"",
"\"rxhash\"",
"\"devname\"",
686 "\"sk_bound_if\"",
"STR",
"QUOTED",
"$accept",
"input",
"expr",
"match",
687 "ematch",
"cmp_match",
"cmp_expr",
"text_from",
"text_to",
"meta_value",
688 "meta_int_id",
"meta_var_id",
"pattern",
"pktloc",
"align",
"mask",
689 "shift",
"operand", YY_NULL
696 static const yytype_uint16 yytoknum[] =
698 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
699 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
700 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
701 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
702 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
703 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
704 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
710 static const yytype_uint8 yyr1[] =
712 0, 74, 75, 75, 76, 76, 77, 77, 78, 78,
713 78, 78, 78, 79, 79, 80, 81, 81, 82, 82,
714 83, 83, 83, 83, 84, 84, 84, 84, 84, 84,
715 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
716 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
717 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
718 84, 84, 84, 84, 84, 84, 84, 84, 84, 85,
719 85, 86, 86, 87, 87, 88, 88, 88, 89, 89,
724 static const yytype_uint8 yyr2[] =
726 0, 2, 0, 1, 1, 3, 2, 1, 1, 6,
727 7, 6, 3, 4, 1, 3, 0, 2, 0, 2,
728 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
729 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
730 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
731 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
732 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
733 1, 1, 1, 1, 5, 0, 2, 2, 0, 2,
740 static const yytype_uint8 yydefact[] =
742 2, 75, 0, 0, 75, 0, 0, 0, 0, 73,
743 0, 3, 4, 7, 8, 14, 0, 0, 6, 77,
744 76, 0, 75, 75, 0, 0, 1, 75, 82, 83,
745 84, 0, 0, 12, 0, 0, 0, 21, 24, 25,
746 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
747 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
748 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
749 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
750 66, 67, 68, 69, 70, 20, 0, 80, 80, 5,
751 15, 0, 13, 0, 16, 0, 0, 78, 23, 78,
752 72, 71, 0, 75, 18, 0, 81, 0, 22, 74,
753 9, 17, 75, 0, 11, 79, 19, 10
757 static const yytype_int8 yydefgoto[] =
759 -1, 10, 11, 12, 13, 14, 15, 104, 113, 86,
760 87, 88, 102, 16, 17, 108, 97, 31
765 #define YYPACT_NINF -63
766 static const yytype_int8 yypact[] =
768 -4, 15, -13, -8, 11, 10, 14, 25, 29, -63,
769 26, -63, 37, -63, -63, -63, 16, 33, -63, -63,
770 -63, 32, 1, 1, -28, 65, -63, 11, -63, -63,
771 -63, 38, 34, -63, 36, 28, -24, -63, -63, -63,
772 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
773 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
774 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
775 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
776 -63, -63, -63, -63, -63, -63, 16, 39, 39, -63,
777 -63, 43, -63, -62, 31, 65, 44, 42, -63, 42,
778 -63, -63, 41, 1, 35, 45, -63, 50, -63, -63,
779 -63, -63, 1, 47, -63, -63, -63, -63
783 static const yytype_int8 yypgoto[] =
785 -63, -63, 13, -63, 59, -63, 40, -63, -63, -34,
786 -63, -63, -63, -23, -63, -36, -22, -21
792 #define YYTABLE_NINF -76
793 static const yytype_int8 yytable[] =
795 35, 1, 19, 2, 3, -75, 4, 20, 2, 3,
796 100, 101, 5, 6, 7, 8, 1, 21, 2, 3,
797 22, 4, 2, 3, 23, 4, 26, 5, 6, 7,
798 8, 5, 6, 7, 8, 24, 28, 29, 30, 25,
799 89, 27, 32, 33, 36, 90, 91, 92, 93, 94,
800 99, 106, 110, 96, 103, 107, 114, 115, 117, 112,
801 18, 105, 34, 109, 0, 95, 98, 0, 9, 0,
802 0, 0, 37, 9, 0, 0, 0, 0, 0, 0,
803 111, 0, 0, 9, 0, 0, 0, 9, 0, 116,
804 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
805 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
806 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
807 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
808 78, 79, 80, 81, 82, 83, 84, 0, 85
811 #define yypact_value_is_default(Yystate) \
812 (!!((Yystate) == (-63)))
814 #define yytable_value_is_error(Yytable_value) \
817 static const yytype_int8 yycheck[] =
819 23, 5, 15, 7, 8, 9, 10, 15, 7, 8,
820 72, 73, 16, 17, 18, 19, 5, 4, 7, 8,
821 10, 10, 7, 8, 10, 10, 0, 16, 17, 18,
822 19, 16, 17, 18, 19, 10, 20, 21, 22, 10,
823 27, 4, 9, 11, 72, 7, 12, 11, 20, 73,
824 7, 7, 11, 14, 23, 13, 11, 7, 11, 24,
825 1, 95, 22, 99, -1, 86, 88, -1, 72, -1,
826 -1, -1, 7, 72, -1, -1, -1, -1, -1, -1,
827 103, -1, -1, 72, -1, -1, -1, 72, -1, 112,
828 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
829 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
830 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
831 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
832 65, 66, 67, 68, 69, 70, 71, -1, 73
837 static const yytype_uint8 yystos[] =
839 0, 5, 7, 8, 10, 16, 17, 18, 19, 72,
840 75, 76, 77, 78, 79, 80, 87, 88, 78, 15,
841 15, 76, 10, 10, 10, 10, 0, 4, 20, 21,
842 22, 91, 9, 11, 80, 87, 72, 7, 25, 26,
843 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
844 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
845 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
846 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
847 67, 68, 69, 70, 71, 73, 83, 84, 85, 76,
848 7, 12, 11, 20, 73, 91, 14, 90, 90, 7,
849 72, 73, 86, 23, 81, 83, 7, 13, 89, 89,
850 11, 87, 24, 82, 11, 7, 87, 11
853 #define yyerrok (yyerrstatus = 0)
854 #define yyclearin (yychar = YYEMPTY)
858 #define YYACCEPT goto yyacceptlab
859 #define YYABORT goto yyabortlab
860 #define YYERROR goto yyerrorlab
870 #define YYFAIL goto yyerrlab
878 #define YYRECOVERING() (!!yyerrstatus)
880 #define YYBACKUP(Token, Value) \
882 if (yychar == YYEMPTY) \
886 YYPOPSTACK (yylen); \
892 yyerror (scanner, errp, root, YY_("syntax error: cannot back up")); \
899 #define YYERRCODE 256
905 #ifndef YYLLOC_DEFAULT
906 # define YYLLOC_DEFAULT(Current, Rhs, N) \
910 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
911 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
912 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
913 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
917 (Current).first_line = (Current).last_line = \
918 YYRHSLOC (Rhs, 0).last_line; \
919 (Current).first_column = (Current).last_column = \
920 YYRHSLOC (Rhs, 0).last_column; \
925 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
931 #ifndef YY_LOCATION_PRINT
932 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
939 # define YYLEX yylex (&yylval, YYLEX_PARAM)
941 # define YYLEX yylex (&yylval, scanner)
949 # define YYFPRINTF fprintf
952 # define YYDPRINTF(Args) \
958 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
962 YYFPRINTF (stderr, "%s ", Title); \
963 yy_symbol_print (stderr, \
964 Type, Value, scanner, errp, root); \
965 YYFPRINTF (stderr, "\n"); \
975 #if (defined __STDC__ || defined __C99__FUNC__ \
976 || defined __cplusplus || defined _MSC_VER)
978 yy_symbol_value_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
981 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
984 YYSTYPE const * const yyvaluep;
990 FILE *yyo = yyoutput;
998 if (yytype < YYNTOKENS)
999 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1015 #if (defined __STDC__ || defined __C99__FUNC__ \
1016 || defined __cplusplus || defined _MSC_VER)
1018 yy_symbol_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
1021 yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
1024 YYSTYPE const * const yyvaluep;
1030 if (yytype < YYNTOKENS)
1031 YYFPRINTF (yyoutput,
"token %s (", yytname[yytype]);
1033 YYFPRINTF (yyoutput,
"nterm %s (", yytname[yytype]);
1035 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root);
1036 YYFPRINTF (yyoutput,
")");
1044 #if (defined __STDC__ || defined __C99__FUNC__ \
1045 || defined __cplusplus || defined _MSC_VER)
1047 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1050 yy_stack_print (yybottom, yytop)
1051 yytype_int16 *yybottom;
1052 yytype_int16 *yytop;
1055 YYFPRINTF (stderr,
"Stack now");
1056 for (; yybottom <= yytop; yybottom++)
1058 int yybot = *yybottom;
1059 YYFPRINTF (stderr,
" %d", yybot);
1061 YYFPRINTF (stderr,
"\n");
1064 # define YY_STACK_PRINT(Bottom, Top) \
1067 yy_stack_print ((Bottom), (Top)); \
1075 #if (defined __STDC__ || defined __C99__FUNC__ \
1076 || defined __cplusplus || defined _MSC_VER)
1078 yy_reduce_print (
YYSTYPE *yyvsp,
int yyrule,
void *scanner,
char **errp,
struct nl_list_head *root)
1081 yy_reduce_print (yyvsp, yyrule, scanner, errp, root)
1089 int yynrhs = yyr2[yyrule];
1091 unsigned long int yylno = yyrline[yyrule];
1092 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
1095 for (yyi = 0; yyi < yynrhs; yyi++)
1097 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
1098 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1099 &(yyvsp[(yyi + 1) - (yynrhs)])
1100 , scanner, errp, root);
1101 YYFPRINTF (stderr,
"\n");
1105 # define YY_REDUCE_PRINT(Rule) \
1108 yy_reduce_print (yyvsp, Rule, scanner, errp, root); \
1115 # define YYDPRINTF(Args)
1116 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1117 # define YY_STACK_PRINT(Bottom, Top)
1118 # define YY_REDUCE_PRINT(Rule)
1124 # define YYINITDEPTH 200
1135 # define YYMAXDEPTH 10000
1142 # if defined __GLIBC__ && defined _STRING_H
1143 # define yystrlen strlen
1146 #if (defined __STDC__ || defined __C99__FUNC__ \
1147 || defined __cplusplus || defined _MSC_VER)
1149 yystrlen (
const char *yystr)
1157 for (yylen = 0; yystr[yylen]; yylen++)
1165 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1166 # define yystpcpy stpcpy
1170 #if (defined __STDC__ || defined __C99__FUNC__ \
1171 || defined __cplusplus || defined _MSC_VER)
1173 yystpcpy (
char *yydest,
const char *yysrc)
1176 yystpcpy (yydest, yysrc)
1182 const char *yys = yysrc;
1184 while ((*yyd++ = *yys++) !=
'\0')
1201 yytnamerr (
char *yyres,
const char *yystr)
1206 char const *yyp = yystr;
1213 goto do_not_strip_quotes;
1217 goto do_not_strip_quotes;
1230 do_not_strip_quotes: ;
1234 return yystrlen (yystr);
1236 return yystpcpy (yyres, yystr) - yyres;
1249 yysyntax_error (YYSIZE_T *yymsg_alloc,
char **yymsg,
1250 yytype_int16 *yyssp,
int yytoken)
1252 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1253 YYSIZE_T yysize = yysize0;
1255 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1257 const char *yyformat = YY_NULL;
1259 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1291 if (yytoken != YYEMPTY)
1293 int yyn = yypact[*yyssp];
1294 yyarg[yycount++] = yytname[yytoken];
1295 if (!yypact_value_is_default (yyn))
1300 int yyxbegin = yyn < 0 ? -yyn : 0;
1302 int yychecklim = YYLAST - yyn + 1;
1303 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1306 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1307 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1308 && !yytable_value_is_error (yytable[yyx + yyn]))
1310 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1316 yyarg[yycount++] = yytname[yyx];
1317 yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1318 if (! (yysize <= yysize1
1319 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1328 # define YYCASE_(N, S) \
1332 YYCASE_(0, YY_(
"syntax error"));
1333 YYCASE_(1, YY_(
"syntax error, unexpected %s"));
1334 YYCASE_(2, YY_(
"syntax error, unexpected %s, expecting %s"));
1335 YYCASE_(3, YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1336 YYCASE_(4, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1337 YYCASE_(5, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1341 yysize1 = yysize + yystrlen (yyformat);
1342 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1346 if (*yymsg_alloc < yysize)
1348 *yymsg_alloc = 2 * yysize;
1349 if (! (yysize <= *yymsg_alloc
1350 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1351 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1361 while ((*yyp = *yyformat) !=
'\0')
1362 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1364 yyp += yytnamerr (yyp, yyarg[yyi++]);
1382 #if (defined __STDC__ || defined __C99__FUNC__ \
1383 || defined __cplusplus || defined _MSC_VER)
1385 yydestruct (
const char *yymsg,
int yytype,
YYSTYPE *yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
1388 yydestruct (yymsg, yytype, yyvaluep, scanner, errp, root)
1404 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1410 #line 139 "route/cls/ematch_syntax.y"
1411 { free(((*yyvaluep).s)); NL_DBG(2,
"string destructor\n"); };
1413 #line 1414 "route/cls/ematch_syntax.c"
1417 #line 141 "route/cls/ematch_syntax.y"
1418 { free(((*yyvaluep).q).data); NL_DBG(2,
"quoted destructor\n"); };
1420 #line 1421 "route/cls/ematch_syntax.c"
1424 #line 140 "route/cls/ematch_syntax.y"
1425 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); };
1427 #line 1428 "route/cls/ematch_syntax.c"
1431 #line 140 "route/cls/ematch_syntax.y"
1432 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); };
1434 #line 1435 "route/cls/ematch_syntax.c"
1438 #line 142 "route/cls/ematch_syntax.y"
1439 { rtnl_meta_value_put(((*yyvaluep).mv)); NL_DBG(2,
"meta value destructor\n"); };
1441 #line 1442 "route/cls/ematch_syntax.c"
1445 #line 141 "route/cls/ematch_syntax.y"
1446 { free(((*yyvaluep).q).data); NL_DBG(2,
"quoted destructor\n"); };
1448 #line 1449 "route/cls/ematch_syntax.c"
1452 #line 140 "route/cls/ematch_syntax.y"
1453 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); };
1455 #line 1456 "route/cls/ematch_syntax.c"
1470 #ifdef YYPARSE_PARAM
1471 #if (defined __STDC__ || defined __C99__FUNC__ \
1472 || defined __cplusplus || defined _MSC_VER)
1474 yyparse (
void *YYPARSE_PARAM)
1477 yyparse (YYPARSE_PARAM)
1478 void *YYPARSE_PARAM;
1481 #if (defined __STDC__ || defined __C99__FUNC__ \
1482 || defined __cplusplus || defined _MSC_VER)
1484 yyparse (
void *scanner,
char **errp,
struct nl_list_head *root)
1487 yyparse (scanner, errp, root)
1498 #if defined __GNUC__ && (4 < __GNUC__ + (6 <= __GNUC_MINOR__))
1500 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1501 _Pragma ("GCC diagnostic push") \
1502 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1503 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1504 _Pragma ("GCC diagnostic pop")
1509 # define YYLVAL_INITIALIZE() (yylval = yyval_default)
1511 #ifndef YYLVAL_INITIALIZE
1512 # define YYLVAL_INITIALIZE()
1514 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1515 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1516 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1537 yytype_int16 yyssa[YYINITDEPTH];
1539 yytype_int16 *yyssp;
1546 YYSIZE_T yystacksize;
1559 char *yymsg = yymsgbuf;
1560 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1563 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1571 yystacksize = YYINITDEPTH;
1573 YYDPRINTF ((stderr,
"Starting parse\n"));
1587 YYLVAL_INITIALIZE ();
1601 if (yyss + yystacksize - 1 <= yyssp)
1604 YYSIZE_T yysize = yyssp - yyss + 1;
1612 yytype_int16 *yyss1 = yyss;
1618 yyoverflow (YY_(
"memory exhausted"),
1619 &yyss1, yysize *
sizeof (*yyssp),
1620 &yyvs1, yysize *
sizeof (*yyvsp),
1627 # ifndef YYSTACK_RELOCATE
1628 goto yyexhaustedlab;
1631 if (YYMAXDEPTH <= yystacksize)
1632 goto yyexhaustedlab;
1634 if (YYMAXDEPTH < yystacksize)
1635 yystacksize = YYMAXDEPTH;
1638 yytype_int16 *yyss1 = yyss;
1640 (
union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1642 goto yyexhaustedlab;
1643 YYSTACK_RELOCATE (yyss_alloc, yyss);
1644 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1645 # undef YYSTACK_RELOCATE
1647 YYSTACK_FREE (yyss1);
1652 yyssp = yyss + yysize - 1;
1653 yyvsp = yyvs + yysize - 1;
1655 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1656 (
unsigned long int) yystacksize));
1658 if (yyss + yystacksize - 1 <= yyssp)
1662 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1664 if (yystate == YYFINAL)
1678 yyn = yypact[yystate];
1679 if (yypact_value_is_default (yyn))
1685 if (yychar == YYEMPTY)
1687 YYDPRINTF ((stderr,
"Reading a token: "));
1691 if (yychar <= YYEOF)
1693 yychar = yytoken = YYEOF;
1694 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1698 yytoken = YYTRANSLATE (yychar);
1699 YY_SYMBOL_PRINT (
"Next token is", yytoken, &yylval, &yylloc);
1705 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1710 if (yytable_value_is_error (yyn))
1722 YY_SYMBOL_PRINT (
"Shifting", yytoken, &yylval, &yylloc);
1728 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1730 YY_IGNORE_MAYBE_UNINITIALIZED_END
1739 yyn = yydefact[yystate];
1760 yyval = yyvsp[1-yylen];
1763 YY_REDUCE_PRINT (yyn);
1768 #line 151 "route/cls/ematch_syntax.y"
1770 nl_list_add_tail(root, &(yyvsp[(1) - (1)].e)->e_list);
1776 #line 158 "route/cls/ematch_syntax.y"
1778 (yyval.e) = (yyvsp[(1) - (1)].e);
1784 #line 162 "route/cls/ematch_syntax.y"
1786 rtnl_ematch_set_flags((yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].i));
1789 nl_list_add_tail(&(yyvsp[(1) - (3)].e)->e_list, &(yyvsp[(3) - (3)].e)->e_list);
1791 (yyval.e) = (yyvsp[(1) - (3)].e);
1797 #line 174 "route/cls/ematch_syntax.y"
1799 rtnl_ematch_set_flags((yyvsp[(2) - (2)].e), TCF_EM_INVERT);
1800 (yyval.e) = (yyvsp[(2) - (2)].e);
1806 #line 179 "route/cls/ematch_syntax.y"
1808 (yyval.e) = (yyvsp[(1) - (1)].e);
1814 #line 187 "route/cls/ematch_syntax.y"
1816 struct rtnl_ematch *e;
1819 *errp = strdup(
"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));
1833 #line 202 "route/cls/ematch_syntax.y"
1835 struct rtnl_ematch *e;
1838 *errp = strdup(
"Unable to allocate ematch object");
1842 if (rtnl_ematch_set_kind(e, TCF_EM_NBYTE) < 0)
1845 rtnl_ematch_nbyte_set_offset(e, (yyvsp[(3) - (6)].loc)->layer, (yyvsp[(3) - (6)].loc)->offset);
1847 rtnl_ematch_nbyte_set_pattern(e, (uint8_t *) (yyvsp[(5) - (6)].q).data, (yyvsp[(5) - (6)].q).index);
1855 #line 220 "route/cls/ematch_syntax.y"
1857 struct rtnl_ematch *e;
1860 *errp = strdup(
"Unable to allocate ematch object");
1864 if (rtnl_ematch_set_kind(e, TCF_EM_TEXT) < 0)
1867 rtnl_ematch_text_set_algo(e, (yyvsp[(3) - (7)].s));
1868 rtnl_ematch_text_set_pattern(e, (yyvsp[(4) - (7)].q).data, (yyvsp[(4) - (7)].q).index);
1870 if ((yyvsp[(5) - (7)].loc)) {
1871 rtnl_ematch_text_set_from(e, (yyvsp[(5) - (7)].loc)->layer, (yyvsp[(5) - (7)].loc)->offset);
1875 if ((yyvsp[(6) - (7)].loc)) {
1876 rtnl_ematch_text_set_to(e, (yyvsp[(6) - (7)].loc)->layer, (yyvsp[(6) - (7)].loc)->offset);
1886 #line 247 "route/cls/ematch_syntax.y"
1888 struct rtnl_ematch *e;
1891 *errp = strdup(
"Unable to allocate ematch object");
1895 if (rtnl_ematch_set_kind(e, TCF_EM_META) < 0)
1898 rtnl_ematch_meta_set_lvalue(e, (yyvsp[(3) - (6)].mv));
1899 rtnl_ematch_meta_set_rvalue(e, (yyvsp[(5) - (6)].mv));
1900 rtnl_ematch_meta_set_operand(e, (yyvsp[(4) - (6)].i));
1908 #line 266 "route/cls/ematch_syntax.y"
1910 struct rtnl_ematch *e;
1913 *errp = strdup(
"Unable to allocate ematch object");
1917 if (rtnl_ematch_set_kind(e, TCF_EM_CONTAINER) < 0)
1921 nl_list_add_tail(&e->e_childs, &(yyvsp[(2) - (3)].e)->e_list);
1929 #line 294 "route/cls/ematch_syntax.y"
1930 { (yyval.cmp) = (yyvsp[(3) - (4)].cmp); }
1935 #line 296 "route/cls/ematch_syntax.y"
1936 { (yyval.cmp) = (yyvsp[(1) - (1)].cmp); }
1941 #line 301 "route/cls/ematch_syntax.y"
1943 if ((yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U16 ||
1944 (yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U32)
1945 (yyval.cmp).flags = TCF_EM_CMP_TRANS;
1947 memset(&(yyval.cmp), 0,
sizeof((yyval.cmp)));
1949 (yyval.cmp).mask = (yyvsp[(1) - (3)].loc)->mask;
1950 (yyval.cmp).off = (yyvsp[(1) - (3)].loc)->offset;
1951 (yyval.cmp).align = (yyvsp[(1) - (3)].loc)->align;
1952 (yyval.cmp).layer = (yyvsp[(1) - (3)].loc)->layer;
1953 (yyval.cmp).opnd = (yyvsp[(2) - (3)].i);
1954 (yyval.cmp).val = (yyvsp[(3) - (3)].i);
1962 #line 321 "route/cls/ematch_syntax.y"
1963 { (yyval.loc) = NULL; }
1968 #line 323 "route/cls/ematch_syntax.y"
1969 { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
1974 #line 328 "route/cls/ematch_syntax.y"
1975 { (yyval.loc) = NULL; }
1980 #line 330 "route/cls/ematch_syntax.y"
1981 { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
1986 #line 335 "route/cls/ematch_syntax.y"
1987 { (yyval.mv) = rtnl_meta_value_alloc_var((yyvsp[(1) - (1)].q).data, (yyvsp[(1) - (1)].q).len); }
1992 #line 337 "route/cls/ematch_syntax.y"
1993 { (yyval.mv) = rtnl_meta_value_alloc_int((yyvsp[(1) - (1)].i)); }
1998 #line 339 "route/cls/ematch_syntax.y"
1999 { (yyval.mv) = META_ALLOC(META_INT, (yyvsp[(1) - (3)].i), (yyvsp[(2) - (3)].i), (yyvsp[(3) - (3)].i64)); }
2004 #line 341 "route/cls/ematch_syntax.y"
2005 { (yyval.mv) = META_ALLOC(META_VAR, (yyvsp[(1) - (2)].i), (yyvsp[(2) - (2)].i), 0); }
2010 #line 345 "route/cls/ematch_syntax.y"
2011 { (yyval.i) = META_ID(RANDOM); }
2016 #line 346 "route/cls/ematch_syntax.y"
2017 { (yyval.i) = META_ID(LOADAVG_0); }
2022 #line 347 "route/cls/ematch_syntax.y"
2023 { (yyval.i) = META_ID(LOADAVG_1); }
2028 #line 348 "route/cls/ematch_syntax.y"
2029 { (yyval.i) = META_ID(LOADAVG_2); }
2034 #line 349 "route/cls/ematch_syntax.y"
2035 { (yyval.i) = META_ID(DEV); }
2040 #line 350 "route/cls/ematch_syntax.y"
2041 { (yyval.i) = META_ID(PRIORITY); }
2046 #line 351 "route/cls/ematch_syntax.y"
2047 { (yyval.i) = META_ID(PROTOCOL); }
2052 #line 352 "route/cls/ematch_syntax.y"
2053 { (yyval.i) = META_ID(PKTTYPE); }
2058 #line 353 "route/cls/ematch_syntax.y"
2059 { (yyval.i) = META_ID(PKTLEN); }
2064 #line 354 "route/cls/ematch_syntax.y"
2065 { (yyval.i) = META_ID(DATALEN); }
2070 #line 355 "route/cls/ematch_syntax.y"
2071 { (yyval.i) = META_ID(MACLEN); }
2076 #line 356 "route/cls/ematch_syntax.y"
2077 { (yyval.i) = META_ID(NFMARK); }
2082 #line 357 "route/cls/ematch_syntax.y"
2083 { (yyval.i) = META_ID(TCINDEX); }
2088 #line 358 "route/cls/ematch_syntax.y"
2089 { (yyval.i) = META_ID(RTCLASSID); }
2094 #line 359 "route/cls/ematch_syntax.y"
2095 { (yyval.i) = META_ID(RTIIF); }
2100 #line 360 "route/cls/ematch_syntax.y"
2101 { (yyval.i) = META_ID(SK_FAMILY); }
2106 #line 361 "route/cls/ematch_syntax.y"
2107 { (yyval.i) = META_ID(SK_STATE); }
2112 #line 362 "route/cls/ematch_syntax.y"
2113 { (yyval.i) = META_ID(SK_REUSE); }
2118 #line 363 "route/cls/ematch_syntax.y"
2119 { (yyval.i) = META_ID(SK_REFCNT); }
2124 #line 364 "route/cls/ematch_syntax.y"
2125 { (yyval.i) = META_ID(SK_RCVBUF); }
2130 #line 365 "route/cls/ematch_syntax.y"
2131 { (yyval.i) = META_ID(SK_SNDBUF); }
2136 #line 366 "route/cls/ematch_syntax.y"
2137 { (yyval.i) = META_ID(SK_SHUTDOWN); }
2142 #line 367 "route/cls/ematch_syntax.y"
2143 { (yyval.i) = META_ID(SK_PROTO); }
2148 #line 368 "route/cls/ematch_syntax.y"
2149 { (yyval.i) = META_ID(SK_TYPE); }
2154 #line 369 "route/cls/ematch_syntax.y"
2155 { (yyval.i) = META_ID(SK_RMEM_ALLOC); }
2160 #line 370 "route/cls/ematch_syntax.y"
2161 { (yyval.i) = META_ID(SK_WMEM_ALLOC); }
2166 #line 371 "route/cls/ematch_syntax.y"
2167 { (yyval.i) = META_ID(SK_WMEM_QUEUED); }
2172 #line 372 "route/cls/ematch_syntax.y"
2173 { (yyval.i) = META_ID(SK_RCV_QLEN); }
2178 #line 373 "route/cls/ematch_syntax.y"
2179 { (yyval.i) = META_ID(SK_SND_QLEN); }
2184 #line 374 "route/cls/ematch_syntax.y"
2185 { (yyval.i) = META_ID(SK_ERR_QLEN); }
2190 #line 375 "route/cls/ematch_syntax.y"
2191 { (yyval.i) = META_ID(SK_FORWARD_ALLOCS); }
2196 #line 376 "route/cls/ematch_syntax.y"
2197 { (yyval.i) = META_ID(SK_ALLOCS); }
2202 #line 377 "route/cls/ematch_syntax.y"
2203 { (yyval.i) = META_ID(SK_ROUTE_CAPS); }
2208 #line 378 "route/cls/ematch_syntax.y"
2209 { (yyval.i) = META_ID(SK_HASH); }
2214 #line 379 "route/cls/ematch_syntax.y"
2215 { (yyval.i) = META_ID(SK_LINGERTIME); }
2220 #line 380 "route/cls/ematch_syntax.y"
2221 { (yyval.i) = META_ID(SK_ACK_BACKLOG); }
2226 #line 381 "route/cls/ematch_syntax.y"
2227 { (yyval.i) = META_ID(SK_MAX_ACK_BACKLOG); }
2232 #line 382 "route/cls/ematch_syntax.y"
2233 { (yyval.i) = META_ID(SK_PRIO); }
2238 #line 383 "route/cls/ematch_syntax.y"
2239 { (yyval.i) = META_ID(SK_RCVLOWAT); }
2244 #line 384 "route/cls/ematch_syntax.y"
2245 { (yyval.i) = META_ID(SK_RCVTIMEO); }
2250 #line 385 "route/cls/ematch_syntax.y"
2251 { (yyval.i) = META_ID(SK_SNDTIMEO); }
2256 #line 386 "route/cls/ematch_syntax.y"
2257 { (yyval.i) = META_ID(SK_SENDMSG_OFF); }
2262 #line 387 "route/cls/ematch_syntax.y"
2263 { (yyval.i) = META_ID(SK_WRITE_PENDING); }
2268 #line 388 "route/cls/ematch_syntax.y"
2269 { (yyval.i) = META_ID(VLAN_TAG); }
2274 #line 389 "route/cls/ematch_syntax.y"
2275 { (yyval.i) = META_ID(RXHASH); }
2280 #line 393 "route/cls/ematch_syntax.y"
2281 { (yyval.i) = META_ID(DEV); }
2286 #line 394 "route/cls/ematch_syntax.y"
2287 { (yyval.i) = META_ID(SK_BOUND_IF); }
2292 #line 402 "route/cls/ematch_syntax.y"
2294 (yyval.q) = (yyvsp[(1) - (1)].q);
2300 #line 406 "route/cls/ematch_syntax.y"
2302 struct nl_addr *addr;
2304 if (
nl_addr_parse((yyvsp[(1) - (1)].s), AF_UNSPEC, &addr) == 0) {
2309 if (!((yyval.q).data = calloc(1, (yyval.q).len))) {
2317 if (asprintf(errp,
"invalid pattern \"%s\"", (yyvsp[(1) - (1)].s)) == -1)
2326 #line 435 "route/cls/ematch_syntax.y"
2331 if (asprintf(errp,
"Packet location \"%s\" not found", (yyvsp[(1) - (1)].s)) == -1)
2342 #line 448 "route/cls/ematch_syntax.y"
2346 if ((yyvsp[(5) - (5)].i64) && (!(yyvsp[(1) - (5)].i) || (yyvsp[(1) - (5)].i) > TCF_EM_ALIGN_U32)) {
2347 *errp = strdup(
"mask only allowed for alignments u8|u16|u32");
2352 *errp = strdup(
"Unable to allocate packet location object");
2356 loc->name = strdup(
"<USER-DEFINED>");
2357 loc->align = (yyvsp[(1) - (5)].i);
2358 loc->layer = (yyvsp[(2) - (5)].i);
2359 loc->offset = (yyvsp[(4) - (5)].i);
2360 loc->mask = (yyvsp[(5) - (5)].i64);
2368 #line 473 "route/cls/ematch_syntax.y"
2374 #line 475 "route/cls/ematch_syntax.y"
2375 { (yyval.i) = (yyvsp[(1) - (2)].i); }
2380 #line 477 "route/cls/ematch_syntax.y"
2381 { (yyval.i) = (yyvsp[(1) - (2)].i); }
2386 #line 482 "route/cls/ematch_syntax.y"
2387 { (yyval.i64) = 0; }
2392 #line 484 "route/cls/ematch_syntax.y"
2393 { (yyval.i64) = (yyvsp[(2) - (2)].i); }
2398 #line 489 "route/cls/ematch_syntax.y"
2404 #line 491 "route/cls/ematch_syntax.y"
2405 { (yyval.i) = (yyvsp[(2) - (2)].i); }
2410 #line 496 "route/cls/ematch_syntax.y"
2411 { (yyval.i) = TCF_EM_OPND_EQ; }
2416 #line 498 "route/cls/ematch_syntax.y"
2417 { (yyval.i) = TCF_EM_OPND_GT; }
2422 #line 500 "route/cls/ematch_syntax.y"
2423 { (yyval.i) = TCF_EM_OPND_LT; }
2428 #line 2429 "route/cls/ematch_syntax.c"
2442 YY_SYMBOL_PRINT (
"-> $$ =", yyr1[yyn], &yyval, &yyloc);
2446 YY_STACK_PRINT (yyss, yyssp);
2456 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2457 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2458 yystate = yytable[yystate];
2460 yystate = yydefgoto[yyn - YYNTOKENS];
2471 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2477 #if ! YYERROR_VERBOSE
2478 yyerror (scanner, errp, root, YY_(
"syntax error"));
2480 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2483 char const *yymsgp = YY_(
"syntax error");
2484 int yysyntax_error_status;
2485 yysyntax_error_status = YYSYNTAX_ERROR;
2486 if (yysyntax_error_status == 0)
2488 else if (yysyntax_error_status == 1)
2490 if (yymsg != yymsgbuf)
2491 YYSTACK_FREE (yymsg);
2492 yymsg = (
char *) YYSTACK_ALLOC (yymsg_alloc);
2496 yymsg_alloc =
sizeof yymsgbuf;
2497 yysyntax_error_status = 2;
2501 yysyntax_error_status = YYSYNTAX_ERROR;
2505 yyerror (scanner, errp, root, yymsgp);
2506 if (yysyntax_error_status == 2)
2507 goto yyexhaustedlab;
2509 # undef YYSYNTAX_ERROR
2515 if (yyerrstatus == 3)
2520 if (yychar <= YYEOF)
2523 if (yychar == YYEOF)
2528 yydestruct (
"Error: discarding",
2529 yytoken, &yylval, scanner, errp, root);
2554 YY_STACK_PRINT (yyss, yyssp);
2567 yyn = yypact[yystate];
2568 if (!yypact_value_is_default (yyn))
2571 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2584 yydestruct (
"Error: popping",
2585 yystos[yystate], yyvsp, scanner, errp, root);
2588 YY_STACK_PRINT (yyss, yyssp);
2591 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2593 YY_IGNORE_MAYBE_UNINITIALIZED_END
2597 YY_SYMBOL_PRINT (
"Shifting", yystos[yyn], yyvsp, yylsp);
2617 #if !defined yyoverflow || YYERROR_VERBOSE
2622 yyerror (scanner, errp, root, YY_(
"memory exhausted"));
2628 if (yychar != YYEMPTY)
2632 yytoken = YYTRANSLATE (yychar);
2633 yydestruct (
"Cleanup: discarding lookahead",
2634 yytoken, &yylval, scanner, errp, root);
2639 YY_STACK_PRINT (yyss, yyssp);
2640 while (yyssp != yyss)
2642 yydestruct (
"Cleanup: popping",
2643 yystos[*yyssp], yyvsp, scanner, errp, root);
2648 YYSTACK_FREE (yyss);
2651 if (yymsg != yymsgbuf)
2652 YYSTACK_FREE (yymsg);
2655 return YYID (yyresult);