47 #define YYBISON_VERSION "3.0.2"
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"
288 # define YYSTYPE_IS_TRIVIAL 1
289 # define YYSTYPE_IS_DECLARED 1
294 int ematch_parse (
void *scanner,
char **errp,
struct nl_list_head *root);
299 #line 50 "route/cls/ematch_syntax.y"
301 extern int ematch_lex(
YYSTYPE *,
void *);
303 static void yyerror(
void *scanner,
char **errp,
struct nl_list_head *root,
const char *msg)
311 #line 312 "route/cls/ematch_syntax.c"
318 typedef YYTYPE_UINT8 yytype_uint8;
320 typedef unsigned char yytype_uint8;
324 typedef YYTYPE_INT8 yytype_int8;
326 typedef signed char yytype_int8;
330 typedef YYTYPE_UINT16 yytype_uint16;
332 typedef unsigned short int yytype_uint16;
336 typedef YYTYPE_INT16 yytype_int16;
338 typedef short int yytype_int16;
342 # ifdef __SIZE_TYPE__
343 # define YYSIZE_T __SIZE_TYPE__
344 # elif defined size_t
345 # define YYSIZE_T size_t
346 # elif ! defined YYSIZE_T
348 # define YYSIZE_T size_t
350 # define YYSIZE_T unsigned int
354 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
357 # if defined YYENABLE_NLS && YYENABLE_NLS
359 # include <libintl.h>
360 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
364 # define YY_(Msgid) Msgid
369 # if (defined __GNUC__ \
370 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
371 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
372 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
374 # define YY_ATTRIBUTE(Spec)
378 #ifndef YY_ATTRIBUTE_PURE
379 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
382 #ifndef YY_ATTRIBUTE_UNUSED
383 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
386 #if !defined _Noreturn \
387 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
388 # if defined _MSC_VER && 1200 <= _MSC_VER
389 # define _Noreturn __declspec (noreturn)
391 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
396 #if ! defined lint || defined __GNUC__
397 # define YYUSE(E) ((void) (E))
402 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
404 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
405 _Pragma ("GCC diagnostic push") \
406 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
407 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
408 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
409 _Pragma ("GCC diagnostic pop")
411 # define YY_INITIAL_VALUE(Value) Value
413 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
414 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
415 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
417 #ifndef YY_INITIAL_VALUE
418 # define YY_INITIAL_VALUE(Value)
422 #if ! defined yyoverflow || YYERROR_VERBOSE
426 # ifdef YYSTACK_USE_ALLOCA
427 # if YYSTACK_USE_ALLOCA
429 # define YYSTACK_ALLOC __builtin_alloca
430 # elif defined __BUILTIN_VA_ARG_INCR
433 # define YYSTACK_ALLOC __alloca
434 # elif defined _MSC_VER
436 # define alloca _alloca
438 # define YYSTACK_ALLOC alloca
439 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
442 # ifndef EXIT_SUCCESS
443 # define EXIT_SUCCESS 0
450 # ifdef YYSTACK_ALLOC
452 # define YYSTACK_FREE(Ptr) do { ; } while (0)
453 # ifndef YYSTACK_ALLOC_MAXIMUM
458 # define YYSTACK_ALLOC_MAXIMUM 4032
461 # define YYSTACK_ALLOC YYMALLOC
462 # define YYSTACK_FREE YYFREE
463 # ifndef YYSTACK_ALLOC_MAXIMUM
464 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
466 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
467 && ! ((defined YYMALLOC || defined malloc) \
468 && (defined YYFREE || defined free)))
470 # ifndef EXIT_SUCCESS
471 # define EXIT_SUCCESS 0
475 # define YYMALLOC malloc
476 # if ! defined malloc && ! defined EXIT_SUCCESS
477 void *malloc (YYSIZE_T);
482 # if ! defined free && ! defined EXIT_SUCCESS
490 #if (! defined yyoverflow \
491 && (! defined __cplusplus \
492 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
497 yytype_int16 yyss_alloc;
502 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
506 # define YYSTACK_BYTES(N) \
507 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
508 + YYSTACK_GAP_MAXIMUM)
510 # define YYCOPY_NEEDED 1
517 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
520 YYSIZE_T yynewbytes; \
521 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
522 Stack = &yyptr->Stack_alloc; \
523 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
524 yyptr += yynewbytes / sizeof (*yyptr); \
530 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
534 # if defined __GNUC__ && 1 < __GNUC__
535 # define YYCOPY(Dst, Src, Count) \
536 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
538 # define YYCOPY(Dst, Src, Count) \
542 for (yyi = 0; yyi < (Count); yyi++) \
543 (Dst)[yyi] = (Src)[yyi]; \
562 #define YYNSTATES 118
567 #define YYMAXUTOK 328
569 #define YYTRANSLATE(YYX) \
570 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
574 static const yytype_uint8 yytranslate[] =
576 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
602 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
603 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
604 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
605 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
606 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
607 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
608 65, 66, 67, 68, 69, 70, 71, 72, 73
613 static const yytype_uint16 yyrline[] =
615 0, 148, 148, 150, 157, 161, 173, 178, 186, 201,
616 219, 246, 265, 293, 295, 300, 321, 322, 328, 329,
617 334, 336, 338, 340, 345, 346, 347, 348, 349, 350,
618 351, 352, 353, 354, 355, 356, 357, 358, 359, 360,
619 361, 362, 363, 364, 365, 366, 367, 368, 369, 370,
620 371, 372, 373, 374, 375, 376, 377, 378, 379, 380,
621 381, 382, 383, 384, 385, 386, 387, 388, 389, 393,
622 394, 401, 405, 434, 447, 473, 474, 476, 482, 483,
623 489, 490, 495, 497, 499
627 #if YYDEBUG || YYERROR_VERBOSE || 1
630 static const char *
const yytname[] =
632 "$end",
"error",
"$undefined",
"ERROR",
"LOGIC",
"NOT",
"OPERAND",
633 "NUMBER",
"ALIGN",
"LAYER",
"\"(\"",
"\")\"",
"\"+\"",
"\"mask\"",
634 "\">>\"",
"\"at\"",
"\"cmp\"",
"\"pattern\"",
"\"text\"",
"\"meta\"",
635 "\"=\"",
"\">\"",
"\"<\"",
"\"from\"",
"\"to\"",
"\"random\"",
636 "\"loadavg_0\"",
"\"loadavg_1\"",
"\"loadavg_2\"",
"\"dev\"",
"\"prio\"",
637 "\"proto\"",
"\"pkttype\"",
"\"pktlen\"",
"\"datalen\"",
"\"maclen\"",
638 "\"mark\"",
"\"tcindex\"",
"\"rtclassid\"",
"\"rtiif\"",
"\"sk_family\"",
639 "\"sk_state\"",
"\"sk_reuse\"",
"\"sk_refcnt\"",
"\"sk_rcvbuf\"",
640 "\"sk_sndbuf\"",
"\"sk_shutdown\"",
"\"sk_proto\"",
"\"sk_type\"",
641 "\"sk_rmem_alloc\"",
"\"sk_wmem_alloc\"",
"\"sk_wmem_queued\"",
642 "\"sk_rcv_qlen\"",
"\"sk_snd_qlen\"",
"\"sk_err_qlen\"",
643 "\"sk_forward_allocs\"",
"\"sk_allocs\"",
"\"sk_route_caps\"",
644 "\"sk_hash\"",
"\"sk_lingertime\"",
"\"sk_ack_backlog\"",
645 "\"sk_max_ack_backlog\"",
"\"sk_prio\"",
"\"sk_rcvlowat\"",
646 "\"sk_rcvtimeo\"",
"\"sk_sndtimeo\"",
"\"sk_sendmsg_off\"",
647 "\"sk_write_pending\"",
"\"vlan\"",
"\"rxhash\"",
"\"devname\"",
648 "\"sk_bound_if\"",
"STR",
"QUOTED",
"$accept",
"input",
"expr",
"match",
649 "ematch",
"cmp_match",
"cmp_expr",
"text_from",
"text_to",
"meta_value",
650 "meta_int_id",
"meta_var_id",
"pattern",
"pktloc",
"align",
"mask",
651 "shift",
"operand", YY_NULLPTR
658 static const yytype_uint16 yytoknum[] =
660 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
661 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
662 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
663 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
664 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
665 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
666 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
671 #define YYPACT_NINF -63
673 #define yypact_value_is_default(Yystate) \
674 (!!((Yystate) == (-63)))
676 #define YYTABLE_NINF -76
678 #define yytable_value_is_error(Yytable_value) \
683 static const yytype_int8 yypact[] =
685 -4, 15, -13, -8, 11, 10, 14, 25, 29, -63,
686 26, -63, 37, -63, -63, -63, 16, 33, -63, -63,
687 -63, 32, 1, 1, -28, 65, -63, 11, -63, -63,
688 -63, 38, 34, -63, 36, 28, -24, -63, -63, -63,
689 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
690 -63, -63, -63, -63, -63, -63, -63, -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, 16, 39, 39, -63,
694 -63, 43, -63, -62, 31, 65, 44, 42, -63, 42,
695 -63, -63, 41, 1, 35, 45, -63, 50, -63, -63,
696 -63, -63, 1, 47, -63, -63, -63, -63
702 static const yytype_uint8 yydefact[] =
704 2, 75, 0, 0, 75, 0, 0, 0, 0, 73,
705 0, 3, 4, 7, 8, 14, 0, 0, 6, 77,
706 76, 0, 75, 75, 0, 0, 1, 75, 82, 83,
707 84, 0, 0, 12, 0, 0, 0, 21, 24, 25,
708 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
709 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
710 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
711 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
712 66, 67, 68, 69, 70, 20, 0, 80, 80, 5,
713 15, 0, 13, 0, 16, 0, 0, 78, 23, 78,
714 72, 71, 0, 75, 18, 0, 81, 0, 22, 74,
715 9, 17, 75, 0, 11, 79, 19, 10
719 static const yytype_int8 yypgoto[] =
721 -63, -63, 13, -63, 59, -63, 40, -63, -63, -34,
722 -63, -63, -63, -23, -63, -36, -22, -21
726 static const yytype_int8 yydefgoto[] =
728 -1, 10, 11, 12, 13, 14, 15, 104, 113, 86,
729 87, 88, 102, 16, 17, 108, 97, 31
735 static const yytype_int8 yytable[] =
737 35, 1, 19, 2, 3, -75, 4, 20, 2, 3,
738 100, 101, 5, 6, 7, 8, 1, 21, 2, 3,
739 22, 4, 2, 3, 23, 4, 26, 5, 6, 7,
740 8, 5, 6, 7, 8, 24, 28, 29, 30, 25,
741 89, 27, 32, 33, 36, 90, 91, 92, 93, 94,
742 99, 106, 110, 96, 103, 107, 114, 115, 117, 112,
743 18, 105, 34, 109, 0, 95, 98, 0, 9, 0,
744 0, 0, 37, 9, 0, 0, 0, 0, 0, 0,
745 111, 0, 0, 9, 0, 0, 0, 9, 0, 116,
746 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
747 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
748 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
749 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
750 78, 79, 80, 81, 82, 83, 84, 0, 85
753 static const yytype_int8 yycheck[] =
755 23, 5, 15, 7, 8, 9, 10, 15, 7, 8,
756 72, 73, 16, 17, 18, 19, 5, 4, 7, 8,
757 10, 10, 7, 8, 10, 10, 0, 16, 17, 18,
758 19, 16, 17, 18, 19, 10, 20, 21, 22, 10,
759 27, 4, 9, 11, 72, 7, 12, 11, 20, 73,
760 7, 7, 11, 14, 23, 13, 11, 7, 11, 24,
761 1, 95, 22, 99, -1, 86, 88, -1, 72, -1,
762 -1, -1, 7, 72, -1, -1, -1, -1, -1, -1,
763 103, -1, -1, 72, -1, -1, -1, 72, -1, 112,
764 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
765 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
766 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
767 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
768 65, 66, 67, 68, 69, 70, 71, -1, 73
773 static const yytype_uint8 yystos[] =
775 0, 5, 7, 8, 10, 16, 17, 18, 19, 72,
776 75, 76, 77, 78, 79, 80, 87, 88, 78, 15,
777 15, 76, 10, 10, 10, 10, 0, 4, 20, 21,
778 22, 91, 9, 11, 80, 87, 72, 7, 25, 26,
779 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
780 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
781 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
782 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
783 67, 68, 69, 70, 71, 73, 83, 84, 85, 76,
784 7, 12, 11, 20, 73, 91, 14, 90, 90, 7,
785 72, 73, 86, 23, 81, 83, 7, 13, 89, 89,
786 11, 87, 24, 82, 11, 7, 87, 11
790 static const yytype_uint8 yyr1[] =
792 0, 74, 75, 75, 76, 76, 77, 77, 78, 78,
793 78, 78, 78, 79, 79, 80, 81, 81, 82, 82,
794 83, 83, 83, 83, 84, 84, 84, 84, 84, 84,
795 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
796 84, 84, 84, 84, 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, 85,
799 85, 86, 86, 87, 87, 88, 88, 88, 89, 89,
804 static const yytype_uint8 yyr2[] =
806 0, 2, 0, 1, 1, 3, 2, 1, 1, 6,
807 7, 6, 3, 4, 1, 3, 0, 2, 0, 2,
808 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
809 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
810 1, 1, 1, 1, 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, 5, 0, 2, 2, 0, 2,
818 #define yyerrok (yyerrstatus = 0)
819 #define yyclearin (yychar = YYEMPTY)
823 #define YYACCEPT goto yyacceptlab
824 #define YYABORT goto yyabortlab
825 #define YYERROR goto yyerrorlab
828 #define YYRECOVERING() (!!yyerrstatus)
830 #define YYBACKUP(Token, Value) \
832 if (yychar == YYEMPTY) \
836 YYPOPSTACK (yylen); \
842 yyerror (scanner, errp, root, YY_("syntax error: cannot back up")); \
849 #define YYERRCODE 256
858 # define YYFPRINTF fprintf
861 # define YYDPRINTF(Args) \
868 #ifndef YY_LOCATION_PRINT
869 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
873 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
877 YYFPRINTF (stderr, "%s ", Title); \
878 yy_symbol_print (stderr, \
879 Type, Value, scanner, errp, root); \
880 YYFPRINTF (stderr, "\n"); \
890 yy_symbol_value_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
892 FILE *yyo = yyoutput;
900 if (yytype < YYNTOKENS)
901 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
912 yy_symbol_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
914 YYFPRINTF (yyoutput,
"%s %s (",
915 yytype < YYNTOKENS ?
"token" :
"nterm", yytname[yytype]);
917 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, errp, root);
918 YYFPRINTF (yyoutput,
")");
927 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
929 YYFPRINTF (stderr,
"Stack now");
930 for (; yybottom <= yytop; yybottom++)
932 int yybot = *yybottom;
933 YYFPRINTF (stderr,
" %d", yybot);
935 YYFPRINTF (stderr,
"\n");
938 # define YY_STACK_PRINT(Bottom, Top) \
941 yy_stack_print ((Bottom), (Top)); \
950 yy_reduce_print (yytype_int16 *yyssp,
YYSTYPE *yyvsp,
int yyrule,
void *scanner,
char **errp,
struct nl_list_head *root)
952 unsigned long int yylno = yyrline[yyrule];
953 int yynrhs = yyr2[yyrule];
955 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
958 for (yyi = 0; yyi < yynrhs; yyi++)
960 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
961 yy_symbol_print (stderr,
962 yystos[yyssp[yyi + 1 - yynrhs]],
963 &(yyvsp[(yyi + 1) - (yynrhs)])
964 , scanner, errp, root);
965 YYFPRINTF (stderr,
"\n");
969 # define YY_REDUCE_PRINT(Rule) \
972 yy_reduce_print (yyssp, yyvsp, Rule, scanner, errp, root); \
979 # define YYDPRINTF(Args)
980 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
981 # define YY_STACK_PRINT(Bottom, Top)
982 # define YY_REDUCE_PRINT(Rule)
988 # define YYINITDEPTH 200
999 # define YYMAXDEPTH 10000
1006 # if defined __GLIBC__ && defined _STRING_H
1007 # define yystrlen strlen
1011 yystrlen (
const char *yystr)
1014 for (yylen = 0; yystr[yylen]; yylen++)
1022 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1023 # define yystpcpy stpcpy
1028 yystpcpy (
char *yydest,
const char *yysrc)
1031 const char *yys = yysrc;
1033 while ((*yyd++ = *yys++) !=
'\0')
1050 yytnamerr (
char *yyres,
const char *yystr)
1055 char const *yyp = yystr;
1062 goto do_not_strip_quotes;
1066 goto do_not_strip_quotes;
1079 do_not_strip_quotes: ;
1083 return yystrlen (yystr);
1085 return yystpcpy (yyres, yystr) - yyres;
1098 yysyntax_error (YYSIZE_T *yymsg_alloc,
char **yymsg,
1099 yytype_int16 *yyssp,
int yytoken)
1101 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1102 YYSIZE_T yysize = yysize0;
1103 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1105 const char *yyformat = YY_NULLPTR;
1107 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1135 if (yytoken != YYEMPTY)
1137 int yyn = yypact[*yyssp];
1138 yyarg[yycount++] = yytname[yytoken];
1139 if (!yypact_value_is_default (yyn))
1144 int yyxbegin = yyn < 0 ? -yyn : 0;
1146 int yychecklim = YYLAST - yyn + 1;
1147 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1150 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1151 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1152 && !yytable_value_is_error (yytable[yyx + yyn]))
1154 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1160 yyarg[yycount++] = yytname[yyx];
1162 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1163 if (! (yysize <= yysize1
1164 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1174 # define YYCASE_(N, S) \
1178 YYCASE_(0, YY_(
"syntax error"));
1179 YYCASE_(1, YY_(
"syntax error, unexpected %s"));
1180 YYCASE_(2, YY_(
"syntax error, unexpected %s, expecting %s"));
1181 YYCASE_(3, YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1182 YYCASE_(4, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1183 YYCASE_(5, YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1188 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1189 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1194 if (*yymsg_alloc < yysize)
1196 *yymsg_alloc = 2 * yysize;
1197 if (! (yysize <= *yymsg_alloc
1198 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1199 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1209 while ((*yyp = *yyformat) !=
'\0')
1210 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1212 yyp += yytnamerr (yyp, yyarg[yyi++]);
1230 yydestruct (
const char *yymsg,
int yytype,
YYSTYPE *yyvaluep,
void *scanner,
char **errp,
struct nl_list_head *root)
1238 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1240 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1244 #line 139 "route/cls/ematch_syntax.y"
1245 { free(((*yyvaluep).s)); NL_DBG(2,
"string destructor\n"); }
1246 #line 1247 "route/cls/ematch_syntax.c"
1250 #line 141 "route/cls/ematch_syntax.y"
1251 { free(((*yyvaluep).q).data); NL_DBG(2,
"quoted destructor\n"); }
1252 #line 1253 "route/cls/ematch_syntax.c"
1256 #line 140 "route/cls/ematch_syntax.y"
1257 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); }
1258 #line 1259 "route/cls/ematch_syntax.c"
1262 #line 140 "route/cls/ematch_syntax.y"
1263 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); }
1264 #line 1265 "route/cls/ematch_syntax.c"
1268 #line 142 "route/cls/ematch_syntax.y"
1269 { rtnl_meta_value_put(((*yyvaluep).mv)); NL_DBG(2,
"meta value destructor\n"); }
1270 #line 1271 "route/cls/ematch_syntax.c"
1274 #line 141 "route/cls/ematch_syntax.y"
1275 { free(((*yyvaluep).q).data); NL_DBG(2,
"quoted destructor\n"); }
1276 #line 1277 "route/cls/ematch_syntax.c"
1280 #line 140 "route/cls/ematch_syntax.y"
1281 {
rtnl_pktloc_put(((*yyvaluep).loc)); NL_DBG(2,
"pktloc destructor\n"); }
1282 #line 1283 "route/cls/ematch_syntax.c"
1289 YY_IGNORE_MAYBE_UNINITIALIZED_END
1300 yyparse (
void *scanner,
char **errp,
struct nl_list_head *root)
1309 YY_INITIAL_VALUE (
static YYSTYPE yyval_default;)
1310 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1327 yytype_int16 yyssa[YYINITDEPTH];
1329 yytype_int16 *yyssp;
1336 YYSIZE_T yystacksize;
1349 char *yymsg = yymsgbuf;
1350 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1353 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1359 yyssp = yyss = yyssa;
1360 yyvsp = yyvs = yyvsa;
1361 yystacksize = YYINITDEPTH;
1363 YYDPRINTF ((stderr,
"Starting parse\n"));
1382 if (yyss + yystacksize - 1 <= yyssp)
1385 YYSIZE_T yysize = yyssp - yyss + 1;
1393 yytype_int16 *yyss1 = yyss;
1399 yyoverflow (YY_(
"memory exhausted"),
1400 &yyss1, yysize *
sizeof (*yyssp),
1401 &yyvs1, yysize *
sizeof (*yyvsp),
1408 # ifndef YYSTACK_RELOCATE
1409 goto yyexhaustedlab;
1412 if (YYMAXDEPTH <= yystacksize)
1413 goto yyexhaustedlab;
1415 if (YYMAXDEPTH < yystacksize)
1416 yystacksize = YYMAXDEPTH;
1419 yytype_int16 *yyss1 = yyss;
1421 (
union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1423 goto yyexhaustedlab;
1424 YYSTACK_RELOCATE (yyss_alloc, yyss);
1425 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1426 # undef YYSTACK_RELOCATE
1428 YYSTACK_FREE (yyss1);
1433 yyssp = yyss + yysize - 1;
1434 yyvsp = yyvs + yysize - 1;
1436 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1437 (
unsigned long int) yystacksize));
1439 if (yyss + yystacksize - 1 <= yyssp)
1443 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1445 if (yystate == YYFINAL)
1459 yyn = yypact[yystate];
1460 if (yypact_value_is_default (yyn))
1466 if (yychar == YYEMPTY)
1468 YYDPRINTF ((stderr,
"Reading a token: "));
1469 yychar = yylex (&yylval, scanner);
1472 if (yychar <= YYEOF)
1474 yychar = yytoken = YYEOF;
1475 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1479 yytoken = YYTRANSLATE (yychar);
1480 YY_SYMBOL_PRINT (
"Next token is", yytoken, &yylval, &yylloc);
1486 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1491 if (yytable_value_is_error (yyn))
1503 YY_SYMBOL_PRINT (
"Shifting", yytoken, &yylval, &yylloc);
1509 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1511 YY_IGNORE_MAYBE_UNINITIALIZED_END
1520 yyn = yydefact[yystate];
1541 yyval = yyvsp[1-yylen];
1544 YY_REDUCE_PRINT (yyn);
1548 #line 151 "route/cls/ematch_syntax.y"
1550 nl_list_add_tail(root, &(yyvsp[0].e)->e_list);
1552 #line 1553 "route/cls/ematch_syntax.c"
1556 #line 158 "route/cls/ematch_syntax.y"
1558 (yyval.e) = (yyvsp[0].e);
1560 #line 1561 "route/cls/ematch_syntax.c"
1564 #line 162 "route/cls/ematch_syntax.y"
1566 rtnl_ematch_set_flags((yyvsp[-2].e), (yyvsp[-1].i));
1569 nl_list_add_tail(&(yyvsp[-2].e)->e_list, &(yyvsp[0].e)->e_list);
1571 (yyval.e) = (yyvsp[-2].e);
1573 #line 1574 "route/cls/ematch_syntax.c"
1577 #line 174 "route/cls/ematch_syntax.y"
1579 rtnl_ematch_set_flags((yyvsp[0].e), TCF_EM_INVERT);
1580 (yyval.e) = (yyvsp[0].e);
1582 #line 1583 "route/cls/ematch_syntax.c"
1586 #line 179 "route/cls/ematch_syntax.y"
1588 (yyval.e) = (yyvsp[0].e);
1590 #line 1591 "route/cls/ematch_syntax.c"
1594 #line 187 "route/cls/ematch_syntax.y"
1596 struct rtnl_ematch *e;
1599 *errp = strdup(
"Unable to allocate ematch object");
1603 if (rtnl_ematch_set_kind(e, TCF_EM_CMP) < 0)
1606 rtnl_ematch_cmp_set(e, &(yyvsp[0].cmp));
1609 #line 1610 "route/cls/ematch_syntax.c"
1613 #line 202 "route/cls/ematch_syntax.y"
1615 struct rtnl_ematch *e;
1618 *errp = strdup(
"Unable to allocate ematch object");
1622 if (rtnl_ematch_set_kind(e, TCF_EM_NBYTE) < 0)
1625 rtnl_ematch_nbyte_set_offset(e, (yyvsp[-3].loc)->layer, (yyvsp[-3].loc)->offset);
1627 rtnl_ematch_nbyte_set_pattern(e, (uint8_t *) (yyvsp[-1].q).data, (yyvsp[-1].q).index);
1631 #line 1632 "route/cls/ematch_syntax.c"
1635 #line 220 "route/cls/ematch_syntax.y"
1637 struct rtnl_ematch *e;
1640 *errp = strdup(
"Unable to allocate ematch object");
1644 if (rtnl_ematch_set_kind(e, TCF_EM_TEXT) < 0)
1647 rtnl_ematch_text_set_algo(e, (yyvsp[-4].s));
1648 rtnl_ematch_text_set_pattern(e, (yyvsp[-3].q).data, (yyvsp[-3].q).index);
1650 if ((yyvsp[-2].loc)) {
1651 rtnl_ematch_text_set_from(e, (yyvsp[-2].loc)->layer, (yyvsp[-2].loc)->offset);
1655 if ((yyvsp[-1].loc)) {
1656 rtnl_ematch_text_set_to(e, (yyvsp[-1].loc)->layer, (yyvsp[-1].loc)->offset);
1662 #line 1663 "route/cls/ematch_syntax.c"
1666 #line 247 "route/cls/ematch_syntax.y"
1668 struct rtnl_ematch *e;
1671 *errp = strdup(
"Unable to allocate ematch object");
1675 if (rtnl_ematch_set_kind(e, TCF_EM_META) < 0)
1678 rtnl_ematch_meta_set_lvalue(e, (yyvsp[-3].mv));
1679 rtnl_ematch_meta_set_rvalue(e, (yyvsp[-1].mv));
1680 rtnl_ematch_meta_set_operand(e, (yyvsp[-2].i));
1684 #line 1685 "route/cls/ematch_syntax.c"
1688 #line 266 "route/cls/ematch_syntax.y"
1690 struct rtnl_ematch *e;
1693 *errp = strdup(
"Unable to allocate ematch object");
1697 if (rtnl_ematch_set_kind(e, TCF_EM_CONTAINER) < 0)
1701 nl_list_add_tail(&e->e_childs, &(yyvsp[-1].e)->e_list);
1705 #line 1706 "route/cls/ematch_syntax.c"
1709 #line 294 "route/cls/ematch_syntax.y"
1710 { (yyval.cmp) = (yyvsp[-1].cmp); }
1711 #line 1712 "route/cls/ematch_syntax.c"
1715 #line 296 "route/cls/ematch_syntax.y"
1716 { (yyval.cmp) = (yyvsp[0].cmp); }
1717 #line 1718 "route/cls/ematch_syntax.c"
1721 #line 301 "route/cls/ematch_syntax.y"
1723 if ((yyvsp[-2].loc)->align == TCF_EM_ALIGN_U16 ||
1724 (yyvsp[-2].loc)->align == TCF_EM_ALIGN_U32)
1725 (yyval.cmp).flags = TCF_EM_CMP_TRANS;
1727 memset(&(yyval.cmp), 0,
sizeof((yyval.cmp)));
1729 (yyval.cmp).mask = (yyvsp[-2].loc)->mask;
1730 (yyval.cmp).off = (yyvsp[-2].loc)->offset;
1731 (yyval.cmp).align = (yyvsp[-2].loc)->align;
1732 (yyval.cmp).layer = (yyvsp[-2].loc)->layer;
1733 (yyval.cmp).opnd = (yyvsp[-1].i);
1734 (yyval.cmp).val = (yyvsp[0].i);
1738 #line 1739 "route/cls/ematch_syntax.c"
1742 #line 321 "route/cls/ematch_syntax.y"
1743 { (yyval.loc) = NULL; }
1744 #line 1745 "route/cls/ematch_syntax.c"
1748 #line 323 "route/cls/ematch_syntax.y"
1749 { (yyval.loc) = (yyvsp[0].loc); }
1750 #line 1751 "route/cls/ematch_syntax.c"
1754 #line 328 "route/cls/ematch_syntax.y"
1755 { (yyval.loc) = NULL; }
1756 #line 1757 "route/cls/ematch_syntax.c"
1760 #line 330 "route/cls/ematch_syntax.y"
1761 { (yyval.loc) = (yyvsp[0].loc); }
1762 #line 1763 "route/cls/ematch_syntax.c"
1766 #line 335 "route/cls/ematch_syntax.y"
1767 { (yyval.mv) = rtnl_meta_value_alloc_var((yyvsp[0].q).data, (yyvsp[0].q).len); }
1768 #line 1769 "route/cls/ematch_syntax.c"
1772 #line 337 "route/cls/ematch_syntax.y"
1773 { (yyval.mv) = rtnl_meta_value_alloc_int((yyvsp[0].i)); }
1774 #line 1775 "route/cls/ematch_syntax.c"
1778 #line 339 "route/cls/ematch_syntax.y"
1779 { (yyval.mv) = META_ALLOC(META_INT, (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i64)); }
1780 #line 1781 "route/cls/ematch_syntax.c"
1784 #line 341 "route/cls/ematch_syntax.y"
1785 { (yyval.mv) = META_ALLOC(META_VAR, (yyvsp[-1].i), (yyvsp[0].i), 0); }
1786 #line 1787 "route/cls/ematch_syntax.c"
1790 #line 345 "route/cls/ematch_syntax.y"
1791 { (yyval.i) = META_ID(RANDOM); }
1792 #line 1793 "route/cls/ematch_syntax.c"
1796 #line 346 "route/cls/ematch_syntax.y"
1797 { (yyval.i) = META_ID(LOADAVG_0); }
1798 #line 1799 "route/cls/ematch_syntax.c"
1802 #line 347 "route/cls/ematch_syntax.y"
1803 { (yyval.i) = META_ID(LOADAVG_1); }
1804 #line 1805 "route/cls/ematch_syntax.c"
1808 #line 348 "route/cls/ematch_syntax.y"
1809 { (yyval.i) = META_ID(LOADAVG_2); }
1810 #line 1811 "route/cls/ematch_syntax.c"
1814 #line 349 "route/cls/ematch_syntax.y"
1815 { (yyval.i) = META_ID(DEV); }
1816 #line 1817 "route/cls/ematch_syntax.c"
1820 #line 350 "route/cls/ematch_syntax.y"
1821 { (yyval.i) = META_ID(PRIORITY); }
1822 #line 1823 "route/cls/ematch_syntax.c"
1826 #line 351 "route/cls/ematch_syntax.y"
1827 { (yyval.i) = META_ID(PROTOCOL); }
1828 #line 1829 "route/cls/ematch_syntax.c"
1832 #line 352 "route/cls/ematch_syntax.y"
1833 { (yyval.i) = META_ID(PKTTYPE); }
1834 #line 1835 "route/cls/ematch_syntax.c"
1838 #line 353 "route/cls/ematch_syntax.y"
1839 { (yyval.i) = META_ID(PKTLEN); }
1840 #line 1841 "route/cls/ematch_syntax.c"
1844 #line 354 "route/cls/ematch_syntax.y"
1845 { (yyval.i) = META_ID(DATALEN); }
1846 #line 1847 "route/cls/ematch_syntax.c"
1850 #line 355 "route/cls/ematch_syntax.y"
1851 { (yyval.i) = META_ID(MACLEN); }
1852 #line 1853 "route/cls/ematch_syntax.c"
1856 #line 356 "route/cls/ematch_syntax.y"
1857 { (yyval.i) = META_ID(NFMARK); }
1858 #line 1859 "route/cls/ematch_syntax.c"
1862 #line 357 "route/cls/ematch_syntax.y"
1863 { (yyval.i) = META_ID(TCINDEX); }
1864 #line 1865 "route/cls/ematch_syntax.c"
1868 #line 358 "route/cls/ematch_syntax.y"
1869 { (yyval.i) = META_ID(RTCLASSID); }
1870 #line 1871 "route/cls/ematch_syntax.c"
1874 #line 359 "route/cls/ematch_syntax.y"
1875 { (yyval.i) = META_ID(RTIIF); }
1876 #line 1877 "route/cls/ematch_syntax.c"
1880 #line 360 "route/cls/ematch_syntax.y"
1881 { (yyval.i) = META_ID(SK_FAMILY); }
1882 #line 1883 "route/cls/ematch_syntax.c"
1886 #line 361 "route/cls/ematch_syntax.y"
1887 { (yyval.i) = META_ID(SK_STATE); }
1888 #line 1889 "route/cls/ematch_syntax.c"
1892 #line 362 "route/cls/ematch_syntax.y"
1893 { (yyval.i) = META_ID(SK_REUSE); }
1894 #line 1895 "route/cls/ematch_syntax.c"
1898 #line 363 "route/cls/ematch_syntax.y"
1899 { (yyval.i) = META_ID(SK_REFCNT); }
1900 #line 1901 "route/cls/ematch_syntax.c"
1904 #line 364 "route/cls/ematch_syntax.y"
1905 { (yyval.i) = META_ID(SK_RCVBUF); }
1906 #line 1907 "route/cls/ematch_syntax.c"
1910 #line 365 "route/cls/ematch_syntax.y"
1911 { (yyval.i) = META_ID(SK_SNDBUF); }
1912 #line 1913 "route/cls/ematch_syntax.c"
1916 #line 366 "route/cls/ematch_syntax.y"
1917 { (yyval.i) = META_ID(SK_SHUTDOWN); }
1918 #line 1919 "route/cls/ematch_syntax.c"
1922 #line 367 "route/cls/ematch_syntax.y"
1923 { (yyval.i) = META_ID(SK_PROTO); }
1924 #line 1925 "route/cls/ematch_syntax.c"
1928 #line 368 "route/cls/ematch_syntax.y"
1929 { (yyval.i) = META_ID(SK_TYPE); }
1930 #line 1931 "route/cls/ematch_syntax.c"
1934 #line 369 "route/cls/ematch_syntax.y"
1935 { (yyval.i) = META_ID(SK_RMEM_ALLOC); }
1936 #line 1937 "route/cls/ematch_syntax.c"
1940 #line 370 "route/cls/ematch_syntax.y"
1941 { (yyval.i) = META_ID(SK_WMEM_ALLOC); }
1942 #line 1943 "route/cls/ematch_syntax.c"
1946 #line 371 "route/cls/ematch_syntax.y"
1947 { (yyval.i) = META_ID(SK_WMEM_QUEUED); }
1948 #line 1949 "route/cls/ematch_syntax.c"
1952 #line 372 "route/cls/ematch_syntax.y"
1953 { (yyval.i) = META_ID(SK_RCV_QLEN); }
1954 #line 1955 "route/cls/ematch_syntax.c"
1958 #line 373 "route/cls/ematch_syntax.y"
1959 { (yyval.i) = META_ID(SK_SND_QLEN); }
1960 #line 1961 "route/cls/ematch_syntax.c"
1964 #line 374 "route/cls/ematch_syntax.y"
1965 { (yyval.i) = META_ID(SK_ERR_QLEN); }
1966 #line 1967 "route/cls/ematch_syntax.c"
1970 #line 375 "route/cls/ematch_syntax.y"
1971 { (yyval.i) = META_ID(SK_FORWARD_ALLOCS); }
1972 #line 1973 "route/cls/ematch_syntax.c"
1976 #line 376 "route/cls/ematch_syntax.y"
1977 { (yyval.i) = META_ID(SK_ALLOCS); }
1978 #line 1979 "route/cls/ematch_syntax.c"
1982 #line 377 "route/cls/ematch_syntax.y"
1983 { (yyval.i) = META_ID(SK_ROUTE_CAPS); }
1984 #line 1985 "route/cls/ematch_syntax.c"
1988 #line 378 "route/cls/ematch_syntax.y"
1989 { (yyval.i) = META_ID(SK_HASH); }
1990 #line 1991 "route/cls/ematch_syntax.c"
1994 #line 379 "route/cls/ematch_syntax.y"
1995 { (yyval.i) = META_ID(SK_LINGERTIME); }
1996 #line 1997 "route/cls/ematch_syntax.c"
2000 #line 380 "route/cls/ematch_syntax.y"
2001 { (yyval.i) = META_ID(SK_ACK_BACKLOG); }
2002 #line 2003 "route/cls/ematch_syntax.c"
2006 #line 381 "route/cls/ematch_syntax.y"
2007 { (yyval.i) = META_ID(SK_MAX_ACK_BACKLOG); }
2008 #line 2009 "route/cls/ematch_syntax.c"
2012 #line 382 "route/cls/ematch_syntax.y"
2013 { (yyval.i) = META_ID(SK_PRIO); }
2014 #line 2015 "route/cls/ematch_syntax.c"
2018 #line 383 "route/cls/ematch_syntax.y"
2019 { (yyval.i) = META_ID(SK_RCVLOWAT); }
2020 #line 2021 "route/cls/ematch_syntax.c"
2024 #line 384 "route/cls/ematch_syntax.y"
2025 { (yyval.i) = META_ID(SK_RCVTIMEO); }
2026 #line 2027 "route/cls/ematch_syntax.c"
2030 #line 385 "route/cls/ematch_syntax.y"
2031 { (yyval.i) = META_ID(SK_SNDTIMEO); }
2032 #line 2033 "route/cls/ematch_syntax.c"
2036 #line 386 "route/cls/ematch_syntax.y"
2037 { (yyval.i) = META_ID(SK_SENDMSG_OFF); }
2038 #line 2039 "route/cls/ematch_syntax.c"
2042 #line 387 "route/cls/ematch_syntax.y"
2043 { (yyval.i) = META_ID(SK_WRITE_PENDING); }
2044 #line 2045 "route/cls/ematch_syntax.c"
2048 #line 388 "route/cls/ematch_syntax.y"
2049 { (yyval.i) = META_ID(VLAN_TAG); }
2050 #line 2051 "route/cls/ematch_syntax.c"
2054 #line 389 "route/cls/ematch_syntax.y"
2055 { (yyval.i) = META_ID(RXHASH); }
2056 #line 2057 "route/cls/ematch_syntax.c"
2060 #line 393 "route/cls/ematch_syntax.y"
2061 { (yyval.i) = META_ID(DEV); }
2062 #line 2063 "route/cls/ematch_syntax.c"
2066 #line 394 "route/cls/ematch_syntax.y"
2067 { (yyval.i) = META_ID(SK_BOUND_IF); }
2068 #line 2069 "route/cls/ematch_syntax.c"
2072 #line 402 "route/cls/ematch_syntax.y"
2074 (yyval.q) = (yyvsp[0].q);
2076 #line 2077 "route/cls/ematch_syntax.c"
2080 #line 406 "route/cls/ematch_syntax.y"
2082 struct nl_addr *addr;
2089 if (!((yyval.q).data = calloc(1, (yyval.q).len))) {
2097 if (asprintf(errp,
"invalid pattern \"%s\"", (yyvsp[0].s)) == -1)
2102 #line 2103 "route/cls/ematch_syntax.c"
2106 #line 435 "route/cls/ematch_syntax.y"
2111 if (asprintf(errp,
"Packet location \"%s\" not found", (yyvsp[0].s)) == -1)
2118 #line 2119 "route/cls/ematch_syntax.c"
2122 #line 448 "route/cls/ematch_syntax.y"
2126 if ((yyvsp[0].i64) && (!(yyvsp[-4].i) || (yyvsp[-4].i) > TCF_EM_ALIGN_U32)) {
2127 *errp = strdup(
"mask only allowed for alignments u8|u16|u32");
2132 *errp = strdup(
"Unable to allocate packet location object");
2136 loc->name = strdup(
"<USER-DEFINED>");
2137 loc->align = (yyvsp[-4].i);
2138 loc->layer = (yyvsp[-3].i);
2139 loc->offset = (yyvsp[-1].i);
2140 loc->mask = (yyvsp[0].i64);
2144 #line 2145 "route/cls/ematch_syntax.c"
2148 #line 473 "route/cls/ematch_syntax.y"
2150 #line 2151 "route/cls/ematch_syntax.c"
2154 #line 475 "route/cls/ematch_syntax.y"
2155 { (yyval.i) = (yyvsp[-1].i); }
2156 #line 2157 "route/cls/ematch_syntax.c"
2160 #line 477 "route/cls/ematch_syntax.y"
2161 { (yyval.i) = (yyvsp[-1].i); }
2162 #line 2163 "route/cls/ematch_syntax.c"
2166 #line 482 "route/cls/ematch_syntax.y"
2167 { (yyval.i64) = 0; }
2168 #line 2169 "route/cls/ematch_syntax.c"
2172 #line 484 "route/cls/ematch_syntax.y"
2173 { (yyval.i64) = (yyvsp[0].i); }
2174 #line 2175 "route/cls/ematch_syntax.c"
2178 #line 489 "route/cls/ematch_syntax.y"
2180 #line 2181 "route/cls/ematch_syntax.c"
2184 #line 491 "route/cls/ematch_syntax.y"
2185 { (yyval.i) = (yyvsp[0].i); }
2186 #line 2187 "route/cls/ematch_syntax.c"
2190 #line 496 "route/cls/ematch_syntax.y"
2191 { (yyval.i) = TCF_EM_OPND_EQ; }
2192 #line 2193 "route/cls/ematch_syntax.c"
2196 #line 498 "route/cls/ematch_syntax.y"
2197 { (yyval.i) = TCF_EM_OPND_GT; }
2198 #line 2199 "route/cls/ematch_syntax.c"
2202 #line 500 "route/cls/ematch_syntax.y"
2203 { (yyval.i) = TCF_EM_OPND_LT; }
2204 #line 2205 "route/cls/ematch_syntax.c"
2208 #line 2209 "route/cls/ematch_syntax.c"
2222 YY_SYMBOL_PRINT (
"-> $$ =", yyr1[yyn], &yyval, &yyloc);
2226 YY_STACK_PRINT (yyss, yyssp);
2236 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2237 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2238 yystate = yytable[yystate];
2240 yystate = yydefgoto[yyn - YYNTOKENS];
2251 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2257 #if ! YYERROR_VERBOSE
2258 yyerror (scanner, errp, root, YY_(
"syntax error"));
2260 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2263 char const *yymsgp = YY_(
"syntax error");
2264 int yysyntax_error_status;
2265 yysyntax_error_status = YYSYNTAX_ERROR;
2266 if (yysyntax_error_status == 0)
2268 else if (yysyntax_error_status == 1)
2270 if (yymsg != yymsgbuf)
2271 YYSTACK_FREE (yymsg);
2272 yymsg = (
char *) YYSTACK_ALLOC (yymsg_alloc);
2276 yymsg_alloc =
sizeof yymsgbuf;
2277 yysyntax_error_status = 2;
2281 yysyntax_error_status = YYSYNTAX_ERROR;
2285 yyerror (scanner, errp, root, yymsgp);
2286 if (yysyntax_error_status == 2)
2287 goto yyexhaustedlab;
2289 # undef YYSYNTAX_ERROR
2295 if (yyerrstatus == 3)
2300 if (yychar <= YYEOF)
2303 if (yychar == YYEOF)
2308 yydestruct (
"Error: discarding",
2309 yytoken, &yylval, scanner, errp, root);
2334 YY_STACK_PRINT (yyss, yyssp);
2347 yyn = yypact[yystate];
2348 if (!yypact_value_is_default (yyn))
2351 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2364 yydestruct (
"Error: popping",
2365 yystos[yystate], yyvsp, scanner, errp, root);
2368 YY_STACK_PRINT (yyss, yyssp);
2371 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2373 YY_IGNORE_MAYBE_UNINITIALIZED_END
2377 YY_SYMBOL_PRINT (
"Shifting", yystos[yyn], yyvsp, yylsp);
2397 #if !defined yyoverflow || YYERROR_VERBOSE
2402 yyerror (scanner, errp, root, YY_(
"memory exhausted"));
2408 if (yychar != YYEMPTY)
2412 yytoken = YYTRANSLATE (yychar);
2413 yydestruct (
"Cleanup: discarding lookahead",
2414 yytoken, &yylval, scanner, errp, root);
2419 YY_STACK_PRINT (yyss, yyssp);
2420 while (yyssp != yyss)
2422 yydestruct (
"Cleanup: popping",
2423 yystos[*yyssp], yyvsp, scanner, errp, root);
2428 YYSTACK_FREE (yyss);
2431 if (yymsg != yymsgbuf)
2432 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.