diff options
author | Martin Mares <mj@ucw.cz> | 2000-05-13 13:17:49 +0200 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2000-05-13 13:17:49 +0200 |
commit | 758458be054ebdf4cd77620faf214f2b491a49dc (patch) | |
tree | e8cdebbcf3095ddc1db63ac3c5b611f9708c9879 /conf | |
parent | 02bd064ab76f163313261dad5c273cb376be2a75 (diff) | |
download | bird-758458be054ebdf4cd77620faf214f2b491a49dc.tar bird-758458be054ebdf4cd77620faf214f2b491a49dc.zip |
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 7ac07fe..c614301 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); |