[PATCH 4/7] Babel: Documentation updates.
This updates the documentation to correctly mention Babel when protocols are listed, and adds examples and route attribute documentation to the Babel section of the docs. Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> --- doc/bird.sgml | 33 ++++++++++++++++++++++++++++++--- nest/config.Y | 2 +- nest/rt-attr.c | 2 +- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/doc/bird.sgml b/doc/bird.sgml index a0b45f4..71fcb1c 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -610,8 +610,8 @@ agreement"). options, in that case for given interface the first matching interface option is used. - This option is allowed in BFD, Direct, OSPF, RAdv and RIP protocols, but - in OSPF protocol it is used in the <cf/area/ subsection. + This option is allowed in Babel, BFD, Direct, OSPF, RAdv and RIP + protocols, but in OSPF protocol it is used in the <cf/area/ subsection. Default: none. @@ -1312,7 +1312,7 @@ clist for most purposes. <cf/RTS_DUMMY/, <cf/RTS_STATIC/, <cf/RTS_INHERIT/, <cf/RTS_DEVICE/, <cf/RTS_STATIC_DEVICE/, <cf/RTS_REDIRECT/, <cf/RTS_RIP/, <cf/RTS_OSPF/, <cf/RTS_OSPF_IA/, <cf/RTS_OSPF_EXT1/, <cf/RTS_OSPF_EXT2/, <cf/RTS_BGP/, - <cf/RTS_PIPE/. + <cf/RTS_PIPE/, <cf/RTS_BABEL/. <tag><m/enum/ cast</tag> Route type (Currently <cf/RTC_UNICAST/ for normal routes, @@ -1475,6 +1475,33 @@ protocol babel [<name>] { yes. </descrip> +<sect1>Attributes + +<p>Babel defines just one attribute: the internal babel metric of the route. It +is exposed as the <cf/babel_metric/ attribute and has range from 1 to infinity +(65535). + +<sect1>Example + +<p><code> +protocol babel { + interface "eth*" { + type wired; + }; + interface "wlan0", "wlan1" { + type wireless; + hello interval 1; + rxcost 512; + }; + interface "tap0"; + + # This matches the default of babeld: redistribute all addresses + # configured on local interfaces, plus re-distribute all routes received + # from other babel peers. + export where (source = RTS_DEVICE) || (source = RTS_BABEL); +} +</code> + <sect><label id="sect-bfd">BFD diff --git a/nest/config.Y b/nest/config.Y index 4566971..ca70564 100644 --- a/nest/config.Y +++ b/nest/config.Y @@ -63,7 +63,7 @@ CF_KEYWORDS(RELOAD, IN, OUT, MRTDUMP, MESSAGES, RESTRICT, MEMORY, IGP_METRIC, CL CF_KEYWORDS(GRACEFUL, RESTART, WAIT, MAX, FLUSH, AS) CF_ENUM(T_ENUM_RTS, RTS_, DUMMY, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIRECT, - RIP, OSPF, OSPF_IA, OSPF_EXT1, OSPF_EXT2, BGP, PIPE) + RIP, OSPF, OSPF_IA, OSPF_EXT1, OSPF_EXT2, BGP, PIPE, BABEL) CF_ENUM(T_ENUM_SCOPE, SCOPE_, HOST, LINK, SITE, ORGANIZATION, UNIVERSE, UNDEFINED) CF_ENUM(T_ENUM_RTC, RTC_, UNICAST, BROADCAST, MULTICAST, ANYCAST) CF_ENUM(T_ENUM_RTD, RTD_, ROUTER, DEVICE, BLACKHOLE, UNREACHABLE, PROHIBIT, MULTIPATH) diff --git a/nest/rt-attr.c b/nest/rt-attr.c index 7fa05d6..b57bcd5 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -1160,7 +1160,7 @@ rta_dump(rta *a) static char *rts[] = { "RTS_DUMMY", "RTS_STATIC", "RTS_INHERIT", "RTS_DEVICE", "RTS_STAT_DEV", "RTS_REDIR", "RTS_RIP", "RTS_OSPF", "RTS_OSPF_IA", "RTS_OSPF_EXT1", - "RTS_OSPF_EXT2", "RTS_BGP" }; + "RTS_OSPF_EXT2", "RTS_BGP", "RTS_PIPE", "RTS_BABEL" }; static char *rtc[] = { "", " BC", " MC", " AC" }; static char *rtd[] = { "", " DEV", " HOLE", " UNREACH", " PROHIBIT" }; -- 2.8.0
On Mon, May 02, 2016 at 07:07:52PM +0200, Toke Høiland-Jørgensen wrote:
This updates the documentation to correctly mention Babel when protocols are listed, and adds examples and route attribute documentation to the Babel section of the docs.
Thanks Toke :)
+<sect1>Attributes + +<p>Babel defines just one attribute: the internal babel metric of the route. It +is exposed as the <cf/babel_metric/ attribute and has range from 1 to infinity +(65535).
I thought you were also exporting the router-id as an attribute, since it is shown in "show route all": bird> show route all 2001:db8:8081:1a00::1/128 via fe80::e8db:78ff:fe05:8a64 on tap-fastd [babel1 12:53:53] * (130/1) [cc:5a:c9:1b:07:06:d2:c7] Type: <NULL> unicast univ Babel.metric: 1 Babel.router_id: cc:5a:c9:1b:07:06:d2:c7 Would it make sense to export the router ID? It would allow to filter routes based on the originating router (babeld allows that, but I have no idea whether it's actually used by somebody).
+<sect1>Example + +<p><code> +protocol babel { + interface "eth*" { + type wired; + }; + interface "wlan0", "wlan1" { + type wireless; + hello interval 1; + rxcost 512; + }; + interface "tap0"; + + # This matches the default of babeld: redistribute all addresses + # configured on local interfaces, plus re-distribute all routes received + # from other babel peers. + export where (source = RTS_DEVICE) || (source = RTS_BABEL); +} +</code>
Great, that looks good! The filter can also be written as: export where source ~ [RTS_DEVICE, RTS_BABEL]; Can you mention that it needs "protocol direct" to work? Maybe just add this at the beginning of the example: protocol direct { interface "*"; } Baptiste
On 3 May 2016 13:22:06 CEST, Baptiste Jonglez <baptiste@bitsofnetworks.org> wrote:
On Mon, May 02, 2016 at 07:07:52PM +0200, Toke Høiland-Jørgensen wrote:
This updates the documentation to correctly mention Babel when protocols are listed, and adds examples and route attribute documentation to the Babel section of the docs.
Thanks Toke :)
You're very welcome :)
+<sect1>Attributes + +<p>Babel defines just one attribute: the internal babel metric of the route. It +is exposed as the <cf/babel_metric/ attribute and has range from 1 to infinity +(65535).
I thought you were also exporting the router-id as an attribute, since it is shown in "show route all":
bird> show route all 2001:db8:8081:1a00::1/128 via fe80::e8db:78ff:fe05:8a64 on tap-fastd [babel1 12:53:53] * (130/1) [cc:5a:c9:1b:07:06:d2:c7] Type: <NULL> unicast univ Babel.metric: 1 Babel.router_id: cc:5a:c9:1b:07:06:d2:c7
It is exported, but as an opaque blob as far as the Bird core is concerned.
Would it make sense to export the router ID? It would allow to filter routes based on the originating router (babeld allows that, but I have no idea whether it's actually used by somebody).
It would, I guess, but that would require teaching the core about 64-bit router IDs, and the parser would need to learn a syntax for them. So it's not trivial, unfortunately, and so I've punted on that for now.
+<sect1>Example + +<p><code> +protocol babel { + interface "eth*" { + type wired; + }; + interface "wlan0", "wlan1" { + type wireless; + hello interval 1; + rxcost 512; + }; + interface "tap0"; + + # This matches the default of babeld: redistribute all addresses + # configured on local interfaces, plus re-distribute all routes received + # from other babel peers. + export where (source = RTS_DEVICE) || (source = RTS_BABEL); +} +</code>
Great, that looks good!
The filter can also be written as:
export where source ~ [RTS_DEVICE, RTS_BABEL];
Right. Note that I had also missed adding the RTS_BABEL keyword to the config parser. That's in the patch series as well somewhere.
Can you mention that it needs "protocol direct" to work? Maybe just add this at the beginning of the example:
protocol direct { interface "*"; }
Well I figured that is already in the example config file shipped with Bird, and that most people would just use that as a starting point... -Toke
On Tue, May 03, 2016 at 01:37:37PM +0200, Toke Høiland-Jørgensen wrote:
I thought you were also exporting the router-id as an attribute, since it is shown in "show route all": It is exported, but as an opaque blob as far as the Bird core is concerned.
Would it make sense to export the router ID? It would allow to filter routes based on the originating router (babeld allows that, but I have no idea whether it's actually used by somebody).
It would, I guess, but that would require teaching the core about 64-bit router IDs, and the parser would need to learn a syntax for them. So it's not trivial, unfortunately, and so I've punted on that for now.
No worries then, as I said, it's probably not used much with babeld (I certainly don't use it).
Can you mention that it needs "protocol direct" to work? Maybe just add this at the beginning of the example:
protocol direct { interface "*"; }
Well I figured that is already in the example config file shipped with Bird, and that most people would just use that as a starting point...
Hmm, on Debian, it isn't. I think it couldn't hurt to at least mention that it is needed. Baptiste
participants (2)
-
Baptiste Jonglez -
Toke Høiland-Jørgensen