1 %{ 2 #include <netlink-private/netlink.h> 3 #include <netlink-private/tc.h> 4 #include <netlink/netlink.h> 5 #include <netlink/utils.h> 6 #include <netlink/route/pktloc.h> 7 #include <linux/tc_ematch/tc_em_cmp.h> 8 #include "pktloc_syntax.h" 9 10 int pktloc_get_column(yyscan_t); 11 void pktloc_set_column(int, yyscan_t); 12 %} 13 14 %option 8bit 15 %option reentrant 16 %option warn 17 %option noyywrap 18 %option noinput 19 %option nounput 20 %option bison-bridge 21 %option bison-locations 22 %option prefix="pktloc_" 23 24 %% 25 26 [ \t\r\n]+ 27 28 "#".* 29 30 [[:digit:]]+ | 31 0[xX][[:xdigit:]]+ { 32 yylval->i = strtoul(yytext, NULL, 0); 33 return NUMBER; 34 } 35 36 "+" { return yylval->i = yytext[0]; } 37 38 [uU]8 { yylval->i = TCF_EM_ALIGN_U8; return ALIGN; } 39 [uU]16 { yylval->i = TCF_EM_ALIGN_U16; return ALIGN; } 40 [uU]32 { yylval->i = TCF_EM_ALIGN_U32; return ALIGN; } 41 42 [lL][iI][nN][kK] | 43 [eE][tT][hH] { yylval->i = TCF_LAYER_LINK; return LAYER; } 44 [nN][eE][tT] | 45 [iI][pP] { yylval->i = TCF_LAYER_NETWORK; return LAYER; } 46 [tT][rR][aA][nN][sS][pP][oO][rR][tT] | 47 [tT][cC][pP] { yylval->i = TCF_LAYER_TRANSPORT; return LAYER; } 48 49 50 [^ \t\r\n+]+ { 51 yylval->s = strdup(yytext); 52 if (yylval->s == NULL) 53 return ERROR; 54 return NAME; 55 } 56