test issue
[parefeu.git] / policy_test.l
1 %{
2 #include <sys/types.h>
3 #include <sys/param.h>
4 #include <sys/socket.h>
5 #include <net/route.h>
6 #include <net/pfkeyv2.h>
7 #include <netipsec/keydb.h>
8 #include <netinet/in.h>
9 #include <netipsec/ipsec.h>
10
11 #include <stdlib.h>
12 #include <limits.h>
13 #include <string.h>
14 #include <unistd.h>
15 #include <errno.h>
16
17 #include "y.tab.h"
18
19 %}
20
21 %option noyywrap
22 %option nounput
23 %option noinput
24
25 /* common section */
26 nl              \n
27 ws              [ \t]+
28 socket  [\/][a-zA-Z0-9\/]+
29 topic   [\"][a-zA-Z0-9/]+[\"]
30
31 %%
32
33 any             { return(ANY); }
34 drop    { yylval.number=0;return (ACTION);}
35 pass    { yylval.number=1;return (ACTION);}
36 in              { yylval.number=0;return (DIR);}
37 out             { yylval.number=1;return (DIR);}
38 {topic} { yylval.string=strdup(yytext);return WORD;}
39 {socket}        { yylval.string=strdup(yytext);return SOCKET;}
40 "FROM"  { return FROM;}
41 "ANY"   { return ANY;}
42
43 {ws}            { ; }
44 {nl}            { ; }
45
46 %%
47