if (IS_RIPNG_DEBUG_ZEBRA)
vty_out(vty, " RIPng zebra debugging is on\n");
+ cmd_show_lib_debugs(vty);
+
return CMD_SUCCESS;
}
{
int idx_recv_send = 3;
ripng_debug_packet |= RIPNG_DEBUG_PACKET;
- if (strncmp("send", argv[idx_recv_send]->arg,
- strlen(argv[idx_recv_send]->arg))
- == 0)
+ if (strcmp("send", argv[idx_recv_send]->text) == 0)
ripng_debug_packet |= RIPNG_DEBUG_SEND;
- if (strncmp("recv", argv[idx_recv_send]->arg,
- strlen(argv[idx_recv_send]->arg))
- == 0)
+ if (strcmp("recv", argv[idx_recv_send]->text) == 0)
ripng_debug_packet |= RIPNG_DEBUG_RECV;
return CMD_SUCCESS;
"Debug option set for send packet\n")
{
int idx_recv_send = 4;
- if (strncmp("send", argv[idx_recv_send]->arg,
- strlen(argv[idx_recv_send]->arg))
- == 0) {
+ if (strcmp("send", argv[idx_recv_send]->text) == 0) {
if (IS_RIPNG_DEBUG_RECV)
ripng_debug_packet &= ~RIPNG_DEBUG_SEND;
else
ripng_debug_packet = 0;
- } else if (strncmp("recv", argv[idx_recv_send]->arg,
- strlen(argv[idx_recv_send]->arg))
- == 0) {
+ } else if (strcmp("recv", argv[idx_recv_send]->text) == 0) {
if (IS_RIPNG_DEBUG_SEND)
ripng_debug_packet &= ~RIPNG_DEBUG_RECV;
else
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 /* VTYSH */
+ .name = "debug",
+ .node = DEBUG_NODE,
+ .prompt = "",
+ .config_write = config_write_debug,
};
static int config_write_debug(struct vty *vty)
return write;
}
-void ripng_debug_reset()
-{
- ripng_debug_event = 0;
- ripng_debug_packet = 0;
- ripng_debug_zebra = 0;
-}
-
-void ripng_debug_init()
+void ripng_debug_init(void)
{
ripng_debug_event = 0;
ripng_debug_packet = 0;
ripng_debug_zebra = 0;
- install_node(&debug_node, config_write_debug);
+ install_node(&debug_node);
- install_element(VIEW_NODE, &show_debugging_ripng_cmd);
+ install_element(ENABLE_NODE, &show_debugging_ripng_cmd);
install_element(ENABLE_NODE, &debug_ripng_events_cmd);
install_element(ENABLE_NODE, &debug_ripng_packet_cmd);