47 #define YYBISON_VERSION "3.0.4" 50 #define YYSKELETON_NAME "yacc.c" 63 #define yyparse ematch_parse 64 #define yylex ematch_lex 65 #define yyerror ematch_error 66 #define yydebug ematch_debug 67 #define yynerrs ematch_nerrs 71 #line 12 "lib/route/cls/ematch_syntax.y" 73 #include <netlink-private/netlink.h> 74 #include <netlink-private/tc.h> 75 #include <netlink/netlink.h> 76 #include <netlink/utils.h> 77 #include <netlink/route/pktloc.h> 78 #include <netlink/route/cls/ematch.h> 79 #include <netlink/route/cls/ematch/cmp.h> 80 #include <netlink/route/cls/ematch/nbyte.h> 81 #include <netlink/route/cls/ematch/text.h> 82 #include <netlink/route/cls/ematch/meta.h> 83 #include <linux/tc_ematch/tc_em_meta.h> 84 #include <linux/tc_ematch/tc_em_cmp.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 91 #line 92 "lib/route/cls/ematch_syntax.c" 94 # if defined __cplusplus && 201103L <= __cplusplus 95 # define YY_NULLPTR nullptr 102 #ifdef YYERROR_VERBOSE 103 # undef YYERROR_VERBOSE 104 # define YYERROR_VERBOSE 1 106 # define YYERROR_VERBOSE 1 111 #ifndef YY_EMATCH_LIB_ROUTE_CLS_EMATCH_SYNTAX_H_INCLUDED 112 # define YY_EMATCH_LIB_ROUTE_CLS_EMATCH_SYNTAX_H_INCLUDED 118 extern int ematch_debug;
149 META_LOADAVG_0 = 281,
150 META_LOADAVG_1 = 282,
151 META_LOADAVG_2 = 283,
161 META_RTCLASSID = 293,
163 META_SK_FAMILY = 295,
166 META_SK_REFCNT = 298,
167 META_SK_RCVBUF = 299,
168 META_SK_SNDBUF = 300,
169 META_SK_SHUTDOWN = 301,
172 META_SK_RMEM_ALLOC = 304,
173 META_SK_WMEM_ALLOC = 305,
174 META_SK_WMEM_QUEUED = 306,
175 META_SK_RCV_QLEN = 307,
176 META_SK_SND_QLEN = 308,
177 META_SK_ERR_QLEN = 309,
178 META_SK_FORWARD_ALLOCS = 310,
179 META_SK_ALLOCS = 311,
180 META_SK_ROUTE_CAPS = 312,
182 META_SK_LINGERTIME = 314,
183 META_SK_ACK_BACKLOG = 315,
184 META_SK_MAX_ACK_BACKLOG = 316,
186 META_SK_RCVLOWAT = 318,
187 META_SK_RCVTIMEO = 319,
188 META_SK_SNDTIMEO = 320,
189 META_SK_SENDMSG_OFF = 321,
190 META_SK_WRITE_PENDING = 322,
194 META_SK_BOUND_IF = 326,
213 #define EMATCH_CMP 271 214 #define EMATCH_NBYTE 272 215 #define EMATCH_TEXT 273 216 #define EMATCH_META 274 222 #define META_RANDOM 280 223 #define META_LOADAVG_0 281 224 #define META_LOADAVG_1 282 225 #define META_LOADAVG_2 283 227 #define META_PRIO 285 228 #define META_PROTO 286 229 #define META_PKTTYPE 287 230 #define META_PKTLEN 288 231 #define META_DATALEN 289 232 #define META_MACLEN 290 233 #define META_MARK 291 234 #define META_TCINDEX 292 235 #define META_RTCLASSID 293 236 #define META_RTIIF 294 237 #define META_SK_FAMILY 295 238 #define META_SK_STATE 296 239 #define META_SK_REUSE 297 240 #define META_SK_REFCNT 298 241 #define META_SK_RCVBUF 299 242 #define META_SK_SNDBUF 300 243 #define META_SK_SHUTDOWN 301 244 #define META_SK_PROTO 302 245 #define META_SK_TYPE 303 246 #define META_SK_RMEM_ALLOC 304 247 #define META_SK_WMEM_ALLOC 305 248 #define META_SK_WMEM_QUEUED 306 249 #define META_SK_RCV_QLEN 307 250 #define META_SK_SND_QLEN 308 251 #define META_SK_ERR_QLEN 309 252 #define META_SK_FORWARD_ALLOCS 310 253 #define META_SK_ALLOCS 311 254 #define META_SK_ROUTE_CAPS 312 255 #define META_SK_HASH 313 256 #define META_SK_LINGERTIME 314 257 #define META_SK_ACK_BACKLOG 315 258 #define META_SK_MAX_ACK_BACKLOG 316 259 #define META_SK_PRIO 317 260 #define META_SK_RCVLOWAT 318 261 #define META_SK_RCVTIMEO 319 262 #define META_SK_SNDTIMEO 320 263 #define META_SK_SENDMSG_OFF 321 264 #define META_SK_WRITE_PENDING 322 265 #define META_VLAN 323 266 #define META_RXHASH 324 267 #define META_DEVNAME 325 268 #define META_SK_BOUND_IF 326 273 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 277 #line 41 "lib/route/cls/ematch_syntax.y" 279 struct tcf_em_cmp cmp;
280 struct ematch_quoted q;
281 struct rtnl_ematch * e;
288 #line 289 "lib/route/cls/ematch_syntax.c" 292 # define YYSTYPE_IS_TRIVIAL 1 293 # define YYSTYPE_IS_DECLARED 1 298 int ematch_parse (
void *scanner,
char **errp,
struct nl_list_head *root);
303 #line 52 "lib/route/cls/ematch_syntax.y" 305 extern int ematch_lex(YYSTYPE *,
void *);
307 static void yyerror(
void *scanner,
char **errp,
struct nl_list_head *root,
const char *msg)
315 #line 316 "lib/route/cls/ematch_syntax.c" 322 typedef YYTYPE_UINT8 yytype_uint8;
324 typedef unsigned char yytype_uint8;
328 typedef YYTYPE_INT8 yytype_int8;
330 typedef signed char yytype_int8;
334 typedef YYTYPE_UINT16 yytype_uint16;
336 typedef unsigned short int yytype_uint16;
340 typedef YYTYPE_INT16 yytype_int16;
342 typedef short int yytype_int16;
346 # ifdef __SIZE_TYPE__ 347 # define YYSIZE_T __SIZE_TYPE__ 348 # elif defined size_t 349 # define YYSIZE_T size_t 350 # elif ! defined YYSIZE_T 352 # define YYSIZE_T size_t 354 # define YYSIZE_T unsigned int 358 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 361 # if defined YYENABLE_NLS && YYENABLE_NLS 363 # include <libintl.h> 364 # define YY_(Msgid) dgettext ("bison-runtime", Msgid) 368 # define YY_(Msgid) Msgid 373 # if (defined __GNUC__ \ 374 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 375 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 376 # define YY_ATTRIBUTE(Spec) __attribute__(Spec) 378 # define YY_ATTRIBUTE(Spec) 382 #ifndef YY_ATTRIBUTE_PURE 383 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 386 #ifndef YY_ATTRIBUTE_UNUSED 387 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 390 #if !defined _Noreturn \ 391 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) 392 # if defined _MSC_VER && 1200 <= _MSC_VER 393 # define _Noreturn __declspec (noreturn) 395 # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) 400 #if ! defined lint || defined __GNUC__ 401 # define YYUSE(E) ((void) (E)) 406 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 408 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 409 _Pragma ("GCC diagnostic push") \ 410 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 411 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 412 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 413 _Pragma ("GCC diagnostic pop") 415 # define YY_INITIAL_VALUE(Value) Value 417 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 418 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 419 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 421 #ifndef YY_INITIAL_VALUE 422 # define YY_INITIAL_VALUE(Value) 426 #if ! defined yyoverflow || YYERROR_VERBOSE 430 # ifdef YYSTACK_USE_ALLOCA 431 # if YYSTACK_USE_ALLOCA 433 # define YYSTACK_ALLOC __builtin_alloca 434 # elif defined __BUILTIN_VA_ARG_INCR 437 # define YYSTACK_ALLOC __alloca 438 # elif defined _MSC_VER 440 # define alloca _alloca 442 # define YYSTACK_ALLOC alloca 443 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 446 # ifndef EXIT_SUCCESS 447 # define EXIT_SUCCESS 0 454 # ifdef YYSTACK_ALLOC 456 # define YYSTACK_FREE(Ptr) do { ; } while (0) 457 # ifndef YYSTACK_ALLOC_MAXIMUM 462 # define YYSTACK_ALLOC_MAXIMUM 4032 465 # define YYSTACK_ALLOC YYMALLOC 466 # define YYSTACK_FREE YYFREE 467 # ifndef YYSTACK_ALLOC_MAXIMUM 468 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 470 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 471 && ! ((defined YYMALLOC || defined malloc) \ 472 && (defined YYFREE || defined free))) 474 # ifndef EXIT_SUCCESS 475 # define EXIT_SUCCESS 0 479 # define YYMALLOC malloc 480 # if ! defined malloc && ! defined EXIT_SUCCESS 481 void *malloc (YYSIZE_T);
486 # if ! defined free && ! defined EXIT_SUCCESS 494 #if (! defined yyoverflow \ 495 && (! defined __cplusplus \ 496 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 501 yytype_int16 yyss_alloc;
506 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 510 # define YYSTACK_BYTES(N) \ 511 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 512 + YYSTACK_GAP_MAXIMUM) 514 # define YYCOPY_NEEDED 1 521 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 524 YYSIZE_T yynewbytes; \ 525 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 526 Stack = &yyptr->Stack_alloc; \ 527 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 528 yyptr += yynewbytes / sizeof (*yyptr); \ 534 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 538 # if defined __GNUC__ && 1 < __GNUC__ 539 # define YYCOPY(Dst, Src, Count) \ 540 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 542 # define YYCOPY(Dst, Src, Count) \ 546 for (yyi = 0; yyi < (Count); yyi++) \ 547 (Dst)[yyi] = (Src)[yyi]; \ 566 #define YYNSTATES 118 571 #define YYMAXUTOK 328 573 #define YYTRANSLATE(YYX) \ 574 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 578 static const yytype_uint8 yytranslate[] =
580 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
606 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
607 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
608 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
609 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
610 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
611 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
612 65, 66, 67, 68, 69, 70, 71, 72, 73
617 static const yytype_uint16 yyrline[] =
619 0, 150, 150, 152, 159, 163, 175, 180, 188, 203,
620 221, 248, 267, 295, 297, 302, 323, 324, 330, 331,
621 336, 338, 340, 342, 347, 348, 349, 350, 351, 352,
622 353, 354, 355, 356, 357, 358, 359, 360, 361, 362,
623 363, 364, 365, 366, 367, 368, 369, 370, 371, 372,
624 373, 374, 375, 376, 377, 378, 379, 380, 381, 382,
625 383, 384, 385, 386, 387, 388, 389, 390, 391, 395,
626 396, 403, 407, 436, 449, 475, 476, 478, 484, 485,
627 491, 492, 497, 499, 501
631 #if YYDEBUG || YYERROR_VERBOSE || 1 634 static const char *
const yytname[] =
636 "$end",
"error",
"$undefined",
"ERROR",
"LOGIC",
"NOT",
"OPERAND",
637 "NUMBER",
"ALIGN",
"LAYER",
"\"(\"",
"\")\"",
"\"+\"",
"\"mask\"",
638 "\">>\"",
"\"at\"",
"\"cmp\"",
"\"pattern\"",
"\"text\"",
"\"meta\"",
639 "\"=\"",
"\">\"",
"\"<\"",
"\"from\"",
"\"to\"",
"\"random\"",
640 "\"loadavg_0\"",
"\"loadavg_1\"",
"\"loadavg_2\"",
"\"dev\"",
"\"prio\"",
641 "\"proto\"",
"\"pkttype\"",
"\"pktlen\"",
"\"datalen\"",
"\"maclen\"",
642 "\"mark\"",
"\"tcindex\"",
"\"rtclassid\"",
"\"rtiif\"",
"\"sk_family\"",
643 "\"sk_state\"",
"\"sk_reuse\"",
"\"sk_refcnt\"",
"\"sk_rcvbuf\"",
644 "\"sk_sndbuf\"",
"\"sk_shutdown\"",
"\"sk_proto\"",
"\"sk_type\"",
645 "\"sk_rmem_alloc\"",
"\"sk_wmem_alloc\"",
"\"sk_wmem_queued\"",
646 "\"sk_rcv_qlen\"",
"\"sk_snd_qlen\"",
"\"sk_err_qlen\"",
647 "\"sk_forward_allocs\"",
"\"sk_allocs\"",
"\"sk_route_caps\"",
648 "\"sk_hash\"",
"\"sk_lingertime\"",
"\"sk_ack_backlog\"",
649 "\"sk_max_ack_backlog\"",
"\"sk_prio\"",
"\"sk_rcvlowat\"",
650 "\"sk_rcvtimeo\"",
"\"sk_sndtimeo\"",
"\"sk_sendmsg_off\"",
651 "\"sk_write_pending\"",
"\"vlan\"",
"\"rxhash\"",
"\"devname\"",
652 "\"sk_bound_if\"",
"STR",
"QUOTED",
"$accept",
"input",
"expr",
"match",
653 "ematch",
"cmp_match",
"cmp_expr",
"text_from",
"text_to",
"meta_value",
654 "meta_int_id",
"meta_var_id",
"pattern",
"pktloc",
"align",
"mask",
655 "shift",
"operand", YY_NULLPTR
662 static const yytype_uint16 yytoknum[] =
664 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
665 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
666 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
667 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
668 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
669 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
670 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
675 #define YYPACT_NINF -63 677 #define yypact_value_is_default(Yystate) \ 678 (!!((Yystate) == (-63))) 680 #define YYTABLE_NINF -76 682 #define yytable_value_is_error(Yytable_value) \ 687 static const yytype_int8 yypact[] =
689 -4, 15, -13, -8, 11, 10, 14, 25, 29, -63,
690 26, -63, 37, -63, -63, -63, 16, 33, -63, -63,
691 -63, 32, 1, 1, -28, 65, -63, 11, -63, -63,
692 -63, 38, 34, -63, 36, 28, -24, -63, -63, -63,
693 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
694 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
695 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
696 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
697 -63, -63, -63, -63, -63, -63, 16, 39, 39, -63,
698 -63, 43, -63, -62, 31, 65, 44, 42, -63, 42,
699 -63, -63, 41, 1, 35, 45, -63, 50, -63, -63,
700 -63, -63, 1, 47, -63, -63, -63, -63
706 static const yytype_uint8 yydefact[] =
708 2, 75, 0, 0, 75, 0, 0, 0, 0, 73,
709 0, 3, 4, 7, 8, 14, 0, 0, 6, 77,
710 76, 0, 75, 75, 0, 0, 1, 75, 82, 83,
711 84, 0, 0, 12, 0, 0, 0, 21, 24, 25,
712 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
713 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
714 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
715 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
716 66, 67, 68, 69, 70, 20, 0, 80, 80, 5,
717 15, 0, 13, 0, 16, 0, 0, 78, 23, 78,
718 72, 71, 0, 75, 18, 0, 81, 0, 22, 74,
719 9, 17, 75, 0, 11, 79, 19, 10
723 static const yytype_int8 yypgoto[] =
725 -63, -63, 13, -63, 59, -63, 40, -63, -63, -34,
726 -63, -63, -63, -23, -63, -36, -22, -21
730 static const yytype_int8 yydefgoto[] =
732 -1, 10, 11, 12, 13, 14, 15, 104, 113, 86,
733 87, 88, 102, 16, 17, 108, 97, 31
739 static const yytype_int8 yytable[] =
741 35, 1, 19, 2, 3, -75, 4, 20, 2, 3,
742 100, 101, 5, 6, 7, 8, 1, 21, 2, 3,
743 22, 4, 2, 3, 23, 4, 26, 5, 6, 7,
744 8, 5, 6, 7, 8, 24, 28, 29, 30, 25,
745 89, 27, 32, 33, 36, 90, 91, 92, 93, 94,
746 99, 106, 110, 96, 103, 107, 114, 115, 117, 112,
747 18, 105, 34, 109, 0, 95, 98, 0, 9, 0,
748 0, 0, 37, 9, 0, 0, 0, 0, 0, 0,
749 111, 0, 0, 9, 0, 0, 0, 9, 0, 116,
750 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
751 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
752 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
753 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
754 78, 79, 80, 81, 82, 83, 84, 0, 85
757 static const yytype_int8 yycheck[] =
759 23, 5, 15, 7, 8, 9, 10, 15, 7, 8,
760 72, 73, 16, 17, 18, 19, 5, 4, 7, 8,
761 10, 10, 7, 8, 10, 10, 0, 16, 17, 18,
762 19, 16, 17, 18, 19, 10, 20, 21, 22, 10,
763 27, 4, 9, 11, 72, 7, 12, 11, 20, 73,
764 7, 7, 11, 14, 23, 13, 11, 7, 11, 24,
765 1, 95, 22, 99, -1, 86, 88, -1, 72, -1,
766 -1, -1, 7, 72, -1, -1, -1, -1, -1, -1,
767 103, -1, -1, 72, -1, -1, -1, 72, -1, 112,
768 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
769 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
770 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
771 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
772 65, 66, 67, 68, 69, 70, 71, -1, 73
777 static const yytype_uint8 yystos[] =
779 0, 5, 7, 8, 10, 16, 17, 18, 19, 72,
780 75, 76, 77, 78, 79, 80, 87, 88, 78, 15,
781 15, 76, 10, 10, 10, 10, 0, 4, 20, 21,
782 22, 91, 9, 11, 80, 87, 72, 7, 25, 26,
783 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
784 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
785 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
786 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
787 67, 68, 69, 70, 71, 73, 83, 84, 85, 76,
788 7, 12, 11, 20, 73, 91, 14, 90, 90, 7,
789 72, 73, 86, 23, 81, 83, 7, 13, 89, 89,
790 11, 87, 24, 82, 11, 7, 87, 11
794 static const yytype_uint8 yyr1[] =
796 0, 74, 75, 75, 76, 76, 77, 77, 78, 78,
797 78, 78, 78, 79, 79, 80, 81, 81, 82, 82,
798 83, 83, 83, 83, 84, 84, 84, 84, 84, 84,
799 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
800 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
801 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
802 84, 84, 84, 84, 84, 84, 84, 84, 84, 85,
803 85, 86, 86, 87, 87, 88, 88, 88, 89, 89,
808 static const yytype_uint8 yyr2[] =
810 0, 2, 0, 1, 1, 3, 2, 1, 1, 6,
811 7, 6, 3, 4, 1, 3, 0, 2, 0, 2,
812 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
813 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
814 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
815 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
816 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
817 1, 1, 1, 1, 5, 0, 2, 2, 0, 2,
822 #define yyerrok (yyerrstatus = 0) 823 #define yyclearin (yychar = YYEMPTY) 827 #define YYACCEPT goto yyacceptlab 828 #define YYABORT goto yyabortlab 829 #define YYERROR goto yyerrorlab 832 #define YYRECOVERING() (!!yyerrstatus) 834 #define YYBACKUP(Token, Value) \ 836 if (yychar == YYEMPTY) \ 840 YYPOPSTACK (yylen); \ 846 yyerror (scanner, errp, root, YY_("syntax error: cannot back up")); \ 853 #define YYERRCODE 256 862 # define YYFPRINTF fprintf 865 # define YYDPRINTF(Args) \ 872 #ifndef YY_LOCATION_PRINT 873 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 877 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 881 YYFPRINTF (stderr, "%s ", Title); \ 882 yy_symbol_print (stderr, \ 883 Type, Value, scanner, errp, root); \ 884 YYFPRINTF (stderr, "\n"); \ 894 yy_symbol_value_print (FILE *yyoutput,
int yytype, YYSTYPE
const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
896 FILE *yyo = yyoutput;
904 if (yytype < YYNTOKENS)
905 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
916 yy_symbol_print (FILE *yyoutput,
int yytype, YYSTYPE
const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
918 YYFPRINTF (yyoutput,
"%s %s (",
919 yytype < YYNTOKENS ?
"token" :
"nterm", yytname[yytype]);
921 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root);
922 YYFPRINTF (yyoutput,
")");
931 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
933 YYFPRINTF (stderr,
"Stack now");
934 for (; yybottom <= yytop; yybottom++)
936 int yybot = *yybottom;
937 YYFPRINTF (stderr,
" %d", yybot);
939 YYFPRINTF (stderr,
"\n");
942 # define YY_STACK_PRINT(Bottom, Top) \ 945 yy_stack_print ((Bottom), (Top)); \ 954 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp,
int yyrule,
void *scanner,
char **errp,
struct nl_list_head *root)
956 unsigned long int yylno = yyrline[yyrule];
957 int yynrhs = yyr2[yyrule];
959 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
962 for (yyi = 0; yyi < yynrhs; yyi++)
964 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
965 yy_symbol_print (stderr,
966 yystos[yyssp[yyi + 1 - yynrhs]],
967 &(yyvsp[(yyi + 1) - (yynrhs)])
968 , scanner, errp, root);
969 YYFPRINTF (stderr,
"\n");
973 # define YY_REDUCE_PRINT(Rule) \ 976 yy_reduce_print (yyssp, yyvsp, Rule, scanner, errp, root); \ 983 # define YYDPRINTF(Args) 984 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 985 # define YY_STACK_PRINT(Bottom, Top) 986 # define YY_REDUCE_PRINT(Rule) 992 # define YYINITDEPTH 200 1003 # define YYMAXDEPTH 10000 1010 # if defined __GLIBC__ && defined _STRING_H 1011 # define yystrlen strlen 1015 yystrlen (
const char *yystr)
1018 for (yylen = 0; yystr[yylen]; yylen++)
1026 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 1027 # define yystpcpy stpcpy 1032 yystpcpy (
char *yydest,
const char *yysrc)
1035 const char *yys = yysrc;
1037 while ((*yyd++ = *yys++) !=
'\0')
1054 yytnamerr (
char *yyres,
const char *yystr)
1059 char const *yyp = yystr;
1066 goto do_not_strip_quotes;
1070 goto do_not_strip_quotes;
1083 do_not_strip_quotes: ;
1087 return yystrlen (yystr);
1089 return yystpcpy (yyres, yystr) - yyres;
1102 yysyntax_error (YYSIZE_T *yymsg_alloc,
char **yymsg,
1103 yytype_int16 *yyssp,
int yytoken)
1105 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1106 YYSIZE_T yysize = yysize0;
1107 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1109 const char *yyformat = YY_NULLPTR;
1111 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1139 if (yytoken != YYEMPTY)
1141 int yyn = yypact[*yyssp];
1142 yyarg[yycount++] = yytname[yytoken];
1143 if (!yypact_value_is_default (yyn))
1148 int yyxbegin = yyn < 0 ? -yyn : 0;
1150 int yychecklim = YYLAST - yyn + 1;
1151 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1154 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1155 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1156 && !yytable_value_is_error (yytable[yyx + yyn]))
1158 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1164 yyarg[yycount++] = yytname[yyx];
1166 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1167 if (! (yysize <= yysize1
1168 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1178 # define YYCASE_(N, S) \ 1182 YYCASE_(0, YY_(
"syntax error"));
1183 YYCASE_(1, YY_(
"syntax error, unexpected %s"));
1184 YYCASE_(2, YY_(
"syntax error, unexpected %s, expecting %s"));
1185 YYCASE_(3, YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1186 YYCASE_(4, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1187 YYCASE_(5, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1192 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1193 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1198 if (*yymsg_alloc < yysize)
1200 *yymsg_alloc = 2 * yysize;
1201 if (! (yysize <= *yymsg_alloc
1202 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1203 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1213 while ((*yyp = *yyformat) !=
'\0')
1214 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1216 yyp += yytnamerr (yyp, yyarg[yyi++]);
1234 yydestruct (
const char *yymsg,
int yytype, YYSTYPE *yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
1242 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1244 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1248 #line 141 "lib/route/cls/ematch_syntax.y" 1249 { free(((*yyvaluep).s)); NL_DBG(2,
"string destructor\n"); }
1250 #line 1251 "lib/route/cls/ematch_syntax.c" 1254 #line 143 "lib/route/cls/ematch_syntax.y" 1255 { free(((*yyvaluep).q).data); NL_DBG(2,
"quoted destructor\n"); }
1256 #line 1257 "lib/route/cls/ematch_syntax.c" 1260 #line 142 "lib/route/cls/ematch_syntax.y" 1261 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); }
1262 #line 1263 "lib/route/cls/ematch_syntax.c" 1266 #line 142 "lib/route/cls/ematch_syntax.y" 1267 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); }
1268 #line 1269 "lib/route/cls/ematch_syntax.c" 1272 #line 144 "lib/route/cls/ematch_syntax.y" 1273 { rtnl_meta_value_put(((*yyvaluep).mv)); NL_DBG(2,
"meta value destructor\n"); }
1274 #line 1275 "lib/route/cls/ematch_syntax.c" 1278 #line 143 "lib/route/cls/ematch_syntax.y" 1279 { free(((*yyvaluep).q).data); NL_DBG(2,
"quoted destructor\n"); }
1280 #line 1281 "lib/route/cls/ematch_syntax.c" 1284 #line 142 "lib/route/cls/ematch_syntax.y" 1285 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); }
1286 #line 1287 "lib/route/cls/ematch_syntax.c" 1293 YY_IGNORE_MAYBE_UNINITIALIZED_END
1304 yyparse (
void *scanner,
char **errp,
struct nl_list_head *root)
1313 YY_INITIAL_VALUE (
static YYSTYPE yyval_default;)
1314 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1331 yytype_int16 yyssa[YYINITDEPTH];
1333 yytype_int16 *yyssp;
1336 YYSTYPE yyvsa[YYINITDEPTH];
1340 YYSIZE_T yystacksize;
1353 char *yymsg = yymsgbuf;
1354 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1357 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1363 yyssp = yyss = yyssa;
1364 yyvsp = yyvs = yyvsa;
1365 yystacksize = YYINITDEPTH;
1367 YYDPRINTF ((stderr,
"Starting parse\n"));
1386 if (yyss + yystacksize - 1 <= yyssp)
1389 YYSIZE_T yysize = yyssp - yyss + 1;
1396 YYSTYPE *yyvs1 = yyvs;
1397 yytype_int16 *yyss1 = yyss;
1403 yyoverflow (YY_(
"memory exhausted"),
1404 &yyss1, yysize *
sizeof (*yyssp),
1405 &yyvs1, yysize *
sizeof (*yyvsp),
1412 # ifndef YYSTACK_RELOCATE 1413 goto yyexhaustedlab;
1416 if (YYMAXDEPTH <= yystacksize)
1417 goto yyexhaustedlab;
1419 if (YYMAXDEPTH < yystacksize)
1420 yystacksize = YYMAXDEPTH;
1423 yytype_int16 *yyss1 = yyss;
1425 (
union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1427 goto yyexhaustedlab;
1428 YYSTACK_RELOCATE (yyss_alloc, yyss);
1429 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1430 # undef YYSTACK_RELOCATE 1432 YYSTACK_FREE (yyss1);
1437 yyssp = yyss + yysize - 1;
1438 yyvsp = yyvs + yysize - 1;
1440 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1441 (
unsigned long int) yystacksize));
1443 if (yyss + yystacksize - 1 <= yyssp)
1447 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1449 if (yystate == YYFINAL)
1463 yyn = yypact[yystate];
1464 if (yypact_value_is_default (yyn))
1470 if (yychar == YYEMPTY)
1472 YYDPRINTF ((stderr,
"Reading a token: "));
1473 yychar = yylex (&yylval, scanner);
1476 if (yychar <= YYEOF)
1478 yychar = yytoken = YYEOF;
1479 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1483 yytoken = YYTRANSLATE (yychar);
1484 YY_SYMBOL_PRINT (
"Next token is", yytoken, &yylval, &yylloc);
1490 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1495 if (yytable_value_is_error (yyn))
1507 YY_SYMBOL_PRINT (
"Shifting", yytoken, &yylval, &yylloc);
1513 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1515 YY_IGNORE_MAYBE_UNINITIALIZED_END
1524 yyn = yydefact[yystate];
1545 yyval = yyvsp[1-yylen];
1548 YY_REDUCE_PRINT (yyn);
1552 #line 153 "lib/route/cls/ematch_syntax.y" 1554 nl_list_add_tail(root, &(yyvsp[0].e)->e_list);
1556 #line 1557 "lib/route/cls/ematch_syntax.c" 1560 #line 160 "lib/route/cls/ematch_syntax.y" 1562 (yyval.e) = (yyvsp[0].e);
1564 #line 1565 "lib/route/cls/ematch_syntax.c" 1568 #line 164 "lib/route/cls/ematch_syntax.y" 1570 rtnl_ematch_set_flags((yyvsp[-2].e), (yyvsp[-1].i));
1573 nl_list_add_tail(&(yyvsp[-2].e)->e_list, &(yyvsp[0].e)->e_list);
1575 (yyval.e) = (yyvsp[-2].e);
1577 #line 1578 "lib/route/cls/ematch_syntax.c" 1581 #line 176 "lib/route/cls/ematch_syntax.y" 1583 rtnl_ematch_set_flags((yyvsp[0].e), TCF_EM_INVERT);
1584 (yyval.e) = (yyvsp[0].e);
1586 #line 1587 "lib/route/cls/ematch_syntax.c" 1590 #line 181 "lib/route/cls/ematch_syntax.y" 1592 (yyval.e) = (yyvsp[0].e);
1594 #line 1595 "lib/route/cls/ematch_syntax.c" 1598 #line 189 "lib/route/cls/ematch_syntax.y" 1600 struct rtnl_ematch *e;
1603 *errp = strdup(
"Unable to allocate ematch object");
1607 if (rtnl_ematch_set_kind(e, TCF_EM_CMP) < 0)
1610 rtnl_ematch_cmp_set(e, &(yyvsp[0].cmp));
1613 #line 1614 "lib/route/cls/ematch_syntax.c" 1617 #line 204 "lib/route/cls/ematch_syntax.y" 1619 struct rtnl_ematch *e;
1622 *errp = strdup(
"Unable to allocate ematch object");
1626 if (rtnl_ematch_set_kind(e, TCF_EM_NBYTE) < 0)
1629 rtnl_ematch_nbyte_set_offset(e, (yyvsp[-3].loc)->layer, (yyvsp[-3].loc)->offset);
1631 rtnl_ematch_nbyte_set_pattern(e, (uint8_t *) (yyvsp[-1].q).data, (yyvsp[-1].q).index);
1635 #line 1636 "lib/route/cls/ematch_syntax.c" 1639 #line 222 "lib/route/cls/ematch_syntax.y" 1641 struct rtnl_ematch *e;
1644 *errp = strdup(
"Unable to allocate ematch object");
1648 if (rtnl_ematch_set_kind(e, TCF_EM_TEXT) < 0)
1651 rtnl_ematch_text_set_algo(e, (yyvsp[-4].s));
1652 rtnl_ematch_text_set_pattern(e, (yyvsp[-3].q).data, (yyvsp[-3].q).index);
1654 if ((yyvsp[-2].loc)) {
1655 rtnl_ematch_text_set_from(e, (yyvsp[-2].loc)->layer, (yyvsp[-2].loc)->offset);
1659 if ((yyvsp[-1].loc)) {
1660 rtnl_ematch_text_set_to(e, (yyvsp[-1].loc)->layer, (yyvsp[-1].loc)->offset);
1666 #line 1667 "lib/route/cls/ematch_syntax.c" 1670 #line 249 "lib/route/cls/ematch_syntax.y" 1672 struct rtnl_ematch *e;
1675 *errp = strdup(
"Unable to allocate ematch object");
1679 if (rtnl_ematch_set_kind(e, TCF_EM_META) < 0)
1682 rtnl_ematch_meta_set_lvalue(e, (yyvsp[-3].mv));
1683 rtnl_ematch_meta_set_rvalue(e, (yyvsp[-1].mv));
1684 rtnl_ematch_meta_set_operand(e, (yyvsp[-2].i));
1688 #line 1689 "lib/route/cls/ematch_syntax.c" 1692 #line 268 "lib/route/cls/ematch_syntax.y" 1694 struct rtnl_ematch *e;
1697 *errp = strdup(
"Unable to allocate ematch object");
1701 if (rtnl_ematch_set_kind(e, TCF_EM_CONTAINER) < 0)
1705 nl_list_add_tail(&e->e_childs, &(yyvsp[-1].e)->e_list);
1709 #line 1710 "lib/route/cls/ematch_syntax.c" 1713 #line 296 "lib/route/cls/ematch_syntax.y" 1714 { (yyval.cmp) = (yyvsp[-1].cmp); }
1715 #line 1716 "lib/route/cls/ematch_syntax.c" 1719 #line 298 "lib/route/cls/ematch_syntax.y" 1720 { (yyval.cmp) = (yyvsp[0].cmp); }
1721 #line 1722 "lib/route/cls/ematch_syntax.c" 1725 #line 303 "lib/route/cls/ematch_syntax.y" 1727 if ((yyvsp[-2].loc)->align == TCF_EM_ALIGN_U16 ||
1728 (yyvsp[-2].loc)->align == TCF_EM_ALIGN_U32)
1729 (yyval.cmp).flags = TCF_EM_CMP_TRANS;
1731 memset(&(yyval.cmp), 0,
sizeof((yyval.cmp)));
1733 (yyval.cmp).mask = (yyvsp[-2].loc)->mask;
1734 (yyval.cmp).off = (yyvsp[-2].loc)->offset;
1735 (yyval.cmp).align = (yyvsp[-2].loc)->align;
1736 (yyval.cmp).layer = (yyvsp[-2].loc)->layer;
1737 (yyval.cmp).opnd = (yyvsp[-1].i);
1738 (yyval.cmp).val = (yyvsp[0].i);
1742 #line 1743 "lib/route/cls/ematch_syntax.c" 1746 #line 323 "lib/route/cls/ematch_syntax.y" 1747 { (yyval.loc) = NULL; }
1748 #line 1749 "lib/route/cls/ematch_syntax.c" 1752 #line 325 "lib/route/cls/ematch_syntax.y" 1753 { (yyval.loc) = (yyvsp[0].loc); }
1754 #line 1755 "lib/route/cls/ematch_syntax.c" 1758 #line 330 "lib/route/cls/ematch_syntax.y" 1759 { (yyval.loc) = NULL; }
1760 #line 1761 "lib/route/cls/ematch_syntax.c" 1764 #line 332 "lib/route/cls/ematch_syntax.y" 1765 { (yyval.loc) = (yyvsp[0].loc); }
1766 #line 1767 "lib/route/cls/ematch_syntax.c" 1770 #line 337 "lib/route/cls/ematch_syntax.y" 1771 { (yyval.mv) = rtnl_meta_value_alloc_var((yyvsp[0].q).data, (yyvsp[0].q).len); }
1772 #line 1773 "lib/route/cls/ematch_syntax.c" 1776 #line 339 "lib/route/cls/ematch_syntax.y" 1777 { (yyval.mv) = rtnl_meta_value_alloc_int((yyvsp[0].i)); }
1778 #line 1779 "lib/route/cls/ematch_syntax.c" 1782 #line 341 "lib/route/cls/ematch_syntax.y" 1783 { (yyval.mv) = META_ALLOC(META_INT, (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i64)); }
1784 #line 1785 "lib/route/cls/ematch_syntax.c" 1788 #line 343 "lib/route/cls/ematch_syntax.y" 1789 { (yyval.mv) = META_ALLOC(META_VAR, (yyvsp[-1].i), (yyvsp[0].i), 0); }
1790 #line 1791 "lib/route/cls/ematch_syntax.c" 1794 #line 347 "lib/route/cls/ematch_syntax.y" 1795 { (yyval.i) = META_ID(RANDOM); }
1796 #line 1797 "lib/route/cls/ematch_syntax.c" 1800 #line 348 "lib/route/cls/ematch_syntax.y" 1801 { (yyval.i) = META_ID(LOADAVG_0); }
1802 #line 1803 "lib/route/cls/ematch_syntax.c" 1806 #line 349 "lib/route/cls/ematch_syntax.y" 1807 { (yyval.i) = META_ID(LOADAVG_1); }
1808 #line 1809 "lib/route/cls/ematch_syntax.c" 1812 #line 350 "lib/route/cls/ematch_syntax.y" 1813 { (yyval.i) = META_ID(LOADAVG_2); }
1814 #line 1815 "lib/route/cls/ematch_syntax.c" 1818 #line 351 "lib/route/cls/ematch_syntax.y" 1819 { (yyval.i) = META_ID(DEV); }
1820 #line 1821 "lib/route/cls/ematch_syntax.c" 1824 #line 352 "lib/route/cls/ematch_syntax.y" 1825 { (yyval.i) = META_ID(PRIORITY); }
1826 #line 1827 "lib/route/cls/ematch_syntax.c" 1830 #line 353 "lib/route/cls/ematch_syntax.y" 1831 { (yyval.i) = META_ID(PROTOCOL); }
1832 #line 1833 "lib/route/cls/ematch_syntax.c" 1836 #line 354 "lib/route/cls/ematch_syntax.y" 1837 { (yyval.i) = META_ID(PKTTYPE); }
1838 #line 1839 "lib/route/cls/ematch_syntax.c" 1842 #line 355 "lib/route/cls/ematch_syntax.y" 1843 { (yyval.i) = META_ID(PKTLEN); }
1844 #line 1845 "lib/route/cls/ematch_syntax.c" 1848 #line 356 "lib/route/cls/ematch_syntax.y" 1849 { (yyval.i) = META_ID(DATALEN); }
1850 #line 1851 "lib/route/cls/ematch_syntax.c" 1854 #line 357 "lib/route/cls/ematch_syntax.y" 1855 { (yyval.i) = META_ID(MACLEN); }
1856 #line 1857 "lib/route/cls/ematch_syntax.c" 1860 #line 358 "lib/route/cls/ematch_syntax.y" 1861 { (yyval.i) = META_ID(NFMARK); }
1862 #line 1863 "lib/route/cls/ematch_syntax.c" 1866 #line 359 "lib/route/cls/ematch_syntax.y" 1867 { (yyval.i) = META_ID(TCINDEX); }
1868 #line 1869 "lib/route/cls/ematch_syntax.c" 1872 #line 360 "lib/route/cls/ematch_syntax.y" 1873 { (yyval.i) = META_ID(RTCLASSID); }
1874 #line 1875 "lib/route/cls/ematch_syntax.c" 1878 #line 361 "lib/route/cls/ematch_syntax.y" 1879 { (yyval.i) = META_ID(RTIIF); }
1880 #line 1881 "lib/route/cls/ematch_syntax.c" 1884 #line 362 "lib/route/cls/ematch_syntax.y" 1885 { (yyval.i) = META_ID(SK_FAMILY); }
1886 #line 1887 "lib/route/cls/ematch_syntax.c" 1890 #line 363 "lib/route/cls/ematch_syntax.y" 1891 { (yyval.i) = META_ID(SK_STATE); }
1892 #line 1893 "lib/route/cls/ematch_syntax.c" 1896 #line 364 "lib/route/cls/ematch_syntax.y" 1897 { (yyval.i) = META_ID(SK_REUSE); }
1898 #line 1899 "lib/route/cls/ematch_syntax.c" 1902 #line 365 "lib/route/cls/ematch_syntax.y" 1903 { (yyval.i) = META_ID(SK_REFCNT); }
1904 #line 1905 "lib/route/cls/ematch_syntax.c" 1908 #line 366 "lib/route/cls/ematch_syntax.y" 1909 { (yyval.i) = META_ID(SK_RCVBUF); }
1910 #line 1911 "lib/route/cls/ematch_syntax.c" 1914 #line 367 "lib/route/cls/ematch_syntax.y" 1915 { (yyval.i) = META_ID(SK_SNDBUF); }
1916 #line 1917 "lib/route/cls/ematch_syntax.c" 1920 #line 368 "lib/route/cls/ematch_syntax.y" 1921 { (yyval.i) = META_ID(SK_SHUTDOWN); }
1922 #line 1923 "lib/route/cls/ematch_syntax.c" 1926 #line 369 "lib/route/cls/ematch_syntax.y" 1927 { (yyval.i) = META_ID(SK_PROTO); }
1928 #line 1929 "lib/route/cls/ematch_syntax.c" 1932 #line 370 "lib/route/cls/ematch_syntax.y" 1933 { (yyval.i) = META_ID(SK_TYPE); }
1934 #line 1935 "lib/route/cls/ematch_syntax.c" 1938 #line 371 "lib/route/cls/ematch_syntax.y" 1939 { (yyval.i) = META_ID(SK_RMEM_ALLOC); }
1940 #line 1941 "lib/route/cls/ematch_syntax.c" 1944 #line 372 "lib/route/cls/ematch_syntax.y" 1945 { (yyval.i) = META_ID(SK_WMEM_ALLOC); }
1946 #line 1947 "lib/route/cls/ematch_syntax.c" 1950 #line 373 "lib/route/cls/ematch_syntax.y" 1951 { (yyval.i) = META_ID(SK_WMEM_QUEUED); }
1952 #line 1953 "lib/route/cls/ematch_syntax.c" 1956 #line 374 "lib/route/cls/ematch_syntax.y" 1957 { (yyval.i) = META_ID(SK_RCV_QLEN); }
1958 #line 1959 "lib/route/cls/ematch_syntax.c" 1962 #line 375 "lib/route/cls/ematch_syntax.y" 1963 { (yyval.i) = META_ID(SK_SND_QLEN); }
1964 #line 1965 "lib/route/cls/ematch_syntax.c" 1968 #line 376 "lib/route/cls/ematch_syntax.y" 1969 { (yyval.i) = META_ID(SK_ERR_QLEN); }
1970 #line 1971 "lib/route/cls/ematch_syntax.c" 1974 #line 377 "lib/route/cls/ematch_syntax.y" 1975 { (yyval.i) = META_ID(SK_FORWARD_ALLOCS); }
1976 #line 1977 "lib/route/cls/ematch_syntax.c" 1980 #line 378 "lib/route/cls/ematch_syntax.y" 1981 { (yyval.i) = META_ID(SK_ALLOCS); }
1982 #line 1983 "lib/route/cls/ematch_syntax.c" 1986 #line 379 "lib/route/cls/ematch_syntax.y" 1987 { (yyval.i) = META_ID(SK_ROUTE_CAPS); }
1988 #line 1989 "lib/route/cls/ematch_syntax.c" 1992 #line 380 "lib/route/cls/ematch_syntax.y" 1993 { (yyval.i) = META_ID(SK_HASH); }
1994 #line 1995 "lib/route/cls/ematch_syntax.c" 1998 #line 381 "lib/route/cls/ematch_syntax.y" 1999 { (yyval.i) = META_ID(SK_LINGERTIME); }
2000 #line 2001 "lib/route/cls/ematch_syntax.c" 2004 #line 382 "lib/route/cls/ematch_syntax.y" 2005 { (yyval.i) = META_ID(SK_ACK_BACKLOG); }
2006 #line 2007 "lib/route/cls/ematch_syntax.c" 2010 #line 383 "lib/route/cls/ematch_syntax.y" 2011 { (yyval.i) = META_ID(SK_MAX_ACK_BACKLOG); }
2012 #line 2013 "lib/route/cls/ematch_syntax.c" 2016 #line 384 "lib/route/cls/ematch_syntax.y" 2017 { (yyval.i) = META_ID(SK_PRIO); }
2018 #line 2019 "lib/route/cls/ematch_syntax.c" 2022 #line 385 "lib/route/cls/ematch_syntax.y" 2023 { (yyval.i) = META_ID(SK_RCVLOWAT); }
2024 #line 2025 "lib/route/cls/ematch_syntax.c" 2028 #line 386 "lib/route/cls/ematch_syntax.y" 2029 { (yyval.i) = META_ID(SK_RCVTIMEO); }
2030 #line 2031 "lib/route/cls/ematch_syntax.c" 2034 #line 387 "lib/route/cls/ematch_syntax.y" 2035 { (yyval.i) = META_ID(SK_SNDTIMEO); }
2036 #line 2037 "lib/route/cls/ematch_syntax.c" 2040 #line 388 "lib/route/cls/ematch_syntax.y" 2041 { (yyval.i) = META_ID(SK_SENDMSG_OFF); }
2042 #line 2043 "lib/route/cls/ematch_syntax.c" 2046 #line 389 "lib/route/cls/ematch_syntax.y" 2047 { (yyval.i) = META_ID(SK_WRITE_PENDING); }
2048 #line 2049 "lib/route/cls/ematch_syntax.c" 2052 #line 390 "lib/route/cls/ematch_syntax.y" 2053 { (yyval.i) = META_ID(VLAN_TAG); }
2054 #line 2055 "lib/route/cls/ematch_syntax.c" 2058 #line 391 "lib/route/cls/ematch_syntax.y" 2059 { (yyval.i) = META_ID(RXHASH); }
2060 #line 2061 "lib/route/cls/ematch_syntax.c" 2064 #line 395 "lib/route/cls/ematch_syntax.y" 2065 { (yyval.i) = META_ID(DEV); }
2066 #line 2067 "lib/route/cls/ematch_syntax.c" 2070 #line 396 "lib/route/cls/ematch_syntax.y" 2071 { (yyval.i) = META_ID(SK_BOUND_IF); }
2072 #line 2073 "lib/route/cls/ematch_syntax.c" 2076 #line 404 "lib/route/cls/ematch_syntax.y" 2078 (yyval.q) = (yyvsp[0].q);
2080 #line 2081 "lib/route/cls/ematch_syntax.c" 2084 #line 408 "lib/route/cls/ematch_syntax.y" 2086 struct nl_addr *addr;
2093 if (!((yyval.q).data = calloc(1, (yyval.q).len))) {
2101 if (asprintf(errp,
"invalid pattern \"%s\"", (yyvsp[0].s)) == -1)
2106 #line 2107 "lib/route/cls/ematch_syntax.c" 2110 #line 437 "lib/route/cls/ematch_syntax.y" 2115 if (asprintf(errp,
"Packet location \"%s\" not found", (yyvsp[0].s)) == -1)
2122 #line 2123 "lib/route/cls/ematch_syntax.c" 2126 #line 450 "lib/route/cls/ematch_syntax.y" 2130 if ((yyvsp[0].i64) && (!(yyvsp[-4].i) || (yyvsp[-4].i) > TCF_EM_ALIGN_U32)) {
2131 *errp = strdup(
"mask only allowed for alignments u8|u16|u32");
2136 *errp = strdup(
"Unable to allocate packet location object");
2140 loc->name = strdup(
"<USER-DEFINED>");
2141 loc->align = (yyvsp[-4].i);
2142 loc->layer = (yyvsp[-3].i);
2143 loc->offset = (yyvsp[-1].i);
2144 loc->mask = (yyvsp[0].i64);
2148 #line 2149 "lib/route/cls/ematch_syntax.c" 2152 #line 475 "lib/route/cls/ematch_syntax.y" 2154 #line 2155 "lib/route/cls/ematch_syntax.c" 2158 #line 477 "lib/route/cls/ematch_syntax.y" 2159 { (yyval.i) = (yyvsp[-1].i); }
2160 #line 2161 "lib/route/cls/ematch_syntax.c" 2164 #line 479 "lib/route/cls/ematch_syntax.y" 2165 { (yyval.i) = (yyvsp[-1].i); }
2166 #line 2167 "lib/route/cls/ematch_syntax.c" 2170 #line 484 "lib/route/cls/ematch_syntax.y" 2171 { (yyval.i64) = 0; }
2172 #line 2173 "lib/route/cls/ematch_syntax.c" 2176 #line 486 "lib/route/cls/ematch_syntax.y" 2177 { (yyval.i64) = (yyvsp[0].i); }
2178 #line 2179 "lib/route/cls/ematch_syntax.c" 2182 #line 491 "lib/route/cls/ematch_syntax.y" 2184 #line 2185 "lib/route/cls/ematch_syntax.c" 2188 #line 493 "lib/route/cls/ematch_syntax.y" 2189 { (yyval.i) = (yyvsp[0].i); }
2190 #line 2191 "lib/route/cls/ematch_syntax.c" 2194 #line 498 "lib/route/cls/ematch_syntax.y" 2195 { (yyval.i) = TCF_EM_OPND_EQ; }
2196 #line 2197 "lib/route/cls/ematch_syntax.c" 2200 #line 500 "lib/route/cls/ematch_syntax.y" 2201 { (yyval.i) = TCF_EM_OPND_GT; }
2202 #line 2203 "lib/route/cls/ematch_syntax.c" 2206 #line 502 "lib/route/cls/ematch_syntax.y" 2207 { (yyval.i) = TCF_EM_OPND_LT; }
2208 #line 2209 "lib/route/cls/ematch_syntax.c" 2212 #line 2213 "lib/route/cls/ematch_syntax.c" 2226 YY_SYMBOL_PRINT (
"-> $$ =", yyr1[yyn], &yyval, &yyloc);
2230 YY_STACK_PRINT (yyss, yyssp);
2240 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2241 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2242 yystate = yytable[yystate];
2244 yystate = yydefgoto[yyn - YYNTOKENS];
2255 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2261 #if ! YYERROR_VERBOSE 2262 yyerror (scanner, errp, root, YY_(
"syntax error"));
2264 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 2267 char const *yymsgp = YY_(
"syntax error");
2268 int yysyntax_error_status;
2269 yysyntax_error_status = YYSYNTAX_ERROR;
2270 if (yysyntax_error_status == 0)
2272 else if (yysyntax_error_status == 1)
2274 if (yymsg != yymsgbuf)
2275 YYSTACK_FREE (yymsg);
2276 yymsg = (
char *) YYSTACK_ALLOC (yymsg_alloc);
2280 yymsg_alloc =
sizeof yymsgbuf;
2281 yysyntax_error_status = 2;
2285 yysyntax_error_status = YYSYNTAX_ERROR;
2289 yyerror (scanner, errp, root, yymsgp);
2290 if (yysyntax_error_status == 2)
2291 goto yyexhaustedlab;
2293 # undef YYSYNTAX_ERROR 2299 if (yyerrstatus == 3)
2304 if (yychar <= YYEOF)
2307 if (yychar == YYEOF)
2312 yydestruct (
"Error: discarding",
2313 yytoken, &yylval, scanner, errp, root);
2338 YY_STACK_PRINT (yyss, yyssp);
2351 yyn = yypact[yystate];
2352 if (!yypact_value_is_default (yyn))
2355 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2368 yydestruct (
"Error: popping",
2369 yystos[yystate], yyvsp, scanner, errp, root);
2372 YY_STACK_PRINT (yyss, yyssp);
2375 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2377 YY_IGNORE_MAYBE_UNINITIALIZED_END
2381 YY_SYMBOL_PRINT (
"Shifting", yystos[yyn], yyvsp, yylsp);
2401 #if !defined yyoverflow || YYERROR_VERBOSE 2406 yyerror (scanner, errp, root, YY_(
"memory exhausted"));
2412 if (yychar != YYEMPTY)
2416 yytoken = YYTRANSLATE (yychar);
2417 yydestruct (
"Cleanup: discarding lookahead",
2418 yytoken, &yylval, scanner, errp, root);
2423 YY_STACK_PRINT (yyss, yyssp);
2424 while (yyssp != yyss)
2426 yydestruct (
"Cleanup: popping",
2427 yystos[*yyssp], yyvsp, scanner, errp, root);
2432 YYSTACK_FREE (yyss);
2435 if (yymsg != yymsgbuf)
2436 YYSTACK_FREE (yymsg);
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.