diff --git a/conf/confbase.Y b/conf/confbase.Y index 24fff87b..8e321299 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -15,6 +15,7 @@ CF_HDR #include "lib/timer.h" #include "nest/protocol.h" #include "nest/iface.h" +#include "nest/route.h" CF_DECLS @@ -31,12 +32,12 @@ CF_DECLS %token SYM %token TEXT -%type expr +%type expr bool %left '+' '-' %left '*' '/' '%' -CF_KEYWORDS(DEFINE) +CF_KEYWORDS(DEFINE, ON, OFF, YES, NO) CF_GRAMMAR @@ -76,6 +77,17 @@ definition: } ; +/* Switches */ + +bool: + expr {$$ = !!$1; } + | ON { $$ = 1; } + | YES { $$ = 1; } + | OFF { $$ = 0; } + | NO { $$ = 0; } + | /* Silence means agreement */ { $$ = 1; } + ; + CF_CODE CF_END