diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2012-12-27 12:56:23 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2012-12-27 12:56:23 +0100 |
commit | 79b4e12e6032faf6bb1f3feac385bd36ee53019e (patch) | |
tree | 0509f66417bbaf3429594ac7c359971d75b3ec49 /nest/config.Y | |
parent | a92cf57dd6ba021a495fe7268c86dc8e6aeecbb2 (diff) |
Implements interface masks for choosing router id.
Router ID could be automatically determined based of subset of
ifaces/addresses specified by 'router id from' option. The patch also
does some minor changes related to router ID reconfiguration.
Thanks to Alexander V. Chernikov for most of the work.
Diffstat (limited to 'nest/config.Y')
-rw-r--r-- | nest/config.Y | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/nest/config.Y b/nest/config.Y index cb6a85c2..dbd72055 100644 --- a/nest/config.Y +++ b/nest/config.Y @@ -75,9 +75,9 @@ CF_GRAMMAR CF_ADDTO(conf, rtrid) -rtrid: ROUTER ID idval ';' { - new_config->router_id = $3; - } +rtrid: + ROUTER ID idval ';' { new_config->router_id = $3; } + | ROUTER ID FROM iface_patt ';' { new_config->router_id_from = this_ipatt; } ; idval: @@ -264,6 +264,17 @@ iface_patt_list: | iface_patt_list ',' iface_patt_node ; +iface_patt_init: { + /* Generic this_ipatt init */ + this_ipatt = cfg_allocz(sizeof(struct iface_patt)); + init_list(&this_ipatt->ipn_list); + } + ; + +iface_patt: + iface_patt_init iface_patt_list + ; + /* Direct device route protocol */ |