diff options
author | Martin Mares <mj@ucw.cz> | 2000-05-13 11:17:49 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2000-05-13 11:17:49 +0000 |
commit | 758458be054ebdf4cd77620faf214f2b491a49dc (patch) | |
tree | e8cdebbcf3095ddc1db63ac3c5b611f9708c9879 /conf | |
parent | 02bd064ab76f163313261dad5c273cb376be2a75 (diff) |
Unified parsing of prefixes.
Had to rename `prefix' in filters to `fprefix'.
Diffstat (limited to 'conf')
-rw-r--r-- | conf/confbase.Y | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/conf/confbase.Y b/conf/confbase.Y index 7ac07fea..c6143012 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -40,6 +40,7 @@ CF_DECLS struct rt_show_data *ra; void *g; bird_clock_t time; + struct prefix px; } %token END CLI_MARKER INVALID_TOKEN @@ -52,6 +53,7 @@ CF_DECLS %type <i> expr bool pxlen %type <time> datetime +%type <px> prefix %nonassoc '=' '<' '>' '~' '.' GEQ LEQ NEQ %left '+' '-' @@ -109,6 +111,13 @@ bool: /* Prefixes and netmasks */ +prefix: + IPA pxlen { + if (!ip_is_prefix($1, $2)) cf_error("Invalid prefix"); + $$.addr = $1; $$.len = $2; + } + ; + pxlen: '/' NUM { if ($2 < 0 || $2 > BITS_PER_IP_ADDRESS) cf_error("Invalid prefix length %d", $2); |