Added prefix_or_ipa.

This commit is contained in:
Martin Mares 2000-05-13 11:41:26 +00:00
parent 758458be05
commit d3abfbc68d

View file

@ -53,7 +53,7 @@ CF_DECLS
%type <i> expr bool pxlen %type <i> expr bool pxlen
%type <time> datetime %type <time> datetime
%type <px> prefix %type <px> prefix prefix_or_ipa
%nonassoc '=' '<' '>' '~' '.' GEQ LEQ NEQ %nonassoc '=' '<' '>' '~' '.' GEQ LEQ NEQ
%left '+' '-' %left '+' '-'
@ -118,6 +118,11 @@ prefix:
} }
; ;
prefix_or_ipa:
prefix
| IPA { $$.addr = $1; $$.len = BITS_PER_IP_ADDRESS; }
;
pxlen: pxlen:
'/' NUM { '/' NUM {
if ($2 < 0 || $2 > BITS_PER_IP_ADDRESS) cf_error("Invalid prefix length %d", $2); if ($2 < 0 || $2 > BITS_PER_IP_ADDRESS) cf_error("Invalid prefix length %d", $2);