summaryrefslogtreecommitdiffstats
path: root/src/config.l
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-24 22:32:24 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-24 22:32:24 +0100
commit359e9b6c2b0cc4817b55338f0b89638945d98c50 (patch)
tree731b1b59a96f9ff84a6a5b531964418bee634815 /src/config.l
parent4ffc28ecd6d914f9c1e5aaf5d5921ee4827bb289 (diff)
downloadfastd-359e9b6c2b0cc4817b55338f0b89638945d98c50.tar
fastd-359e9b6c2b0cc4817b55338f0b89638945d98c50.zip
Rename methods to protocols; fix some command line parse bugs; implement most of the config file parser
Diffstat (limited to 'src/config.l')
-rw-r--r--src/config.l6
1 files changed, 4 insertions, 2 deletions
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 <fastd.h>
#include <config.yy.h>
- #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; }