[PATCH] Filter: picking community elements and finding min/max element
Alexander Zubkov
green at qrator.net
Thu Dec 16 14:44:51 CET 2021
Of course I forgot to attach the patches. :)
On Thu, Dec 16, 2021 at 2:41 PM Alexander Zubkov <green at qrator.net> wrote:
>
> Hi everyone!
>
> I made a couple of patches to do some interesting stuff with communities.
> The first patch allows to pick a component from a standard or a large community:
>
> (10, 20, 30) @ 2 --> 20
>
> And the second patch allows to search for minimum or maximum element
> in a community list. This combined allows to do some cool stuff with
> communities like this:
>
> bgp_local_pref = filter(bgp_large_community, [(<as>, <localpref_val>,
> *)]).min @ 3
>
> This will find us the minimum from our "localpref" communities and get
> that number as integer, ready to assign it where we need. Now we use a
> series of if's to check all the possible variants and that is not very
> convenient. I think this features will greatly boost the possibilities
> of working with communities in bird.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bird-pick-community.patch
Type: text/x-patch
Size: 3276 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20211216/17798a72/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bird-set-min-max.patch
Type: text/x-patch
Size: 9016 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20211216/17798a72/attachment-0001.bin>
More information about the Bird-users
mailing list