diff options
Diffstat (limited to 'ripd')
| -rw-r--r-- | ripd/rip_debug.c | 12 | ||||
| -rw-r--r-- | ripd/rip_interface.c | 9 | ||||
| -rw-r--r-- | ripd/rip_main.c | 1 | ||||
| -rw-r--r-- | ripd/ripd.c | 17 |
4 files changed, 29 insertions, 10 deletions
diff --git a/ripd/rip_debug.c b/ripd/rip_debug.c index 3356d99c2a..871ee8e87e 100644 --- a/ripd/rip_debug.c +++ b/ripd/rip_debug.c @@ -172,10 +172,14 @@ DEFUN (no_debug_rip_zebra, return CMD_SUCCESS; } +static int config_write_debug(struct vty *vty); /* Debug node. */ -static struct cmd_node debug_node = {DEBUG_NODE, - "", /* Debug node has no interface. */ - 1}; +static struct cmd_node debug_node = { + .name = "debug", + .node = DEBUG_NODE, + .prompt = "", + .config_write = config_write_debug, +}; static int config_write_debug(struct vty *vty) { @@ -210,7 +214,7 @@ void rip_debug_init(void) rip_debug_packet = 0; rip_debug_zebra = 0; - install_node(&debug_node, config_write_debug); + install_node(&debug_node); install_element(ENABLE_NODE, &show_debugging_rip_cmd); install_element(ENABLE_NODE, &debug_rip_events_cmd); diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index c05d776eb1..177f53db45 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -1193,8 +1193,13 @@ int rip_show_network_config(struct vty *vty, struct rip *rip) return 0; } +static int rip_interface_config_write(struct vty *vty); static struct cmd_node interface_node = { - INTERFACE_NODE, "%s(config-if)# ", 1, + .name = "interface", + .node = INTERFACE_NODE, + .parent_node = CONFIG_NODE, + .prompt = "%s(config-if)# ", + .config_write = rip_interface_config_write, }; void rip_interface_sync(struct interface *ifp) @@ -1236,7 +1241,7 @@ void rip_if_init(void) hook_register_prio(if_del, 0, rip_interface_delete_hook); /* Install interface node. */ - install_node(&interface_node, rip_interface_config_write); + install_node(&interface_node); if_cmd_init(); if_zapi_callbacks(rip_ifp_create, rip_ifp_up, rip_ifp_down, rip_ifp_destroy); diff --git a/ripd/rip_main.c b/ripd/rip_main.c index 73e94deefc..9ec32a53e3 100644 --- a/ripd/rip_main.c +++ b/ripd/rip_main.c @@ -117,6 +117,7 @@ static const struct frr_yang_module_info *const ripd_yang_modules[] = { &frr_interface_info, &frr_ripd_info, &frr_route_map_info, + &frr_vrf_info, }; FRR_DAEMON_INFO(ripd, RIP, .vty_port = RIP_VTY_PORT, diff --git a/ripd/ripd.c b/ripd/ripd.c index f092da847d..30d2a59d77 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -44,6 +44,7 @@ #include "privs.h" #include "lib_errors.h" #include "northbound_cli.h" +#include "network.h" #include "ripd/ripd.h" #include "ripd/rip_nb.h" @@ -2647,7 +2648,7 @@ static int rip_triggered_update(struct thread *t) random interval between 1 and 5 seconds. If other changes that would trigger updates occur before the timer expires, a single update is triggered when the timer expires. */ - interval = (random() % 5) + 1; + interval = (frr_weak_random() % 5) + 1; rip->t_triggered_interval = NULL; thread_add_timer(master, rip_triggered_interval, rip, interval, @@ -2844,7 +2845,8 @@ static int rip_update_jitter(unsigned long time) if (jitter_input < JITTER_BOUND) jitter_input = JITTER_BOUND; - jitter = (((random() % ((jitter_input * 2) + 1)) - jitter_input)); + jitter = (((frr_weak_random() % ((jitter_input * 2) + 1)) + - jitter_input)); return jitter / JITTER_BOUND; } @@ -3327,8 +3329,15 @@ static int config_write_rip(struct vty *vty) return write; } +static int config_write_rip(struct vty *vty); /* RIP node structure. */ -static struct cmd_node rip_node = {RIP_NODE, "%s(config-router)# ", 1}; +static struct cmd_node rip_node = { + .name = "rip", + .node = RIP_NODE, + .parent_node = CONFIG_NODE, + .prompt = "%s(config-router)# ", + .config_write = config_write_rip, +}; /* Distribute-list update functions. */ static void rip_distribute_update(struct distribute_ctx *ctx, @@ -3731,7 +3740,7 @@ void rip_vrf_terminate(void) void rip_init(void) { /* Install top nodes. */ - install_node(&rip_node, config_write_rip); + install_node(&rip_node); /* Install rip commands. */ install_element(VIEW_NODE, &show_ip_rip_cmd); |
