diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2018-05-09 06:35:00 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2018-10-27 20:16:12 +0200 |
commit | 44f2f852a18dd4f0b93215f46c1020f04676fa64 (patch) | |
tree | 1cc73b8c9b69868ad4152b33a8614692ab99fe80 /ripd/ripd.h | |
parent | ripd: retrofit the 'offset-list' command to the new northbound model (diff) | |
download | frr-44f2f852a18dd4f0b93215f46c1020f04676fa64.tar.xz frr-44f2f852a18dd4f0b93215f46c1020f04676fa64.zip |
ripd: retrofit the 'passive-interface' command to the new northbound model
In ripd, the "passive-interface default" command has the following
behavior:
* All interfaces are converted to the passive mode;
* The "passive-interface IFNAME" command becomes a no-operation and
"passive-interface IFNAME" statements are removed from the running
configuration.
* The "no passive-interface IFNAME" can be used to remove interfaces
from the passive mode.
This command was modeled using the following YANG data nodes in the
frr-ripd module:
leaf passive-default {
type boolean;
default "false";
description
"Control whether interfaces are in the passive mode
by default or not.";
}
leaf-list passive-interface {
when "../passive-default = 'false'";
type string {
length "1..16";
}
description
"A list of interfaces where the sending of RIP packets
is disabled.";
}
leaf-list non-passive-interface {
when "../passive-default = 'true'";
type string {
length "1..16";
}
description
"A list of interfaces where the sending of RIP packets
is enabled.";
}
The 'when' statements guarantee that the list of passive interfaces
is cleared when the "passive-interface default" command is entered
(likewise, they guarantee that the list of non-passive interfaces is
cleared when the "passive-interface default" command is removed). This
matches exactly the behavior we want to model.
Finally, move the 'passive_default' global variable into the
'rip' structure where it belongs. This fixed the bug where the
"passive-interface default" command was being retained after a "no router
rip" + "router rip".
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripd/ripd.h')
-rw-r--r-- | ripd/ripd.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ripd/ripd.h b/ripd/ripd.h index 4378f75af..307f7934b 100644 --- a/ripd/ripd.h +++ b/ripd/ripd.h @@ -149,6 +149,9 @@ struct rip { /* RIP ECMP flag */ bool ecmp; + /* Are we in passive-interface default mode? */ + bool passive_default; + /* For redistribute route map. */ struct { char *name; @@ -388,6 +391,8 @@ extern void rip_clean(void); extern void rip_clean_network(void); extern void rip_interfaces_clean(void); extern void rip_interfaces_reset(void); +extern int rip_passive_nondefault_set(const char *ifname); +extern int rip_passive_nondefault_unset(const char *ifname); extern void rip_passive_nondefault_clean(void); extern void rip_if_init(void); extern void rip_if_down_all(void); @@ -426,7 +431,7 @@ extern void rip_interface_multicast_set(int, struct connected *); extern void rip_distribute_update_interface(struct interface *); extern void rip_if_rmap_update_interface(struct interface *); -extern int config_write_rip_network(struct vty *, int); +extern int rip_show_network_config(struct vty *); extern int config_write_rip_redistribute(struct vty *, int); extern void rip_peer_init(void); @@ -473,6 +478,7 @@ DECLARE_HOOK(rip_ifaddr_add, (struct connected * ifc), (ifc)) DECLARE_HOOK(rip_ifaddr_del, (struct connected * ifc), (ifc)) extern struct route_table *rip_distance_table; +extern vector Vrip_passive_nondefault; /* Northbound. */ extern void rip_cli_init(void); |