47 #define YYBISON_VERSION "3.0.5" 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) \ 1183 YYCASE_(0, YY_(
"syntax error"));
1184 YYCASE_(1, YY_(
"syntax error, unexpected %s"));
1185 YYCASE_(2, YY_(
"syntax error, unexpected %s, expecting %s"));
1186 YYCASE_(3, YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1187 YYCASE_(4, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1188 YYCASE_(5, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1193 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1194 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1199 if (*yymsg_alloc < yysize)
1201 *yymsg_alloc = 2 * yysize;
1202 if (! (yysize <= *yymsg_alloc
1203 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1204 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1214 while ((*yyp = *yyformat) !=
'\0')
1215 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1217 yyp += yytnamerr (yyp, yyarg[yyi++]);
1235 yydestruct (
const char *yymsg,
int yytype,
YYSTYPE *yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
1243 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1245 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1249 #line 141 "lib/route/cls/ematch_syntax.y" 1250 { free(((*yyvaluep).s)); NL_DBG(2,
"string destructor\n"); }
1251 #line 1252 "lib/route/cls/ematch_syntax.c" 1255 #line 143 "lib/route/cls/ematch_syntax.y" 1256 { free(((*yyvaluep).q).data); NL_DBG(2,
"quoted destructor\n"); }
1257 #line 1258 "lib/route/cls/ematch_syntax.c" 1261 #line 142 "lib/route/cls/ematch_syntax.y" 1262 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); }
1263 #line 1264 "lib/route/cls/ematch_syntax.c" 1267 #line 142 "lib/route/cls/ematch_syntax.y" 1268 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); }
1269 #line 1270 "lib/route/cls/ematch_syntax.c" 1273 #line 144 "lib/route/cls/ematch_syntax.y" 1274 { rtnl_meta_value_put(((*yyvaluep).mv)); NL_DBG(2,
"meta value destructor\n"); }
1275 #line 1276 "lib/route/cls/ematch_syntax.c" 1279 #line 143 "lib/route/cls/ematch_syntax.y" 1280 { free(((*yyvaluep).q).data); NL_DBG(2,
"quoted destructor\n"); }
1281 #line 1282 "lib/route/cls/ematch_syntax.c" 1285 #line 142 "lib/route/cls/ematch_syntax.y" 1286 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); }
1287 #line 1288 "lib/route/cls/ematch_syntax.c" 1294 YY_IGNORE_MAYBE_UNINITIALIZED_END
1305 yyparse (
void *scanner,
char **errp,
struct nl_list_head *root)
1314 YY_INITIAL_VALUE (
static YYSTYPE yyval_default;)
1315 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1332 yytype_int16 yyssa[YYINITDEPTH];
1334 yytype_int16 *yyssp;
1341 YYSIZE_T yystacksize;
1354 char *yymsg = yymsgbuf;
1355 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1358 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1364 yyssp = yyss = yyssa;
1365 yyvsp = yyvs = yyvsa;
1366 yystacksize = YYINITDEPTH;
1368 YYDPRINTF ((stderr,
"Starting parse\n"));
1387 if (yyss + yystacksize - 1 <= yyssp)
1390 YYSIZE_T yysize = yyssp - yyss + 1;
1398 yytype_int16 *yyss1 = yyss;
1404 yyoverflow (YY_(
"memory exhausted"),
1405 &yyss1, yysize *
sizeof (*yyssp),
1406 &yyvs1, yysize *
sizeof (*yyvsp),
1413 # ifndef YYSTACK_RELOCATE 1414 goto yyexhaustedlab;
1417 if (YYMAXDEPTH <= yystacksize)
1418 goto yyexhaustedlab;
1420 if (YYMAXDEPTH < yystacksize)
1421 yystacksize = YYMAXDEPTH;
1424 yytype_int16 *yyss1 = yyss;
1426 (
union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1428 goto yyexhaustedlab;
1429 YYSTACK_RELOCATE (yyss_alloc, yyss);
1430 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1431 # undef YYSTACK_RELOCATE 1433 YYSTACK_FREE (yyss1);
1438 yyssp = yyss + yysize - 1;
1439 yyvsp = yyvs + yysize - 1;
1441 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1442 (
unsigned long int) yystacksize));
1444 if (yyss + yystacksize - 1 <= yyssp)
1448 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1450 if (yystate == YYFINAL)
1464 yyn = yypact[yystate];
1465 if (yypact_value_is_default (yyn))
1471 if (yychar == YYEMPTY)
1473 YYDPRINTF ((stderr,
"Reading a token: "));
1474 yychar = yylex (&yylval, scanner);
1477 if (yychar <= YYEOF)
1479 yychar = yytoken = YYEOF;
1480 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1484 yytoken = YYTRANSLATE (yychar);
1485 YY_SYMBOL_PRINT (
"Next token is", yytoken, &yylval, &yylloc);
1491 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1496 if (yytable_value_is_error (yyn))
1508 YY_SYMBOL_PRINT (
"Shifting", yytoken, &yylval, &yylloc);
1514 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1516 YY_IGNORE_MAYBE_UNINITIALIZED_END
1525 yyn = yydefact[yystate];
1546 yyval = yyvsp[1-yylen];
1549 YY_REDUCE_PRINT (yyn);
1553 #line 153 "lib/route/cls/ematch_syntax.y" 1555 nl_list_add_tail(root, &(yyvsp[0].e)->e_list);
1557 #line 1558 "lib/route/cls/ematch_syntax.c" 1561 #line 160 "lib/route/cls/ematch_syntax.y" 1563 (yyval.e) = (yyvsp[0].e);
1565 #line 1566 "lib/route/cls/ematch_syntax.c" 1569 #line 164 "lib/route/cls/ematch_syntax.y" 1571 rtnl_ematch_set_flags((yyvsp[-2].e), (yyvsp[-1].i));
1574 nl_list_add_tail(&(yyvsp[-2].e)->e_list, &(yyvsp[0].e)->e_list);
1576 (yyval.e) = (yyvsp[-2].e);
1578 #line 1579 "lib/route/cls/ematch_syntax.c" 1582 #line 176 "lib/route/cls/ematch_syntax.y" 1584 rtnl_ematch_set_flags((yyvsp[0].e), TCF_EM_INVERT);
1585 (yyval.e) = (yyvsp[0].e);
1587 #line 1588 "lib/route/cls/ematch_syntax.c" 1591 #line 181 "lib/route/cls/ematch_syntax.y" 1593 (yyval.e) = (yyvsp[0].e);
1595 #line 1596 "lib/route/cls/ematch_syntax.c" 1599 #line 189 "lib/route/cls/ematch_syntax.y" 1601 struct rtnl_ematch *e;
1604 *errp = strdup(
"Unable to allocate ematch object");
1608 if (rtnl_ematch_set_kind(e, TCF_EM_CMP) < 0)
1611 rtnl_ematch_cmp_set(e, &(yyvsp[0].cmp));
1614 #line 1615 "lib/route/cls/ematch_syntax.c" 1618 #line 204 "lib/route/cls/ematch_syntax.y" 1620 struct rtnl_ematch *e;
1623 *errp = strdup(
"Unable to allocate ematch object");
1627 if (rtnl_ematch_set_kind(e, TCF_EM_NBYTE) < 0)
1630 rtnl_ematch_nbyte_set_offset(e, (yyvsp[-3].loc)->layer, (yyvsp[-3].loc)->offset);
1632 rtnl_ematch_nbyte_set_pattern(e, (uint8_t *) (yyvsp[-1].q).data, (yyvsp[-1].q).index);
1636 #line 1637 "lib/route/cls/ematch_syntax.c" 1640 #line 222 "lib/route/cls/ematch_syntax.y" 1642 struct rtnl_ematch *e;
1645 *errp = strdup(
"Unable to allocate ematch object");
1649 if (rtnl_ematch_set_kind(e, TCF_EM_TEXT) < 0)
1652 rtnl_ematch_text_set_algo(e, (yyvsp[-4].s));
1653 rtnl_ematch_text_set_pattern(e, (yyvsp[-3].q).data, (yyvsp[-3].q).index);
1655 if ((yyvsp[-2].loc)) {
1656 rtnl_ematch_text_set_from(e, (yyvsp[-2].loc)->layer, (yyvsp[-2].loc)->offset);
1660 if ((yyvsp[-1].loc)) {
1661 rtnl_ematch_text_set_to(e, (yyvsp[-1].loc)->layer, (yyvsp[-1].loc)->offset);
1667 #line 1668 "lib/route/cls/ematch_syntax.c" 1671 #line 249 "lib/route/cls/ematch_syntax.y" 1673 struct rtnl_ematch *e;
1676 *errp = strdup(
"Unable to allocate ematch object");
1680 if (rtnl_ematch_set_kind(e, TCF_EM_META) < 0)
1683 rtnl_ematch_meta_set_lvalue(e, (yyvsp[-3].mv));
1684 rtnl_ematch_meta_set_rvalue(e, (yyvsp[-1].mv));
1685 rtnl_ematch_meta_set_operand(e, (yyvsp[-2].i));
1689 #line 1690 "lib/route/cls/ematch_syntax.c" 1693 #line 268 "lib/route/cls/ematch_syntax.y" 1695 struct rtnl_ematch *e;
1698 *errp = strdup(
"Unable to allocate ematch object");
1702 if (rtnl_ematch_set_kind(e, TCF_EM_CONTAINER) < 0)
1706 nl_list_add_tail(&e->e_childs, &(yyvsp[-1].e)->e_list);
1710 #line 1711 "lib/route/cls/ematch_syntax.c" 1714 #line 296 "lib/route/cls/ematch_syntax.y" 1715 { (yyval.cmp) = (yyvsp[-1].cmp); }
1716 #line 1717 "lib/route/cls/ematch_syntax.c" 1720 #line 298 "lib/route/cls/ematch_syntax.y" 1721 { (yyval.cmp) = (yyvsp[0].cmp); }
1722 #line 1723 "lib/route/cls/ematch_syntax.c" 1726 #line 303 "lib/route/cls/ematch_syntax.y" 1728 if ((yyvsp[-2].loc)->align == TCF_EM_ALIGN_U16 ||
1729 (yyvsp[-2].loc)->align == TCF_EM_ALIGN_U32)
1730 (yyval.cmp).flags = TCF_EM_CMP_TRANS;
1732 memset(&(yyval.cmp), 0,
sizeof((yyval.cmp)));
1734 (yyval.cmp).mask = (yyvsp[-2].loc)->mask;
1735 (yyval.cmp).off = (yyvsp[-2].loc)->offset;
1736 (yyval.cmp).align = (yyvsp[-2].loc)->align;
1737 (yyval.cmp).layer = (yyvsp[-2].loc)->layer;
1738 (yyval.cmp).opnd = (yyvsp[-1].i);
1739 (yyval.cmp).val = (yyvsp[0].i);
1743 #line 1744 "lib/route/cls/ematch_syntax.c" 1747 #line 323 "lib/route/cls/ematch_syntax.y" 1748 { (yyval.loc) = NULL; }
1749 #line 1750 "lib/route/cls/ematch_syntax.c" 1753 #line 325 "lib/route/cls/ematch_syntax.y" 1754 { (yyval.loc) = (yyvsp[0].loc); }
1755 #line 1756 "lib/route/cls/ematch_syntax.c" 1759 #line 330 "lib/route/cls/ematch_syntax.y" 1760 { (yyval.loc) = NULL; }
1761 #line 1762 "lib/route/cls/ematch_syntax.c" 1765 #line 332 "lib/route/cls/ematch_syntax.y" 1766 { (yyval.loc) = (yyvsp[0].loc); }
1767 #line 1768 "lib/route/cls/ematch_syntax.c" 1771 #line 337 "lib/route/cls/ematch_syntax.y" 1772 { (yyval.mv) = rtnl_meta_value_alloc_var((yyvsp[0].q).data, (yyvsp[0].q).len); }
1773 #line 1774 "lib/route/cls/ematch_syntax.c" 1777 #line 339 "lib/route/cls/ematch_syntax.y" 1778 { (yyval.mv) = rtnl_meta_value_alloc_int((yyvsp[0].i)); }
1779 #line 1780 "lib/route/cls/ematch_syntax.c" 1783 #line 341 "lib/route/cls/ematch_syntax.y" 1784 { (yyval.mv) = META_ALLOC(META_INT, (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i64)); }
1785 #line 1786 "lib/route/cls/ematch_syntax.c" 1789 #line 343 "lib/route/cls/ematch_syntax.y" 1790 { (yyval.mv) = META_ALLOC(META_VAR, (yyvsp[-1].i), (yyvsp[0].i), 0); }
1791 #line 1792 "lib/route/cls/ematch_syntax.c" 1795 #line 347 "lib/route/cls/ematch_syntax.y" 1796 { (yyval.i) = META_ID(RANDOM); }
1797 #line 1798 "lib/route/cls/ematch_syntax.c" 1801 #line 348 "lib/route/cls/ematch_syntax.y" 1802 { (yyval.i) = META_ID(LOADAVG_0); }
1803 #line 1804 "lib/route/cls/ematch_syntax.c" 1807 #line 349 "lib/route/cls/ematch_syntax.y" 1808 { (yyval.i) = META_ID(LOADAVG_1); }
1809 #line 1810 "lib/route/cls/ematch_syntax.c" 1813 #line 350 "lib/route/cls/ematch_syntax.y" 1814 { (yyval.i) = META_ID(LOADAVG_2); }
1815 #line 1816 "lib/route/cls/ematch_syntax.c" 1819 #line 351 "lib/route/cls/ematch_syntax.y" 1820 { (yyval.i) = META_ID(DEV); }
1821 #line 1822 "lib/route/cls/ematch_syntax.c" 1825 #line 352 "lib/route/cls/ematch_syntax.y" 1826 { (yyval.i) = META_ID(PRIORITY); }
1827 #line 1828 "lib/route/cls/ematch_syntax.c" 1831 #line 353 "lib/route/cls/ematch_syntax.y" 1832 { (yyval.i) = META_ID(PROTOCOL); }
1833 #line 1834 "lib/route/cls/ematch_syntax.c" 1837 #line 354 "lib/route/cls/ematch_syntax.y" 1838 { (yyval.i) = META_ID(PKTTYPE); }
1839 #line 1840 "lib/route/cls/ematch_syntax.c" 1843 #line 355 "lib/route/cls/ematch_syntax.y" 1844 { (yyval.i) = META_ID(PKTLEN); }
1845 #line 1846 "lib/route/cls/ematch_syntax.c" 1849 #line 356 "lib/route/cls/ematch_syntax.y" 1850 { (yyval.i) = META_ID(DATALEN); }
1851 #line 1852 "lib/route/cls/ematch_syntax.c" 1855 #line 357 "lib/route/cls/ematch_syntax.y" 1856 { (yyval.i) = META_ID(MACLEN); }
1857 #line 1858 "lib/route/cls/ematch_syntax.c" 1861 #line 358 "lib/route/cls/ematch_syntax.y" 1862 { (yyval.i) = META_ID(NFMARK); }
1863 #line 1864 "lib/route/cls/ematch_syntax.c" 1867 #line 359 "lib/route/cls/ematch_syntax.y" 1868 { (yyval.i) = META_ID(TCINDEX); }
1869 #line 1870 "lib/route/cls/ematch_syntax.c" 1873 #line 360 "lib/route/cls/ematch_syntax.y" 1874 { (yyval.i) = META_ID(RTCLASSID); }
1875 #line 1876 "lib/route/cls/ematch_syntax.c" 1879 #line 361 "lib/route/cls/ematch_syntax.y" 1880 { (yyval.i) = META_ID(RTIIF); }
1881 #line 1882 "lib/route/cls/ematch_syntax.c" 1885 #line 362 "lib/route/cls/ematch_syntax.y" 1886 { (yyval.i) = META_ID(SK_FAMILY); }
1887 #line 1888 "lib/route/cls/ematch_syntax.c" 1891 #line 363 "lib/route/cls/ematch_syntax.y" 1892 { (yyval.i) = META_ID(SK_STATE); }
1893 #line 1894 "lib/route/cls/ematch_syntax.c" 1897 #line 364 "lib/route/cls/ematch_syntax.y" 1898 { (yyval.i) = META_ID(SK_REUSE); }
1899 #line 1900 "lib/route/cls/ematch_syntax.c" 1903 #line 365 "lib/route/cls/ematch_syntax.y" 1904 { (yyval.i) = META_ID(SK_REFCNT); }
1905 #line 1906 "lib/route/cls/ematch_syntax.c" 1909 #line 366 "lib/route/cls/ematch_syntax.y" 1910 { (yyval.i) = META_ID(SK_RCVBUF); }
1911 #line 1912 "lib/route/cls/ematch_syntax.c" 1915 #line 367 "lib/route/cls/ematch_syntax.y" 1916 { (yyval.i) = META_ID(SK_SNDBUF); }
1917 #line 1918 "lib/route/cls/ematch_syntax.c" 1921 #line 368 "lib/route/cls/ematch_syntax.y" 1922 { (yyval.i) = META_ID(SK_SHUTDOWN); }
1923 #line 1924 "lib/route/cls/ematch_syntax.c" 1927 #line 369 "lib/route/cls/ematch_syntax.y" 1928 { (yyval.i) = META_ID(SK_PROTO); }
1929 #line 1930 "lib/route/cls/ematch_syntax.c" 1933 #line 370 "lib/route/cls/ematch_syntax.y" 1934 { (yyval.i) = META_ID(SK_TYPE); }
1935 #line 1936 "lib/route/cls/ematch_syntax.c" 1939 #line 371 "lib/route/cls/ematch_syntax.y" 1940 { (yyval.i) = META_ID(SK_RMEM_ALLOC); }
1941 #line 1942 "lib/route/cls/ematch_syntax.c" 1945 #line 372 "lib/route/cls/ematch_syntax.y" 1946 { (yyval.i) = META_ID(SK_WMEM_ALLOC); }
1947 #line 1948 "lib/route/cls/ematch_syntax.c" 1951 #line 373 "lib/route/cls/ematch_syntax.y" 1952 { (yyval.i) = META_ID(SK_WMEM_QUEUED); }
1953 #line 1954 "lib/route/cls/ematch_syntax.c" 1957 #line 374 "lib/route/cls/ematch_syntax.y" 1958 { (yyval.i) = META_ID(SK_RCV_QLEN); }
1959 #line 1960 "lib/route/cls/ematch_syntax.c" 1963 #line 375 "lib/route/cls/ematch_syntax.y" 1964 { (yyval.i) = META_ID(SK_SND_QLEN); }
1965 #line 1966 "lib/route/cls/ematch_syntax.c" 1969 #line 376 "lib/route/cls/ematch_syntax.y" 1970 { (yyval.i) = META_ID(SK_ERR_QLEN); }
1971 #line 1972 "lib/route/cls/ematch_syntax.c" 1975 #line 377 "lib/route/cls/ematch_syntax.y" 1976 { (yyval.i) = META_ID(SK_FORWARD_ALLOCS); }
1977 #line 1978 "lib/route/cls/ematch_syntax.c" 1981 #line 378 "lib/route/cls/ematch_syntax.y" 1982 { (yyval.i) = META_ID(SK_ALLOCS); }
1983 #line 1984 "lib/route/cls/ematch_syntax.c" 1987 #line 379 "lib/route/cls/ematch_syntax.y" 1988 { (yyval.i) = __TCF_META_ID_SK_ROUTE_CAPS; }
1989 #line 1990 "lib/route/cls/ematch_syntax.c" 1993 #line 380 "lib/route/cls/ematch_syntax.y" 1994 { (yyval.i) = META_ID(SK_HASH); }
1995 #line 1996 "lib/route/cls/ematch_syntax.c" 1999 #line 381 "lib/route/cls/ematch_syntax.y" 2000 { (yyval.i) = META_ID(SK_LINGERTIME); }
2001 #line 2002 "lib/route/cls/ematch_syntax.c" 2005 #line 382 "lib/route/cls/ematch_syntax.y" 2006 { (yyval.i) = META_ID(SK_ACK_BACKLOG); }
2007 #line 2008 "lib/route/cls/ematch_syntax.c" 2011 #line 383 "lib/route/cls/ematch_syntax.y" 2012 { (yyval.i) = META_ID(SK_MAX_ACK_BACKLOG); }
2013 #line 2014 "lib/route/cls/ematch_syntax.c" 2017 #line 384 "lib/route/cls/ematch_syntax.y" 2018 { (yyval.i) = META_ID(SK_PRIO); }
2019 #line 2020 "lib/route/cls/ematch_syntax.c" 2023 #line 385 "lib/route/cls/ematch_syntax.y" 2024 { (yyval.i) = META_ID(SK_RCVLOWAT); }
2025 #line 2026 "lib/route/cls/ematch_syntax.c" 2029 #line 386 "lib/route/cls/ematch_syntax.y" 2030 { (yyval.i) = META_ID(SK_RCVTIMEO); }
2031 #line 2032 "lib/route/cls/ematch_syntax.c" 2035 #line 387 "lib/route/cls/ematch_syntax.y" 2036 { (yyval.i) = META_ID(SK_SNDTIMEO); }
2037 #line 2038 "lib/route/cls/ematch_syntax.c" 2041 #line 388 "lib/route/cls/ematch_syntax.y" 2042 { (yyval.i) = META_ID(SK_SENDMSG_OFF); }
2043 #line 2044 "lib/route/cls/ematch_syntax.c" 2047 #line 389 "lib/route/cls/ematch_syntax.y" 2048 { (yyval.i) = META_ID(SK_WRITE_PENDING); }
2049 #line 2050 "lib/route/cls/ematch_syntax.c" 2053 #line 390 "lib/route/cls/ematch_syntax.y" 2054 { (yyval.i) = META_ID(VLAN_TAG); }
2055 #line 2056 "lib/route/cls/ematch_syntax.c" 2059 #line 391 "lib/route/cls/ematch_syntax.y" 2060 { (yyval.i) = META_ID(RXHASH); }
2061 #line 2062 "lib/route/cls/ematch_syntax.c" 2065 #line 395 "lib/route/cls/ematch_syntax.y" 2066 { (yyval.i) = META_ID(DEV); }
2067 #line 2068 "lib/route/cls/ematch_syntax.c" 2071 #line 396 "lib/route/cls/ematch_syntax.y" 2072 { (yyval.i) = META_ID(SK_BOUND_IF); }
2073 #line 2074 "lib/route/cls/ematch_syntax.c" 2077 #line 404 "lib/route/cls/ematch_syntax.y" 2079 (yyval.q) = (yyvsp[0].q);
2081 #line 2082 "lib/route/cls/ematch_syntax.c" 2085 #line 408 "lib/route/cls/ematch_syntax.y" 2087 struct nl_addr *addr;
2094 if (!((yyval.q).data = calloc(1, (yyval.q).len))) {
2102 if (asprintf(errp,
"invalid pattern \"%s\"", (yyvsp[0].s)) == -1)
2107 #line 2108 "lib/route/cls/ematch_syntax.c" 2111 #line 437 "lib/route/cls/ematch_syntax.y" 2116 if (asprintf(errp,
"Packet location \"%s\" not found", (yyvsp[0].s)) == -1)
2123 #line 2124 "lib/route/cls/ematch_syntax.c" 2127 #line 450 "lib/route/cls/ematch_syntax.y" 2131 if ((yyvsp[0].i64) && (!(yyvsp[-4].i) || (yyvsp[-4].i) > TCF_EM_ALIGN_U32)) {
2132 *errp = strdup(
"mask only allowed for alignments u8|u16|u32");
2137 *errp = strdup(
"Unable to allocate packet location object");
2141 loc->name = strdup(
"<USER-DEFINED>");
2142 loc->align = (yyvsp[-4].i);
2143 loc->layer = (yyvsp[-3].i);
2144 loc->offset = (yyvsp[-1].i);
2145 loc->mask = (yyvsp[0].i64);
2149 #line 2150 "lib/route/cls/ematch_syntax.c" 2153 #line 475 "lib/route/cls/ematch_syntax.y" 2155 #line 2156 "lib/route/cls/ematch_syntax.c" 2159 #line 477 "lib/route/cls/ematch_syntax.y" 2160 { (yyval.i) = (yyvsp[-1].i); }
2161 #line 2162 "lib/route/cls/ematch_syntax.c" 2165 #line 479 "lib/route/cls/ematch_syntax.y" 2166 { (yyval.i) = (yyvsp[-1].i); }
2167 #line 2168 "lib/route/cls/ematch_syntax.c" 2171 #line 484 "lib/route/cls/ematch_syntax.y" 2172 { (yyval.i64) = 0; }
2173 #line 2174 "lib/route/cls/ematch_syntax.c" 2177 #line 486 "lib/route/cls/ematch_syntax.y" 2178 { (yyval.i64) = (yyvsp[0].i); }
2179 #line 2180 "lib/route/cls/ematch_syntax.c" 2183 #line 491 "lib/route/cls/ematch_syntax.y" 2185 #line 2186 "lib/route/cls/ematch_syntax.c" 2189 #line 493 "lib/route/cls/ematch_syntax.y" 2190 { (yyval.i) = (yyvsp[0].i); }
2191 #line 2192 "lib/route/cls/ematch_syntax.c" 2195 #line 498 "lib/route/cls/ematch_syntax.y" 2196 { (yyval.i) = TCF_EM_OPND_EQ; }
2197 #line 2198 "lib/route/cls/ematch_syntax.c" 2201 #line 500 "lib/route/cls/ematch_syntax.y" 2202 { (yyval.i) = TCF_EM_OPND_GT; }
2203 #line 2204 "lib/route/cls/ematch_syntax.c" 2207 #line 502 "lib/route/cls/ematch_syntax.y" 2208 { (yyval.i) = TCF_EM_OPND_LT; }
2209 #line 2210 "lib/route/cls/ematch_syntax.c" 2213 #line 2214 "lib/route/cls/ematch_syntax.c" 2227 YY_SYMBOL_PRINT (
"-> $$ =", yyr1[yyn], &yyval, &yyloc);
2231 YY_STACK_PRINT (yyss, yyssp);
2241 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2242 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2243 yystate = yytable[yystate];
2245 yystate = yydefgoto[yyn - YYNTOKENS];
2256 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2262 #if ! YYERROR_VERBOSE 2263 yyerror (scanner, errp, root, YY_(
"syntax error"));
2265 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 2268 char const *yymsgp = YY_(
"syntax error");
2269 int yysyntax_error_status;
2270 yysyntax_error_status = YYSYNTAX_ERROR;
2271 if (yysyntax_error_status == 0)
2273 else if (yysyntax_error_status == 1)
2275 if (yymsg != yymsgbuf)
2276 YYSTACK_FREE (yymsg);
2277 yymsg = (
char *) YYSTACK_ALLOC (yymsg_alloc);
2281 yymsg_alloc =
sizeof yymsgbuf;
2282 yysyntax_error_status = 2;
2286 yysyntax_error_status = YYSYNTAX_ERROR;
2290 yyerror (scanner, errp, root, yymsgp);
2291 if (yysyntax_error_status == 2)
2292 goto yyexhaustedlab;
2294 # undef YYSYNTAX_ERROR 2300 if (yyerrstatus == 3)
2305 if (yychar <= YYEOF)
2308 if (yychar == YYEOF)
2313 yydestruct (
"Error: discarding",
2314 yytoken, &yylval, scanner, errp, root);
2339 YY_STACK_PRINT (yyss, yyssp);
2352 yyn = yypact[yystate];
2353 if (!yypact_value_is_default (yyn))
2356 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2369 yydestruct (
"Error: popping",
2370 yystos[yystate], yyvsp, scanner, errp, root);
2373 YY_STACK_PRINT (yyss, yyssp);
2376 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2378 YY_IGNORE_MAYBE_UNINITIALIZED_END
2382 YY_SYMBOL_PRINT (
"Shifting", yystos[yyn], yyvsp, yylsp);
2402 #if !defined yyoverflow || YYERROR_VERBOSE 2407 yyerror (scanner, errp, root, YY_(
"memory exhausted"));
2413 if (yychar != YYEMPTY)
2417 yytoken = YYTRANSLATE (yychar);
2418 yydestruct (
"Cleanup: discarding lookahead",
2419 yytoken, &yylval, scanner, errp, root);
2424 YY_STACK_PRINT (yyss, yyssp);
2425 while (yyssp != yyss)
2427 yydestruct (
"Cleanup: popping",
2428 yystos[*yyssp], yyvsp, scanner, errp, root);
2433 YYSTACK_FREE (yyss);
2436 if (yymsg != yymsgbuf)
2437 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.