logical operations on parts of pairs
Hi guys, Is there a way to do logical operations on only 1 of the 2 ints in a pair? case: I would like to check if in community (xxx,yyy) yyy is bigger than some other variable. I now have something like this: define deny = 1337; define maxRange 100; define denyRange = [ (deny,1)..(deny,maxRange) ]; if (bgp_community ~ DenyRange) then { print "ALARM!"; ### PSEUDO CODE #### if bgp_community.part2 >= 10 { return false; } } Same question for extended and large communities, but I assume that would work the same way. Regards, Stefan -- Mit freundlichen Grüßen / Best regards / Met vriendelijke groet Stefan Plug Network Engineer spl@ecix.net GSM: +49.151.58040805 Fax: +49.30.81495459 Web: http://www.ecix.net/ PEERING GmbH - Division ECIX Lindenallee 27 14050 Berlin Germany Geschaeftsfuehrer: Stefan Wahl Amtsgericht Charlottenburg, HRB 97752B, USt-Id-Nr: DE2746301838
Little bump, As a workaround I'm now just using a loop using a jinja template to generate multiple community lists each with 1 less community which I then simply check per route. This works swimmingly, but it just feels like a cheat. Regards, Stefan On 23.01.2017 17:34, Stefan Plug wrote:
Hi guys,
Is there a way to do logical operations on only 1 of the 2 ints in a pair? case: I would like to check if in community (xxx,yyy) yyy is bigger than some other variable.
I now have something like this: define deny = 1337; define maxRange 100; define denyRange = [ (deny,1)..(deny,maxRange) ]; if (bgp_community ~ DenyRange) then { print "ALARM!";
### PSEUDO CODE #### if bgp_community.part2 >= 10 { return false; } }
Same question for extended and large communities, but I assume that would work the same way.
Regards,
Stefan
-- Mit freundlichen Grüßen / Best regards / Met vriendelijke groet Stefan Plug Network Engineer spl@ecix.net GSM: +49.151.58040805 Fax: +49.30.81495459 Web: http://www.ecix.net/ PEERING GmbH - Division ECIX Lindenallee 27 14050 Berlin Germany Geschaeftsfuehrer: Stefan Wahl Amtsgericht Charlottenburg, HRB 97752B, USt-Id-Nr: DE2746301838
participants (1)
-
Stefan Plug