Re: Import directly connected routes

2017-05-10 Thread Damien Clabaut

Thank you for your answer.

This is really useful and helped me solve a problem that seemed 
impossible in Quagga.


Thanks :)


On 09/05/17 08:47 AM, Ondrej Zajicek wrote:

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.



--
Damien Clabaut
R&D vRouter
ovh.qc.ca



Re: Import directly connected routes

2017-05-09 Thread Ondrej Zajicek
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: santi...@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."



Re: Import directly connected routes

2017-05-09 Thread Damien Clabaut

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



Re: Import directly connected routes

2017-05-09 Thread Ondrej Zajicek
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);
}


-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santi...@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."


Re: Import directly connected routes

2017-05-08 Thread Damien Clabaut

I have several 'direct" instances which write in different routing table.

I would like to have it manipulated by robots in the context of 
automated deployment, so it would be a lot easier to have lists in 
variables in a separate config file than isolated in similar lines in 
one config file.


Maybe this can be done through the C API though ?


On 08/05/17 05:23 PM, Maximilian Wilhelm wrote:

Anno domini 2017 Damien Clabaut scripsit:

Hi,


Is there any way to declare a list of interfaces in a string set or
something ?

The goal would be to use it in direct protocol, and in pipe protocol (import
where ifname ~ list_if1)

How 'bout managing the list of devices within the direct protocol and
in the pipe filtering on the protocol name?

Like

protocol direct "connected" {
interface "eth0", "vlan42";
}

import where proto = "connected"

Best
Max


--
Damien Clabaut
R&D vRouter
ovh.qc.ca



Re: Import directly connected routes

2017-05-08 Thread Maximilian Wilhelm
Anno domini 2017 Damien Clabaut scripsit:

Hi,

> Is there any way to declare a list of interfaces in a string set or
> something ?
> 
> The goal would be to use it in direct protocol, and in pipe protocol (import
> where ifname ~ list_if1)

How 'bout managing the list of devices within the direct protocol and
in the pipe filtering on the protocol name?

Like

protocol direct "connected" {
interface "eth0", "vlan42";
}

import where proto = "connected"

Best
Max
-- 
"Wer nicht mehr liebt und nicht mehr irrt, der lasse sich begraben."
 -- Johann Wolfgang von Goethe


Re: Import directly connected routes

2017-05-08 Thread Damien Clabaut

Hello again,

Is there any way to declare a list of interfaces in a string set or 
something ?


The goal would be to use it in direct protocol, and in pipe protocol 
(import where ifname ~ list_if1)


Regards,


On 08/05/17 03:47 PM, Ondrej Zajicek wrote:

On Mon, May 08, 2017 at 03:45:17PM -0400, Damien Clabaut wrote:

Hello Ondrej,

Thank you for your answer.

I did not manage to do it with "device", but "direct" works:

Yes, that was my mistake. 'direct' is the correct one,



--
Damien Clabaut
R&D vRouter
ovh.qc.ca



Re: Import directly connected routes

2017-05-08 Thread Ondrej Zajicek
On Mon, May 08, 2017 at 03:45:17PM -0400, Damien Clabaut wrote:
> Hello Ondrej,
> 
> Thank you for your answer.
> 
> I did not manage to do it with "device", but "direct" works:

Yes, that was my mistake. 'direct' is the correct one,

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santi...@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."


signature.asc
Description: Digital signature


Re: Import directly connected routes

2017-05-08 Thread Damien Clabaut

Hello Ondrej,

Thank you for your answer.

I did not manage to do it with "device", but "direct" works:

protocol direct direct_numa0 {
  table numa0;
  interface "eth4.800", "eth4.801";
}

Thanks :)


On 08/05/17 03:16 PM, Ondrej Zajicek wrote:

On Mon, May 08, 2017 at 02:51:55PM -0400, Damien Clabaut wrote:

Hello,

I have an issue with latest stable Bird (1.6.3) on Debian8.

I have a bunch of directly connected networks, with route in main routing
table:

# ip route show
default via 10.21.136.126 dev eth0
10.21.136.0/25 dev eth0  proto kernel  scope link  src 10.21.136.19
192.168.1.0/31 dev eth4.800  proto kernel  scope link  src 192.168.1.1
192.168.1.2/31 dev eth4.801  proto kernel  scope link  src 192.168.1.3
192.168.1.4/31 dev eth4.802  proto kernel  scope link  src 192.168.1.5
192.168.1.6/31 dev eth4.803  proto kernel  scope link  src 192.168.1.7

...


But only the default (static) route is imported:

bird> show route table default1
0.0.0.0/0  via 10.21.136.126 on eth0 [kernel_default 20:32:40] *
(10)

Is there any way I can import them ?

Hello

Kernel protocol in 'learn' mode does not learn 'native' kernel routes,
just routes added by other daemons/tools (like the default route).

But 'device' protocol could do what you want.



--
Damien Clabaut
R&D vRouter
ovh.qc.ca



Re: Import directly connected routes

2017-05-08 Thread Ondrej Zajicek
On Mon, May 08, 2017 at 02:51:55PM -0400, Damien Clabaut wrote:
> Hello,
> 
> I have an issue with latest stable Bird (1.6.3) on Debian8.
> 
> I have a bunch of directly connected networks, with route in main routing
> table:
> 
> # ip route show
> default via 10.21.136.126 dev eth0
> 10.21.136.0/25 dev eth0  proto kernel  scope link  src 10.21.136.19
> 192.168.1.0/31 dev eth4.800  proto kernel  scope link  src 192.168.1.1
> 192.168.1.2/31 dev eth4.801  proto kernel  scope link  src 192.168.1.3
> 192.168.1.4/31 dev eth4.802  proto kernel  scope link  src 192.168.1.5
> 192.168.1.6/31 dev eth4.803  proto kernel  scope link  src 192.168.1.7

...

> But only the default (static) route is imported:
> 
> bird> show route table default1
> 0.0.0.0/0  via 10.21.136.126 on eth0 [kernel_default 20:32:40] *
> (10)
> 
> Is there any way I can import them ?

Hello

Kernel protocol in 'learn' mode does not learn 'native' kernel routes,
just routes added by other daemons/tools (like the default route). 

But 'device' protocol could do what you want.

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santi...@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."


signature.asc
Description: Digital signature