<html><head></head><body><div dir="auto">Thank you, Ondrej! Choose int set solution<br><br></div>
<div dir="auto"><i><!-- tmjah_g_1299s -->С уважением, <!-- tmjah_g_1299e --></i><br></div>
<div dir="auto"><i><!-- tmjah_g_1299s -->Борис Коваленко<!-- tmjah_g_1299e --></i></div>
<div class="gmail_quote" >На 19 февр. 2017 г., в 5:10, Ondrej Zajicek <<a href="mailto:santiago@crfreenet.org" target="_blank">santiago@crfreenet.org</a>> написал:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="blue">On Sat, Feb 18, 2017 at 06:52:56PM +0000, Борис Коваленко wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Hello!<br> <br> I have an idea to write common filters like<br> <br> define RF_REDISTRIBUTE_CONNECTED 0x10<br> define RF_REDISTRIBUTE_STATIC 0x20<br> .....<br> <br> protocol ospf main_ospf {<br> export where f_main_ospf_e(RF_REDISTRIBUTE_CONNECTED |<br> RF_REDISTRIBUTE_STATIC);<br> .....<br> }<br> <br> function f_main_ospf_e(int flags) {<br> if(source ~ [RTS_STATIC, RTS_STATIC_DEVICE] && (flags &<br> RF_REDISTRIBUTE_STATIC)<br> ........<br> }<br> <br> Unfortunatelly there are not bit operators :( But may be there is another<br> way?<br></blockquote><br>Well, you could add multiple arguments to functions.<br><br>Or you could add 'int set' argument to function:<br>export where f_main_ospf_e([RF_REDISTRIBUTE_CONNECTED, RF_REDISTRIBUTE_STATIC]);<br><br>Or could use specific functions for each type:<br>export where f_ospf_redistribute_connected() || f_ospf_redistribute_static();<br></pre></blockquote></div></body></html>