<div dir="ltr">Aaahh now i see...<div><br></div><div>Currently I do pattern matching... Sorry.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face="monospace">function is_filtered_proto_in ( string p )<br>{<br>        return false;<br>}<br>function is_filtered_proto_out ( string p )<br>{<br>        if p ~ "*2220" then<br>        {<br>                bgp_community.add((65000,11120));<br>                print "Reached is_filtered_proto_out( ", p, " ): Adding Community 65000,11120";<br>        }<br>        if p = "*2221" then<br>        {<br>                bgp_community.add((65000,11050));<br>                print "Reached is_filtered_proto_out( ", p, " ): Adding Community 65000,11050";<br>        }<br>        return false;<br>}</font></blockquote></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Mi., 8. Apr. 2020 um 20:09 Uhr schrieb Maria Matějka <<a href="mailto:maria.matejka@nic.cz">maria.matejka@nic.cz</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>I say that there is no support for such a thing yet but I may be able to provide you with a patch (we want to add it to the filter language).<br><br>Maria<br><br><div class="gmail_quote">On April 8, 2020 7:58:41 PM GMT+02:00, Michael Rack <<a href="mailto:mail@michaelrack.de" target="_blank">mail@michaelrack.de</a>> wrote:<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">Can you explain what you mean?<div><br></div><div>How should I change my scripts?</div><div><br></div><div>I think it will be a good workaround when I simply use functions instead of filters, so I can bypass some parameters.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><b>protocol bgp </b>'peer-neo' {<br>      ipv4 { export where <b>filter_common_ipv4_out(</b> "peer-neo" <b>)</b>; };<br>} <br><b>function  </b>filter_common_ipv4_out( string remote_peer_name ) {<br>      if <font color="#f3f3f3" style="background-color:rgb(106,168,79)"> remote_peer_name </font> = 'peer-neo' then .....;<br>}  </blockquote><div><br></div><div>It is stupid because i define the peer-name twice.</div><div>But for now it will do the job relatively easily.</div><div><br></div><div>I have over 40 peers, so I have to write the function / filter for common use.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Mi., 8. Apr. 2020 um 19:39 Uhr schrieb Maria Matějka <<a href="mailto:maria.matejka@nic.cz" target="_blank">maria.matejka@nic.cz</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hello!<br><br>Currently not supported. Is simple exact match enough for your purposes? This may be simply added to the filter language.<br><br>Maria<br><br><div class="gmail_quote">On April 8, 2020 6:47:49 PM GMT+02:00, Michael Rack <<a href="mailto:mail@michaelrack.de" target="_blank">mail@michaelrack.de</a>> wrote:<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">Hi Guys,<div><br></div><div>if i am in the EXPORT-Routine, how can i access the "protocol-name" of that instance that is currently using my function?</div><div><br></div><div>If I rely on "proto" I get the protocol-name where the route comes from. That is not what I want.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><b>protocol bgp </b>'peer-neo' {<br>      ipv4 { export filter <b>filter_common_ipv4_out</b>; };<br>} <br><b>filter 
</b>
filter_common_ipv4_out() {<br>      if <font color="#f3f3f3" style="background-color:rgb(204,0,0)"> proto </font> = 'peer-neo' then .....;<br>}</blockquote><div><br></div><div>How can I match for 'peer-neo' ?</div><div><br></div><div>Thank you.</div><div>Michael.</div></div>
</blockquote></div><br>-- <br>Sent from my Android device with K-9 Mail. Please excuse my brevity.</div></blockquote></div>
</blockquote></div><br>-- <br>Sent from my Android device with K-9 Mail. Please excuse my brevity.</div></blockquote></div>