47 #define YYBISON_VERSION "2.7"
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
903 #ifndef YY_LOCATION_PRINT
904 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
910 # define YYLEX yylex (&yylval, YYLEX_PARAM)
912 # define YYLEX yylex (&yylval, scanner)
920 # define YYFPRINTF fprintf
923 # define YYDPRINTF(Args) \
929 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
933 YYFPRINTF (stderr, "%s ", Title); \
934 yy_symbol_print (stderr, \
935 Type, Value, scanner, errp, root); \
936 YYFPRINTF (stderr, "\n"); \
946 #if (defined __STDC__ || defined __C99__FUNC__ \
947 || defined __cplusplus || defined _MSC_VER)
949 yy_symbol_value_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
952 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
955 YYSTYPE const * const yyvaluep;
961 FILE *yyo = yyoutput;
969 if (yytype < YYNTOKENS)
970 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
986 #if (defined __STDC__ || defined __C99__FUNC__ \
987 || defined __cplusplus || defined _MSC_VER)
989 yy_symbol_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
992 yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
995 YYSTYPE const * const yyvaluep;
1001 if (yytype < YYNTOKENS)
1002 YYFPRINTF (yyoutput,
"token %s (", yytname[yytype]);
1004 YYFPRINTF (yyoutput,
"nterm %s (", yytname[yytype]);
1006 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root);
1007 YYFPRINTF (yyoutput,
")");
1015 #if (defined __STDC__ || defined __C99__FUNC__ \
1016 || defined __cplusplus || defined _MSC_VER)
1018 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1021 yy_stack_print (yybottom, yytop)
1022 yytype_int16 *yybottom;
1023 yytype_int16 *yytop;
1026 YYFPRINTF (stderr,
"Stack now");
1027 for (; yybottom <= yytop; yybottom++)
1029 int yybot = *yybottom;
1030 YYFPRINTF (stderr,
" %d", yybot);
1032 YYFPRINTF (stderr,
"\n");
1035 # define YY_STACK_PRINT(Bottom, Top) \
1038 yy_stack_print ((Bottom), (Top)); \
1046 #if (defined __STDC__ || defined __C99__FUNC__ \
1047 || defined __cplusplus || defined _MSC_VER)
1049 yy_reduce_print (
YYSTYPE *yyvsp,
int yyrule,
void *scanner,
char **errp,
struct nl_list_head *root)
1052 yy_reduce_print (yyvsp, yyrule, scanner, errp, root)
1060 int yynrhs = yyr2[yyrule];
1062 unsigned long int yylno = yyrline[yyrule];
1063 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
1066 for (yyi = 0; yyi < yynrhs; yyi++)
1068 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
1069 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1070 &(yyvsp[(yyi + 1) - (yynrhs)])
1071 , scanner, errp, root);
1072 YYFPRINTF (stderr,
"\n");
1076 # define YY_REDUCE_PRINT(Rule) \
1079 yy_reduce_print (yyvsp, Rule, scanner, errp, root); \
1086 # define YYDPRINTF(Args)
1087 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1088 # define YY_STACK_PRINT(Bottom, Top)
1089 # define YY_REDUCE_PRINT(Rule)
1095 # define YYINITDEPTH 200
1106 # define YYMAXDEPTH 10000
1113 # if defined __GLIBC__ && defined _STRING_H
1114 # define yystrlen strlen
1117 #if (defined __STDC__ || defined __C99__FUNC__ \
1118 || defined __cplusplus || defined _MSC_VER)
1120 yystrlen (
const char *yystr)
1128 for (yylen = 0; yystr[yylen]; yylen++)
1136 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1137 # define yystpcpy stpcpy
1141 #if (defined __STDC__ || defined __C99__FUNC__ \
1142 || defined __cplusplus || defined _MSC_VER)
1144 yystpcpy (
char *yydest,
const char *yysrc)
1147 yystpcpy (yydest, yysrc)
1153 const char *yys = yysrc;
1155 while ((*yyd++ = *yys++) !=
'\0')
1172 yytnamerr (
char *yyres,
const char *yystr)
1177 char const *yyp = yystr;
1184 goto do_not_strip_quotes;
1188 goto do_not_strip_quotes;
1201 do_not_strip_quotes: ;
1205 return yystrlen (yystr);
1207 return yystpcpy (yyres, yystr) - yyres;
1220 yysyntax_error (YYSIZE_T *yymsg_alloc,
char **yymsg,
1221 yytype_int16 *yyssp,
int yytoken)
1223 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1224 YYSIZE_T yysize = yysize0;
1225 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1227 const char *yyformat = YY_NULL;
1229 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1261 if (yytoken != YYEMPTY)
1263 int yyn = yypact[*yyssp];
1264 yyarg[yycount++] = yytname[yytoken];
1265 if (!yypact_value_is_default (yyn))
1270 int yyxbegin = yyn < 0 ? -yyn : 0;
1272 int yychecklim = YYLAST - yyn + 1;
1273 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1276 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1277 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1278 && !yytable_value_is_error (yytable[yyx + yyn]))
1280 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1286 yyarg[yycount++] = yytname[yyx];
1288 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1289 if (! (yysize <= yysize1
1290 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1300 # define YYCASE_(N, S) \
1304 YYCASE_(0, YY_(
"syntax error"));
1305 YYCASE_(1, YY_(
"syntax error, unexpected %s"));
1306 YYCASE_(2, YY_(
"syntax error, unexpected %s, expecting %s"));
1307 YYCASE_(3, YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1308 YYCASE_(4, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1309 YYCASE_(5, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1314 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1315 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1320 if (*yymsg_alloc < yysize)
1322 *yymsg_alloc = 2 * yysize;
1323 if (! (yysize <= *yymsg_alloc
1324 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1325 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1335 while ((*yyp = *yyformat) !=
'\0')
1336 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1338 yyp += yytnamerr (yyp, yyarg[yyi++]);
1356 #if (defined __STDC__ || defined __C99__FUNC__ \
1357 || defined __cplusplus || defined _MSC_VER)
1359 yydestruct (
const char *yymsg,
int yytype,
YYSTYPE *yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
1362 yydestruct (yymsg, yytype, yyvaluep, scanner, errp, root)
1378 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1384 #line 139 "route/cls/ematch_syntax.y"
1385 { free(((*yyvaluep).s)); NL_DBG(2,
"string destructor\n"); };
1387 #line 1388 "route/cls/ematch_syntax.c"
1391 #line 141 "route/cls/ematch_syntax.y"
1392 { free(((*yyvaluep).q).data); NL_DBG(2,
"quoted destructor\n"); };
1394 #line 1395 "route/cls/ematch_syntax.c"
1398 #line 140 "route/cls/ematch_syntax.y"
1399 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); };
1401 #line 1402 "route/cls/ematch_syntax.c"
1405 #line 140 "route/cls/ematch_syntax.y"
1406 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); };
1408 #line 1409 "route/cls/ematch_syntax.c"
1412 #line 142 "route/cls/ematch_syntax.y"
1413 { rtnl_meta_value_put(((*yyvaluep).mv)); NL_DBG(2,
"meta value destructor\n"); };
1415 #line 1416 "route/cls/ematch_syntax.c"
1419 #line 141 "route/cls/ematch_syntax.y"
1420 { free(((*yyvaluep).q).data); NL_DBG(2,
"quoted destructor\n"); };
1422 #line 1423 "route/cls/ematch_syntax.c"
1426 #line 140 "route/cls/ematch_syntax.y"
1427 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); };
1429 #line 1430 "route/cls/ematch_syntax.c"
1444 #ifdef YYPARSE_PARAM
1445 #if (defined __STDC__ || defined __C99__FUNC__ \
1446 || defined __cplusplus || defined _MSC_VER)
1448 yyparse (
void *YYPARSE_PARAM)
1451 yyparse (YYPARSE_PARAM)
1452 void *YYPARSE_PARAM;
1455 #if (defined __STDC__ || defined __C99__FUNC__ \
1456 || defined __cplusplus || defined _MSC_VER)
1458 yyparse (
void *scanner,
char **errp,
struct nl_list_head *root)
1461 yyparse (scanner, errp, root)
1472 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1474 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1475 _Pragma ("GCC diagnostic push") \
1476 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1477 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1478 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1479 _Pragma ("GCC diagnostic pop")
1484 # define YY_INITIAL_VALUE(Value) = Value
1486 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1487 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1488 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1490 #ifndef YY_INITIAL_VALUE
1491 # define YY_INITIAL_VALUE(Value)
1495 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
1512 yytype_int16 yyssa[YYINITDEPTH];
1514 yytype_int16 *yyssp;
1521 YYSIZE_T yystacksize;
1534 char *yymsg = yymsgbuf;
1535 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1538 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1544 yyssp = yyss = yyssa;
1545 yyvsp = yyvs = yyvsa;
1546 yystacksize = YYINITDEPTH;
1548 YYDPRINTF ((stderr,
"Starting parse\n"));
1567 if (yyss + yystacksize - 1 <= yyssp)
1570 YYSIZE_T yysize = yyssp - yyss + 1;
1578 yytype_int16 *yyss1 = yyss;
1584 yyoverflow (YY_(
"memory exhausted"),
1585 &yyss1, yysize *
sizeof (*yyssp),
1586 &yyvs1, yysize *
sizeof (*yyvsp),
1593 # ifndef YYSTACK_RELOCATE
1594 goto yyexhaustedlab;
1597 if (YYMAXDEPTH <= yystacksize)
1598 goto yyexhaustedlab;
1600 if (YYMAXDEPTH < yystacksize)
1601 yystacksize = YYMAXDEPTH;
1604 yytype_int16 *yyss1 = yyss;
1606 (
union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1608 goto yyexhaustedlab;
1609 YYSTACK_RELOCATE (yyss_alloc, yyss);
1610 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1611 # undef YYSTACK_RELOCATE
1613 YYSTACK_FREE (yyss1);
1618 yyssp = yyss + yysize - 1;
1619 yyvsp = yyvs + yysize - 1;
1621 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1622 (
unsigned long int) yystacksize));
1624 if (yyss + yystacksize - 1 <= yyssp)
1628 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1630 if (yystate == YYFINAL)
1644 yyn = yypact[yystate];
1645 if (yypact_value_is_default (yyn))
1651 if (yychar == YYEMPTY)
1653 YYDPRINTF ((stderr,
"Reading a token: "));
1657 if (yychar <= YYEOF)
1659 yychar = yytoken = YYEOF;
1660 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1664 yytoken = YYTRANSLATE (yychar);
1665 YY_SYMBOL_PRINT (
"Next token is", yytoken, &yylval, &yylloc);
1671 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1676 if (yytable_value_is_error (yyn))
1688 YY_SYMBOL_PRINT (
"Shifting", yytoken, &yylval, &yylloc);
1694 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1696 YY_IGNORE_MAYBE_UNINITIALIZED_END
1705 yyn = yydefact[yystate];
1726 yyval = yyvsp[1-yylen];
1729 YY_REDUCE_PRINT (yyn);
1734 #line 151 "route/cls/ematch_syntax.y"
1736 nl_list_add_tail(root, &(yyvsp[(1) - (1)].e)->e_list);
1742 #line 158 "route/cls/ematch_syntax.y"
1744 (yyval.e) = (yyvsp[(1) - (1)].e);
1750 #line 162 "route/cls/ematch_syntax.y"
1752 rtnl_ematch_set_flags((yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].i));
1755 nl_list_add_tail(&(yyvsp[(1) - (3)].e)->e_list, &(yyvsp[(3) - (3)].e)->e_list);
1757 (yyval.e) = (yyvsp[(1) - (3)].e);
1763 #line 174 "route/cls/ematch_syntax.y"
1765 rtnl_ematch_set_flags((yyvsp[(2) - (2)].e), TCF_EM_INVERT);
1766 (yyval.e) = (yyvsp[(2) - (2)].e);
1772 #line 179 "route/cls/ematch_syntax.y"
1774 (yyval.e) = (yyvsp[(1) - (1)].e);
1780 #line 187 "route/cls/ematch_syntax.y"
1782 struct rtnl_ematch *e;
1785 *errp = strdup(
"Unable to allocate ematch object");
1789 if (rtnl_ematch_set_kind(e, TCF_EM_CMP) < 0)
1792 rtnl_ematch_cmp_set(e, &(yyvsp[(1) - (1)].cmp));
1799 #line 202 "route/cls/ematch_syntax.y"
1801 struct rtnl_ematch *e;
1804 *errp = strdup(
"Unable to allocate ematch object");
1808 if (rtnl_ematch_set_kind(e, TCF_EM_NBYTE) < 0)
1811 rtnl_ematch_nbyte_set_offset(e, (yyvsp[(3) - (6)].loc)->layer, (yyvsp[(3) - (6)].loc)->offset);
1813 rtnl_ematch_nbyte_set_pattern(e, (uint8_t *) (yyvsp[(5) - (6)].q).data, (yyvsp[(5) - (6)].q).index);
1821 #line 220 "route/cls/ematch_syntax.y"
1823 struct rtnl_ematch *e;
1826 *errp = strdup(
"Unable to allocate ematch object");
1830 if (rtnl_ematch_set_kind(e, TCF_EM_TEXT) < 0)
1833 rtnl_ematch_text_set_algo(e, (yyvsp[(3) - (7)].s));
1834 rtnl_ematch_text_set_pattern(e, (yyvsp[(4) - (7)].q).data, (yyvsp[(4) - (7)].q).index);
1836 if ((yyvsp[(5) - (7)].loc)) {
1837 rtnl_ematch_text_set_from(e, (yyvsp[(5) - (7)].loc)->layer, (yyvsp[(5) - (7)].loc)->offset);
1841 if ((yyvsp[(6) - (7)].loc)) {
1842 rtnl_ematch_text_set_to(e, (yyvsp[(6) - (7)].loc)->layer, (yyvsp[(6) - (7)].loc)->offset);
1852 #line 247 "route/cls/ematch_syntax.y"
1854 struct rtnl_ematch *e;
1857 *errp = strdup(
"Unable to allocate ematch object");
1861 if (rtnl_ematch_set_kind(e, TCF_EM_META) < 0)
1864 rtnl_ematch_meta_set_lvalue(e, (yyvsp[(3) - (6)].mv));
1865 rtnl_ematch_meta_set_rvalue(e, (yyvsp[(5) - (6)].mv));
1866 rtnl_ematch_meta_set_operand(e, (yyvsp[(4) - (6)].i));
1874 #line 266 "route/cls/ematch_syntax.y"
1876 struct rtnl_ematch *e;
1879 *errp = strdup(
"Unable to allocate ematch object");
1883 if (rtnl_ematch_set_kind(e, TCF_EM_CONTAINER) < 0)
1887 nl_list_add_tail(&e->e_childs, &(yyvsp[(2) - (3)].e)->e_list);
1895 #line 294 "route/cls/ematch_syntax.y"
1896 { (yyval.cmp) = (yyvsp[(3) - (4)].cmp); }
1901 #line 296 "route/cls/ematch_syntax.y"
1902 { (yyval.cmp) = (yyvsp[(1) - (1)].cmp); }
1907 #line 301 "route/cls/ematch_syntax.y"
1909 if ((yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U16 ||
1910 (yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U32)
1911 (yyval.cmp).flags = TCF_EM_CMP_TRANS;
1913 memset(&(yyval.cmp), 0,
sizeof((yyval.cmp)));
1915 (yyval.cmp).mask = (yyvsp[(1) - (3)].loc)->mask;
1916 (yyval.cmp).off = (yyvsp[(1) - (3)].loc)->offset;
1917 (yyval.cmp).align = (yyvsp[(1) - (3)].loc)->align;
1918 (yyval.cmp).layer = (yyvsp[(1) - (3)].loc)->layer;
1919 (yyval.cmp).opnd = (yyvsp[(2) - (3)].i);
1920 (yyval.cmp).val = (yyvsp[(3) - (3)].i);
1928 #line 321 "route/cls/ematch_syntax.y"
1929 { (yyval.loc) = NULL; }
1934 #line 323 "route/cls/ematch_syntax.y"
1935 { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
1940 #line 328 "route/cls/ematch_syntax.y"
1941 { (yyval.loc) = NULL; }
1946 #line 330 "route/cls/ematch_syntax.y"
1947 { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
1952 #line 335 "route/cls/ematch_syntax.y"
1953 { (yyval.mv) = rtnl_meta_value_alloc_var((yyvsp[(1) - (1)].q).data, (yyvsp[(1) - (1)].q).len); }
1958 #line 337 "route/cls/ematch_syntax.y"
1959 { (yyval.mv) = rtnl_meta_value_alloc_int((yyvsp[(1) - (1)].i)); }
1964 #line 339 "route/cls/ematch_syntax.y"
1965 { (yyval.mv) = META_ALLOC(META_INT, (yyvsp[(1) - (3)].i), (yyvsp[(2) - (3)].i), (yyvsp[(3) - (3)].i64)); }
1970 #line 341 "route/cls/ematch_syntax.y"
1971 { (yyval.mv) = META_ALLOC(META_VAR, (yyvsp[(1) - (2)].i), (yyvsp[(2) - (2)].i), 0); }
1976 #line 345 "route/cls/ematch_syntax.y"
1977 { (yyval.i) = META_ID(RANDOM); }
1982 #line 346 "route/cls/ematch_syntax.y"
1983 { (yyval.i) = META_ID(LOADAVG_0); }
1988 #line 347 "route/cls/ematch_syntax.y"
1989 { (yyval.i) = META_ID(LOADAVG_1); }
1994 #line 348 "route/cls/ematch_syntax.y"
1995 { (yyval.i) = META_ID(LOADAVG_2); }
2000 #line 349 "route/cls/ematch_syntax.y"
2001 { (yyval.i) = META_ID(DEV); }
2006 #line 350 "route/cls/ematch_syntax.y"
2007 { (yyval.i) = META_ID(PRIORITY); }
2012 #line 351 "route/cls/ematch_syntax.y"
2013 { (yyval.i) = META_ID(PROTOCOL); }
2018 #line 352 "route/cls/ematch_syntax.y"
2019 { (yyval.i) = META_ID(PKTTYPE); }
2024 #line 353 "route/cls/ematch_syntax.y"
2025 { (yyval.i) = META_ID(PKTLEN); }
2030 #line 354 "route/cls/ematch_syntax.y"
2031 { (yyval.i) = META_ID(DATALEN); }
2036 #line 355 "route/cls/ematch_syntax.y"
2037 { (yyval.i) = META_ID(MACLEN); }
2042 #line 356 "route/cls/ematch_syntax.y"
2043 { (yyval.i) = META_ID(NFMARK); }
2048 #line 357 "route/cls/ematch_syntax.y"
2049 { (yyval.i) = META_ID(TCINDEX); }
2054 #line 358 "route/cls/ematch_syntax.y"
2055 { (yyval.i) = META_ID(RTCLASSID); }
2060 #line 359 "route/cls/ematch_syntax.y"
2061 { (yyval.i) = META_ID(RTIIF); }
2066 #line 360 "route/cls/ematch_syntax.y"
2067 { (yyval.i) = META_ID(SK_FAMILY); }
2072 #line 361 "route/cls/ematch_syntax.y"
2073 { (yyval.i) = META_ID(SK_STATE); }
2078 #line 362 "route/cls/ematch_syntax.y"
2079 { (yyval.i) = META_ID(SK_REUSE); }
2084 #line 363 "route/cls/ematch_syntax.y"
2085 { (yyval.i) = META_ID(SK_REFCNT); }
2090 #line 364 "route/cls/ematch_syntax.y"
2091 { (yyval.i) = META_ID(SK_RCVBUF); }
2096 #line 365 "route/cls/ematch_syntax.y"
2097 { (yyval.i) = META_ID(SK_SNDBUF); }
2102 #line 366 "route/cls/ematch_syntax.y"
2103 { (yyval.i) = META_ID(SK_SHUTDOWN); }
2108 #line 367 "route/cls/ematch_syntax.y"
2109 { (yyval.i) = META_ID(SK_PROTO); }
2114 #line 368 "route/cls/ematch_syntax.y"
2115 { (yyval.i) = META_ID(SK_TYPE); }
2120 #line 369 "route/cls/ematch_syntax.y"
2121 { (yyval.i) = META_ID(SK_RMEM_ALLOC); }
2126 #line 370 "route/cls/ematch_syntax.y"
2127 { (yyval.i) = META_ID(SK_WMEM_ALLOC); }
2132 #line 371 "route/cls/ematch_syntax.y"
2133 { (yyval.i) = META_ID(SK_WMEM_QUEUED); }
2138 #line 372 "route/cls/ematch_syntax.y"
2139 { (yyval.i) = META_ID(SK_RCV_QLEN); }
2144 #line 373 "route/cls/ematch_syntax.y"
2145 { (yyval.i) = META_ID(SK_SND_QLEN); }
2150 #line 374 "route/cls/ematch_syntax.y"
2151 { (yyval.i) = META_ID(SK_ERR_QLEN); }
2156 #line 375 "route/cls/ematch_syntax.y"
2157 { (yyval.i) = META_ID(SK_FORWARD_ALLOCS); }
2162 #line 376 "route/cls/ematch_syntax.y"
2163 { (yyval.i) = META_ID(SK_ALLOCS); }
2168 #line 377 "route/cls/ematch_syntax.y"
2169 { (yyval.i) = META_ID(SK_ROUTE_CAPS); }
2174 #line 378 "route/cls/ematch_syntax.y"
2175 { (yyval.i) = META_ID(SK_HASH); }
2180 #line 379 "route/cls/ematch_syntax.y"
2181 { (yyval.i) = META_ID(SK_LINGERTIME); }
2186 #line 380 "route/cls/ematch_syntax.y"
2187 { (yyval.i) = META_ID(SK_ACK_BACKLOG); }
2192 #line 381 "route/cls/ematch_syntax.y"
2193 { (yyval.i) = META_ID(SK_MAX_ACK_BACKLOG); }
2198 #line 382 "route/cls/ematch_syntax.y"
2199 { (yyval.i) = META_ID(SK_PRIO); }
2204 #line 383 "route/cls/ematch_syntax.y"
2205 { (yyval.i) = META_ID(SK_RCVLOWAT); }
2210 #line 384 "route/cls/ematch_syntax.y"
2211 { (yyval.i) = META_ID(SK_RCVTIMEO); }
2216 #line 385 "route/cls/ematch_syntax.y"
2217 { (yyval.i) = META_ID(SK_SNDTIMEO); }
2222 #line 386 "route/cls/ematch_syntax.y"
2223 { (yyval.i) = META_ID(SK_SENDMSG_OFF); }
2228 #line 387 "route/cls/ematch_syntax.y"
2229 { (yyval.i) = META_ID(SK_WRITE_PENDING); }
2234 #line 388 "route/cls/ematch_syntax.y"
2235 { (yyval.i) = META_ID(VLAN_TAG); }
2240 #line 389 "route/cls/ematch_syntax.y"
2241 { (yyval.i) = META_ID(RXHASH); }
2246 #line 393 "route/cls/ematch_syntax.y"
2247 { (yyval.i) = META_ID(DEV); }
2252 #line 394 "route/cls/ematch_syntax.y"
2253 { (yyval.i) = META_ID(SK_BOUND_IF); }
2258 #line 402 "route/cls/ematch_syntax.y"
2260 (yyval.q) = (yyvsp[(1) - (1)].q);
2266 #line 406 "route/cls/ematch_syntax.y"
2268 struct nl_addr *addr;
2270 if (
nl_addr_parse((yyvsp[(1) - (1)].s), AF_UNSPEC, &addr) == 0) {
2275 if (!((yyval.q).data = calloc(1, (yyval.q).len))) {
2283 if (asprintf(errp,
"invalid pattern \"%s\"", (yyvsp[(1) - (1)].s)) == -1)
2292 #line 435 "route/cls/ematch_syntax.y"
2297 if (asprintf(errp,
"Packet location \"%s\" not found", (yyvsp[(1) - (1)].s)) == -1)
2308 #line 448 "route/cls/ematch_syntax.y"
2312 if ((yyvsp[(5) - (5)].i64) && (!(yyvsp[(1) - (5)].i) || (yyvsp[(1) - (5)].i) > TCF_EM_ALIGN_U32)) {
2313 *errp = strdup(
"mask only allowed for alignments u8|u16|u32");
2318 *errp = strdup(
"Unable to allocate packet location object");
2322 loc->name = strdup(
"<USER-DEFINED>");
2323 loc->align = (yyvsp[(1) - (5)].i);
2324 loc->layer = (yyvsp[(2) - (5)].i);
2325 loc->offset = (yyvsp[(4) - (5)].i);
2326 loc->mask = (yyvsp[(5) - (5)].i64);
2334 #line 473 "route/cls/ematch_syntax.y"
2340 #line 475 "route/cls/ematch_syntax.y"
2341 { (yyval.i) = (yyvsp[(1) - (2)].i); }
2346 #line 477 "route/cls/ematch_syntax.y"
2347 { (yyval.i) = (yyvsp[(1) - (2)].i); }
2352 #line 482 "route/cls/ematch_syntax.y"
2353 { (yyval.i64) = 0; }
2358 #line 484 "route/cls/ematch_syntax.y"
2359 { (yyval.i64) = (yyvsp[(2) - (2)].i); }
2364 #line 489 "route/cls/ematch_syntax.y"
2370 #line 491 "route/cls/ematch_syntax.y"
2371 { (yyval.i) = (yyvsp[(2) - (2)].i); }
2376 #line 496 "route/cls/ematch_syntax.y"
2377 { (yyval.i) = TCF_EM_OPND_EQ; }
2382 #line 498 "route/cls/ematch_syntax.y"
2383 { (yyval.i) = TCF_EM_OPND_GT; }
2388 #line 500 "route/cls/ematch_syntax.y"
2389 { (yyval.i) = TCF_EM_OPND_LT; }
2394 #line 2395 "route/cls/ematch_syntax.c"
2408 YY_SYMBOL_PRINT (
"-> $$ =", yyr1[yyn], &yyval, &yyloc);
2412 YY_STACK_PRINT (yyss, yyssp);
2422 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2423 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2424 yystate = yytable[yystate];
2426 yystate = yydefgoto[yyn - YYNTOKENS];
2437 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2443 #if ! YYERROR_VERBOSE
2444 yyerror (scanner, errp, root, YY_(
"syntax error"));
2446 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2449 char const *yymsgp = YY_(
"syntax error");
2450 int yysyntax_error_status;
2451 yysyntax_error_status = YYSYNTAX_ERROR;
2452 if (yysyntax_error_status == 0)
2454 else if (yysyntax_error_status == 1)
2456 if (yymsg != yymsgbuf)
2457 YYSTACK_FREE (yymsg);
2458 yymsg = (
char *) YYSTACK_ALLOC (yymsg_alloc);
2462 yymsg_alloc =
sizeof yymsgbuf;
2463 yysyntax_error_status = 2;
2467 yysyntax_error_status = YYSYNTAX_ERROR;
2471 yyerror (scanner, errp, root, yymsgp);
2472 if (yysyntax_error_status == 2)
2473 goto yyexhaustedlab;
2475 # undef YYSYNTAX_ERROR
2481 if (yyerrstatus == 3)
2486 if (yychar <= YYEOF)
2489 if (yychar == YYEOF)
2494 yydestruct (
"Error: discarding",
2495 yytoken, &yylval, scanner, errp, root);
2520 YY_STACK_PRINT (yyss, yyssp);
2533 yyn = yypact[yystate];
2534 if (!yypact_value_is_default (yyn))
2537 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2550 yydestruct (
"Error: popping",
2551 yystos[yystate], yyvsp, scanner, errp, root);
2554 YY_STACK_PRINT (yyss, yyssp);
2557 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2559 YY_IGNORE_MAYBE_UNINITIALIZED_END
2563 YY_SYMBOL_PRINT (
"Shifting", yystos[yyn], yyvsp, yylsp);
2583 #if !defined yyoverflow || YYERROR_VERBOSE
2588 yyerror (scanner, errp, root, YY_(
"memory exhausted"));
2594 if (yychar != YYEMPTY)
2598 yytoken = YYTRANSLATE (yychar);
2599 yydestruct (
"Cleanup: discarding lookahead",
2600 yytoken, &yylval, scanner, errp, root);
2605 YY_STACK_PRINT (yyss, yyssp);
2606 while (yyssp != yyss)
2608 yydestruct (
"Cleanup: popping",
2609 yystos[*yyssp], yyvsp, scanner, errp, root);
2614 YYSTACK_FREE (yyss);
2617 if (yymsg != yymsgbuf)
2618 YYSTACK_FREE (yymsg);
2621 return YYID (yyresult);
unsigned int nl_addr_get_prefixlen(const struct nl_addr *addr)
Return prefix length of abstract address object.
int nl_addr_parse(const char *addrstr, int hint, struct nl_addr **result)
Allocate abstract address based on character string.
struct rtnl_pktloc * rtnl_pktloc_alloc(void)
Allocate packet location object.
struct rtnl_ematch * rtnl_ematch_alloc(void)
Allocate ematch object.
void rtnl_pktloc_put(struct rtnl_pktloc *loc)
Return reference of a packet location.
void nl_addr_put(struct nl_addr *addr)
Decrease the reference counter of an abstract address.
int rtnl_pktloc_lookup(const char *name, struct rtnl_pktloc **result)
Lookup packet location alias.
unsigned int nl_addr_get_len(const struct nl_addr *addr)
Get length of binary address of abstract address object.
void * nl_addr_get_binary_addr(const struct nl_addr *addr)
Get binary address of abstract address object.