diff options
Diffstat (limited to 'bgpd/bgp_debug.c')
-rw-r--r-- | bgpd/bgp_debug.c | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c index 60284a2d..acb1de7f 100644 --- a/bgpd/bgp_debug.c +++ b/bgpd/bgp_debug.c @@ -36,6 +36,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "bgpd/bgp_debug.h" #include "bgpd/bgp_community.h" +unsigned long conf_bgp_debug_as4; unsigned long conf_bgp_debug_fsm; unsigned long conf_bgp_debug_events; unsigned long conf_bgp_debug_packet; @@ -45,6 +46,7 @@ unsigned long conf_bgp_debug_update; unsigned long conf_bgp_debug_normal; unsigned long conf_bgp_debug_zebra; +unsigned long term_bgp_debug_as4; unsigned long term_bgp_debug_fsm; unsigned long term_bgp_debug_events; unsigned long term_bgp_debug_packet; @@ -297,6 +299,92 @@ debug (unsigned int option) return bgp_debug_option & option; } +DEFUN (debug_bgp_as4, + debug_bgp_as4_cmd, + "debug bgp as4", + DEBUG_STR + BGP_STR + "BGP AS4 actions\n") +{ + if (vty->node == CONFIG_NODE) + DEBUG_ON (as4, AS4); + else + { + TERM_DEBUG_ON (as4, AS4); + vty_out (vty, "BGP as4 debugging is on%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +DEFUN (no_debug_bgp_as4, + no_debug_bgp_as4_cmd, + "no debug bgp as4", + NO_STR + DEBUG_STR + BGP_STR + "BGP AS4 actions\n") +{ + if (vty->node == CONFIG_NODE) + DEBUG_OFF (as4, AS4); + else + { + TERM_DEBUG_OFF (as4, AS4); + vty_out (vty, "BGP as4 debugging is off%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +ALIAS (no_debug_bgp_as4, + undebug_bgp_as4_cmd, + "undebug bgp as4", + UNDEBUG_STR + DEBUG_STR + BGP_STR + "BGP AS4 actions\n") + +DEFUN (debug_bgp_as4_segment, + debug_bgp_as4_segment_cmd, + "debug bgp as4 segment", + DEBUG_STR + BGP_STR + "BGP AS4 aspath segment handling\n") +{ + if (vty->node == CONFIG_NODE) + DEBUG_ON (as4, AS4_SEGMENT); + else + { + TERM_DEBUG_ON (as4, AS4_SEGMENT); + vty_out (vty, "BGP as4 segment debugging is on%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +DEFUN (no_debug_bgp_as4_segment, + no_debug_bgp_as4_segment_cmd, + "no debug bgp as4 segment", + NO_STR + DEBUG_STR + BGP_STR + "BGP AS4 aspath segment handling\n") +{ + if (vty->node == CONFIG_NODE) + DEBUG_OFF (as4, AS4_SEGMENT); + else + { + TERM_DEBUG_OFF (as4, AS4_SEGMENT); + vty_out (vty, "BGP as4 segment debugging is off%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + +ALIAS (no_debug_bgp_as4_segment, + undebug_bgp_as4_segment_cmd, + "undebug bgp as4 segment", + UNDEBUG_STR + DEBUG_STR + BGP_STR + "BGP AS4 aspath segment handling\n") + DEFUN (debug_bgp_fsm, debug_bgp_fsm_cmd, "debug bgp fsm", @@ -651,6 +739,8 @@ DEFUN (no_debug_bgp_all, TERM_DEBUG_OFF (keepalive, KEEPALIVE); TERM_DEBUG_OFF (update, UPDATE_IN); TERM_DEBUG_OFF (update, UPDATE_OUT); + TERM_DEBUG_OFF (as4, AS4); + TERM_DEBUG_OFF (as4, AS4_SEGMENT); TERM_DEBUG_OFF (fsm, FSM); TERM_DEBUG_OFF (filter, FILTER); TERM_DEBUG_OFF (zebra, ZEBRA); @@ -693,6 +783,10 @@ DEFUN (show_debugging_bgp, vty_out (vty, " BGP filter debugging is on%s", VTY_NEWLINE); if (BGP_DEBUG (zebra, ZEBRA)) vty_out (vty, " BGP zebra debugging is on%s", VTY_NEWLINE); + if (BGP_DEBUG (as4, AS4)) + vty_out (vty, " BGP as4 debugging is on%s", VTY_NEWLINE); + if (BGP_DEBUG (as4, AS4_SEGMENT)) + vty_out (vty, " BGP as4 aspath segment debugging is on%s", VTY_NEWLINE); vty_out (vty, "%s", VTY_NEWLINE); return CMD_SUCCESS; } @@ -708,6 +802,18 @@ bgp_config_write_debug (struct vty *vty) write++; } + if (CONF_BGP_DEBUG (as4, AS4)) + { + vty_out (vty, "debug bgp as4%s", VTY_NEWLINE); + write++; + } + + if (CONF_BGP_DEBUG (as4, AS4_SEGMENT)) + { + vty_out (vty, "debug bgp as4 segment%s", VTY_NEWLINE); + write++; + } + if (CONF_BGP_DEBUG (events, EVENTS)) { vty_out (vty, "debug bgp events%s", VTY_NEWLINE); @@ -771,6 +877,11 @@ bgp_debug_init (void) install_element (ENABLE_NODE, &show_debugging_bgp_cmd); + install_element (ENABLE_NODE, &debug_bgp_as4_cmd); + install_element (CONFIG_NODE, &debug_bgp_as4_cmd); + install_element (ENABLE_NODE, &debug_bgp_as4_segment_cmd); + install_element (CONFIG_NODE, &debug_bgp_as4_segment_cmd); + install_element (ENABLE_NODE, &debug_bgp_fsm_cmd); install_element (CONFIG_NODE, &debug_bgp_fsm_cmd); install_element (ENABLE_NODE, &debug_bgp_events_cmd); @@ -788,6 +899,13 @@ bgp_debug_init (void) install_element (ENABLE_NODE, &debug_bgp_zebra_cmd); install_element (CONFIG_NODE, &debug_bgp_zebra_cmd); + install_element (ENABLE_NODE, &no_debug_bgp_as4_cmd); + install_element (ENABLE_NODE, &undebug_bgp_as4_cmd); + install_element (CONFIG_NODE, &no_debug_bgp_as4_cmd); + install_element (ENABLE_NODE, &no_debug_bgp_as4_segment_cmd); + install_element (ENABLE_NODE, &undebug_bgp_as4_segment_cmd); + install_element (CONFIG_NODE, &no_debug_bgp_as4_segment_cmd); + install_element (ENABLE_NODE, &no_debug_bgp_fsm_cmd); install_element (ENABLE_NODE, &undebug_bgp_fsm_cmd); install_element (CONFIG_NODE, &no_debug_bgp_fsm_cmd); |