filters: Implement "ifname" and "ifindex" route attributes
popovich_sergei at mail.ru
Thu Sep 26 11:45:37 CEST 2013
Hello, BIRD developers!
Currently there is no way in filter rules to match routes by interface name
and interface index.
However string comparison (=,!=,>,<,... operations), and pattern matching
(using ~ operator) already implemented in filters, so expressions like:
if "eth0" ~ "eth*" || "eth1" = "eth1" then
print "This pattern matches!";
Only one thing that is really needed is exposing attribute with name to filter
which references route outgoing interface name and index. Of course all of
these variables must be readonly.
Interface indexes are taken from kernel (at least on Linux, and FreeBSD) and
represents interface number in system. Matching to indexes is not such
reliable as matching with interface names, as indexes might change on
Currently only sink (blackhole, unreachable and prohibit) routes in BIRD
have no interface associated. Return an empty string and index equal to zero
(no real index in kernel) for such routes.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3446 bytes
Desc: not available
More information about the Bird-users