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 "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> 84 #define META_ALLOC rtnl_meta_value_alloc_id 85 #define META_ID(name) TCF_META_ID_##name 86 #define META_INT TCF_META_TYPE_INT 87 #define META_VAR TCF_META_TYPE_VAR 89 #line 90 "route/cls/ematch_syntax.c" 92 # if defined __cplusplus && 201103L <= __cplusplus 93 # define YY_NULLPTR nullptr 100 #ifdef YYERROR_VERBOSE 101 # undef YYERROR_VERBOSE 102 # define YYERROR_VERBOSE 1 104 # define YYERROR_VERBOSE 1 109 #ifndef YY_EMATCH_ROUTE_CLS_EMATCH_SYNTAX_H_INCLUDED 110 # define YY_EMATCH_ROUTE_CLS_EMATCH_SYNTAX_H_INCLUDED 116 extern int ematch_debug;
147 META_LOADAVG_0 = 281,
148 META_LOADAVG_1 = 282,
149 META_LOADAVG_2 = 283,
159 META_RTCLASSID = 293,
161 META_SK_FAMILY = 295,
164 META_SK_REFCNT = 298,
165 META_SK_RCVBUF = 299,
166 META_SK_SNDBUF = 300,
167 META_SK_SHUTDOWN = 301,
170 META_SK_RMEM_ALLOC = 304,
171 META_SK_WMEM_ALLOC = 305,
172 META_SK_WMEM_QUEUED = 306,
173 META_SK_RCV_QLEN = 307,
174 META_SK_SND_QLEN = 308,
175 META_SK_ERR_QLEN = 309,
176 META_SK_FORWARD_ALLOCS = 310,
177 META_SK_ALLOCS = 311,
178 META_SK_ROUTE_CAPS = 312,
180 META_SK_LINGERTIME = 314,
181 META_SK_ACK_BACKLOG = 315,
182 META_SK_MAX_ACK_BACKLOG = 316,
184 META_SK_RCVLOWAT = 318,
185 META_SK_RCVTIMEO = 319,
186 META_SK_SNDTIMEO = 320,
187 META_SK_SENDMSG_OFF = 321,
188 META_SK_WRITE_PENDING = 322,
192 META_SK_BOUND_IF = 326,
211 #define EMATCH_CMP 271 212 #define EMATCH_NBYTE 272 213 #define EMATCH_TEXT 273 214 #define EMATCH_META 274 220 #define META_RANDOM 280 221 #define META_LOADAVG_0 281 222 #define META_LOADAVG_1 282 223 #define META_LOADAVG_2 283 225 #define META_PRIO 285 226 #define META_PROTO 286 227 #define META_PKTTYPE 287 228 #define META_PKTLEN 288 229 #define META_DATALEN 289 230 #define META_MACLEN 290 231 #define META_MARK 291 232 #define META_TCINDEX 292 233 #define META_RTCLASSID 293 234 #define META_RTIIF 294 235 #define META_SK_FAMILY 295 236 #define META_SK_STATE 296 237 #define META_SK_REUSE 297 238 #define META_SK_REFCNT 298 239 #define META_SK_RCVBUF 299 240 #define META_SK_SNDBUF 300 241 #define META_SK_SHUTDOWN 301 242 #define META_SK_PROTO 302 243 #define META_SK_TYPE 303 244 #define META_SK_RMEM_ALLOC 304 245 #define META_SK_WMEM_ALLOC 305 246 #define META_SK_WMEM_QUEUED 306 247 #define META_SK_RCV_QLEN 307 248 #define META_SK_SND_QLEN 308 249 #define META_SK_ERR_QLEN 309 250 #define META_SK_FORWARD_ALLOCS 310 251 #define META_SK_ALLOCS 311 252 #define META_SK_ROUTE_CAPS 312 253 #define META_SK_HASH 313 254 #define META_SK_LINGERTIME 314 255 #define META_SK_ACK_BACKLOG 315 256 #define META_SK_MAX_ACK_BACKLOG 316 257 #define META_SK_PRIO 317 258 #define META_SK_RCVLOWAT 318 259 #define META_SK_RCVTIMEO 319 260 #define META_SK_SNDTIMEO 320 261 #define META_SK_SENDMSG_OFF 321 262 #define META_SK_WRITE_PENDING 322 263 #define META_VLAN 323 264 #define META_RXHASH 324 265 #define META_DEVNAME 325 266 #define META_SK_BOUND_IF 326 271 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 275 #line 39 "route/cls/ematch_syntax.y" 277 struct tcf_em_cmp cmp;
278 struct ematch_quoted q;
279 struct rtnl_ematch * e;
286 #line 287 "route/cls/ematch_syntax.c" 290 # define YYSTYPE_IS_TRIVIAL 1 291 # define YYSTYPE_IS_DECLARED 1 296 int ematch_parse (
void *scanner,
char **errp,
struct nl_list_head *root);
301 #line 50 "route/cls/ematch_syntax.y" 303 extern int ematch_lex(YYSTYPE *,
void *);
305 static void yyerror(
void *scanner,
char **errp,
struct nl_list_head *root,
const char *msg)
313 #line 314 "route/cls/ematch_syntax.c" 320 typedef YYTYPE_UINT8 yytype_uint8;
322 typedef unsigned char yytype_uint8;
326 typedef YYTYPE_INT8 yytype_int8;
328 typedef signed char yytype_int8;
332 typedef YYTYPE_UINT16 yytype_uint16;
334 typedef unsigned short int yytype_uint16;
338 typedef YYTYPE_INT16 yytype_int16;
340 typedef short int yytype_int16;
344 # ifdef __SIZE_TYPE__ 345 # define YYSIZE_T __SIZE_TYPE__ 346 # elif defined size_t 347 # define YYSIZE_T size_t 348 # elif ! defined YYSIZE_T 350 # define YYSIZE_T size_t 352 # define YYSIZE_T unsigned int 356 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 359 # if defined YYENABLE_NLS && YYENABLE_NLS 361 # include <libintl.h> 362 # define YY_(Msgid) dgettext ("bison-runtime", Msgid) 366 # define YY_(Msgid) Msgid 371 # if (defined __GNUC__ \ 372 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 373 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 374 # define YY_ATTRIBUTE(Spec) __attribute__(Spec) 376 # define YY_ATTRIBUTE(Spec) 380 #ifndef YY_ATTRIBUTE_PURE 381 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 384 #ifndef YY_ATTRIBUTE_UNUSED 385 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 388 #if !defined _Noreturn \ 389 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) 390 # if defined _MSC_VER && 1200 <= _MSC_VER 391 # define _Noreturn __declspec (noreturn) 393 # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) 398 #if ! defined lint || defined __GNUC__ 399 # define YYUSE(E) ((void) (E)) 404 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 406 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 407 _Pragma ("GCC diagnostic push") \ 408 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 409 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 410 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 411 _Pragma ("GCC diagnostic pop") 413 # define YY_INITIAL_VALUE(Value) Value 415 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 416 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 417 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 419 #ifndef YY_INITIAL_VALUE 420 # define YY_INITIAL_VALUE(Value) 424 #if ! defined yyoverflow || YYERROR_VERBOSE 428 # ifdef YYSTACK_USE_ALLOCA 429 # if YYSTACK_USE_ALLOCA 431 # define YYSTACK_ALLOC __builtin_alloca 432 # elif defined __BUILTIN_VA_ARG_INCR 435 # define YYSTACK_ALLOC __alloca 436 # elif defined _MSC_VER 438 # define alloca _alloca 440 # define YYSTACK_ALLOC alloca 441 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 444 # ifndef EXIT_SUCCESS 445 # define EXIT_SUCCESS 0 452 # ifdef YYSTACK_ALLOC 454 # define YYSTACK_FREE(Ptr) do { ; } while (0) 455 # ifndef YYSTACK_ALLOC_MAXIMUM 460 # define YYSTACK_ALLOC_MAXIMUM 4032 463 # define YYSTACK_ALLOC YYMALLOC 464 # define YYSTACK_FREE YYFREE 465 # ifndef YYSTACK_ALLOC_MAXIMUM 466 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 468 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 469 && ! ((defined YYMALLOC || defined malloc) \ 470 && (defined YYFREE || defined free))) 472 # ifndef EXIT_SUCCESS 473 # define EXIT_SUCCESS 0 477 # define YYMALLOC malloc 478 # if ! defined malloc && ! defined EXIT_SUCCESS 479 void *malloc (YYSIZE_T);
484 # if ! defined free && ! defined EXIT_SUCCESS 492 #if (! defined yyoverflow \ 493 && (! defined __cplusplus \ 494 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 499 yytype_int16 yyss_alloc;
504 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 508 # define YYSTACK_BYTES(N) \ 509 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 510 + YYSTACK_GAP_MAXIMUM) 512 # define YYCOPY_NEEDED 1 519 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 522 YYSIZE_T yynewbytes; \ 523 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 524 Stack = &yyptr->Stack_alloc; \ 525 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 526 yyptr += yynewbytes / sizeof (*yyptr); \ 532 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 536 # if defined __GNUC__ && 1 < __GNUC__ 537 # define YYCOPY(Dst, Src, Count) \ 538 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 540 # define YYCOPY(Dst, Src, Count) \ 544 for (yyi = 0; yyi < (Count); yyi++) \ 545 (Dst)[yyi] = (Src)[yyi]; \ 564 #define YYNSTATES 118 569 #define YYMAXUTOK 328 571 #define YYTRANSLATE(YYX) \ 572 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 576 static const yytype_uint8 yytranslate[] =
578 0, 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, 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, 1, 2, 3, 4,
604 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
605 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
606 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
607 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
608 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
609 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
610 65, 66, 67, 68, 69, 70, 71, 72, 73
615 static const yytype_uint16 yyrline[] =
617 0, 148, 148, 150, 157, 161, 173, 178, 186, 201,
618 219, 246, 265, 293, 295, 300, 321, 322, 328, 329,
619 334, 336, 338, 340, 345, 346, 347, 348, 349, 350,
620 351, 352, 353, 354, 355, 356, 357, 358, 359, 360,
621 361, 362, 363, 364, 365, 366, 367, 368, 369, 370,
622 371, 372, 373, 374, 375, 376, 377, 378, 379, 380,
623 381, 382, 383, 384, 385, 386, 387, 388, 389, 393,
624 394, 401, 405, 434, 447, 473, 474, 476, 482, 483,
625 489, 490, 495, 497, 499
629 #if YYDEBUG || YYERROR_VERBOSE || 1 632 static const char *
const yytname[] =
634 "$end",
"error",
"$undefined",
"ERROR",
"LOGIC",
"NOT",
"OPERAND",
635 "NUMBER",
"ALIGN",
"LAYER",
"\"(\"",
"\")\"",
"\"+\"",
"\"mask\"",
636 "\">>\"",
"\"at\"",
"\"cmp\"",
"\"pattern\"",
"\"text\"",
"\"meta\"",
637 "\"=\"",
"\">\"",
"\"<\"",
"\"from\"",
"\"to\"",
"\"random\"",
638 "\"loadavg_0\"",
"\"loadavg_1\"",
"\"loadavg_2\"",
"\"dev\"",
"\"prio\"",
639 "\"proto\"",
"\"pkttype\"",
"\"pktlen\"",
"\"datalen\"",
"\"maclen\"",
640 "\"mark\"",
"\"tcindex\"",
"\"rtclassid\"",
"\"rtiif\"",
"\"sk_family\"",
641 "\"sk_state\"",
"\"sk_reuse\"",
"\"sk_refcnt\"",
"\"sk_rcvbuf\"",
642 "\"sk_sndbuf\"",
"\"sk_shutdown\"",
"\"sk_proto\"",
"\"sk_type\"",
643 "\"sk_rmem_alloc\"",
"\"sk_wmem_alloc\"",
"\"sk_wmem_queued\"",
644 "\"sk_rcv_qlen\"",
"\"sk_snd_qlen\"",
"\"sk_err_qlen\"",
645 "\"sk_forward_allocs\"",
"\"sk_allocs\"",
"\"sk_route_caps\"",
646 "\"sk_hash\"",
"\"sk_lingertime\"",
"\"sk_ack_backlog\"",
647 "\"sk_max_ack_backlog\"",
"\"sk_prio\"",
"\"sk_rcvlowat\"",
648 "\"sk_rcvtimeo\"",
"\"sk_sndtimeo\"",
"\"sk_sendmsg_off\"",
649 "\"sk_write_pending\"",
"\"vlan\"",
"\"rxhash\"",
"\"devname\"",
650 "\"sk_bound_if\"",
"STR",
"QUOTED",
"$accept",
"input",
"expr",
"match",
651 "ematch",
"cmp_match",
"cmp_expr",
"text_from",
"text_to",
"meta_value",
652 "meta_int_id",
"meta_var_id",
"pattern",
"pktloc",
"align",
"mask",
653 "shift",
"operand", YY_NULLPTR
660 static const yytype_uint16 yytoknum[] =
662 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
663 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
664 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
665 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
666 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
667 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
668 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
673 #define YYPACT_NINF -63 675 #define yypact_value_is_default(Yystate) \ 676 (!!((Yystate) == (-63))) 678 #define YYTABLE_NINF -76 680 #define yytable_value_is_error(Yytable_value) \ 685 static const yytype_int8 yypact[] =
687 -4, 15, -13, -8, 11, 10, 14, 25, 29, -63,
688 26, -63, 37, -63, -63, -63, 16, 33, -63, -63,
689 -63, 32, 1, 1, -28, 65, -63, 11, -63, -63,
690 -63, 38, 34, -63, 36, 28, -24, -63, -63, -63,
691 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
692 -63, -63, -63, -63, -63, -63, -63, -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, 16, 39, 39, -63,
696 -63, 43, -63, -62, 31, 65, 44, 42, -63, 42,
697 -63, -63, 41, 1, 35, 45, -63, 50, -63, -63,
698 -63, -63, 1, 47, -63, -63, -63, -63
704 static const yytype_uint8 yydefact[] =
706 2, 75, 0, 0, 75, 0, 0, 0, 0, 73,
707 0, 3, 4, 7, 8, 14, 0, 0, 6, 77,
708 76, 0, 75, 75, 0, 0, 1, 75, 82, 83,
709 84, 0, 0, 12, 0, 0, 0, 21, 24, 25,
710 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
711 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
712 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
713 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
714 66, 67, 68, 69, 70, 20, 0, 80, 80, 5,
715 15, 0, 13, 0, 16, 0, 0, 78, 23, 78,
716 72, 71, 0, 75, 18, 0, 81, 0, 22, 74,
717 9, 17, 75, 0, 11, 79, 19, 10
721 static const yytype_int8 yypgoto[] =
723 -63, -63, 13, -63, 59, -63, 40, -63, -63, -34,
724 -63, -63, -63, -23, -63, -36, -22, -21
728 static const yytype_int8 yydefgoto[] =
730 -1, 10, 11, 12, 13, 14, 15, 104, 113, 86,
731 87, 88, 102, 16, 17, 108, 97, 31
737 static const yytype_int8 yytable[] =
739 35, 1, 19, 2, 3, -75, 4, 20, 2, 3,
740 100, 101, 5, 6, 7, 8, 1, 21, 2, 3,
741 22, 4, 2, 3, 23, 4, 26, 5, 6, 7,
742 8, 5, 6, 7, 8, 24, 28, 29, 30, 25,
743 89, 27, 32, 33, 36, 90, 91, 92, 93, 94,
744 99, 106, 110, 96, 103, 107, 114, 115, 117, 112,
745 18, 105, 34, 109, 0, 95, 98, 0, 9, 0,
746 0, 0, 37, 9, 0, 0, 0, 0, 0, 0,
747 111, 0, 0, 9, 0, 0, 0, 9, 0, 116,
748 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
749 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
750 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
751 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
752 78, 79, 80, 81, 82, 83, 84, 0, 85
755 static const yytype_int8 yycheck[] =
757 23, 5, 15, 7, 8, 9, 10, 15, 7, 8,
758 72, 73, 16, 17, 18, 19, 5, 4, 7, 8,
759 10, 10, 7, 8, 10, 10, 0, 16, 17, 18,
760 19, 16, 17, 18, 19, 10, 20, 21, 22, 10,
761 27, 4, 9, 11, 72, 7, 12, 11, 20, 73,
762 7, 7, 11, 14, 23, 13, 11, 7, 11, 24,
763 1, 95, 22, 99, -1, 86, 88, -1, 72, -1,
764 -1, -1, 7, 72, -1, -1, -1, -1, -1, -1,
765 103, -1, -1, 72, -1, -1, -1, 72, -1, 112,
766 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
767 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
768 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
769 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
770 65, 66, 67, 68, 69, 70, 71, -1, 73
775 static const yytype_uint8 yystos[] =
777 0, 5, 7, 8, 10, 16, 17, 18, 19, 72,
778 75, 76, 77, 78, 79, 80, 87, 88, 78, 15,
779 15, 76, 10, 10, 10, 10, 0, 4, 20, 21,
780 22, 91, 9, 11, 80, 87, 72, 7, 25, 26,
781 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
782 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
783 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
784 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
785 67, 68, 69, 70, 71, 73, 83, 84, 85, 76,
786 7, 12, 11, 20, 73, 91, 14, 90, 90, 7,
787 72, 73, 86, 23, 81, 83, 7, 13, 89, 89,
788 11, 87, 24, 82, 11, 7, 87, 11
792 static const yytype_uint8 yyr1[] =
794 0, 74, 75, 75, 76, 76, 77, 77, 78, 78,
795 78, 78, 78, 79, 79, 80, 81, 81, 82, 82,
796 83, 83, 83, 83, 84, 84, 84, 84, 84, 84,
797 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
798 84, 84, 84, 84, 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, 85,
801 85, 86, 86, 87, 87, 88, 88, 88, 89, 89,
806 static const yytype_uint8 yyr2[] =
808 0, 2, 0, 1, 1, 3, 2, 1, 1, 6,
809 7, 6, 3, 4, 1, 3, 0, 2, 0, 2,
810 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
811 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
812 1, 1, 1, 1, 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, 5, 0, 2, 2, 0, 2,
820 #define yyerrok (yyerrstatus = 0) 821 #define yyclearin (yychar = YYEMPTY) 825 #define YYACCEPT goto yyacceptlab 826 #define YYABORT goto yyabortlab 827 #define YYERROR goto yyerrorlab 830 #define YYRECOVERING() (!!yyerrstatus) 832 #define YYBACKUP(Token, Value) \ 834 if (yychar == YYEMPTY) \ 838 YYPOPSTACK (yylen); \ 844 yyerror (scanner, errp, root, YY_("syntax error: cannot back up")); \ 851 #define YYERRCODE 256 860 # define YYFPRINTF fprintf 863 # define YYDPRINTF(Args) \ 870 #ifndef YY_LOCATION_PRINT 871 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 875 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 879 YYFPRINTF (stderr, "%s ", Title); \ 880 yy_symbol_print (stderr, \ 881 Type, Value, scanner, errp, root); \ 882 YYFPRINTF (stderr, "\n"); \ 892 yy_symbol_value_print (FILE *yyoutput,
int yytype, YYSTYPE
const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
894 FILE *yyo = yyoutput;
902 if (yytype < YYNTOKENS)
903 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
914 yy_symbol_print (FILE *yyoutput,
int yytype, YYSTYPE
const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
916 YYFPRINTF (yyoutput,
"%s %s (",
917 yytype < YYNTOKENS ?
"token" :
"nterm", yytname[yytype]);
919 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root);
920 YYFPRINTF (yyoutput,
")");
929 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
931 YYFPRINTF (stderr,
"Stack now");
932 for (; yybottom <= yytop; yybottom++)
934 int yybot = *yybottom;
935 YYFPRINTF (stderr,
" %d", yybot);
937 YYFPRINTF (stderr,
"\n");
940 # define YY_STACK_PRINT(Bottom, Top) \ 943 yy_stack_print ((Bottom), (Top)); \ 952 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp,
int yyrule,
void *scanner,
char **errp,
struct nl_list_head *root)
954 unsigned long int yylno = yyrline[yyrule];
955 int yynrhs = yyr2[yyrule];
957 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
960 for (yyi = 0; yyi < yynrhs; yyi++)
962 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
963 yy_symbol_print (stderr,
964 yystos[yyssp[yyi + 1 - yynrhs]],
965 &(yyvsp[(yyi + 1) - (yynrhs)])
966 , scanner, errp, root);
967 YYFPRINTF (stderr,
"\n");
971 # define YY_REDUCE_PRINT(Rule) \ 974 yy_reduce_print (yyssp, yyvsp, Rule, scanner, errp, root); \ 981 # define YYDPRINTF(Args) 982 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 983 # define YY_STACK_PRINT(Bottom, Top) 984 # define YY_REDUCE_PRINT(Rule) 990 # define YYINITDEPTH 200 1001 # define YYMAXDEPTH 10000 1008 # if defined __GLIBC__ && defined _STRING_H 1009 # define yystrlen strlen 1013 yystrlen (
const char *yystr)
1016 for (yylen = 0; yystr[yylen]; yylen++)
1024 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 1025 # define yystpcpy stpcpy 1030 yystpcpy (
char *yydest,
const char *yysrc)
1033 const char *yys = yysrc;
1035 while ((*yyd++ = *yys++) !=
'\0')
1052 yytnamerr (
char *yyres,
const char *yystr)
1057 char const *yyp = yystr;
1064 goto do_not_strip_quotes;
1068 goto do_not_strip_quotes;
1081 do_not_strip_quotes: ;
1085 return yystrlen (yystr);
1087 return yystpcpy (yyres, yystr) - yyres;
1100 yysyntax_error (YYSIZE_T *yymsg_alloc,
char **yymsg,
1101 yytype_int16 *yyssp,
int yytoken)
1103 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1104 YYSIZE_T yysize = yysize0;
1105 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1107 const char *yyformat = YY_NULLPTR;
1109 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1137 if (yytoken != YYEMPTY)
1139 int yyn = yypact[*yyssp];
1140 yyarg[yycount++] = yytname[yytoken];
1141 if (!yypact_value_is_default (yyn))
1146 int yyxbegin = yyn < 0 ? -yyn : 0;
1148 int yychecklim = YYLAST - yyn + 1;
1149 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1152 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1153 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1154 && !yytable_value_is_error (yytable[yyx + yyn]))
1156 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1162 yyarg[yycount++] = yytname[yyx];
1164 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1165 if (! (yysize <= yysize1
1166 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1176 # define YYCASE_(N, S) \ 1180 YYCASE_(0, YY_(
"syntax error"));
1181 YYCASE_(1, YY_(
"syntax error, unexpected %s"));
1182 YYCASE_(2, YY_(
"syntax error, unexpected %s, expecting %s"));
1183 YYCASE_(3, YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1184 YYCASE_(4, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1185 YYCASE_(5, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1190 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1191 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1196 if (*yymsg_alloc < yysize)
1198 *yymsg_alloc = 2 * yysize;
1199 if (! (yysize <= *yymsg_alloc
1200 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1201 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1211 while ((*yyp = *yyformat) !=
'\0')
1212 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1214 yyp += yytnamerr (yyp, yyarg[yyi++]);
1232 yydestruct (
const char *yymsg,
int yytype, YYSTYPE *yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
1240 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1242 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1246 #line 139 "route/cls/ematch_syntax.y" 1247 { free(((*yyvaluep).s)); NL_DBG(2,
"string destructor\n"); }
1248 #line 1249 "route/cls/ematch_syntax.c" 1252 #line 141 "route/cls/ematch_syntax.y" 1253 { free(((*yyvaluep).q).data); NL_DBG(2,
"quoted destructor\n"); }
1254 #line 1255 "route/cls/ematch_syntax.c" 1258 #line 140 "route/cls/ematch_syntax.y" 1259 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); }
1260 #line 1261 "route/cls/ematch_syntax.c" 1264 #line 140 "route/cls/ematch_syntax.y" 1265 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); }
1266 #line 1267 "route/cls/ematch_syntax.c" 1270 #line 142 "route/cls/ematch_syntax.y" 1271 { rtnl_meta_value_put(((*yyvaluep).mv)); NL_DBG(2,
"meta value destructor\n"); }
1272 #line 1273 "route/cls/ematch_syntax.c" 1276 #line 141 "route/cls/ematch_syntax.y" 1277 { free(((*yyvaluep).q).data); NL_DBG(2,
"quoted destructor\n"); }
1278 #line 1279 "route/cls/ematch_syntax.c" 1282 #line 140 "route/cls/ematch_syntax.y" 1283 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); }
1284 #line 1285 "route/cls/ematch_syntax.c" 1291 YY_IGNORE_MAYBE_UNINITIALIZED_END
1302 yyparse (
void *scanner,
char **errp,
struct nl_list_head *root)
1311 YY_INITIAL_VALUE (
static YYSTYPE yyval_default;)
1312 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1329 yytype_int16 yyssa[YYINITDEPTH];
1331 yytype_int16 *yyssp;
1334 YYSTYPE yyvsa[YYINITDEPTH];
1338 YYSIZE_T yystacksize;
1351 char *yymsg = yymsgbuf;
1352 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1355 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1361 yyssp = yyss = yyssa;
1362 yyvsp = yyvs = yyvsa;
1363 yystacksize = YYINITDEPTH;
1365 YYDPRINTF ((stderr,
"Starting parse\n"));
1384 if (yyss + yystacksize - 1 <= yyssp)
1387 YYSIZE_T yysize = yyssp - yyss + 1;
1394 YYSTYPE *yyvs1 = yyvs;
1395 yytype_int16 *yyss1 = yyss;
1401 yyoverflow (YY_(
"memory exhausted"),
1402 &yyss1, yysize *
sizeof (*yyssp),
1403 &yyvs1, yysize *
sizeof (*yyvsp),
1410 # ifndef YYSTACK_RELOCATE 1411 goto yyexhaustedlab;
1414 if (YYMAXDEPTH <= yystacksize)
1415 goto yyexhaustedlab;
1417 if (YYMAXDEPTH < yystacksize)
1418 yystacksize = YYMAXDEPTH;
1421 yytype_int16 *yyss1 = yyss;
1423 (
union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1425 goto yyexhaustedlab;
1426 YYSTACK_RELOCATE (yyss_alloc, yyss);
1427 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1428 # undef YYSTACK_RELOCATE 1430 YYSTACK_FREE (yyss1);
1435 yyssp = yyss + yysize - 1;
1436 yyvsp = yyvs + yysize - 1;
1438 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1439 (
unsigned long int) yystacksize));
1441 if (yyss + yystacksize - 1 <= yyssp)
1445 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1447 if (yystate == YYFINAL)
1461 yyn = yypact[yystate];
1462 if (yypact_value_is_default (yyn))
1468 if (yychar == YYEMPTY)
1470 YYDPRINTF ((stderr,
"Reading a token: "));
1471 yychar = yylex (&yylval, scanner);
1474 if (yychar <= YYEOF)
1476 yychar = yytoken = YYEOF;
1477 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1481 yytoken = YYTRANSLATE (yychar);
1482 YY_SYMBOL_PRINT (
"Next token is", yytoken, &yylval, &yylloc);
1488 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1493 if (yytable_value_is_error (yyn))
1505 YY_SYMBOL_PRINT (
"Shifting", yytoken, &yylval, &yylloc);
1511 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1513 YY_IGNORE_MAYBE_UNINITIALIZED_END
1522 yyn = yydefact[yystate];
1543 yyval = yyvsp[1-yylen];
1546 YY_REDUCE_PRINT (yyn);
1550 #line 151 "route/cls/ematch_syntax.y" 1552 nl_list_add_tail(root, &(yyvsp[0].e)->e_list);
1554 #line 1555 "route/cls/ematch_syntax.c" 1558 #line 158 "route/cls/ematch_syntax.y" 1560 (yyval.e) = (yyvsp[0].e);
1562 #line 1563 "route/cls/ematch_syntax.c" 1566 #line 162 "route/cls/ematch_syntax.y" 1568 rtnl_ematch_set_flags((yyvsp[-2].e), (yyvsp[-1].i));
1571 nl_list_add_tail(&(yyvsp[-2].e)->e_list, &(yyvsp[0].e)->e_list);
1573 (yyval.e) = (yyvsp[-2].e);
1575 #line 1576 "route/cls/ematch_syntax.c" 1579 #line 174 "route/cls/ematch_syntax.y" 1581 rtnl_ematch_set_flags((yyvsp[0].e), TCF_EM_INVERT);
1582 (yyval.e) = (yyvsp[0].e);
1584 #line 1585 "route/cls/ematch_syntax.c" 1588 #line 179 "route/cls/ematch_syntax.y" 1590 (yyval.e) = (yyvsp[0].e);
1592 #line 1593 "route/cls/ematch_syntax.c" 1596 #line 187 "route/cls/ematch_syntax.y" 1598 struct rtnl_ematch *e;
1601 *errp = strdup(
"Unable to allocate ematch object");
1605 if (rtnl_ematch_set_kind(e, TCF_EM_CMP) < 0)
1608 rtnl_ematch_cmp_set(e, &(yyvsp[0].cmp));
1611 #line 1612 "route/cls/ematch_syntax.c" 1615 #line 202 "route/cls/ematch_syntax.y" 1617 struct rtnl_ematch *e;
1620 *errp = strdup(
"Unable to allocate ematch object");
1624 if (rtnl_ematch_set_kind(e, TCF_EM_NBYTE) < 0)
1627 rtnl_ematch_nbyte_set_offset(e, (yyvsp[-3].loc)->layer, (yyvsp[-3].loc)->offset);
1629 rtnl_ematch_nbyte_set_pattern(e, (uint8_t *) (yyvsp[-1].q).data, (yyvsp[-1].q).index);
1633 #line 1634 "route/cls/ematch_syntax.c" 1637 #line 220 "route/cls/ematch_syntax.y" 1639 struct rtnl_ematch *e;
1642 *errp = strdup(
"Unable to allocate ematch object");
1646 if (rtnl_ematch_set_kind(e, TCF_EM_TEXT) < 0)
1649 rtnl_ematch_text_set_algo(e, (yyvsp[-4].s));
1650 rtnl_ematch_text_set_pattern(e, (yyvsp[-3].q).data, (yyvsp[-3].q).index);
1652 if ((yyvsp[-2].loc)) {
1653 rtnl_ematch_text_set_from(e, (yyvsp[-2].loc)->layer, (yyvsp[-2].loc)->offset);
1657 if ((yyvsp[-1].loc)) {
1658 rtnl_ematch_text_set_to(e, (yyvsp[-1].loc)->layer, (yyvsp[-1].loc)->offset);
1664 #line 1665 "route/cls/ematch_syntax.c" 1668 #line 247 "route/cls/ematch_syntax.y" 1670 struct rtnl_ematch *e;
1673 *errp = strdup(
"Unable to allocate ematch object");
1677 if (rtnl_ematch_set_kind(e, TCF_EM_META) < 0)
1680 rtnl_ematch_meta_set_lvalue(e, (yyvsp[-3].mv));
1681 rtnl_ematch_meta_set_rvalue(e, (yyvsp[-1].mv));
1682 rtnl_ematch_meta_set_operand(e, (yyvsp[-2].i));
1686 #line 1687 "route/cls/ematch_syntax.c" 1690 #line 266 "route/cls/ematch_syntax.y" 1692 struct rtnl_ematch *e;
1695 *errp = strdup(
"Unable to allocate ematch object");
1699 if (rtnl_ematch_set_kind(e, TCF_EM_CONTAINER) < 0)
1703 nl_list_add_tail(&e->e_childs, &(yyvsp[-1].e)->e_list);
1707 #line 1708 "route/cls/ematch_syntax.c" 1711 #line 294 "route/cls/ematch_syntax.y" 1712 { (yyval.cmp) = (yyvsp[-1].cmp); }
1713 #line 1714 "route/cls/ematch_syntax.c" 1717 #line 296 "route/cls/ematch_syntax.y" 1718 { (yyval.cmp) = (yyvsp[0].cmp); }
1719 #line 1720 "route/cls/ematch_syntax.c" 1723 #line 301 "route/cls/ematch_syntax.y" 1725 if ((yyvsp[-2].loc)->align == TCF_EM_ALIGN_U16 ||
1726 (yyvsp[-2].loc)->align == TCF_EM_ALIGN_U32)
1727 (yyval.cmp).flags = TCF_EM_CMP_TRANS;
1729 memset(&(yyval.cmp), 0,
sizeof((yyval.cmp)));
1731 (yyval.cmp).mask = (yyvsp[-2].loc)->mask;
1732 (yyval.cmp).off = (yyvsp[-2].loc)->offset;
1733 (yyval.cmp).align = (yyvsp[-2].loc)->align;
1734 (yyval.cmp).layer = (yyvsp[-2].loc)->layer;
1735 (yyval.cmp).opnd = (yyvsp[-1].i);
1736 (yyval.cmp).val = (yyvsp[0].i);
1740 #line 1741 "route/cls/ematch_syntax.c" 1744 #line 321 "route/cls/ematch_syntax.y" 1745 { (yyval.loc) = NULL; }
1746 #line 1747 "route/cls/ematch_syntax.c" 1750 #line 323 "route/cls/ematch_syntax.y" 1751 { (yyval.loc) = (yyvsp[0].loc); }
1752 #line 1753 "route/cls/ematch_syntax.c" 1756 #line 328 "route/cls/ematch_syntax.y" 1757 { (yyval.loc) = NULL; }
1758 #line 1759 "route/cls/ematch_syntax.c" 1762 #line 330 "route/cls/ematch_syntax.y" 1763 { (yyval.loc) = (yyvsp[0].loc); }
1764 #line 1765 "route/cls/ematch_syntax.c" 1768 #line 335 "route/cls/ematch_syntax.y" 1769 { (yyval.mv) = rtnl_meta_value_alloc_var((yyvsp[0].q).data, (yyvsp[0].q).len); }
1770 #line 1771 "route/cls/ematch_syntax.c" 1774 #line 337 "route/cls/ematch_syntax.y" 1775 { (yyval.mv) = rtnl_meta_value_alloc_int((yyvsp[0].i)); }
1776 #line 1777 "route/cls/ematch_syntax.c" 1780 #line 339 "route/cls/ematch_syntax.y" 1781 { (yyval.mv) = META_ALLOC(META_INT, (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i64)); }
1782 #line 1783 "route/cls/ematch_syntax.c" 1786 #line 341 "route/cls/ematch_syntax.y" 1787 { (yyval.mv) = META_ALLOC(META_VAR, (yyvsp[-1].i), (yyvsp[0].i), 0); }
1788 #line 1789 "route/cls/ematch_syntax.c" 1792 #line 345 "route/cls/ematch_syntax.y" 1793 { (yyval.i) = META_ID(RANDOM); }
1794 #line 1795 "route/cls/ematch_syntax.c" 1798 #line 346 "route/cls/ematch_syntax.y" 1799 { (yyval.i) = META_ID(LOADAVG_0); }
1800 #line 1801 "route/cls/ematch_syntax.c" 1804 #line 347 "route/cls/ematch_syntax.y" 1805 { (yyval.i) = META_ID(LOADAVG_1); }
1806 #line 1807 "route/cls/ematch_syntax.c" 1810 #line 348 "route/cls/ematch_syntax.y" 1811 { (yyval.i) = META_ID(LOADAVG_2); }
1812 #line 1813 "route/cls/ematch_syntax.c" 1816 #line 349 "route/cls/ematch_syntax.y" 1817 { (yyval.i) = META_ID(DEV); }
1818 #line 1819 "route/cls/ematch_syntax.c" 1822 #line 350 "route/cls/ematch_syntax.y" 1823 { (yyval.i) = META_ID(PRIORITY); }
1824 #line 1825 "route/cls/ematch_syntax.c" 1828 #line 351 "route/cls/ematch_syntax.y" 1829 { (yyval.i) = META_ID(PROTOCOL); }
1830 #line 1831 "route/cls/ematch_syntax.c" 1834 #line 352 "route/cls/ematch_syntax.y" 1835 { (yyval.i) = META_ID(PKTTYPE); }
1836 #line 1837 "route/cls/ematch_syntax.c" 1840 #line 353 "route/cls/ematch_syntax.y" 1841 { (yyval.i) = META_ID(PKTLEN); }
1842 #line 1843 "route/cls/ematch_syntax.c" 1846 #line 354 "route/cls/ematch_syntax.y" 1847 { (yyval.i) = META_ID(DATALEN); }
1848 #line 1849 "route/cls/ematch_syntax.c" 1852 #line 355 "route/cls/ematch_syntax.y" 1853 { (yyval.i) = META_ID(MACLEN); }
1854 #line 1855 "route/cls/ematch_syntax.c" 1858 #line 356 "route/cls/ematch_syntax.y" 1859 { (yyval.i) = META_ID(NFMARK); }
1860 #line 1861 "route/cls/ematch_syntax.c" 1864 #line 357 "route/cls/ematch_syntax.y" 1865 { (yyval.i) = META_ID(TCINDEX); }
1866 #line 1867 "route/cls/ematch_syntax.c" 1870 #line 358 "route/cls/ematch_syntax.y" 1871 { (yyval.i) = META_ID(RTCLASSID); }
1872 #line 1873 "route/cls/ematch_syntax.c" 1876 #line 359 "route/cls/ematch_syntax.y" 1877 { (yyval.i) = META_ID(RTIIF); }
1878 #line 1879 "route/cls/ematch_syntax.c" 1882 #line 360 "route/cls/ematch_syntax.y" 1883 { (yyval.i) = META_ID(SK_FAMILY); }
1884 #line 1885 "route/cls/ematch_syntax.c" 1888 #line 361 "route/cls/ematch_syntax.y" 1889 { (yyval.i) = META_ID(SK_STATE); }
1890 #line 1891 "route/cls/ematch_syntax.c" 1894 #line 362 "route/cls/ematch_syntax.y" 1895 { (yyval.i) = META_ID(SK_REUSE); }
1896 #line 1897 "route/cls/ematch_syntax.c" 1900 #line 363 "route/cls/ematch_syntax.y" 1901 { (yyval.i) = META_ID(SK_REFCNT); }
1902 #line 1903 "route/cls/ematch_syntax.c" 1906 #line 364 "route/cls/ematch_syntax.y" 1907 { (yyval.i) = META_ID(SK_RCVBUF); }
1908 #line 1909 "route/cls/ematch_syntax.c" 1912 #line 365 "route/cls/ematch_syntax.y" 1913 { (yyval.i) = META_ID(SK_SNDBUF); }
1914 #line 1915 "route/cls/ematch_syntax.c" 1918 #line 366 "route/cls/ematch_syntax.y" 1919 { (yyval.i) = META_ID(SK_SHUTDOWN); }
1920 #line 1921 "route/cls/ematch_syntax.c" 1924 #line 367 "route/cls/ematch_syntax.y" 1925 { (yyval.i) = META_ID(SK_PROTO); }
1926 #line 1927 "route/cls/ematch_syntax.c" 1930 #line 368 "route/cls/ematch_syntax.y" 1931 { (yyval.i) = META_ID(SK_TYPE); }
1932 #line 1933 "route/cls/ematch_syntax.c" 1936 #line 369 "route/cls/ematch_syntax.y" 1937 { (yyval.i) = META_ID(SK_RMEM_ALLOC); }
1938 #line 1939 "route/cls/ematch_syntax.c" 1942 #line 370 "route/cls/ematch_syntax.y" 1943 { (yyval.i) = META_ID(SK_WMEM_ALLOC); }
1944 #line 1945 "route/cls/ematch_syntax.c" 1948 #line 371 "route/cls/ematch_syntax.y" 1949 { (yyval.i) = META_ID(SK_WMEM_QUEUED); }
1950 #line 1951 "route/cls/ematch_syntax.c" 1954 #line 372 "route/cls/ematch_syntax.y" 1955 { (yyval.i) = META_ID(SK_RCV_QLEN); }
1956 #line 1957 "route/cls/ematch_syntax.c" 1960 #line 373 "route/cls/ematch_syntax.y" 1961 { (yyval.i) = META_ID(SK_SND_QLEN); }
1962 #line 1963 "route/cls/ematch_syntax.c" 1966 #line 374 "route/cls/ematch_syntax.y" 1967 { (yyval.i) = META_ID(SK_ERR_QLEN); }
1968 #line 1969 "route/cls/ematch_syntax.c" 1972 #line 375 "route/cls/ematch_syntax.y" 1973 { (yyval.i) = META_ID(SK_FORWARD_ALLOCS); }
1974 #line 1975 "route/cls/ematch_syntax.c" 1978 #line 376 "route/cls/ematch_syntax.y" 1979 { (yyval.i) = META_ID(SK_ALLOCS); }
1980 #line 1981 "route/cls/ematch_syntax.c" 1984 #line 377 "route/cls/ematch_syntax.y" 1985 { (yyval.i) = META_ID(SK_ROUTE_CAPS); }
1986 #line 1987 "route/cls/ematch_syntax.c" 1990 #line 378 "route/cls/ematch_syntax.y" 1991 { (yyval.i) = META_ID(SK_HASH); }
1992 #line 1993 "route/cls/ematch_syntax.c" 1996 #line 379 "route/cls/ematch_syntax.y" 1997 { (yyval.i) = META_ID(SK_LINGERTIME); }
1998 #line 1999 "route/cls/ematch_syntax.c" 2002 #line 380 "route/cls/ematch_syntax.y" 2003 { (yyval.i) = META_ID(SK_ACK_BACKLOG); }
2004 #line 2005 "route/cls/ematch_syntax.c" 2008 #line 381 "route/cls/ematch_syntax.y" 2009 { (yyval.i) = META_ID(SK_MAX_ACK_BACKLOG); }
2010 #line 2011 "route/cls/ematch_syntax.c" 2014 #line 382 "route/cls/ematch_syntax.y" 2015 { (yyval.i) = META_ID(SK_PRIO); }
2016 #line 2017 "route/cls/ematch_syntax.c" 2020 #line 383 "route/cls/ematch_syntax.y" 2021 { (yyval.i) = META_ID(SK_RCVLOWAT); }
2022 #line 2023 "route/cls/ematch_syntax.c" 2026 #line 384 "route/cls/ematch_syntax.y" 2027 { (yyval.i) = META_ID(SK_RCVTIMEO); }
2028 #line 2029 "route/cls/ematch_syntax.c" 2032 #line 385 "route/cls/ematch_syntax.y" 2033 { (yyval.i) = META_ID(SK_SNDTIMEO); }
2034 #line 2035 "route/cls/ematch_syntax.c" 2038 #line 386 "route/cls/ematch_syntax.y" 2039 { (yyval.i) = META_ID(SK_SENDMSG_OFF); }
2040 #line 2041 "route/cls/ematch_syntax.c" 2044 #line 387 "route/cls/ematch_syntax.y" 2045 { (yyval.i) = META_ID(SK_WRITE_PENDING); }
2046 #line 2047 "route/cls/ematch_syntax.c" 2050 #line 388 "route/cls/ematch_syntax.y" 2051 { (yyval.i) = META_ID(VLAN_TAG); }
2052 #line 2053 "route/cls/ematch_syntax.c" 2056 #line 389 "route/cls/ematch_syntax.y" 2057 { (yyval.i) = META_ID(RXHASH); }
2058 #line 2059 "route/cls/ematch_syntax.c" 2062 #line 393 "route/cls/ematch_syntax.y" 2063 { (yyval.i) = META_ID(DEV); }
2064 #line 2065 "route/cls/ematch_syntax.c" 2068 #line 394 "route/cls/ematch_syntax.y" 2069 { (yyval.i) = META_ID(SK_BOUND_IF); }
2070 #line 2071 "route/cls/ematch_syntax.c" 2074 #line 402 "route/cls/ematch_syntax.y" 2076 (yyval.q) = (yyvsp[0].q);
2078 #line 2079 "route/cls/ematch_syntax.c" 2082 #line 406 "route/cls/ematch_syntax.y" 2084 struct nl_addr *addr;
2091 if (!((yyval.q).data = calloc(1, (yyval.q).len))) {
2099 if (asprintf(errp,
"invalid pattern \"%s\"", (yyvsp[0].s)) == -1)
2104 #line 2105 "route/cls/ematch_syntax.c" 2108 #line 435 "route/cls/ematch_syntax.y" 2113 if (asprintf(errp,
"Packet location \"%s\" not found", (yyvsp[0].s)) == -1)
2120 #line 2121 "route/cls/ematch_syntax.c" 2124 #line 448 "route/cls/ematch_syntax.y" 2128 if ((yyvsp[0].i64) && (!(yyvsp[-4].i) || (yyvsp[-4].i) > TCF_EM_ALIGN_U32)) {
2129 *errp = strdup(
"mask only allowed for alignments u8|u16|u32");
2134 *errp = strdup(
"Unable to allocate packet location object");
2138 loc->name = strdup(
"<USER-DEFINED>");
2139 loc->align = (yyvsp[-4].i);
2140 loc->layer = (yyvsp[-3].i);
2141 loc->offset = (yyvsp[-1].i);
2142 loc->mask = (yyvsp[0].i64);
2146 #line 2147 "route/cls/ematch_syntax.c" 2150 #line 473 "route/cls/ematch_syntax.y" 2152 #line 2153 "route/cls/ematch_syntax.c" 2156 #line 475 "route/cls/ematch_syntax.y" 2157 { (yyval.i) = (yyvsp[-1].i); }
2158 #line 2159 "route/cls/ematch_syntax.c" 2162 #line 477 "route/cls/ematch_syntax.y" 2163 { (yyval.i) = (yyvsp[-1].i); }
2164 #line 2165 "route/cls/ematch_syntax.c" 2168 #line 482 "route/cls/ematch_syntax.y" 2169 { (yyval.i64) = 0; }
2170 #line 2171 "route/cls/ematch_syntax.c" 2174 #line 484 "route/cls/ematch_syntax.y" 2175 { (yyval.i64) = (yyvsp[0].i); }
2176 #line 2177 "route/cls/ematch_syntax.c" 2180 #line 489 "route/cls/ematch_syntax.y" 2182 #line 2183 "route/cls/ematch_syntax.c" 2186 #line 491 "route/cls/ematch_syntax.y" 2187 { (yyval.i) = (yyvsp[0].i); }
2188 #line 2189 "route/cls/ematch_syntax.c" 2192 #line 496 "route/cls/ematch_syntax.y" 2193 { (yyval.i) = TCF_EM_OPND_EQ; }
2194 #line 2195 "route/cls/ematch_syntax.c" 2198 #line 498 "route/cls/ematch_syntax.y" 2199 { (yyval.i) = TCF_EM_OPND_GT; }
2200 #line 2201 "route/cls/ematch_syntax.c" 2204 #line 500 "route/cls/ematch_syntax.y" 2205 { (yyval.i) = TCF_EM_OPND_LT; }
2206 #line 2207 "route/cls/ematch_syntax.c" 2210 #line 2211 "route/cls/ematch_syntax.c" 2224 YY_SYMBOL_PRINT (
"-> $$ =", yyr1[yyn], &yyval, &yyloc);
2228 YY_STACK_PRINT (yyss, yyssp);
2238 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2239 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2240 yystate = yytable[yystate];
2242 yystate = yydefgoto[yyn - YYNTOKENS];
2253 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2259 #if ! YYERROR_VERBOSE 2260 yyerror (scanner, errp, root, YY_(
"syntax error"));
2262 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 2265 char const *yymsgp = YY_(
"syntax error");
2266 int yysyntax_error_status;
2267 yysyntax_error_status = YYSYNTAX_ERROR;
2268 if (yysyntax_error_status == 0)
2270 else if (yysyntax_error_status == 1)
2272 if (yymsg != yymsgbuf)
2273 YYSTACK_FREE (yymsg);
2274 yymsg = (
char *) YYSTACK_ALLOC (yymsg_alloc);
2278 yymsg_alloc =
sizeof yymsgbuf;
2279 yysyntax_error_status = 2;
2283 yysyntax_error_status = YYSYNTAX_ERROR;
2287 yyerror (scanner, errp, root, yymsgp);
2288 if (yysyntax_error_status == 2)
2289 goto yyexhaustedlab;
2291 # undef YYSYNTAX_ERROR 2297 if (yyerrstatus == 3)
2302 if (yychar <= YYEOF)
2305 if (yychar == YYEOF)
2310 yydestruct (
"Error: discarding",
2311 yytoken, &yylval, scanner, errp, root);
2336 YY_STACK_PRINT (yyss, yyssp);
2349 yyn = yypact[yystate];
2350 if (!yypact_value_is_default (yyn))
2353 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2366 yydestruct (
"Error: popping",
2367 yystos[yystate], yyvsp, scanner, errp, root);
2370 YY_STACK_PRINT (yyss, yyssp);
2373 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2375 YY_IGNORE_MAYBE_UNINITIALIZED_END
2379 YY_SYMBOL_PRINT (
"Shifting", yystos[yyn], yyvsp, yylsp);
2399 #if !defined yyoverflow || YYERROR_VERBOSE 2404 yyerror (scanner, errp, root, YY_(
"memory exhausted"));
2410 if (yychar != YYEMPTY)
2414 yytoken = YYTRANSLATE (yychar);
2415 yydestruct (
"Cleanup: discarding lookahead",
2416 yytoken, &yylval, scanner, errp, root);
2421 YY_STACK_PRINT (yyss, yyssp);
2422 while (yyssp != yyss)
2424 yydestruct (
"Cleanup: popping",
2425 yystos[*yyssp], yyvsp, scanner, errp, root);
2430 YYSTACK_FREE (yyss);
2433 if (yymsg != yymsgbuf)
2434 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.