47 #define YYBISON_VERSION "2.5"
50 #define YYSKELETON_NAME "yacc.c"
62 #define YYLSP_NEEDED 0
65 #define yyparse ematch_parse
66 #define yylex ematch_lex
67 #define yyerror ematch_error
68 #define yylval ematch_lval
69 #define yychar ematch_char
70 #define yydebug ematch_debug
71 #define yynerrs ematch_nerrs
77 #line 12 "route/cls/ematch_syntax.y"
79 #include <netlink-private/netlink.h>
80 #include <netlink-private/tc.h>
81 #include <netlink/netlink.h>
82 #include <netlink/utils.h>
83 #include <netlink/route/pktloc.h>
84 #include <netlink/route/cls/ematch.h>
85 #include <netlink/route/cls/ematch/cmp.h>
86 #include <netlink/route/cls/ematch/nbyte.h>
87 #include <netlink/route/cls/ematch/text.h>
88 #include <netlink/route/cls/ematch/meta.h>
90 #define META_ALLOC rtnl_meta_value_alloc_id
91 #define META_ID(name) TCF_META_ID_##name
92 #define META_INT TCF_META_TYPE_INT
93 #define META_VAR TCF_META_TYPE_VAR
97 #line 98 "route/cls/ematch_syntax.c"
105 #ifdef YYERROR_VERBOSE
106 # undef YYERROR_VERBOSE
107 # define YYERROR_VERBOSE 1
109 # define YYERROR_VERBOSE 1
113 #ifndef YYTOKEN_TABLE
114 # define YYTOKEN_TABLE 0
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
273 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
278 #line 39 "route/cls/ematch_syntax.y"
280 struct tcf_em_cmp cmp;
281 struct ematch_quoted q;
282 struct rtnl_ematch * e;
292 #line 293 "route/cls/ematch_syntax.c"
294 # define YYSTYPE_IS_TRIVIAL 1
295 # define yystype YYSTYPE
296 # define YYSTYPE_IS_DECLARED 1
303 #line 50 "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)
317 #line 318 "route/cls/ematch_syntax.c"
324 typedef YYTYPE_UINT8 yytype_uint8;
326 typedef unsigned char yytype_uint8;
330 typedef YYTYPE_INT8 yytype_int8;
331 #elif (defined __STDC__ || defined __C99__FUNC__ \
332 || defined __cplusplus || defined _MSC_VER)
333 typedef signed char yytype_int8;
335 typedef short int yytype_int8;
339 typedef YYTYPE_UINT16 yytype_uint16;
341 typedef unsigned short int yytype_uint16;
345 typedef YYTYPE_INT16 yytype_int16;
347 typedef short int yytype_int16;
351 # ifdef __SIZE_TYPE__
352 # define YYSIZE_T __SIZE_TYPE__
353 # elif defined size_t
354 # define YYSIZE_T size_t
355 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
356 || defined __cplusplus || defined _MSC_VER)
358 # define YYSIZE_T size_t
360 # define YYSIZE_T unsigned int
364 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
367 # if defined YYENABLE_NLS && YYENABLE_NLS
369 # include <libintl.h>
370 # define YY_(msgid) dgettext ("bison-runtime", msgid)
374 # define YY_(msgid) msgid
379 #if ! defined lint || defined __GNUC__
380 # define YYUSE(e) ((void) (e))
389 #if (defined __STDC__ || defined __C99__FUNC__ \
390 || defined __cplusplus || defined _MSC_VER)
403 #if ! defined yyoverflow || YYERROR_VERBOSE
407 # ifdef YYSTACK_USE_ALLOCA
408 # if YYSTACK_USE_ALLOCA
410 # define YYSTACK_ALLOC __builtin_alloca
411 # elif defined __BUILTIN_VA_ARG_INCR
414 # define YYSTACK_ALLOC __alloca
415 # elif defined _MSC_VER
417 # define alloca _alloca
419 # define YYSTACK_ALLOC alloca
420 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
421 || defined __cplusplus || defined _MSC_VER)
423 # ifndef EXIT_SUCCESS
424 # define EXIT_SUCCESS 0
431 # ifdef YYSTACK_ALLOC
433 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
434 # ifndef YYSTACK_ALLOC_MAXIMUM
439 # define YYSTACK_ALLOC_MAXIMUM 4032
442 # define YYSTACK_ALLOC YYMALLOC
443 # define YYSTACK_FREE YYFREE
444 # ifndef YYSTACK_ALLOC_MAXIMUM
445 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
447 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
448 && ! ((defined YYMALLOC || defined malloc) \
449 && (defined YYFREE || defined free)))
451 # ifndef EXIT_SUCCESS
452 # define EXIT_SUCCESS 0
456 # define YYMALLOC malloc
457 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
458 || defined __cplusplus || defined _MSC_VER)
459 void *malloc (YYSIZE_T);
464 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
465 || defined __cplusplus || defined _MSC_VER)
473 #if (! defined yyoverflow \
474 && (! defined __cplusplus \
475 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
480 yytype_int16 yyss_alloc;
485 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
489 # define YYSTACK_BYTES(N) \
490 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
491 + YYSTACK_GAP_MAXIMUM)
493 # define YYCOPY_NEEDED 1
500 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
503 YYSIZE_T yynewbytes; \
504 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
505 Stack = &yyptr->Stack_alloc; \
506 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
507 yyptr += yynewbytes / sizeof (*yyptr); \
513 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
517 # if defined __GNUC__ && 1 < __GNUC__
518 # define YYCOPY(To, From, Count) \
519 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
521 # define YYCOPY(To, From, Count) \
525 for (yyi = 0; yyi < (Count); yyi++) \
526 (To)[yyi] = (From)[yyi]; \
545 #define YYNSTATES 118
549 #define YYMAXUTOK 328
551 #define YYTRANSLATE(YYX) \
552 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
555 static const yytype_uint8 yytranslate[] =
557 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
583 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
584 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
585 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
586 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
587 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
588 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
589 65, 66, 67, 68, 69, 70, 71, 72, 73
595 static const yytype_uint8 yyprhs[] =
597 0, 0, 3, 4, 6, 8, 12, 15, 17, 19,
598 26, 34, 41, 45, 50, 52, 56, 57, 60, 61,
599 64, 66, 68, 72, 75, 77, 79, 81, 83, 85,
600 87, 89, 91, 93, 95, 97, 99, 101, 103, 105,
601 107, 109, 111, 113, 115, 117, 119, 121, 123, 125,
602 127, 129, 131, 133, 135, 137, 139, 141, 143, 145,
603 147, 149, 151, 153, 155, 157, 159, 161, 163, 165,
604 167, 169, 171, 173, 175, 181, 182, 185, 188, 189,
605 192, 193, 196, 198, 200
609 static const yytype_int8 yyrhs[] =
611 75, 0, -1, -1, 76, -1, 77, -1, 77, 4,
612 76, -1, 5, 78, -1, 78, -1, 79, -1, 17,
613 10, 87, 20, 86, 11, -1, 18, 10, 72, 73,
614 81, 82, 11, -1, 19, 10, 83, 91, 83, 11,
615 -1, 10, 76, 11, -1, 16, 10, 80, 11, -1,
616 80, -1, 87, 91, 7, -1, -1, 23, 87, -1,
617 -1, 24, 87, -1, 73, -1, 7, -1, 84, 90,
618 89, -1, 85, 90, -1, 25, -1, 26, -1, 27,
619 -1, 28, -1, 29, -1, 30, -1, 31, -1, 32,
620 -1, 33, -1, 34, -1, 35, -1, 36, -1, 37,
621 -1, 38, -1, 39, -1, 40, -1, 41, -1, 42,
622 -1, 43, -1, 44, -1, 45, -1, 46, -1, 47,
623 -1, 48, -1, 49, -1, 50, -1, 51, -1, 52,
624 -1, 53, -1, 54, -1, 55, -1, 56, -1, 57,
625 -1, 58, -1, 59, -1, 60, -1, 61, -1, 62,
626 -1, 63, -1, 64, -1, 65, -1, 66, -1, 67,
627 -1, 68, -1, 69, -1, 70, -1, 71, -1, 73,
628 -1, 72, -1, 72, -1, 88, 9, 12, 7, 89,
629 -1, -1, 8, 15, -1, 7, 15, -1, -1, 13,
630 7, -1, -1, 14, 7, -1, 20, -1, 21, -1,
635 static const yytype_uint16 yyrline[] =
637 0, 148, 148, 150, 157, 161, 173, 178, 186, 201,
638 219, 246, 265, 293, 295, 300, 321, 322, 328, 329,
639 334, 336, 338, 340, 345, 346, 347, 348, 349, 350,
640 351, 352, 353, 354, 355, 356, 357, 358, 359, 360,
641 361, 362, 363, 364, 365, 366, 367, 368, 369, 370,
642 371, 372, 373, 374, 375, 376, 377, 378, 379, 380,
643 381, 382, 383, 384, 385, 386, 387, 388, 389, 393,
644 394, 401, 405, 434, 447, 473, 474, 476, 482, 483,
645 489, 490, 495, 497, 499
649 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
652 static const char *
const yytname[] =
654 "$end",
"error",
"$undefined",
"ERROR",
"LOGIC",
"NOT",
"OPERAND",
655 "NUMBER",
"ALIGN",
"LAYER",
"\"(\"",
"\")\"",
"\"+\"",
"\"mask\"",
656 "\">>\"",
"\"at\"",
"\"cmp\"",
"\"pattern\"",
"\"text\"",
"\"meta\"",
657 "\"=\"",
"\">\"",
"\"<\"",
"\"from\"",
"\"to\"",
"\"random\"",
658 "\"loadavg_0\"",
"\"loadavg_1\"",
"\"loadavg_2\"",
"\"dev\"",
"\"prio\"",
659 "\"proto\"",
"\"pkttype\"",
"\"pktlen\"",
"\"datalen\"",
"\"maclen\"",
660 "\"mark\"",
"\"tcindex\"",
"\"rtclassid\"",
"\"rtiif\"",
"\"sk_family\"",
661 "\"sk_state\"",
"\"sk_reuse\"",
"\"sk_refcnt\"",
"\"sk_rcvbuf\"",
662 "\"sk_sndbuf\"",
"\"sk_shutdown\"",
"\"sk_proto\"",
"\"sk_type\"",
663 "\"sk_rmem_alloc\"",
"\"sk_wmem_alloc\"",
"\"sk_wmem_queued\"",
664 "\"sk_rcv_qlen\"",
"\"sk_snd_qlen\"",
"\"sk_err_qlen\"",
665 "\"sk_forward_allocs\"",
"\"sk_allocs\"",
"\"sk_route_caps\"",
666 "\"sk_hash\"",
"\"sk_lingertime\"",
"\"sk_ack_backlog\"",
667 "\"sk_max_ack_backlog\"",
"\"sk_prio\"",
"\"sk_rcvlowat\"",
668 "\"sk_rcvtimeo\"",
"\"sk_sndtimeo\"",
"\"sk_sendmsg_off\"",
669 "\"sk_write_pending\"",
"\"vlan\"",
"\"rxhash\"",
"\"devname\"",
670 "\"sk_bound_if\"",
"STR",
"QUOTED",
"$accept",
"input",
"expr",
"match",
671 "ematch",
"cmp_match",
"cmp_expr",
"text_from",
"text_to",
"meta_value",
672 "meta_int_id",
"meta_var_id",
"pattern",
"pktloc",
"align",
"mask",
673 "shift",
"operand", 0
680 static const yytype_uint16 yytoknum[] =
682 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
683 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
684 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
685 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
686 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
687 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
688 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
694 static const yytype_uint8 yyr1[] =
696 0, 74, 75, 75, 76, 76, 77, 77, 78, 78,
697 78, 78, 78, 79, 79, 80, 81, 81, 82, 82,
698 83, 83, 83, 83, 84, 84, 84, 84, 84, 84,
699 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
700 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
701 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
702 84, 84, 84, 84, 84, 84, 84, 84, 84, 85,
703 85, 86, 86, 87, 87, 88, 88, 88, 89, 89,
708 static const yytype_uint8 yyr2[] =
710 0, 2, 0, 1, 1, 3, 2, 1, 1, 6,
711 7, 6, 3, 4, 1, 3, 0, 2, 0, 2,
712 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
713 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
714 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
715 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
716 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
717 1, 1, 1, 1, 5, 0, 2, 2, 0, 2,
724 static const yytype_uint8 yydefact[] =
726 2, 75, 0, 0, 75, 0, 0, 0, 0, 73,
727 0, 3, 4, 7, 8, 14, 0, 0, 6, 77,
728 76, 0, 75, 75, 0, 0, 1, 75, 82, 83,
729 84, 0, 0, 12, 0, 0, 0, 21, 24, 25,
730 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
731 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
732 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
733 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
734 66, 67, 68, 69, 70, 20, 0, 80, 80, 5,
735 15, 0, 13, 0, 16, 0, 0, 78, 23, 78,
736 72, 71, 0, 75, 18, 0, 81, 0, 22, 74,
737 9, 17, 75, 0, 11, 79, 19, 10
741 static const yytype_int8 yydefgoto[] =
743 -1, 10, 11, 12, 13, 14, 15, 104, 113, 86,
744 87, 88, 102, 16, 17, 108, 97, 31
749 #define YYPACT_NINF -63
750 static const yytype_int8 yypact[] =
752 -4, 15, -13, -8, 11, 10, 14, 25, 29, -63,
753 26, -63, 37, -63, -63, -63, 16, 33, -63, -63,
754 -63, 32, 1, 1, -28, 65, -63, 11, -63, -63,
755 -63, 38, 34, -63, 36, 28, -24, -63, -63, -63,
756 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
757 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
758 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
759 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
760 -63, -63, -63, -63, -63, -63, 16, 39, 39, -63,
761 -63, 43, -63, -62, 31, 65, 44, 42, -63, 42,
762 -63, -63, 41, 1, 35, 45, -63, 50, -63, -63,
763 -63, -63, 1, 47, -63, -63, -63, -63
767 static const yytype_int8 yypgoto[] =
769 -63, -63, 13, -63, 59, -63, 40, -63, -63, -34,
770 -63, -63, -63, -23, -63, -36, -22, -21
776 #define YYTABLE_NINF -76
777 static const yytype_int8 yytable[] =
779 35, 1, 19, 2, 3, -75, 4, 20, 2, 3,
780 100, 101, 5, 6, 7, 8, 1, 21, 2, 3,
781 22, 4, 2, 3, 23, 4, 26, 5, 6, 7,
782 8, 5, 6, 7, 8, 24, 28, 29, 30, 25,
783 89, 27, 32, 33, 36, 90, 91, 92, 93, 94,
784 99, 106, 110, 96, 103, 107, 114, 115, 117, 112,
785 18, 105, 34, 109, 0, 95, 98, 0, 9, 0,
786 0, 0, 37, 9, 0, 0, 0, 0, 0, 0,
787 111, 0, 0, 9, 0, 0, 0, 9, 0, 116,
788 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
789 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
790 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
791 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
792 78, 79, 80, 81, 82, 83, 84, 0, 85
795 #define yypact_value_is_default(yystate) \
798 #define yytable_value_is_error(yytable_value) \
801 static const yytype_int8 yycheck[] =
803 23, 5, 15, 7, 8, 9, 10, 15, 7, 8,
804 72, 73, 16, 17, 18, 19, 5, 4, 7, 8,
805 10, 10, 7, 8, 10, 10, 0, 16, 17, 18,
806 19, 16, 17, 18, 19, 10, 20, 21, 22, 10,
807 27, 4, 9, 11, 72, 7, 12, 11, 20, 73,
808 7, 7, 11, 14, 23, 13, 11, 7, 11, 24,
809 1, 95, 22, 99, -1, 86, 88, -1, 72, -1,
810 -1, -1, 7, 72, -1, -1, -1, -1, -1, -1,
811 103, -1, -1, 72, -1, -1, -1, 72, -1, 112,
812 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
813 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
814 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
815 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
816 65, 66, 67, 68, 69, 70, 71, -1, 73
821 static const yytype_uint8 yystos[] =
823 0, 5, 7, 8, 10, 16, 17, 18, 19, 72,
824 75, 76, 77, 78, 79, 80, 87, 88, 78, 15,
825 15, 76, 10, 10, 10, 10, 0, 4, 20, 21,
826 22, 91, 9, 11, 80, 87, 72, 7, 25, 26,
827 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
828 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
829 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
830 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
831 67, 68, 69, 70, 71, 73, 83, 84, 85, 76,
832 7, 12, 11, 20, 73, 91, 14, 90, 90, 7,
833 72, 73, 86, 23, 81, 83, 7, 13, 89, 89,
834 11, 87, 24, 82, 11, 7, 87, 11
837 #define yyerrok (yyerrstatus = 0)
838 #define yyclearin (yychar = YYEMPTY)
842 #define YYACCEPT goto yyacceptlab
843 #define YYABORT goto yyabortlab
844 #define YYERROR goto yyerrorlab
854 #define YYFAIL goto yyerrlab
862 #define YYRECOVERING() (!!yyerrstatus)
864 #define YYBACKUP(Token, Value) \
866 if (yychar == YYEMPTY && yylen == 1) \
875 yyerror (scanner, errp, root, YY_("syntax error: cannot back up")); \
882 #define YYERRCODE 256
889 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
890 #ifndef YYLLOC_DEFAULT
891 # define YYLLOC_DEFAULT(Current, Rhs, N) \
895 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
896 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
897 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
898 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
902 (Current).first_line = (Current).last_line = \
903 YYRHSLOC (Rhs, 0).last_line; \
904 (Current).first_column = (Current).last_column = \
905 YYRHSLOC (Rhs, 0).last_column; \
913 #ifndef YY_LOCATION_PRINT
914 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
921 # define YYLEX yylex (&yylval, YYLEX_PARAM)
923 # define YYLEX yylex (&yylval, scanner)
931 # define YYFPRINTF fprintf
934 # define YYDPRINTF(Args) \
940 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
944 YYFPRINTF (stderr, "%s ", Title); \
945 yy_symbol_print (stderr, \
946 Type, Value, scanner, errp, root); \
947 YYFPRINTF (stderr, "\n"); \
957 #if (defined __STDC__ || defined __C99__FUNC__ \
958 || defined __cplusplus || defined _MSC_VER)
960 yy_symbol_value_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
963 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
966 YYSTYPE const * const yyvaluep;
978 if (yytype < YYNTOKENS)
979 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
995 #if (defined __STDC__ || defined __C99__FUNC__ \
996 || defined __cplusplus || defined _MSC_VER)
998 yy_symbol_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
1001 yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, errp, root)
1004 YYSTYPE const * const yyvaluep;
1010 if (yytype < YYNTOKENS)
1011 YYFPRINTF (yyoutput,
"token %s (", yytname[yytype]);
1013 YYFPRINTF (yyoutput,
"nterm %s (", yytname[yytype]);
1015 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root);
1016 YYFPRINTF (yyoutput,
")");
1024 #if (defined __STDC__ || defined __C99__FUNC__ \
1025 || defined __cplusplus || defined _MSC_VER)
1027 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1030 yy_stack_print (yybottom, yytop)
1031 yytype_int16 *yybottom;
1032 yytype_int16 *yytop;
1035 YYFPRINTF (stderr,
"Stack now");
1036 for (; yybottom <= yytop; yybottom++)
1038 int yybot = *yybottom;
1039 YYFPRINTF (stderr,
" %d", yybot);
1041 YYFPRINTF (stderr,
"\n");
1044 # define YY_STACK_PRINT(Bottom, Top) \
1047 yy_stack_print ((Bottom), (Top)); \
1055 #if (defined __STDC__ || defined __C99__FUNC__ \
1056 || defined __cplusplus || defined _MSC_VER)
1058 yy_reduce_print (
YYSTYPE *yyvsp,
int yyrule,
void *scanner,
char **errp,
struct nl_list_head *root)
1061 yy_reduce_print (yyvsp, yyrule, scanner, errp, root)
1069 int yynrhs = yyr2[yyrule];
1071 unsigned long int yylno = yyrline[yyrule];
1072 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
1075 for (yyi = 0; yyi < yynrhs; yyi++)
1077 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
1078 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1079 &(yyvsp[(yyi + 1) - (yynrhs)])
1080 , scanner, errp, root);
1081 YYFPRINTF (stderr,
"\n");
1085 # define YY_REDUCE_PRINT(Rule) \
1088 yy_reduce_print (yyvsp, Rule, scanner, errp, root); \
1095 # define YYDPRINTF(Args)
1096 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1097 # define YY_STACK_PRINT(Bottom, Top)
1098 # define YY_REDUCE_PRINT(Rule)
1104 # define YYINITDEPTH 200
1115 # define YYMAXDEPTH 10000
1122 # if defined __GLIBC__ && defined _STRING_H
1123 # define yystrlen strlen
1126 #if (defined __STDC__ || defined __C99__FUNC__ \
1127 || defined __cplusplus || defined _MSC_VER)
1129 yystrlen (
const char *yystr)
1137 for (yylen = 0; yystr[yylen]; yylen++)
1145 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1146 # define yystpcpy stpcpy
1150 #if (defined __STDC__ || defined __C99__FUNC__ \
1151 || defined __cplusplus || defined _MSC_VER)
1153 yystpcpy (
char *yydest,
const char *yysrc)
1156 yystpcpy (yydest, yysrc)
1162 const char *yys = yysrc;
1164 while ((*yyd++ = *yys++) !=
'\0')
1181 yytnamerr (
char *yyres,
const char *yystr)
1186 char const *yyp = yystr;
1193 goto do_not_strip_quotes;
1197 goto do_not_strip_quotes;
1210 do_not_strip_quotes: ;
1214 return yystrlen (yystr);
1216 return yystpcpy (yyres, yystr) - yyres;
1229 yysyntax_error (YYSIZE_T *yymsg_alloc,
char **yymsg,
1230 yytype_int16 *yyssp,
int yytoken)
1232 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1233 YYSIZE_T yysize = yysize0;
1235 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1237 const char *yyformat = 0;
1239 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1271 if (yytoken != YYEMPTY)
1273 int yyn = yypact[*yyssp];
1274 yyarg[yycount++] = yytname[yytoken];
1275 if (!yypact_value_is_default (yyn))
1280 int yyxbegin = yyn < 0 ? -yyn : 0;
1282 int yychecklim = YYLAST - yyn + 1;
1283 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1286 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1287 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1288 && !yytable_value_is_error (yytable[yyx + yyn]))
1290 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1296 yyarg[yycount++] = yytname[yyx];
1297 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1298 if (! (yysize <= yysize1
1299 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1308 # define YYCASE_(N, S) \
1312 YYCASE_(0, YY_(
"syntax error"));
1313 YYCASE_(1, YY_(
"syntax error, unexpected %s"));
1314 YYCASE_(2, YY_(
"syntax error, unexpected %s, expecting %s"));
1315 YYCASE_(3, YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1316 YYCASE_(4, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1317 YYCASE_(5, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1321 yysize1 = yysize + yystrlen (yyformat);
1322 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1326 if (*yymsg_alloc < yysize)
1328 *yymsg_alloc = 2 * yysize;
1329 if (! (yysize <= *yymsg_alloc
1330 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1331 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1341 while ((*yyp = *yyformat) !=
'\0')
1342 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1344 yyp += yytnamerr (yyp, yyarg[yyi++]);
1362 #if (defined __STDC__ || defined __C99__FUNC__ \
1363 || defined __cplusplus || defined _MSC_VER)
1365 yydestruct (
const char *yymsg,
int yytype,
YYSTYPE *yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
1368 yydestruct (yymsg, yytype, yyvaluep, scanner, errp, root)
1384 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1391 #line 139 "route/cls/ematch_syntax.y"
1392 { free((yyvaluep->s)); NL_DBG(2,
"string destructor\n"); };
1395 #line 1396 "route/cls/ematch_syntax.c"
1400 #line 141 "route/cls/ematch_syntax.y"
1401 { free((yyvaluep->q).data); NL_DBG(2,
"quoted destructor\n"); };
1404 #line 1405 "route/cls/ematch_syntax.c"
1409 #line 140 "route/cls/ematch_syntax.y"
1410 {
rtnl_pktloc_put((yyvaluep->loc)); NL_DBG(2,
"pktloc destructor\n"); };
1413 #line 1414 "route/cls/ematch_syntax.c"
1418 #line 140 "route/cls/ematch_syntax.y"
1419 {
rtnl_pktloc_put((yyvaluep->loc)); NL_DBG(2,
"pktloc destructor\n"); };
1422 #line 1423 "route/cls/ematch_syntax.c"
1427 #line 142 "route/cls/ematch_syntax.y"
1428 { rtnl_meta_value_put((yyvaluep->mv)); NL_DBG(2,
"meta value destructor\n"); };
1431 #line 1432 "route/cls/ematch_syntax.c"
1436 #line 141 "route/cls/ematch_syntax.y"
1437 { free((yyvaluep->q).data); NL_DBG(2,
"quoted destructor\n"); };
1440 #line 1441 "route/cls/ematch_syntax.c"
1445 #line 140 "route/cls/ematch_syntax.y"
1446 {
rtnl_pktloc_put((yyvaluep->loc)); NL_DBG(2,
"pktloc destructor\n"); };
1449 #line 1450 "route/cls/ematch_syntax.c"
1459 #ifdef YYPARSE_PARAM
1460 #if defined __STDC__ || defined __cplusplus
1461 int yyparse (
void *YYPARSE_PARAM);
1466 #if defined __STDC__ || defined __cplusplus
1467 int yyparse (
void *scanner,
char **errp,
struct nl_list_head *root);
1478 #ifdef YYPARSE_PARAM
1479 #if (defined __STDC__ || defined __C99__FUNC__ \
1480 || defined __cplusplus || defined _MSC_VER)
1482 yyparse (
void *YYPARSE_PARAM)
1485 yyparse (YYPARSE_PARAM)
1486 void *YYPARSE_PARAM;
1489 #if (defined __STDC__ || defined __C99__FUNC__ \
1490 || defined __cplusplus || defined _MSC_VER)
1492 yyparse (
void *scanner,
char **errp,
struct nl_list_head *root)
1495 yyparse (scanner, errp, root)
1523 yytype_int16 yyssa[YYINITDEPTH];
1525 yytype_int16 *yyssp;
1532 YYSIZE_T yystacksize;
1545 char *yymsg = yymsgbuf;
1546 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1549 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1558 yystacksize = YYINITDEPTH;
1560 YYDPRINTF ((stderr,
"Starting parse\n"));
1587 if (yyss + yystacksize - 1 <= yyssp)
1590 YYSIZE_T yysize = yyssp - yyss + 1;
1598 yytype_int16 *yyss1 = yyss;
1604 yyoverflow (YY_(
"memory exhausted"),
1605 &yyss1, yysize *
sizeof (*yyssp),
1606 &yyvs1, yysize *
sizeof (*yyvsp),
1613 # ifndef YYSTACK_RELOCATE
1614 goto yyexhaustedlab;
1617 if (YYMAXDEPTH <= yystacksize)
1618 goto yyexhaustedlab;
1620 if (YYMAXDEPTH < yystacksize)
1621 yystacksize = YYMAXDEPTH;
1624 yytype_int16 *yyss1 = yyss;
1626 (
union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1628 goto yyexhaustedlab;
1629 YYSTACK_RELOCATE (yyss_alloc, yyss);
1630 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1631 # undef YYSTACK_RELOCATE
1633 YYSTACK_FREE (yyss1);
1638 yyssp = yyss + yysize - 1;
1639 yyvsp = yyvs + yysize - 1;
1641 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1642 (
unsigned long int) yystacksize));
1644 if (yyss + yystacksize - 1 <= yyssp)
1648 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1650 if (yystate == YYFINAL)
1664 yyn = yypact[yystate];
1665 if (yypact_value_is_default (yyn))
1671 if (yychar == YYEMPTY)
1673 YYDPRINTF ((stderr,
"Reading a token: "));
1677 if (yychar <= YYEOF)
1679 yychar = yytoken = YYEOF;
1680 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1684 yytoken = YYTRANSLATE (yychar);
1685 YY_SYMBOL_PRINT (
"Next token is", yytoken, &yylval, &yylloc);
1691 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1696 if (yytable_value_is_error (yyn))
1708 YY_SYMBOL_PRINT (
"Shifting", yytoken, &yylval, &yylloc);
1723 yyn = yydefact[yystate];
1744 yyval = yyvsp[1-yylen];
1747 YY_REDUCE_PRINT (yyn);
1753 #line 151 "route/cls/ematch_syntax.y"
1755 nl_list_add_tail(root, &(yyvsp[(1) - (1)].e)->e_list);
1762 #line 158 "route/cls/ematch_syntax.y"
1764 (yyval.e) = (yyvsp[(1) - (1)].e);
1771 #line 162 "route/cls/ematch_syntax.y"
1773 rtnl_ematch_set_flags((yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].i));
1776 nl_list_add_tail(&(yyvsp[(1) - (3)].e)->e_list, &(yyvsp[(3) - (3)].e)->e_list);
1778 (yyval.e) = (yyvsp[(1) - (3)].e);
1785 #line 174 "route/cls/ematch_syntax.y"
1787 rtnl_ematch_set_flags((yyvsp[(2) - (2)].e), TCF_EM_INVERT);
1788 (yyval.e) = (yyvsp[(2) - (2)].e);
1795 #line 179 "route/cls/ematch_syntax.y"
1797 (yyval.e) = (yyvsp[(1) - (1)].e);
1804 #line 187 "route/cls/ematch_syntax.y"
1806 struct rtnl_ematch *e;
1809 *errp = strdup(
"Unable to allocate ematch object");
1813 if (rtnl_ematch_set_kind(e, TCF_EM_CMP) < 0)
1816 rtnl_ematch_cmp_set(e, &(yyvsp[(1) - (1)].cmp));
1824 #line 202 "route/cls/ematch_syntax.y"
1826 struct rtnl_ematch *e;
1829 *errp = strdup(
"Unable to allocate ematch object");
1833 if (rtnl_ematch_set_kind(e, TCF_EM_NBYTE) < 0)
1836 rtnl_ematch_nbyte_set_offset(e, (yyvsp[(3) - (6)].loc)->layer, (yyvsp[(3) - (6)].loc)->offset);
1838 rtnl_ematch_nbyte_set_pattern(e, (uint8_t *) (yyvsp[(5) - (6)].q).data, (yyvsp[(5) - (6)].q).index);
1847 #line 220 "route/cls/ematch_syntax.y"
1849 struct rtnl_ematch *e;
1852 *errp = strdup(
"Unable to allocate ematch object");
1856 if (rtnl_ematch_set_kind(e, TCF_EM_TEXT) < 0)
1859 rtnl_ematch_text_set_algo(e, (yyvsp[(3) - (7)].s));
1860 rtnl_ematch_text_set_pattern(e, (yyvsp[(4) - (7)].q).data, (yyvsp[(4) - (7)].q).index);
1862 if ((yyvsp[(5) - (7)].loc)) {
1863 rtnl_ematch_text_set_from(e, (yyvsp[(5) - (7)].loc)->layer, (yyvsp[(5) - (7)].loc)->offset);
1867 if ((yyvsp[(6) - (7)].loc)) {
1868 rtnl_ematch_text_set_to(e, (yyvsp[(6) - (7)].loc)->layer, (yyvsp[(6) - (7)].loc)->offset);
1879 #line 247 "route/cls/ematch_syntax.y"
1881 struct rtnl_ematch *e;
1884 *errp = strdup(
"Unable to allocate ematch object");
1888 if (rtnl_ematch_set_kind(e, TCF_EM_META) < 0)
1891 rtnl_ematch_meta_set_lvalue(e, (yyvsp[(3) - (6)].mv));
1892 rtnl_ematch_meta_set_rvalue(e, (yyvsp[(5) - (6)].mv));
1893 rtnl_ematch_meta_set_operand(e, (yyvsp[(4) - (6)].i));
1902 #line 266 "route/cls/ematch_syntax.y"
1904 struct rtnl_ematch *e;
1907 *errp = strdup(
"Unable to allocate ematch object");
1911 if (rtnl_ematch_set_kind(e, TCF_EM_CONTAINER) < 0)
1915 nl_list_add_tail(&e->e_childs, &(yyvsp[(2) - (3)].e)->e_list);
1924 #line 294 "route/cls/ematch_syntax.y"
1925 { (yyval.cmp) = (yyvsp[(3) - (4)].cmp); }
1931 #line 296 "route/cls/ematch_syntax.y"
1932 { (yyval.cmp) = (yyvsp[(1) - (1)].cmp); }
1938 #line 301 "route/cls/ematch_syntax.y"
1940 if ((yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U16 ||
1941 (yyvsp[(1) - (3)].loc)->align == TCF_EM_ALIGN_U32)
1942 (yyval.cmp).flags = TCF_EM_CMP_TRANS;
1944 memset(&(yyval.cmp), 0,
sizeof((yyval.cmp)));
1946 (yyval.cmp).mask = (yyvsp[(1) - (3)].loc)->mask;
1947 (yyval.cmp).off = (yyvsp[(1) - (3)].loc)->offset;
1948 (yyval.cmp).align = (yyvsp[(1) - (3)].loc)->align;
1949 (yyval.cmp).layer = (yyvsp[(1) - (3)].loc)->layer;
1950 (yyval.cmp).opnd = (yyvsp[(2) - (3)].i);
1951 (yyval.cmp).val = (yyvsp[(3) - (3)].i);
1960 #line 321 "route/cls/ematch_syntax.y"
1961 { (yyval.loc) = NULL; }
1967 #line 323 "route/cls/ematch_syntax.y"
1968 { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
1974 #line 328 "route/cls/ematch_syntax.y"
1975 { (yyval.loc) = NULL; }
1981 #line 330 "route/cls/ematch_syntax.y"
1982 { (yyval.loc) = (yyvsp[(2) - (2)].loc); }
1988 #line 335 "route/cls/ematch_syntax.y"
1989 { (yyval.mv) = rtnl_meta_value_alloc_var((yyvsp[(1) - (1)].q).data, (yyvsp[(1) - (1)].q).len); }
1995 #line 337 "route/cls/ematch_syntax.y"
1996 { (yyval.mv) = rtnl_meta_value_alloc_int((yyvsp[(1) - (1)].i)); }
2002 #line 339 "route/cls/ematch_syntax.y"
2003 { (yyval.mv) = META_ALLOC(META_INT, (yyvsp[(1) - (3)].i), (yyvsp[(2) - (3)].i), (yyvsp[(3) - (3)].i64)); }
2009 #line 341 "route/cls/ematch_syntax.y"
2010 { (yyval.mv) = META_ALLOC(META_VAR, (yyvsp[(1) - (2)].i), (yyvsp[(2) - (2)].i), 0); }
2016 #line 345 "route/cls/ematch_syntax.y"
2017 { (yyval.i) = META_ID(RANDOM); }
2023 #line 346 "route/cls/ematch_syntax.y"
2024 { (yyval.i) = META_ID(LOADAVG_0); }
2030 #line 347 "route/cls/ematch_syntax.y"
2031 { (yyval.i) = META_ID(LOADAVG_1); }
2037 #line 348 "route/cls/ematch_syntax.y"
2038 { (yyval.i) = META_ID(LOADAVG_2); }
2044 #line 349 "route/cls/ematch_syntax.y"
2045 { (yyval.i) = META_ID(DEV); }
2051 #line 350 "route/cls/ematch_syntax.y"
2052 { (yyval.i) = META_ID(PRIORITY); }
2058 #line 351 "route/cls/ematch_syntax.y"
2059 { (yyval.i) = META_ID(PROTOCOL); }
2065 #line 352 "route/cls/ematch_syntax.y"
2066 { (yyval.i) = META_ID(PKTTYPE); }
2072 #line 353 "route/cls/ematch_syntax.y"
2073 { (yyval.i) = META_ID(PKTLEN); }
2079 #line 354 "route/cls/ematch_syntax.y"
2080 { (yyval.i) = META_ID(DATALEN); }
2086 #line 355 "route/cls/ematch_syntax.y"
2087 { (yyval.i) = META_ID(MACLEN); }
2093 #line 356 "route/cls/ematch_syntax.y"
2094 { (yyval.i) = META_ID(NFMARK); }
2100 #line 357 "route/cls/ematch_syntax.y"
2101 { (yyval.i) = META_ID(TCINDEX); }
2107 #line 358 "route/cls/ematch_syntax.y"
2108 { (yyval.i) = META_ID(RTCLASSID); }
2114 #line 359 "route/cls/ematch_syntax.y"
2115 { (yyval.i) = META_ID(RTIIF); }
2121 #line 360 "route/cls/ematch_syntax.y"
2122 { (yyval.i) = META_ID(SK_FAMILY); }
2128 #line 361 "route/cls/ematch_syntax.y"
2129 { (yyval.i) = META_ID(SK_STATE); }
2135 #line 362 "route/cls/ematch_syntax.y"
2136 { (yyval.i) = META_ID(SK_REUSE); }
2142 #line 363 "route/cls/ematch_syntax.y"
2143 { (yyval.i) = META_ID(SK_REFCNT); }
2149 #line 364 "route/cls/ematch_syntax.y"
2150 { (yyval.i) = META_ID(SK_RCVBUF); }
2156 #line 365 "route/cls/ematch_syntax.y"
2157 { (yyval.i) = META_ID(SK_SNDBUF); }
2163 #line 366 "route/cls/ematch_syntax.y"
2164 { (yyval.i) = META_ID(SK_SHUTDOWN); }
2170 #line 367 "route/cls/ematch_syntax.y"
2171 { (yyval.i) = META_ID(SK_PROTO); }
2177 #line 368 "route/cls/ematch_syntax.y"
2178 { (yyval.i) = META_ID(SK_TYPE); }
2184 #line 369 "route/cls/ematch_syntax.y"
2185 { (yyval.i) = META_ID(SK_RMEM_ALLOC); }
2191 #line 370 "route/cls/ematch_syntax.y"
2192 { (yyval.i) = META_ID(SK_WMEM_ALLOC); }
2198 #line 371 "route/cls/ematch_syntax.y"
2199 { (yyval.i) = META_ID(SK_WMEM_QUEUED); }
2205 #line 372 "route/cls/ematch_syntax.y"
2206 { (yyval.i) = META_ID(SK_RCV_QLEN); }
2212 #line 373 "route/cls/ematch_syntax.y"
2213 { (yyval.i) = META_ID(SK_SND_QLEN); }
2219 #line 374 "route/cls/ematch_syntax.y"
2220 { (yyval.i) = META_ID(SK_ERR_QLEN); }
2226 #line 375 "route/cls/ematch_syntax.y"
2227 { (yyval.i) = META_ID(SK_FORWARD_ALLOCS); }
2233 #line 376 "route/cls/ematch_syntax.y"
2234 { (yyval.i) = META_ID(SK_ALLOCS); }
2240 #line 377 "route/cls/ematch_syntax.y"
2241 { (yyval.i) = META_ID(SK_ROUTE_CAPS); }
2247 #line 378 "route/cls/ematch_syntax.y"
2248 { (yyval.i) = META_ID(SK_HASH); }
2254 #line 379 "route/cls/ematch_syntax.y"
2255 { (yyval.i) = META_ID(SK_LINGERTIME); }
2261 #line 380 "route/cls/ematch_syntax.y"
2262 { (yyval.i) = META_ID(SK_ACK_BACKLOG); }
2268 #line 381 "route/cls/ematch_syntax.y"
2269 { (yyval.i) = META_ID(SK_MAX_ACK_BACKLOG); }
2275 #line 382 "route/cls/ematch_syntax.y"
2276 { (yyval.i) = META_ID(SK_PRIO); }
2282 #line 383 "route/cls/ematch_syntax.y"
2283 { (yyval.i) = META_ID(SK_RCVLOWAT); }
2289 #line 384 "route/cls/ematch_syntax.y"
2290 { (yyval.i) = META_ID(SK_RCVTIMEO); }
2296 #line 385 "route/cls/ematch_syntax.y"
2297 { (yyval.i) = META_ID(SK_SNDTIMEO); }
2303 #line 386 "route/cls/ematch_syntax.y"
2304 { (yyval.i) = META_ID(SK_SENDMSG_OFF); }
2310 #line 387 "route/cls/ematch_syntax.y"
2311 { (yyval.i) = META_ID(SK_WRITE_PENDING); }
2317 #line 388 "route/cls/ematch_syntax.y"
2318 { (yyval.i) = META_ID(VLAN_TAG); }
2324 #line 389 "route/cls/ematch_syntax.y"
2325 { (yyval.i) = META_ID(RXHASH); }
2331 #line 393 "route/cls/ematch_syntax.y"
2332 { (yyval.i) = META_ID(DEV); }
2338 #line 394 "route/cls/ematch_syntax.y"
2339 { (yyval.i) = META_ID(SK_BOUND_IF); }
2345 #line 402 "route/cls/ematch_syntax.y"
2347 (yyval.q) = (yyvsp[(1) - (1)].q);
2354 #line 406 "route/cls/ematch_syntax.y"
2356 struct nl_addr *addr;
2358 if (
nl_addr_parse((yyvsp[(1) - (1)].s), AF_UNSPEC, &addr) == 0) {
2363 if (!((yyval.q).data = calloc(1, (yyval.q).len))) {
2371 if (asprintf(errp,
"invalid pattern \"%s\"", (yyvsp[(1) - (1)].s)) == -1)
2381 #line 435 "route/cls/ematch_syntax.y"
2386 if (asprintf(errp,
"Packet location \"%s\" not found", (yyvsp[(1) - (1)].s)) == -1)
2398 #line 448 "route/cls/ematch_syntax.y"
2402 if ((yyvsp[(5) - (5)].i64) && (!(yyvsp[(1) - (5)].i) || (yyvsp[(1) - (5)].i) > TCF_EM_ALIGN_U32)) {
2403 *errp = strdup(
"mask only allowed for alignments u8|u16|u32");
2408 *errp = strdup(
"Unable to allocate packet location object");
2412 loc->name = strdup(
"<USER-DEFINED>");
2413 loc->align = (yyvsp[(1) - (5)].i);
2414 loc->layer = (yyvsp[(2) - (5)].i);
2415 loc->offset = (yyvsp[(4) - (5)].i);
2416 loc->mask = (yyvsp[(5) - (5)].i64);
2425 #line 473 "route/cls/ematch_syntax.y"
2432 #line 475 "route/cls/ematch_syntax.y"
2433 { (yyval.i) = (yyvsp[(1) - (2)].i); }
2439 #line 477 "route/cls/ematch_syntax.y"
2440 { (yyval.i) = (yyvsp[(1) - (2)].i); }
2446 #line 482 "route/cls/ematch_syntax.y"
2447 { (yyval.i64) = 0; }
2453 #line 484 "route/cls/ematch_syntax.y"
2454 { (yyval.i64) = (yyvsp[(2) - (2)].i); }
2460 #line 489 "route/cls/ematch_syntax.y"
2467 #line 491 "route/cls/ematch_syntax.y"
2468 { (yyval.i) = (yyvsp[(2) - (2)].i); }
2474 #line 496 "route/cls/ematch_syntax.y"
2475 { (yyval.i) = TCF_EM_OPND_EQ; }
2481 #line 498 "route/cls/ematch_syntax.y"
2482 { (yyval.i) = TCF_EM_OPND_GT; }
2488 #line 500 "route/cls/ematch_syntax.y"
2489 { (yyval.i) = TCF_EM_OPND_LT; }
2495 #line 2496 "route/cls/ematch_syntax.c"
2509 YY_SYMBOL_PRINT (
"-> $$ =", yyr1[yyn], &yyval, &yyloc);
2513 YY_STACK_PRINT (yyss, yyssp);
2523 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2524 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2525 yystate = yytable[yystate];
2527 yystate = yydefgoto[yyn - YYNTOKENS];
2538 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2544 #if ! YYERROR_VERBOSE
2545 yyerror (scanner, errp, root, YY_(
"syntax error"));
2547 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2550 char const *yymsgp = YY_(
"syntax error");
2551 int yysyntax_error_status;
2552 yysyntax_error_status = YYSYNTAX_ERROR;
2553 if (yysyntax_error_status == 0)
2555 else if (yysyntax_error_status == 1)
2557 if (yymsg != yymsgbuf)
2558 YYSTACK_FREE (yymsg);
2559 yymsg = (
char *) YYSTACK_ALLOC (yymsg_alloc);
2563 yymsg_alloc =
sizeof yymsgbuf;
2564 yysyntax_error_status = 2;
2568 yysyntax_error_status = YYSYNTAX_ERROR;
2572 yyerror (scanner, errp, root, yymsgp);
2573 if (yysyntax_error_status == 2)
2574 goto yyexhaustedlab;
2576 # undef YYSYNTAX_ERROR
2582 if (yyerrstatus == 3)
2587 if (yychar <= YYEOF)
2590 if (yychar == YYEOF)
2595 yydestruct (
"Error: discarding",
2596 yytoken, &yylval, scanner, errp, root);
2621 YY_STACK_PRINT (yyss, yyssp);
2634 yyn = yypact[yystate];
2635 if (!yypact_value_is_default (yyn))
2638 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2651 yydestruct (
"Error: popping",
2652 yystos[yystate], yyvsp, scanner, errp, root);
2655 YY_STACK_PRINT (yyss, yyssp);
2662 YY_SYMBOL_PRINT (
"Shifting", yystos[yyn], yyvsp, yylsp);
2682 #if !defined(yyoverflow) || YYERROR_VERBOSE
2687 yyerror (scanner, errp, root, YY_(
"memory exhausted"));
2693 if (yychar != YYEMPTY)
2697 yytoken = YYTRANSLATE (yychar);
2698 yydestruct (
"Cleanup: discarding lookahead",
2699 yytoken, &yylval, scanner, errp, root);
2704 YY_STACK_PRINT (yyss, yyssp);
2705 while (yyssp != yyss)
2707 yydestruct (
"Cleanup: popping",
2708 yystos[*yyssp], yyvsp, scanner, errp, root);
2713 YYSTACK_FREE (yyss);
2716 if (yymsg != yymsgbuf)
2717 YYSTACK_FREE (yymsg);
2720 return YYID (yyresult);