mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 18:01:54 +00:00
Merge pull request #11961 from maduri111/ospfd-debug-cmds
ospfd: fix for some of ospf debug commands config lost after reboot
This commit is contained in:
commit
a957e14cdf
@ -1060,78 +1060,83 @@ TI-LFA requires a proper Segment Routing configuration.
|
|||||||
Debugging OSPF
|
Debugging OSPF
|
||||||
==============
|
==============
|
||||||
|
|
||||||
.. clicmd:: debug ospf bfd
|
.. clicmd:: debug ospf [(1-65535)] bfd
|
||||||
|
|
||||||
Enable or disable debugging for BFD events. This will show BFD integration
|
Enable or disable debugging for BFD events. This will show BFD integration
|
||||||
library messages and OSPF BFD integration messages that are mostly state
|
library messages and OSPF BFD integration messages that are mostly state
|
||||||
transitions and validation problems.
|
transitions and validation problems.
|
||||||
|
|
||||||
.. clicmd:: debug ospf client-api
|
.. clicmd:: debug ospf [(1-65535)] client-api
|
||||||
|
|
||||||
Show debug information for the OSPF opaque data client API.
|
Show debug information for the OSPF opaque data client API.
|
||||||
|
|
||||||
.. clicmd:: debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]
|
.. clicmd:: debug ospf [(1-65535)] default-information
|
||||||
|
|
||||||
|
Show debug information of default information
|
||||||
|
|
||||||
|
.. clicmd:: debug ospf [(1-65535)] packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]
|
||||||
|
|
||||||
|
|
||||||
Dump Packet for debugging
|
Dump Packet for debugging
|
||||||
|
|
||||||
.. clicmd:: debug ospf ism
|
.. clicmd:: debug ospf [(1-65535)] ism [status|events|timers]
|
||||||
|
|
||||||
.. clicmd:: debug ospf ism (status|events|timers)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Show debug information of Interface State Machine
|
Show debug information of Interface State Machine
|
||||||
|
|
||||||
.. clicmd:: debug ospf nsm
|
.. clicmd:: debug ospf [(1-65535)] nsm [status|events|timers]
|
||||||
|
|
||||||
.. clicmd:: debug ospf nsm (status|events|timers)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Show debug information of Network State Machine
|
Show debug information of Network State Machine
|
||||||
|
|
||||||
.. clicmd:: debug ospf event
|
.. clicmd:: debug ospf [(1-65535)] event
|
||||||
|
|
||||||
|
|
||||||
Show debug information of OSPF event
|
Show debug information of OSPF event
|
||||||
|
|
||||||
.. clicmd:: debug ospf nssa
|
.. clicmd:: debug ospf [(1-65535)] nssa
|
||||||
|
|
||||||
|
|
||||||
Show debug information about Not So Stub Area
|
Show debug information about Not So Stub Area
|
||||||
|
|
||||||
.. clicmd:: debug ospf lsa
|
.. clicmd:: debug ospf [(1-65535)] ldp-sync
|
||||||
|
|
||||||
.. clicmd:: debug ospf lsa (generate|flooding|refresh)
|
Show debug information about LDP-Sync
|
||||||
|
|
||||||
|
.. clicmd:: debug ospf [(1-65535)] lsa [aggregate|flooding|generate|install|refresh]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Show debug detail of Link State messages
|
Show debug detail of Link State messages
|
||||||
|
|
||||||
.. clicmd:: debug ospf te
|
.. clicmd:: debug ospf [(1-65535)] sr
|
||||||
|
|
||||||
|
Show debug information about Segment Routing
|
||||||
|
|
||||||
|
.. clicmd:: debug ospf [(1-65535)] te
|
||||||
|
|
||||||
|
|
||||||
Show debug information about Traffic Engineering LSA
|
Show debug information about Traffic Engineering LSA
|
||||||
|
|
||||||
.. clicmd:: debug ospf zebra
|
.. clicmd:: debug ospf [(1-65535)] ti-lfa
|
||||||
|
|
||||||
.. clicmd:: debug ospf zebra (interface|redistribute)
|
Show debug information about SR TI-LFA
|
||||||
|
|
||||||
|
.. clicmd:: debug ospf [(1-65535)] zebra [interface|redistribute]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Show debug information of ZEBRA API
|
Show debug information of ZEBRA API
|
||||||
|
|
||||||
.. clicmd:: debug ospf graceful-restart helper
|
.. clicmd:: debug ospf [(1-65535)] graceful-restart
|
||||||
|
|
||||||
|
|
||||||
Enable/disable debug information for OSPF Graceful Restart Helper
|
Enable/disable debug information for OSPF Graceful Restart Helper
|
||||||
|
|
||||||
.. clicmd:: show debugging ospf
|
.. clicmd:: show debugging ospf
|
||||||
|
|
||||||
.. clicmd:: debug ospf lsa aggregate
|
|
||||||
|
|
||||||
Debug commnd to enable/disable external route summarisation specific debugs.
|
|
||||||
|
|
||||||
|
|
||||||
Sample Configuration
|
Sample Configuration
|
||||||
|
@ -54,13 +54,13 @@ unsigned long conf_debug_ospf_nsm = 0;
|
|||||||
unsigned long conf_debug_ospf_lsa = 0;
|
unsigned long conf_debug_ospf_lsa = 0;
|
||||||
unsigned long conf_debug_ospf_zebra = 0;
|
unsigned long conf_debug_ospf_zebra = 0;
|
||||||
unsigned long conf_debug_ospf_nssa = 0;
|
unsigned long conf_debug_ospf_nssa = 0;
|
||||||
unsigned long conf_debug_ospf_te = 0;
|
unsigned long conf_debug_ospf_te;
|
||||||
unsigned long conf_debug_ospf_ext = 0;
|
unsigned long conf_debug_ospf_ext = 0;
|
||||||
unsigned long conf_debug_ospf_sr = 0;
|
unsigned long conf_debug_ospf_sr;
|
||||||
unsigned long conf_debug_ospf_ti_lfa = 0;
|
unsigned long conf_debug_ospf_ti_lfa;
|
||||||
unsigned long conf_debug_ospf_defaultinfo = 0;
|
unsigned long conf_debug_ospf_defaultinfo;
|
||||||
unsigned long conf_debug_ospf_ldp_sync = 0;
|
unsigned long conf_debug_ospf_ldp_sync;
|
||||||
unsigned long conf_debug_ospf_gr = 0;
|
unsigned long conf_debug_ospf_gr;
|
||||||
unsigned long conf_debug_ospf_bfd;
|
unsigned long conf_debug_ospf_bfd;
|
||||||
unsigned long conf_debug_ospf_client_api;
|
unsigned long conf_debug_ospf_client_api;
|
||||||
|
|
||||||
@ -72,13 +72,13 @@ unsigned long term_debug_ospf_nsm = 0;
|
|||||||
unsigned long term_debug_ospf_lsa = 0;
|
unsigned long term_debug_ospf_lsa = 0;
|
||||||
unsigned long term_debug_ospf_zebra = 0;
|
unsigned long term_debug_ospf_zebra = 0;
|
||||||
unsigned long term_debug_ospf_nssa = 0;
|
unsigned long term_debug_ospf_nssa = 0;
|
||||||
unsigned long term_debug_ospf_te = 0;
|
unsigned long term_debug_ospf_te;
|
||||||
unsigned long term_debug_ospf_ext = 0;
|
unsigned long term_debug_ospf_ext = 0;
|
||||||
unsigned long term_debug_ospf_sr = 0;
|
unsigned long term_debug_ospf_sr;
|
||||||
unsigned long term_debug_ospf_ti_lfa = 0;
|
unsigned long term_debug_ospf_ti_lfa;
|
||||||
unsigned long term_debug_ospf_defaultinfo;
|
unsigned long term_debug_ospf_defaultinfo;
|
||||||
unsigned long term_debug_ospf_ldp_sync;
|
unsigned long term_debug_ospf_ldp_sync;
|
||||||
unsigned long term_debug_ospf_gr = 0;
|
unsigned long term_debug_ospf_gr;
|
||||||
unsigned long term_debug_ospf_bfd;
|
unsigned long term_debug_ospf_bfd;
|
||||||
unsigned long term_debug_ospf_client_api;
|
unsigned long term_debug_ospf_client_api;
|
||||||
|
|
||||||
@ -628,84 +628,9 @@ void ospf_packet_dump(struct stream *s)
|
|||||||
stream_set_getp(s, gp);
|
stream_set_getp(s, gp);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN (debug_ospf_packet,
|
DEFPY (debug_ospf_packet,
|
||||||
debug_ospf_packet_cmd,
|
debug_ospf_packet_cmd,
|
||||||
"debug ospf [(1-65535)] packet <hello|dd|ls-request|ls-update|ls-ack|all> [<send [detail]|recv [detail]|detail>]",
|
"[no$no] debug ospf [(1-65535)$inst] packet <hello|dd|ls-request|ls-update|ls-ack|all>$packet [<send$send [detail$detail]|recv$recv [detail$detail]|detail$detail>]",
|
||||||
DEBUG_STR
|
|
||||||
OSPF_STR
|
|
||||||
"Instance ID\n"
|
|
||||||
"OSPF packets\n"
|
|
||||||
"OSPF Hello\n"
|
|
||||||
"OSPF Database Description\n"
|
|
||||||
"OSPF Link State Request\n"
|
|
||||||
"OSPF Link State Update\n"
|
|
||||||
"OSPF Link State Acknowledgment\n"
|
|
||||||
"OSPF all packets\n"
|
|
||||||
"Packet sent\n"
|
|
||||||
"Detail Information\n"
|
|
||||||
"Packet received\n"
|
|
||||||
"Detail Information\n"
|
|
||||||
"Detail Information\n")
|
|
||||||
{
|
|
||||||
int inst = (argv[2]->type == RANGE_TKN) ? 1 : 0;
|
|
||||||
int detail = strmatch(argv[argc - 1]->text, "detail");
|
|
||||||
int send = strmatch(argv[argc - (1 + detail)]->text, "send");
|
|
||||||
int recv = strmatch(argv[argc - (1 + detail)]->text, "recv");
|
|
||||||
char *packet = argv[3 + inst]->text;
|
|
||||||
|
|
||||||
if (inst) // user passed instance ID
|
|
||||||
{
|
|
||||||
if (inst != ospf_instance)
|
|
||||||
return CMD_NOT_MY_INSTANCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int type = 0;
|
|
||||||
int flag = 0;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/* Check packet type. */
|
|
||||||
if (strmatch(packet, "hello"))
|
|
||||||
type = OSPF_DEBUG_HELLO;
|
|
||||||
else if (strmatch(packet, "dd"))
|
|
||||||
type = OSPF_DEBUG_DB_DESC;
|
|
||||||
else if (strmatch(packet, "ls-request"))
|
|
||||||
type = OSPF_DEBUG_LS_REQ;
|
|
||||||
else if (strmatch(packet, "ls-update"))
|
|
||||||
type = OSPF_DEBUG_LS_UPD;
|
|
||||||
else if (strmatch(packet, "ls-ack"))
|
|
||||||
type = OSPF_DEBUG_LS_ACK;
|
|
||||||
else if (strmatch(packet, "all"))
|
|
||||||
type = OSPF_DEBUG_ALL;
|
|
||||||
|
|
||||||
/* Cases:
|
|
||||||
* (none) = send + recv
|
|
||||||
* detail = send + recv + detail
|
|
||||||
* recv = recv
|
|
||||||
* send = send
|
|
||||||
* recv detail = recv + detail
|
|
||||||
* send detail = send + detail
|
|
||||||
*/
|
|
||||||
if (!send && !recv)
|
|
||||||
send = recv = 1;
|
|
||||||
|
|
||||||
flag |= (send) ? OSPF_DEBUG_SEND : 0;
|
|
||||||
flag |= (recv) ? OSPF_DEBUG_RECV : 0;
|
|
||||||
flag |= (detail) ? OSPF_DEBUG_DETAIL : 0;
|
|
||||||
|
|
||||||
for (i = 0; i < 5; i++)
|
|
||||||
if (type & (0x01 << i)) {
|
|
||||||
if (vty->node == CONFIG_NODE)
|
|
||||||
DEBUG_PACKET_ON(i, flag);
|
|
||||||
else
|
|
||||||
TERM_DEBUG_PACKET_ON(i, flag);
|
|
||||||
}
|
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN (no_debug_ospf_packet,
|
|
||||||
no_debug_ospf_packet_cmd,
|
|
||||||
"no debug ospf [(1-65535)] packet <hello|dd|ls-request|ls-update|ls-ack|all> [<send [detail]|recv [detail]|detail>]",
|
|
||||||
NO_STR
|
NO_STR
|
||||||
DEBUG_STR
|
DEBUG_STR
|
||||||
OSPF_STR
|
OSPF_STR
|
||||||
@ -723,22 +648,13 @@ DEFUN (no_debug_ospf_packet,
|
|||||||
"Detail Information\n"
|
"Detail Information\n"
|
||||||
"Detail Information\n")
|
"Detail Information\n")
|
||||||
{
|
{
|
||||||
int inst = (argv[3]->type == RANGE_TKN) ? 1 : 0;
|
|
||||||
int detail = strmatch(argv[argc - 1]->text, "detail");
|
|
||||||
int send = strmatch(argv[argc - (1 + detail)]->text, "send");
|
|
||||||
int recv = strmatch(argv[argc - (1 + detail)]->text, "recv");
|
|
||||||
char *packet = argv[4 + inst]->text;
|
|
||||||
|
|
||||||
if (inst) // user passed instance ID
|
|
||||||
{
|
|
||||||
if (inst != ospf_instance)
|
|
||||||
return CMD_NOT_MY_INSTANCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int type = 0;
|
int type = 0;
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (inst && inst != ospf_instance)
|
||||||
|
return CMD_NOT_MY_INSTANCE;
|
||||||
|
|
||||||
/* Check packet type. */
|
/* Check packet type. */
|
||||||
if (strmatch(packet, "hello"))
|
if (strmatch(packet, "hello"))
|
||||||
type = OSPF_DEBUG_HELLO;
|
type = OSPF_DEBUG_HELLO;
|
||||||
@ -761,8 +677,10 @@ DEFUN (no_debug_ospf_packet,
|
|||||||
* recv detail = recv + detail
|
* recv detail = recv + detail
|
||||||
* send detail = send + detail
|
* send detail = send + detail
|
||||||
*/
|
*/
|
||||||
if (!send && !recv)
|
if (!send && !recv) {
|
||||||
send = recv = 1;
|
flag |= OSPF_DEBUG_SEND;
|
||||||
|
flag |= OSPF_DEBUG_RECV;
|
||||||
|
}
|
||||||
|
|
||||||
flag |= (send) ? OSPF_DEBUG_SEND : 0;
|
flag |= (send) ? OSPF_DEBUG_SEND : 0;
|
||||||
flag |= (recv) ? OSPF_DEBUG_RECV : 0;
|
flag |= (recv) ? OSPF_DEBUG_RECV : 0;
|
||||||
@ -770,10 +688,17 @@ DEFUN (no_debug_ospf_packet,
|
|||||||
|
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < 5; i++)
|
||||||
if (type & (0x01 << i)) {
|
if (type & (0x01 << i)) {
|
||||||
if (vty->node == CONFIG_NODE)
|
if (vty->node == CONFIG_NODE) {
|
||||||
DEBUG_PACKET_OFF(i, flag);
|
if (no)
|
||||||
else
|
DEBUG_PACKET_OFF(i, flag);
|
||||||
TERM_DEBUG_PACKET_OFF(i, flag);
|
else
|
||||||
|
DEBUG_PACKET_ON(i, flag);
|
||||||
|
} else {
|
||||||
|
if (no)
|
||||||
|
TERM_DEBUG_PACKET_OFF(i, flag);
|
||||||
|
else
|
||||||
|
TERM_DEBUG_PACKET_ON(i, flag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -1457,194 +1382,221 @@ DEFUN (no_debug_ospf_instance_nssa,
|
|||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN (debug_ospf_te,
|
DEFPY (debug_ospf_te,
|
||||||
debug_ospf_te_cmd,
|
debug_ospf_te_cmd,
|
||||||
"debug ospf te",
|
"[no$no] debug ospf [(1-65535)$instance] te",
|
||||||
|
NO_STR
|
||||||
DEBUG_STR
|
DEBUG_STR
|
||||||
OSPF_STR
|
OSPF_STR
|
||||||
|
"Instance ID\n"
|
||||||
"OSPF-TE information\n")
|
"OSPF-TE information\n")
|
||||||
{
|
{
|
||||||
if (vty->node == CONFIG_NODE)
|
if (instance && instance != ospf_instance)
|
||||||
CONF_DEBUG_ON(te, TE);
|
return CMD_NOT_MY_INSTANCE;
|
||||||
TERM_DEBUG_ON(te, TE);
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN (no_debug_ospf_te,
|
|
||||||
no_debug_ospf_te_cmd,
|
|
||||||
"no debug ospf te",
|
|
||||||
NO_STR
|
|
||||||
DEBUG_STR
|
|
||||||
OSPF_STR
|
|
||||||
"OSPF-TE information\n")
|
|
||||||
{
|
|
||||||
if (vty->node == CONFIG_NODE)
|
|
||||||
CONF_DEBUG_OFF(te, TE);
|
|
||||||
TERM_DEBUG_OFF(te, TE);
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN (debug_ospf_sr,
|
|
||||||
debug_ospf_sr_cmd,
|
|
||||||
"debug ospf sr",
|
|
||||||
DEBUG_STR
|
|
||||||
OSPF_STR
|
|
||||||
"OSPF-SR information\n")
|
|
||||||
{
|
|
||||||
if (vty->node == CONFIG_NODE)
|
|
||||||
CONF_DEBUG_ON(sr, SR);
|
|
||||||
TERM_DEBUG_ON(sr, SR);
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN (no_debug_ospf_sr,
|
|
||||||
no_debug_ospf_sr_cmd,
|
|
||||||
"no debug ospf sr",
|
|
||||||
NO_STR
|
|
||||||
DEBUG_STR
|
|
||||||
OSPF_STR
|
|
||||||
"OSPF-SR information\n")
|
|
||||||
{
|
|
||||||
if (vty->node == CONFIG_NODE)
|
|
||||||
CONF_DEBUG_OFF(sr, SR);
|
|
||||||
TERM_DEBUG_OFF(sr, SR);
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN(debug_ospf_ti_lfa, debug_ospf_ti_lfa_cmd, "debug ospf ti-lfa",
|
|
||||||
DEBUG_STR OSPF_STR "OSPF-SR TI-LFA information\n")
|
|
||||||
{
|
|
||||||
if (vty->node == CONFIG_NODE)
|
|
||||||
CONF_DEBUG_ON(ti_lfa, TI_LFA);
|
|
||||||
TERM_DEBUG_ON(ti_lfa, TI_LFA);
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN(no_debug_ospf_ti_lfa, no_debug_ospf_ti_lfa_cmd, "no debug ospf ti-lfa",
|
|
||||||
NO_STR DEBUG_STR OSPF_STR "OSPF-SR TI-LFA information\n")
|
|
||||||
{
|
|
||||||
if (vty->node == CONFIG_NODE)
|
|
||||||
CONF_DEBUG_OFF(ti_lfa, TI_LFA);
|
|
||||||
TERM_DEBUG_OFF(ti_lfa, TI_LFA);
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN (debug_ospf_default_info,
|
|
||||||
debug_ospf_default_info_cmd,
|
|
||||||
"debug ospf default-information",
|
|
||||||
DEBUG_STR
|
|
||||||
OSPF_STR
|
|
||||||
"OSPF default information\n")
|
|
||||||
{
|
|
||||||
if (vty->node == CONFIG_NODE)
|
|
||||||
CONF_DEBUG_ON(defaultinfo, DEFAULTINFO);
|
|
||||||
TERM_DEBUG_ON(defaultinfo, DEFAULTINFO);
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN (no_debug_ospf_default_info,
|
|
||||||
no_debug_ospf_default_info_cmd,
|
|
||||||
"no debug ospf default-information",
|
|
||||||
NO_STR
|
|
||||||
DEBUG_STR
|
|
||||||
OSPF_STR
|
|
||||||
"OSPF default information\n")
|
|
||||||
{
|
|
||||||
if (vty->node == CONFIG_NODE)
|
|
||||||
CONF_DEBUG_OFF(defaultinfo, DEFAULTINFO);
|
|
||||||
TERM_DEBUG_OFF(defaultinfo, DEFAULTINFO);
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN(debug_ospf_ldp_sync,
|
|
||||||
debug_ospf_ldp_sync_cmd,
|
|
||||||
"debug ospf ldp-sync",
|
|
||||||
DEBUG_STR OSPF_STR
|
|
||||||
"OSPF LDP-Sync information\n")
|
|
||||||
{
|
|
||||||
if (vty->node == CONFIG_NODE)
|
|
||||||
CONF_DEBUG_ON(ldp_sync, LDP_SYNC);
|
|
||||||
TERM_DEBUG_ON(ldp_sync, LDP_SYNC);
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN(no_debug_ospf_ldp_sync,
|
|
||||||
no_debug_ospf_ldp_sync_cmd,
|
|
||||||
"no debug ospf ldp-sync",
|
|
||||||
NO_STR
|
|
||||||
DEBUG_STR
|
|
||||||
OSPF_STR
|
|
||||||
"OSPF LDP-Sync information\n")
|
|
||||||
{
|
|
||||||
if (vty->node == CONFIG_NODE)
|
|
||||||
CONF_DEBUG_OFF(ldp_sync, LDP_SYNC);
|
|
||||||
TERM_DEBUG_OFF(ldp_sync, LDP_SYNC);
|
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFPY(debug_ospf_gr, debug_ospf_gr_cmd, "[no$no] debug ospf graceful-restart",
|
|
||||||
NO_STR DEBUG_STR OSPF_STR "OSPF Graceful Restart\n")
|
|
||||||
{
|
|
||||||
if (vty->node == CONFIG_NODE)
|
|
||||||
CONF_DEBUG_ON(gr, GR);
|
|
||||||
|
|
||||||
if (!no)
|
|
||||||
TERM_DEBUG_ON(gr, GR);
|
|
||||||
else
|
|
||||||
TERM_DEBUG_OFF(gr, GR);
|
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFPY(debug_ospf_bfd, debug_ospf_bfd_cmd,
|
|
||||||
"[no] debug ospf bfd",
|
|
||||||
NO_STR
|
|
||||||
DEBUG_STR
|
|
||||||
OSPF_STR
|
|
||||||
"Bidirection Forwarding Detection\n")
|
|
||||||
{
|
|
||||||
if (vty->node == CONFIG_NODE) {
|
if (vty->node == CONFIG_NODE) {
|
||||||
if (no) {
|
if (no)
|
||||||
bfd_protocol_integration_set_debug(false);
|
DEBUG_OFF(te, TE);
|
||||||
CONF_DEBUG_OFF(bfd, BFD_LIB);
|
else
|
||||||
} else {
|
DEBUG_ON(te, TE);
|
||||||
bfd_protocol_integration_set_debug(true);
|
} else {
|
||||||
CONF_DEBUG_ON(bfd, BFD_LIB);
|
if (no)
|
||||||
}
|
TERM_DEBUG_OFF(te, TE);
|
||||||
|
else
|
||||||
|
TERM_DEBUG_ON(te, TE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFPY (debug_ospf_sr,
|
||||||
|
debug_ospf_sr_cmd,
|
||||||
|
"[no$no] debug ospf [(1-65535)$instance] sr",
|
||||||
|
NO_STR
|
||||||
|
DEBUG_STR
|
||||||
|
OSPF_STR
|
||||||
|
"Instance ID\n"
|
||||||
|
"OSPF-SR information\n")
|
||||||
|
{
|
||||||
|
if (instance && instance != ospf_instance)
|
||||||
|
return CMD_NOT_MY_INSTANCE;
|
||||||
|
|
||||||
|
if (vty->node == CONFIG_NODE) {
|
||||||
|
if (no)
|
||||||
|
DEBUG_OFF(sr, SR);
|
||||||
|
else
|
||||||
|
DEBUG_ON(sr, SR);
|
||||||
|
} else {
|
||||||
|
if (no)
|
||||||
|
TERM_DEBUG_OFF(sr, SR);
|
||||||
|
else
|
||||||
|
TERM_DEBUG_ON(sr, SR);
|
||||||
|
}
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFPY (debug_ospf_ti_lfa,
|
||||||
|
debug_ospf_ti_lfa_cmd,
|
||||||
|
"[no$no] debug ospf [(1-65535)$instance] ti-lfa",
|
||||||
|
NO_STR
|
||||||
|
DEBUG_STR
|
||||||
|
OSPF_STR
|
||||||
|
"Instance ID\n"
|
||||||
|
"OSPF-SR TI-LFA information\n")
|
||||||
|
{
|
||||||
|
if (instance && instance != ospf_instance)
|
||||||
|
return CMD_NOT_MY_INSTANCE;
|
||||||
|
|
||||||
|
if (vty->node == CONFIG_NODE) {
|
||||||
|
if (no)
|
||||||
|
DEBUG_OFF(ti_lfa, TI_LFA);
|
||||||
|
else
|
||||||
|
DEBUG_ON(ti_lfa, TI_LFA);
|
||||||
|
} else {
|
||||||
|
if (no)
|
||||||
|
TERM_DEBUG_OFF(ti_lfa, TI_LFA);
|
||||||
|
else
|
||||||
|
TERM_DEBUG_ON(ti_lfa, TI_LFA);
|
||||||
|
}
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFPY (debug_ospf_default_info,
|
||||||
|
debug_ospf_default_info_cmd,
|
||||||
|
"[no$no] debug ospf [(1-65535)$instance] default-information",
|
||||||
|
NO_STR
|
||||||
|
DEBUG_STR
|
||||||
|
OSPF_STR
|
||||||
|
"Instance ID\n"
|
||||||
|
"OSPF default information\n")
|
||||||
|
{
|
||||||
|
if (instance && instance != ospf_instance)
|
||||||
|
return CMD_NOT_MY_INSTANCE;
|
||||||
|
|
||||||
|
if (vty->node == CONFIG_NODE) {
|
||||||
|
if (no)
|
||||||
|
DEBUG_OFF(defaultinfo, DEFAULTINFO);
|
||||||
|
else
|
||||||
|
DEBUG_ON(defaultinfo, DEFAULTINFO);
|
||||||
|
} else {
|
||||||
|
if (no)
|
||||||
|
TERM_DEBUG_OFF(defaultinfo, DEFAULTINFO);
|
||||||
|
else
|
||||||
|
TERM_DEBUG_ON(defaultinfo, DEFAULTINFO);
|
||||||
|
}
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFPY (debug_ospf_ldp_sync,
|
||||||
|
debug_ospf_ldp_sync_cmd,
|
||||||
|
"[no$no] debug ospf [(1-65535)$instance] ldp-sync",
|
||||||
|
NO_STR
|
||||||
|
DEBUG_STR
|
||||||
|
OSPF_STR
|
||||||
|
"Instance ID\n"
|
||||||
|
"OSPF LDP-Sync information\n")
|
||||||
|
{
|
||||||
|
if (instance && instance != ospf_instance)
|
||||||
|
return CMD_NOT_MY_INSTANCE;
|
||||||
|
|
||||||
|
if (vty->node == CONFIG_NODE) {
|
||||||
|
if (no)
|
||||||
|
DEBUG_OFF(ldp_sync, LDP_SYNC);
|
||||||
|
else
|
||||||
|
DEBUG_ON(ldp_sync, LDP_SYNC);
|
||||||
|
} else {
|
||||||
|
if (no)
|
||||||
|
TERM_DEBUG_OFF(ldp_sync, LDP_SYNC);
|
||||||
|
else
|
||||||
|
TERM_DEBUG_ON(ldp_sync, LDP_SYNC);
|
||||||
|
}
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFPY (debug_ospf_gr,
|
||||||
|
debug_ospf_gr_cmd,
|
||||||
|
"[no$no] debug ospf [(1-65535)$instance] graceful-restart",
|
||||||
|
NO_STR
|
||||||
|
DEBUG_STR
|
||||||
|
OSPF_STR
|
||||||
|
"Instance ID\n"
|
||||||
|
"OSPF Graceful Restart\n")
|
||||||
|
{
|
||||||
|
if (instance && instance != ospf_instance)
|
||||||
|
return CMD_NOT_MY_INSTANCE;
|
||||||
|
|
||||||
|
if (vty->node == CONFIG_NODE) {
|
||||||
|
if (no)
|
||||||
|
CONF_DEBUG_OFF(gr, GR);
|
||||||
|
else
|
||||||
|
CONF_DEBUG_ON(gr, GR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (no)
|
if (no)
|
||||||
TERM_DEBUG_OFF(bfd, BFD_LIB);
|
TERM_DEBUG_OFF(gr, GR);
|
||||||
else
|
else
|
||||||
TERM_DEBUG_ON(bfd, BFD_LIB);
|
TERM_DEBUG_ON(gr, GR);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN(debug_ospf_client_api,
|
DEFPY (debug_ospf_bfd,
|
||||||
debug_ospf_client_api_cmd,
|
debug_ospf_bfd_cmd,
|
||||||
"debug ospf client-api",
|
"[no] debug ospf [(1-65535)$instance] bfd",
|
||||||
DEBUG_STR OSPF_STR
|
NO_STR
|
||||||
"OSPF client API information\n")
|
DEBUG_STR
|
||||||
|
OSPF_STR
|
||||||
|
"Instance ID\n"
|
||||||
|
"Bidirection Forwarding Detection\n")
|
||||||
{
|
{
|
||||||
if (vty->node == CONFIG_NODE)
|
if (instance && instance != ospf_instance)
|
||||||
CONF_DEBUG_ON(client_api, CLIENT_API);
|
return CMD_NOT_MY_INSTANCE;
|
||||||
TERM_DEBUG_ON(client_api, CLIENT_API);
|
|
||||||
|
if (vty->node == CONFIG_NODE) {
|
||||||
|
if (no) {
|
||||||
|
bfd_protocol_integration_set_debug(false);
|
||||||
|
DEBUG_OFF(bfd, BFD_LIB);
|
||||||
|
} else {
|
||||||
|
bfd_protocol_integration_set_debug(true);
|
||||||
|
DEBUG_ON(bfd, BFD_LIB);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (no)
|
||||||
|
TERM_DEBUG_OFF(bfd, BFD_LIB);
|
||||||
|
else
|
||||||
|
TERM_DEBUG_ON(bfd, BFD_LIB);
|
||||||
|
}
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN(no_debug_ospf_client_api,
|
DEFPY (debug_ospf_client_api,
|
||||||
no_debug_ospf_client_api_cmd,
|
debug_ospf_client_api_cmd,
|
||||||
"no debug ospf client-api",
|
"[no$no] debug ospf [(1-65535)$instance] client-api",
|
||||||
NO_STR
|
NO_STR
|
||||||
DEBUG_STR
|
DEBUG_STR
|
||||||
OSPF_STR
|
OSPF_STR
|
||||||
"OSPF client API information\n")
|
"Instance ID\n"
|
||||||
|
"OSPF client API information\n")
|
||||||
{
|
{
|
||||||
if (vty->node == CONFIG_NODE)
|
if (instance && instance != ospf_instance)
|
||||||
CONF_DEBUG_OFF(client_api, CLIENT_API);
|
return CMD_NOT_MY_INSTANCE;
|
||||||
TERM_DEBUG_OFF(client_api, CLIENT_API);
|
|
||||||
|
if (vty->node == CONFIG_NODE) {
|
||||||
|
if (no)
|
||||||
|
DEBUG_OFF(client_api, CLIENT_API);
|
||||||
|
else
|
||||||
|
DEBUG_ON(client_api, CLIENT_API);
|
||||||
|
} else {
|
||||||
|
if (no)
|
||||||
|
TERM_DEBUG_OFF(client_api, CLIENT_API);
|
||||||
|
else
|
||||||
|
TERM_DEBUG_ON(client_api, CLIENT_API);
|
||||||
|
}
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -1816,7 +1768,7 @@ static int show_debugging_ospf_common(struct vty *vty)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IS_DEBUG_OSPF(defaultinfo, DEFAULTINFO) == OSPF_DEBUG_DEFAULTINFO)
|
if (IS_DEBUG_OSPF(defaultinfo, DEFAULTINFO) == OSPF_DEBUG_DEFAULTINFO)
|
||||||
vty_out(vty, "OSPF default information is on\n");
|
vty_out(vty, " OSPF default information is on\n");
|
||||||
|
|
||||||
/* Show debug status for NSSA. */
|
/* Show debug status for NSSA. */
|
||||||
if (IS_DEBUG_OSPF(nssa, NSSA) == OSPF_DEBUG_NSSA)
|
if (IS_DEBUG_OSPF(nssa, NSSA) == OSPF_DEBUG_NSSA)
|
||||||
@ -1978,7 +1930,7 @@ static int config_write_debug(struct vty *vty)
|
|||||||
& (OSPF_DEBUG_SEND_RECV | OSPF_DEBUG_DETAIL);
|
& (OSPF_DEBUG_SEND_RECV | OSPF_DEBUG_DETAIL);
|
||||||
if (r == (OSPF_DEBUG_SEND_RECV | OSPF_DEBUG_DETAIL)) {
|
if (r == (OSPF_DEBUG_SEND_RECV | OSPF_DEBUG_DETAIL)) {
|
||||||
vty_out(vty, "debug ospf%s packet all detail\n", str);
|
vty_out(vty, "debug ospf%s packet all detail\n", str);
|
||||||
return 1;
|
write = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* debug ospf packet all. */
|
/* debug ospf packet all. */
|
||||||
@ -1991,7 +1943,7 @@ static int config_write_debug(struct vty *vty)
|
|||||||
if (conf_debug_ospf_packet[i] & OSPF_DEBUG_DETAIL)
|
if (conf_debug_ospf_packet[i] & OSPF_DEBUG_DETAIL)
|
||||||
vty_out(vty, "debug ospf%s packet %s detail\n",
|
vty_out(vty, "debug ospf%s packet %s detail\n",
|
||||||
str, type_str[i]);
|
str, type_str[i]);
|
||||||
return 1;
|
write = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* debug ospf packet (hello|dd|ls-request|ls-update|ls-ack)
|
/* debug ospf packet (hello|dd|ls-request|ls-update|ls-ack)
|
||||||
@ -2047,6 +1999,13 @@ static int config_write_debug(struct vty *vty)
|
|||||||
write = 1;
|
write = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* debug ospf default-information */
|
||||||
|
if (IS_CONF_DEBUG_OSPF(defaultinfo, DEFAULTINFO) ==
|
||||||
|
OSPF_DEBUG_DEFAULTINFO) {
|
||||||
|
vty_out(vty, "debug ospf%s default-information\n", str);
|
||||||
|
write = 1;
|
||||||
|
}
|
||||||
|
|
||||||
return write;
|
return write;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2074,18 +2033,11 @@ void ospf_debug_init(void)
|
|||||||
install_element(ENABLE_NODE, &no_debug_ospf_zebra_cmd);
|
install_element(ENABLE_NODE, &no_debug_ospf_zebra_cmd);
|
||||||
install_element(ENABLE_NODE, &no_debug_ospf_event_cmd);
|
install_element(ENABLE_NODE, &no_debug_ospf_event_cmd);
|
||||||
install_element(ENABLE_NODE, &no_debug_ospf_nssa_cmd);
|
install_element(ENABLE_NODE, &no_debug_ospf_nssa_cmd);
|
||||||
install_element(ENABLE_NODE, &no_debug_ospf_te_cmd);
|
|
||||||
install_element(ENABLE_NODE, &no_debug_ospf_sr_cmd);
|
|
||||||
install_element(ENABLE_NODE, &no_debug_ospf_ti_lfa_cmd);
|
|
||||||
install_element(ENABLE_NODE, &no_debug_ospf_default_info_cmd);
|
|
||||||
install_element(ENABLE_NODE, &no_debug_ospf_ldp_sync_cmd);
|
|
||||||
install_element(ENABLE_NODE, &no_debug_ospf_client_api_cmd);
|
|
||||||
install_element(ENABLE_NODE, &debug_ospf_gr_cmd);
|
install_element(ENABLE_NODE, &debug_ospf_gr_cmd);
|
||||||
install_element(ENABLE_NODE, &debug_ospf_bfd_cmd);
|
install_element(ENABLE_NODE, &debug_ospf_bfd_cmd);
|
||||||
|
|
||||||
install_element(ENABLE_NODE, &show_debugging_ospf_instance_cmd);
|
install_element(ENABLE_NODE, &show_debugging_ospf_instance_cmd);
|
||||||
install_element(ENABLE_NODE, &debug_ospf_packet_cmd);
|
install_element(ENABLE_NODE, &debug_ospf_packet_cmd);
|
||||||
install_element(ENABLE_NODE, &no_debug_ospf_packet_cmd);
|
|
||||||
|
|
||||||
install_element(ENABLE_NODE, &debug_ospf_instance_nsm_cmd);
|
install_element(ENABLE_NODE, &debug_ospf_instance_nsm_cmd);
|
||||||
install_element(ENABLE_NODE, &debug_ospf_instance_lsa_cmd);
|
install_element(ENABLE_NODE, &debug_ospf_instance_lsa_cmd);
|
||||||
@ -2100,7 +2052,6 @@ void ospf_debug_init(void)
|
|||||||
install_element(ENABLE_NODE, &no_debug_ospf_cmd);
|
install_element(ENABLE_NODE, &no_debug_ospf_cmd);
|
||||||
|
|
||||||
install_element(CONFIG_NODE, &debug_ospf_packet_cmd);
|
install_element(CONFIG_NODE, &debug_ospf_packet_cmd);
|
||||||
install_element(CONFIG_NODE, &no_debug_ospf_packet_cmd);
|
|
||||||
install_element(CONFIG_NODE, &debug_ospf_ism_cmd);
|
install_element(CONFIG_NODE, &debug_ospf_ism_cmd);
|
||||||
install_element(CONFIG_NODE, &no_debug_ospf_ism_cmd);
|
install_element(CONFIG_NODE, &no_debug_ospf_ism_cmd);
|
||||||
|
|
||||||
@ -2120,12 +2071,6 @@ void ospf_debug_init(void)
|
|||||||
install_element(CONFIG_NODE, &no_debug_ospf_zebra_cmd);
|
install_element(CONFIG_NODE, &no_debug_ospf_zebra_cmd);
|
||||||
install_element(CONFIG_NODE, &no_debug_ospf_event_cmd);
|
install_element(CONFIG_NODE, &no_debug_ospf_event_cmd);
|
||||||
install_element(CONFIG_NODE, &no_debug_ospf_nssa_cmd);
|
install_element(CONFIG_NODE, &no_debug_ospf_nssa_cmd);
|
||||||
install_element(CONFIG_NODE, &no_debug_ospf_te_cmd);
|
|
||||||
install_element(CONFIG_NODE, &no_debug_ospf_sr_cmd);
|
|
||||||
install_element(CONFIG_NODE, &no_debug_ospf_ti_lfa_cmd);
|
|
||||||
install_element(CONFIG_NODE, &no_debug_ospf_default_info_cmd);
|
|
||||||
install_element(CONFIG_NODE, &no_debug_ospf_ldp_sync_cmd);
|
|
||||||
install_element(CONFIG_NODE, &no_debug_ospf_client_api_cmd);
|
|
||||||
install_element(CONFIG_NODE, &debug_ospf_gr_cmd);
|
install_element(CONFIG_NODE, &debug_ospf_gr_cmd);
|
||||||
install_element(CONFIG_NODE, &debug_ospf_bfd_cmd);
|
install_element(CONFIG_NODE, &debug_ospf_bfd_cmd);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user