From 359e9b6c2b0cc4817b55338f0b89638945d98c50 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 24 Mar 2012 22:32:24 +0100 Subject: Rename methods to protocols; fix some command line parse bugs; implement most of the config file parser --- src/config.l | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/config.l') diff --git a/src/config.l b/src/config.l index e9dd235..f18dca7 100644 --- a/src/config.l +++ b/src/config.l @@ -4,9 +4,11 @@ %option reentrant %top { + #define YY_DECL int fastd_config_lex(YYSTYPE *yylval_param, fastd_context *ctx, void *yyscanner) + #include #include - #define YY_DECL int fastd_config_lex(YYSTYPE *yylval_param, fastd_context *ctx, void *yyscanner) + YY_DECL; } %x STRING @@ -21,6 +23,7 @@ mtu { yylval->str = yytext; return TOK_MTU; } mode { yylval->str = yytext; return TOK_MODE; } protocol { yylval->str = yytext; return TOK_PROTOCOL; } peer { yylval->str = yytext; return TOK_PEER; } +address { yylval->str = yytext; return TOK_ADDRESS; } [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} { if (!inet_pton(AF_INET, yytext, &yylval->addr)) @@ -30,7 +33,6 @@ peer { yylval->str = yytext; return TOK_PEER; } } any { yylval->str = yytext; return TOK_ANY; } -float { yylval->str = yytext; return TOK_FLOAT; } tap { yylval->str = yytext; return TOK_TAP; } tun { yylval->str = yytext; return TOK_TUN; } -- cgit v1.2.3