Multiple parameters in function
Hello, I'm trying to configure the below using examples from bird wiki. (https://git.nic.cz/redmine/projects/bird/wiki/BGP_filtering) But it fails when type "configure" on birdc with a following message. "bird: /etc/bird.conf, line 16: syntax error" It works when I define one parameter in function. Are multiple parameters in function supported on 1.3.4? Or please correct me if I make any mistakes. bird.conf --snip-- 16: function rt_import(int peer_as, int set peer_asns, prefix set peer_net) 17: { 18: if ! ( net ~ peer_net ) then return false; 19: if ! ( bgp_path.last ~ peer_asns ) then return false; 20: return true; 21: } 22: 23: filter AS65000_IN 24: { 25: if ! rt_import(65000, [ 65000, 65001 ], [ 10.0.0.0/8, 192.168.0.0/24 ]) then reject; 26: accept; 27: } 28: 29: protocol bgp TEST { 30: local as myas; 31: neighbor 172.16.0.1 as 65000; 32: import filter AS65000_IN; 33: } --snip-- Thanks, Eiichiro -- ################################################### Eiichiro Watanabe Internet Multifeed Co.
On Mon, Dec 12, 2011 at 09:29:41PM +0900, Eiichiro Watanabe wrote:
Hello,
I'm trying to configure the below using examples from bird wiki. (https://git.nic.cz/redmine/projects/bird/wiki/BGP_filtering)
But it fails when type "configure" on birdc with a following message. "bird: /etc/bird.conf, line 16: syntax error"
It works when I define one parameter in function.
Are multiple parameters in function supported on 1.3.4? Or please correct me if I make any mistakes.
BIRD is OK, the wiki example is buggy - function arguments in BIRD are separated by semicolon, not by comma. So it should be: function rt_import(int peer_as; int set peer_asns; prefix set peer_net) { ... } -- 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."
Thanks for your prompt reply. It worked! ;-) Eiichiro Ondrej Zajicek wrote (2011/12/12 22:08):
On Mon, Dec 12, 2011 at 09:29:41PM +0900, Eiichiro Watanabe wrote:
Hello,
I'm trying to configure the below using examples from bird wiki. (https://git.nic.cz/redmine/projects/bird/wiki/BGP_filtering)
But it fails when type "configure" on birdc with a following message. "bird: /etc/bird.conf, line 16: syntax error"
It works when I define one parameter in function.
Are multiple parameters in function supported on 1.3.4? Or please correct me if I make any mistakes.
BIRD is OK, the wiki example is buggy - function arguments in BIRD are separated by semicolon, not by comma. So it should be:
function rt_import(int peer_as; int set peer_asns; prefix set peer_net) { ... }
-- ################################################### Eiichiro Watanabe Internet Multifeed Co.
participants (2)
-
Eiichiro Watanabe -
Ondrej Zajicek