]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Added new rule for prefix length / netmask.
authorMartin Mares <mj@ucw.cz>
Sun, 6 Dec 1998 23:10:45 +0000 (23:10 +0000)
committerMartin Mares <mj@ucw.cz>
Sun, 6 Dec 1998 23:10:45 +0000 (23:10 +0000)
conf/confbase.Y

index 8e3212993d86394c83e4a1c5e5fb14f96b4ec4fe..0f00587a24acc165b7658e648bd91c6ef3e1a56d 100644 (file)
@@ -32,7 +32,7 @@ CF_DECLS
 %token <s> SYM
 %token <t> TEXT
 
-%type <i> expr bool
+%type <i> expr bool pxlen
 
 %left '+' '-'
 %left '*' '/' '%'
@@ -88,6 +88,19 @@ bool:
  | /* 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_END