diff options
-rw-r--r-- | conf/confbase.Y | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/conf/confbase.Y b/conf/confbase.Y index 9b4f54e9..b25cf2d0 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -80,7 +80,7 @@ CF_DECLS %type <i32> expr_us %type <time> datetime %type <a> ipa -%type <net> net_ip4_ net_ip6_ net_ip6 net_ip_ net_ip net_or_ipa +%type <net> net_ip4_ net_ip6_ net_ip6 net_ip_ net_ip net_or_ipa net_roa4_ net_roa6_ net_roa_ net__ %type <net_ptr> net_ net_any %type <t> text opttext @@ -198,9 +198,26 @@ net_ip6_: IP6 '/' NUM cf_error("Invalid IPv6 prefix"); }; +net_roa4_: net_ip4_ MAX NUM AS NUM +{ + net_fill_roa4(&($$), ((net_addr_ip4 *)&$1)->prefix, $1.pxlen, $3, $5); + if ($3 < 0 || $3 > IP4_MAX_PREFIX_LENGTH) + cf_error("Invalid max prefix length %d", $3); +}; + +net_roa6_: net_ip6_ MAX NUM AS NUM +{ + net_fill_roa6(&($$), ((net_addr_ip6 *)&$1)->prefix, $1.pxlen, $3, $5); + if ($3 < 0 || $3 > IP6_MAX_PREFIX_LENGTH) + cf_error("Invalid max prefix length %d", $3); +}; + net_ip_: net_ip4_ | net_ip6_ ; +net_roa_: net_roa4_ | net_roa6_ ; + +net__: net_ip_ | net_roa_; -net_: net_ip_ { $$ = cfg_alloc($1.length); net_copy($$, &($1)); } ; +net_: net__ { $$ = cfg_alloc($1.length); net_copy($$, &($1)); } ; /* Networks - regular */ |