summaryrefslogtreecommitdiffstats
path: root/filter/config.Y
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2008-11-14 14:50:37 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2008-11-14 14:50:37 +0100
commite29fa06ece1bf9f9a47f224db797df940556136e (patch)
tree10775979f654be43a67c072e225879d3f42973d9 /filter/config.Y
parentaebe06b40ce730a88cc8a3121be1944b3ddf5765 (diff)
downloadbird-e29fa06ece1bf9f9a47f224db797df940556136e.tar
bird-e29fa06ece1bf9f9a47f224db797df940556136e.zip
New read-only route attribute 'proto' added. It returns a string
representing a name of the protocol that originated the route. Strings can be compared using = or matched using ~. Routes can be filtered, for example: show route where proto ~ "bgp1*"
Diffstat (limited to 'filter/config.Y')
-rw-r--r--filter/config.Y3
1 files changed, 2 insertions, 1 deletions
diff --git a/filter/config.Y b/filter/config.Y
index fdfb2e7..d131a25 100644
--- a/filter/config.Y
+++ b/filter/config.Y
@@ -21,7 +21,7 @@ CF_KEYWORDS(FUNCTION, PRINT, PRINTN, UNSET, RETURN,
INT, BOOL, IP, PREFIX, PAIR, SET, STRING, BGPMASK, BGPPATH, CLIST,
IF, THEN, ELSE, CASE,
TRUE, FALSE,
- FROM, GW, NET, MASK, SOURCE, SCOPE, CAST, DEST, PREFERENCE,
+ FROM, GW, NET, MASK, PROTO, SOURCE, SCOPE, CAST, DEST, PREFERENCE,
LEN,
DEFINED,
ADD, DELETE, CONTAINS, RESET,
@@ -331,6 +331,7 @@ static_attr:
| GW { $$ = f_new_inst(); $$->aux = T_IP; $$->a2.i = OFFSETOF(struct rta, gw); $$->a1.i = 1; }
| NET { $$ = f_new_inst(); $$->aux = T_PREFIX; $$->a2.i = 0x12345678; /* This is actually ok - T_PREFIX is special-cased. */ }
+ | PROTO { $$ = f_new_inst(); $$->aux = T_STRING; $$->a2.i = 0x12345678; /* T_STRING is also special-cased. */ }
| SOURCE { $$ = f_new_inst(); $$->aux = T_ENUM_RTS; $$->a2.i = OFFSETOF(struct rta, source); }
| SCOPE { $$ = f_new_inst(); $$->aux = T_ENUM_SCOPE; $$->a2.i = OFFSETOF(struct rta, scope); $$->a1.i = 1; }
| CAST { $$ = f_new_inst(); $$->aux = T_ENUM_RTC; $$->a2.i = OFFSETOF(struct rta, cast); }