summaryrefslogtreecommitdiffstats
path: root/src/config.y
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-04-01 22:47:55 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-04-01 22:47:55 +0200
commite0a3556742a81e6cb6e72590b2696ea39e9872ea (patch)
treed5d16e2f914aa30390558924985339ffe8ec83b7 /src/config.y
parent350353d2c1282b2802bba83f49a3508b3beeb24a (diff)
downloadfastd-e0a3556742a81e6cb6e72590b2696ea39e9872ea.tar
fastd-e0a3556742a81e6cb6e72590b2696ea39e9872ea.zip
Add log level configuration
Diffstat (limited to 'src/config.y')
-rw-r--r--src/config.y22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/config.y b/src/config.y
index d4b9af6..37a4ea9 100644
--- a/src/config.y
+++ b/src/config.y
@@ -72,6 +72,14 @@
%token TOK_UP
%token TOK_PEERS
%token TOK_FROM
+%token TOK_LOG
+%token TOK_LEVEL
+%token TOK_FATAL
+%token TOK_ERROR
+%token TOK_WARN
+%token TOK_INFO
+%token TOK_VERBOSE
+%token TOK_DEBUG
%token <addr> TOK_ADDR
%token <addr6> TOK_ADDR6
@@ -107,7 +115,8 @@ config: config statement
|
;
-statement: TOK_INTERFACE interface ';'
+statement: TOK_LOG log ';'
+ | TOK_INTERFACE interface ';'
| TOK_BIND bind ';'
| TOK_MTU mtu ';'
| TOK_MODE mode ';'
@@ -118,6 +127,17 @@ statement: TOK_INTERFACE interface ';'
| TOK_INCLUDE include ';'
;
+log: TOK_LEVEL log_level
+ ;
+
+log_level: TOK_FATAL { conf->loglevel = LOG_FATAL; }
+ | TOK_ERROR { conf->loglevel = LOG_ERROR; }
+ | TOK_WARN { conf->loglevel = LOG_WARN; }
+ | TOK_INFO { conf->loglevel = LOG_INFO; }
+ | TOK_VERBOSE { conf->loglevel = LOG_VERBOSE; }
+ | TOK_DEBUG { conf->loglevel = LOG_DEBUG; }
+ ;
+
interface: TOK_STRING { free(conf->ifname); conf->ifname = $1; }
;