Re: Import directly connected routes
Hello, Thank you for your answer. Are there some reserved variable names in function arguments ? If I do (as per example in filter.conf in git repo): function onef(string s) { return 1; } I get syntax error in the first line of the function. However, function onef(string a) { return 1; } works. Regards, On 09/05/17 07:32 AM, Ondrej Zajicek wrote:
On Mon, May 08, 2017 at 04:43:32PM -0400, Damien Clabaut wrote:
Hello again,
Is there any way to declare a list of interfaces in a string set or something ? No, string sets are not implemented. Although it is something that makes sense to add.
You could define functions that match a set of string:
function xxx(string s) { return s = "dev1" || s = "dev2" || s = "dev3"; }
Then you could use such functions in filters of direct and pipe protocol.
Instead of:
protocol direct direct_numa0 { table numa0; interface "eth4.800", "eth4.801"; }
You could use:
protocol direct direct_numa0 { table numa0; import where xxx(ifname); }
-- Damien Clabaut R&D vRouter ovh.qc.ca
On Tue, May 09, 2017 at 08:28:26AM -0400, Damien Clabaut wrote:
Hello,
Thank you for your answer.
Are there some reserved variable names in function arguments ?
Yes, unfortunately each keyword is reserved and cannot be used as symbol (variable, argument, protocol, table, ... name). 's' is keyword used for seconds in some time interval options. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
Damien Clabaut -
Ondrej Zajicek