diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2015-11-05 12:48:52 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2015-11-05 12:48:52 +0100 |
commit | fe9f1a6dedda6bab23cbb605d1cd5db6cd3e2468 (patch) | |
tree | d6ea417b7ed16c90b29634fe075e51508dec87d9 /conf/confbase.Y | |
parent | 8eb8e546dc8cc647fcfa4a3a17dfa8ab36b00958 (diff) |
Initial commit on integrated BIRD
New data types net_addr and variants (in lib/net.h) describing
network addresses (prefix/pxlen). Modifications of FIB structures
to handle these data types and changing everything to use these
data types instead of prefix/pxlen pairs where possible.
The commit is WiP, some protocols are not yet updated (BGP, Kernel),
and the code contains some temporary scaffolding.
Comments are welcome.
Diffstat (limited to 'conf/confbase.Y')
-rw-r--r-- | conf/confbase.Y | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/conf/confbase.Y b/conf/confbase.Y index 5f487c1d..64a636cf 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -39,6 +39,8 @@ CF_DECLS int i; u32 i32; ip_addr a; + ip4_addr ip4; + ip6_addr ip6; struct symbol *s; char *t; struct rtable_config *r; @@ -66,8 +68,8 @@ CF_DECLS %token GEQ LEQ NEQ AND OR %token PO PC %token <i> NUM ENUM -%token <i32> RTRID -%token <a> IPA +%token <ip4> IP4 +%token <ip6> IP6 %token <s> SYM %token <t> TEXT %type <iface> ipa_scope @@ -75,10 +77,11 @@ CF_DECLS %type <i> expr bool pxlen %type <i32> expr_us %type <time> datetime -%type <a> ipa +%type <a> ipa ipa_raw %type <px> prefix prefix_or_ipa %type <t> text %type <t> text_or_none +%type <t> opttext %nonassoc PREFIX_DUMMY %left AND OR @@ -148,8 +151,13 @@ bool: /* Addresses, prefixes and netmasks */ +ipa_raw: + IP4 { $$ = ipa_from_ip4($1); } + | IP6 { $$ = ipa_from_ip6($1); } + ; + ipa: - IPA + ipa_raw | SYM { if ($1->class != (SYM_CONSTANT | T_IP)) cf_error("IP address expected"); $$ = SYM_VAL($1).px.ip; @@ -205,6 +213,12 @@ text_or_none: | { $$ = NULL; } ; +opttext: + TEXT + | /* empty */ { $$ = NULL; } + ; + + CF_CODE CF_END |