mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 09:41:54 +00:00
Added new rule for prefix length / netmask.
This commit is contained in:
parent
cc12cf05c7
commit
89d2355d3d
@ -32,7 +32,7 @@ CF_DECLS
|
|||||||
%token <s> SYM
|
%token <s> SYM
|
||||||
%token <t> TEXT
|
%token <t> TEXT
|
||||||
|
|
||||||
%type <i> expr bool
|
%type <i> expr bool pxlen
|
||||||
|
|
||||||
%left '+' '-'
|
%left '+' '-'
|
||||||
%left '*' '/' '%'
|
%left '*' '/' '%'
|
||||||
@ -88,6 +88,19 @@ bool:
|
|||||||
| /* Silence means agreement */ { $$ = 1; }
|
| /* 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_CODE
|
||||||
|
|
||||||
CF_END
|
CF_END
|
||||||
|
Loading…
Reference in New Issue
Block a user