From 89d2355d3d16ac51ad5861d91b17eaa65713f80b Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 6 Dec 1998 23:10:45 +0000 Subject: Added new rule for prefix length / netmask. --- conf/confbase.Y | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'conf') diff --git a/conf/confbase.Y b/conf/confbase.Y index 8e32129..0f00587 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -32,7 +32,7 @@ CF_DECLS %token SYM %token TEXT -%type expr bool +%type expr bool pxlen %left '+' '-' %left '*' '/' '%' @@ -88,6 +88,19 @@ bool: | /* Silence means agreement */ { $$ = 1; } ; +/* Prefixes and netmasks */ + +pxlen: + '/' NUM { + if ($2 < 0 || $2 > 32) cf_error("Invalid prefix length %d", $2); + $$ = $2; + } + | ':' IPA { + $$ = ipa_mklen($2); + if ($$ < 0) cf_error("Invalid netmask %I", $2); + } + ; + CF_CODE CF_END -- cgit v1.2.3