On Fri, 13 Apr 2012, Oleg wrote:
function add_community(pair set peer_community) { bgp_community.add(peer_community); # doesnt work, incompatible types return true; }
...
Not directly like this. But if you have few known communites, you can do next hardcode:
function add_community(pair set comm) { if ( (123,555) ~ comm ) then bgp_community.add((123,555)); if ( (123,666) ~ comm ) then bgp_community.add((123,666)); if ( (123,777) ~ comm ) then bgp_community.add((123,777)); if ( (123,888) ~ comm ) then bgp_community.add((123,888)); }
This is ugly, but if you have little count of communities this is not annoying solution.
Well, we cannot have clist literals, only pair set literals. That makes this limitation of clist operations rather unfortunate. Can BIRD be extended to allow operating on clists using pair sets? I.e. clist.add(pair set), clist.delete(pair set)... commit 0888a737b045b48106edbd28ba3cd62fcc8c191e, "Extends set operations in filters." did add the relevant clist to clist operations, but pair sets were still left unimplemented... -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh