mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 05:27:16 +02:00
lib: common debug config output
Implement common code for debug config output and remove daemon-specific code that is duplicated everywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
5dac696154
commit
82e52e0f21
|
@ -84,14 +84,12 @@ enum node_type {
|
|||
CONFIG_NODE, /* Config node. Default mode of config file. */
|
||||
PREFIX_NODE, /* ip prefix-list node. */
|
||||
PREFIX_IPV6_NODE, /* ipv6 prefix-list node. */
|
||||
LIB_DEBUG_NODE, /* frrlib debug node. */
|
||||
DEBUG_NODE, /* Debug node. */
|
||||
VRF_DEBUG_NODE, /* Vrf Debug node. */
|
||||
NORTHBOUND_DEBUG_NODE, /* Northbound Debug node. */
|
||||
DEBUG_VNC_NODE, /* Debug VNC node. */
|
||||
RMAP_DEBUG_NODE, /* Route-map debug node */
|
||||
RESOLVER_DEBUG_NODE, /* Resolver debug node */
|
||||
MGMT_BE_DEBUG_NODE, /* mgmtd backend-client debug node */
|
||||
MGMT_FE_DEBUG_NODE, /* mgmtd frontend-client debug node */
|
||||
AAA_NODE, /* AAA node. */
|
||||
EXTLOG_NODE, /* RFC5424 & co. extended syslog */
|
||||
KEYCHAIN_NODE, /* Key-chain node. */
|
||||
|
|
21
lib/debug.c
21
lib/debug.c
|
@ -38,6 +38,25 @@ DEFUN_NOSH (debug_all,
|
|||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static int config_write_debug(struct vty *vty)
|
||||
{
|
||||
struct debug *debug;
|
||||
|
||||
frr_each (debug_list, &debug_head, debug) {
|
||||
if (DEBUG_MODE_CHECK(debug, DEBUG_MODE_CONF))
|
||||
vty_out(vty, "%s\n", debug->conf);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct cmd_node debug_node = {
|
||||
.name = "debug",
|
||||
.node = LIB_DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_debug,
|
||||
};
|
||||
|
||||
void debug_install(struct debug *debug)
|
||||
{
|
||||
debug_list_add_tail(&debug_head, debug);
|
||||
|
@ -47,6 +66,8 @@ void debug_init(void)
|
|||
{
|
||||
debug_list_init(&debug_head);
|
||||
|
||||
install_node(&debug_node);
|
||||
|
||||
install_element(ENABLE_NODE, &debug_all_cmd);
|
||||
install_element(CONFIG_NODE, &debug_all_cmd);
|
||||
}
|
||||
|
|
|
@ -64,11 +64,15 @@ PREDECL_LIST(debug_list);
|
|||
* manipulate the flags field in a multithreaded environment results in
|
||||
* undefined behavior.
|
||||
*
|
||||
* conf
|
||||
* The configuration string that will be written to the config file.
|
||||
*
|
||||
* desc
|
||||
* Human-readable description of this debugging record.
|
||||
*/
|
||||
struct debug {
|
||||
atomic_uint_fast32_t flags;
|
||||
const char *conf;
|
||||
const char *desc;
|
||||
|
||||
struct debug_list_item item;
|
||||
|
|
|
@ -116,6 +116,7 @@ struct mgmt_be_client {
|
|||
frr_each_safe (mgmt_be_txns, &(client_ctx)->txn_head, (txn))
|
||||
|
||||
struct debug mgmt_dbg_be_client = {
|
||||
.conf = "debug mgmt client backend",
|
||||
.desc = "Management backend client operations"
|
||||
};
|
||||
|
||||
|
@ -1258,27 +1259,12 @@ DEFPY(debug_mgmt_client_be, debug_mgmt_client_be_cmd,
|
|||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static int mgmt_debug_be_client_config_write(struct vty *vty)
|
||||
{
|
||||
if (DEBUG_MODE_CHECK(&mgmt_dbg_be_client, DEBUG_MODE_CONF))
|
||||
vty_out(vty, "debug mgmt client backend\n");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void mgmt_debug_be_client_show_debug(struct vty *vty)
|
||||
{
|
||||
if (debug_check_be_client())
|
||||
vty_out(vty, "debug mgmt client backend\n");
|
||||
}
|
||||
|
||||
static struct cmd_node mgmt_dbg_node = {
|
||||
.name = "debug mgmt client backend",
|
||||
.node = MGMT_BE_DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = mgmt_debug_be_client_config_write,
|
||||
};
|
||||
|
||||
struct mgmt_be_client *mgmt_be_client_create(const char *client_name,
|
||||
struct mgmt_be_client_cbs *cbs,
|
||||
uintptr_t user_data,
|
||||
|
@ -1326,7 +1312,6 @@ void mgmt_be_client_lib_vty_init(void)
|
|||
{
|
||||
debug_install(&mgmt_dbg_be_client);
|
||||
|
||||
install_node(&mgmt_dbg_node);
|
||||
install_element(ENABLE_NODE, &debug_mgmt_client_be_cmd);
|
||||
install_element(CONFIG_NODE, &debug_mgmt_client_be_cmd);
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ struct mgmt_fe_client {
|
|||
frr_each_safe (mgmt_sessions, &(client)->sessions, (session))
|
||||
|
||||
struct debug mgmt_dbg_fe_client = {
|
||||
.conf = "debug mgmt client frontend",
|
||||
.desc = "Management frontend client operations"
|
||||
};
|
||||
|
||||
|
@ -805,27 +806,12 @@ DEFPY(debug_mgmt_client_fe, debug_mgmt_client_fe_cmd,
|
|||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static int mgmt_debug_fe_client_config_write(struct vty *vty)
|
||||
{
|
||||
if (DEBUG_MODE_CHECK(&mgmt_dbg_fe_client, DEBUG_MODE_CONF))
|
||||
vty_out(vty, "debug mgmt client frontend\n");
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
void mgmt_debug_fe_client_show_debug(struct vty *vty)
|
||||
{
|
||||
if (debug_check_fe_client())
|
||||
vty_out(vty, "debug mgmt client frontend\n");
|
||||
}
|
||||
|
||||
static struct cmd_node mgmt_dbg_node = {
|
||||
.name = "debug mgmt client frontend",
|
||||
.node = MGMT_FE_DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = mgmt_debug_fe_client_config_write,
|
||||
};
|
||||
|
||||
/*
|
||||
* Initialize library and try connecting with MGMTD.
|
||||
*/
|
||||
|
@ -868,7 +854,6 @@ void mgmt_fe_client_lib_vty_init(void)
|
|||
{
|
||||
debug_install(&mgmt_dbg_fe_client);
|
||||
|
||||
install_node(&mgmt_dbg_node);
|
||||
install_element(ENABLE_NODE, &debug_mgmt_client_fe_cmd);
|
||||
install_element(CONFIG_NODE, &debug_mgmt_client_fe_cmd);
|
||||
}
|
||||
|
|
|
@ -799,7 +799,6 @@ DECLARE_HOOK(nb_notification_send, (const char *xpath, struct list *arguments),
|
|||
(xpath, arguments));
|
||||
DECLARE_HOOK(nb_notification_tree_send,
|
||||
(const char *xpath, const struct lyd_node *tree), (xpath, tree));
|
||||
DECLARE_HOOK(nb_client_debug_config_write, (struct vty *vty), (vty));
|
||||
|
||||
/* Northbound debugging records */
|
||||
extern struct debug nb_dbg_cbs_config;
|
||||
|
|
|
@ -22,13 +22,19 @@
|
|||
#include "northbound_db.h"
|
||||
#include "lib/northbound_cli_clippy.c"
|
||||
|
||||
struct debug nb_dbg_cbs_config = {0, "Northbound callbacks: configuration"};
|
||||
struct debug nb_dbg_cbs_state = {0, "Northbound callbacks: state"};
|
||||
struct debug nb_dbg_cbs_rpc = {0, "Northbound callbacks: RPCs"};
|
||||
struct debug nb_dbg_cbs_notify = {0, "Northbound callbacks: notifications"};
|
||||
struct debug nb_dbg_notif = {0, "Northbound notifications"};
|
||||
struct debug nb_dbg_events = {0, "Northbound events"};
|
||||
struct debug nb_dbg_libyang = {0, "libyang debugging"};
|
||||
struct debug nb_dbg_cbs_config = { 0, "debug northbound callbacks configuration",
|
||||
"Northbound callbacks: configuration" };
|
||||
struct debug nb_dbg_cbs_state = { 0, "debug northbound callbacks state",
|
||||
"Northbound callbacks: state" };
|
||||
struct debug nb_dbg_cbs_rpc = { 0, "debug northbound callbacks rpc",
|
||||
"Northbound callbacks: RPCs" };
|
||||
struct debug nb_dbg_cbs_notify = { 0, "debug northbound callbacks notify",
|
||||
"Northbound callbacks: notifications" };
|
||||
struct debug nb_dbg_notif = { 0, "debug northbound notifications",
|
||||
"Northbound notifications" };
|
||||
struct debug nb_dbg_events = { 0, "debug northbound events",
|
||||
"Northbound events" };
|
||||
struct debug nb_dbg_libyang = { 0, "debug northbound libyang", "libyang" };
|
||||
|
||||
struct nb_config *vty_shared_candidate_config;
|
||||
static struct event_loop *master;
|
||||
|
@ -1842,22 +1848,6 @@ DEFPY (rollback_config,
|
|||
}
|
||||
|
||||
/* Debug CLI commands. */
|
||||
static struct debug *nb_debugs[] = {
|
||||
&nb_dbg_cbs_config, &nb_dbg_cbs_state, &nb_dbg_cbs_rpc,
|
||||
&nb_dbg_cbs_notify, &nb_dbg_notif, &nb_dbg_events,
|
||||
&nb_dbg_libyang,
|
||||
};
|
||||
|
||||
static const char *const nb_debugs_conflines[] = {
|
||||
"debug northbound callbacks configuration",
|
||||
"debug northbound callbacks state",
|
||||
"debug northbound callbacks rpc",
|
||||
"debug northbound callbacks notify",
|
||||
"debug northbound notifications",
|
||||
"debug northbound events",
|
||||
"debug northbound libyang",
|
||||
};
|
||||
|
||||
DEFPY (debug_nb,
|
||||
debug_nb_cmd,
|
||||
"[no] debug northbound\
|
||||
|
@ -1910,26 +1900,6 @@ DEFPY (debug_nb,
|
|||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
DEFINE_HOOK(nb_client_debug_config_write, (struct vty *vty), (vty));
|
||||
|
||||
static int nb_debug_config_write(struct vty *vty)
|
||||
{
|
||||
for (unsigned int i = 0; i < array_size(nb_debugs); i++)
|
||||
if (DEBUG_MODE_CHECK(nb_debugs[i], DEBUG_MODE_CONF))
|
||||
vty_out(vty, "%s\n", nb_debugs_conflines[i]);
|
||||
|
||||
hook_call(nb_client_debug_config_write, vty);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static struct cmd_node nb_debug_node = {
|
||||
.name = "northbound debug",
|
||||
.node = NORTHBOUND_DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = nb_debug_config_write,
|
||||
};
|
||||
|
||||
void nb_cli_install_default(int node)
|
||||
{
|
||||
_install_element(node, &show_config_candidate_section_cmd);
|
||||
|
@ -1998,7 +1968,6 @@ void nb_cli_init(struct event_loop *tm)
|
|||
debug_install(&nb_dbg_events);
|
||||
debug_install(&nb_dbg_libyang);
|
||||
|
||||
install_node(&nb_debug_node);
|
||||
install_element(ENABLE_NODE, &debug_nb_cmd);
|
||||
install_element(CONFIG_NODE, &debug_nb_cmd);
|
||||
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
#include <sysrepo/values.h>
|
||||
#include <sysrepo/xpath.h>
|
||||
|
||||
static struct debug nb_dbg_client_sysrepo = {0, "Northbound client: Sysrepo"};
|
||||
static struct debug nb_dbg_client_sysrepo = { 0,
|
||||
"debug northbound client sysrepo",
|
||||
"Northbound client: Sysrepo" };
|
||||
|
||||
static struct event_loop *master;
|
||||
static sr_session_ctx_t *session;
|
||||
|
@ -553,18 +555,8 @@ DEFUN (debug_nb_sr,
|
|||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static int frr_sr_debug_config_write(struct vty *vty)
|
||||
{
|
||||
if (DEBUG_MODE_CHECK(&nb_dbg_client_sysrepo, DEBUG_MODE_CONF))
|
||||
vty_out(vty, "debug northbound client sysrepo\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void frr_sr_cli_init(void)
|
||||
{
|
||||
hook_register(nb_client_debug_config_write, frr_sr_debug_config_write);
|
||||
|
||||
debug_install(&nb_dbg_client_sysrepo);
|
||||
|
||||
install_element(ENABLE_NODE, &debug_nb_sr_cmd);
|
||||
|
|
12
mgmtd/mgmt.c
12
mgmtd/mgmt.c
|
@ -15,10 +15,14 @@
|
|||
#include "mgmtd/mgmt_history.h"
|
||||
#include "mgmtd/mgmt_memory.h"
|
||||
|
||||
struct debug mgmt_debug_be = { .desc = "Management backend adapter" };
|
||||
struct debug mgmt_debug_ds = {.desc = "Management datastore"};
|
||||
struct debug mgmt_debug_fe = { .desc = "Management frontend adapter" };
|
||||
struct debug mgmt_debug_txn = {.desc = "Management transaction"};
|
||||
struct debug mgmt_debug_be = { .conf = "debug mgmt backend",
|
||||
.desc = "Management backend adapter" };
|
||||
struct debug mgmt_debug_ds = { .conf = "debug mgmt datastore",
|
||||
.desc = "Management datastore" };
|
||||
struct debug mgmt_debug_fe = { .conf = "debug mgmt frontend",
|
||||
.desc = "Management frontend adapter" };
|
||||
struct debug mgmt_debug_txn = { .conf = "debug mgmt transaction",
|
||||
.desc = "Management transaction" };
|
||||
|
||||
/* MGMTD process wide configuration. */
|
||||
static struct mgmt_master mgmt_master;
|
||||
|
|
|
@ -557,14 +557,6 @@ DEFPY(mgmt_rollback,
|
|||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
int config_write_mgmt_debug(struct vty *vty);
|
||||
static struct cmd_node debug_node = {
|
||||
.name = "mgmt debug",
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_mgmt_debug,
|
||||
};
|
||||
|
||||
static int write_mgmt_debug_helper(struct vty *vty, bool config)
|
||||
{
|
||||
uint32_t mode = config ? DEBUG_MODE_CONF : DEBUG_MODE_ALL;
|
||||
|
@ -591,11 +583,6 @@ static int write_mgmt_debug_helper(struct vty *vty, bool config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int config_write_mgmt_debug(struct vty *vty)
|
||||
{
|
||||
return write_mgmt_debug_helper(vty, true);
|
||||
}
|
||||
|
||||
DEFPY_NOSH(show_debugging_mgmt, show_debugging_mgmt_cmd,
|
||||
"show debugging [mgmt]", SHOW_STR DEBUG_STR "MGMT Information\n")
|
||||
{
|
||||
|
@ -696,7 +683,6 @@ void mgmt_vty_init(void)
|
|||
event_add_event(mm->master, mgmt_config_read_in, NULL, 0,
|
||||
&mgmt_daemon_info->read_in);
|
||||
|
||||
install_node(&debug_node);
|
||||
install_node(&mgmtd_node);
|
||||
|
||||
install_element(VIEW_NODE, &show_mgmt_be_adapter_cmd);
|
||||
|
|
|
@ -1305,20 +1305,8 @@ int config_write_segment_routing(struct vty *vty)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int path_policy_cli_debug_config_write(struct vty *vty)
|
||||
{
|
||||
if (DEBUG_MODE_CHECK(&path_policy_debug, DEBUG_MODE_CONF)) {
|
||||
vty_out(vty, "debug pathd policy\n");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void path_cli_init(void)
|
||||
{
|
||||
hook_register(nb_client_debug_config_write,
|
||||
path_policy_cli_debug_config_write);
|
||||
|
||||
debug_install(&path_policy_debug);
|
||||
|
||||
install_node(&segment_routing_node);
|
||||
|
|
|
@ -32,10 +32,10 @@ DEFINE_MTYPE(PATHD, PCEP, "PCEP module");
|
|||
* Globals.
|
||||
*/
|
||||
static struct pcep_glob pcep_glob_space = {
|
||||
.dbg_basic = {0, "PCEP basic"},
|
||||
.dbg_path = {0, "PCEP path"},
|
||||
.dbg_msg = {0, "PCEP message"},
|
||||
.dbg_lib = {0, "PCEP lib"},
|
||||
.dbg_basic = { 0, "debug pathd pcep basic", "PCEP basic" },
|
||||
.dbg_path = { 0, "debug pathd pcep path", "PCEP path" },
|
||||
.dbg_msg = { 0, "debug pathd pcep message", "PCEP message" },
|
||||
.dbg_lib = { 0, "debug pathd pcep pceplib", "PCEP lib" },
|
||||
};
|
||||
struct pcep_glob *pcep_g = &pcep_glob_space;
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
#define BUFFER_PCC_PCE_SIZE 1024
|
||||
|
||||
/* CLI Function declarations */
|
||||
static int pcep_cli_debug_config_write(struct vty *vty);
|
||||
static int pcep_cli_pcep_config_write(struct vty *vty);
|
||||
static int pcep_cli_pcc_config_write(struct vty *vty);
|
||||
static int pcep_cli_pce_config_write(struct vty *vty);
|
||||
|
@ -1695,20 +1694,6 @@ static int path_pcep_cli_clear_srte_pcep_session(struct vty *vty,
|
|||
* Config Write functions
|
||||
*/
|
||||
|
||||
int pcep_cli_debug_config_write(struct vty *vty)
|
||||
{
|
||||
if (DEBUG_MODE_CHECK(&pcep_g->dbg_basic, DEBUG_MODE_CONF))
|
||||
vty_out(vty, "debug pathd pcep basic\n");
|
||||
if (DEBUG_MODE_CHECK(&pcep_g->dbg_path, DEBUG_MODE_CONF))
|
||||
vty_out(vty, "debug pathd pcep path\n");
|
||||
if (DEBUG_MODE_CHECK(&pcep_g->dbg_msg, DEBUG_MODE_CONF))
|
||||
vty_out(vty, "debug pathd pcep message\n");
|
||||
if (DEBUG_MODE_CHECK(&pcep_g->dbg_lib, DEBUG_MODE_CONF))
|
||||
vty_out(vty, "debug pathd pcep pceplib\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pcep_cli_pcep_config_write(struct vty *vty)
|
||||
{
|
||||
vty_out(vty, " pcep\n");
|
||||
|
@ -2331,8 +2316,6 @@ DEFPY(pcep_cli_clear_srte_pcep_session,
|
|||
void pcep_cli_init(void)
|
||||
{
|
||||
hook_register(pathd_srte_config_write, pcep_cli_pcep_config_write);
|
||||
hook_register(nb_client_debug_config_write,
|
||||
pcep_cli_debug_config_write);
|
||||
|
||||
debug_install(&pcep_g->dbg_basic);
|
||||
debug_install(&pcep_g->dbg_path);
|
||||
|
|
|
@ -30,11 +30,11 @@ static uint32_t path_ted_stop_importing_igp(void);
|
|||
static enum zclient_send_status path_ted_link_state_sync(void);
|
||||
static void path_ted_timer_handler_sync(struct event *thread);
|
||||
static void path_ted_timer_handler_refresh(struct event *thread);
|
||||
static int path_ted_cli_debug_config_write(struct vty *vty);
|
||||
|
||||
extern struct zclient *zclient;
|
||||
|
||||
struct ted_state ted_state_g = {};
|
||||
struct ted_state ted_state_g = { .dbg = { .conf = "debug pathd mpls-te",
|
||||
.desc = "Pathd TED" } };
|
||||
|
||||
/*
|
||||
* path_path_ted public API function implementations
|
||||
|
@ -467,14 +467,6 @@ DEFPY (show_pathd_ted_db,
|
|||
* Config Write functions
|
||||
*/
|
||||
|
||||
int path_ted_cli_debug_config_write(struct vty *vty)
|
||||
{
|
||||
if (DEBUG_MODE_CHECK(&ted_state_g.dbg, DEBUG_MODE_CONF)) {
|
||||
vty_out(vty, "debug pathd mpls-te\n");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void path_ted_show_debugging(struct vty *vty)
|
||||
{
|
||||
|
@ -528,9 +520,6 @@ static void path_ted_register_vty(void)
|
|||
install_element(CONFIG_NODE, &debug_path_ted_cmd);
|
||||
install_element(ENABLE_NODE, &debug_path_ted_cmd);
|
||||
|
||||
hook_register(nb_client_debug_config_write,
|
||||
path_ted_cli_debug_config_write);
|
||||
|
||||
debug_install(&ted_state_g.dbg);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,10 @@ DEFINE_HOOK(pathd_candidate_updated, (struct srte_candidate * candidate),
|
|||
DEFINE_HOOK(pathd_candidate_removed, (struct srte_candidate * candidate),
|
||||
(candidate));
|
||||
|
||||
struct debug path_policy_debug;
|
||||
struct debug path_policy_debug = {
|
||||
.conf = "debug pathd policy",
|
||||
.desc = "Pathd policy",
|
||||
};
|
||||
|
||||
#define PATH_POLICY_DEBUG(fmt, ...) \
|
||||
DEBUGD(&path_policy_debug, "policy: " fmt, ##__VA_ARGS__)
|
||||
|
|
|
@ -13,10 +13,11 @@
|
|||
#include "pbrd/pbr_debug_clippy.c"
|
||||
#include "pbrd/pbr_debug.h"
|
||||
|
||||
struct debug pbr_dbg_map = {0, "PBR map"};
|
||||
struct debug pbr_dbg_zebra = {0, "PBR Zebra communications"};
|
||||
struct debug pbr_dbg_nht = {0, "PBR nexthop tracking"};
|
||||
struct debug pbr_dbg_event = {0, "PBR events"};
|
||||
struct debug pbr_dbg_map = { 0, "debug pbr map", "PBR map" };
|
||||
struct debug pbr_dbg_zebra = { 0, "debug pbr zebra",
|
||||
"PBR Zebra communications" };
|
||||
struct debug pbr_dbg_nht = { 0, "debug pbr nht", "PBR nexthop tracking" };
|
||||
struct debug pbr_dbg_event = { 0, "debug pbr events", "PBR events" };
|
||||
|
||||
struct debug *pbr_debugs[] = {&pbr_dbg_map, &pbr_dbg_zebra, &pbr_dbg_nht,
|
||||
&pbr_dbg_event};
|
||||
|
@ -41,11 +42,6 @@ int pbr_debug_config_write_helper(struct vty *vty, bool config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pbr_debug_config_write(struct vty *vty)
|
||||
{
|
||||
return pbr_debug_config_write_helper(vty, true);
|
||||
}
|
||||
|
||||
void pbr_debug_init(void)
|
||||
{
|
||||
debug_install(&pbr_dbg_map);
|
||||
|
|
|
@ -49,12 +49,4 @@ void pbr_debug_set_all(uint32_t flags, bool set);
|
|||
*/
|
||||
int pbr_debug_config_write_helper(struct vty *vty, bool config);
|
||||
|
||||
/*
|
||||
* Print PBR debugging configuration.
|
||||
*
|
||||
* vty
|
||||
* VTY to print debugging configuration to.
|
||||
*/
|
||||
int pbr_debug_config_write(struct vty *vty);
|
||||
|
||||
#endif /* __PBR_DEBUG_H__ */
|
||||
|
|
|
@ -1954,13 +1954,6 @@ DEFPY (show_pbr_interface,
|
|||
|
||||
/* PBR debugging CLI ------------------------------------------------------- */
|
||||
|
||||
static struct cmd_node debug_node = {
|
||||
.name = "debug",
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = pbr_debug_config_write,
|
||||
};
|
||||
|
||||
DEFPY(debug_pbr,
|
||||
debug_pbr_cmd,
|
||||
"[no] debug pbr [{map$map|zebra$zebra|nht$nht|events$events}]",
|
||||
|
@ -2195,7 +2188,6 @@ void pbr_vty_init(void)
|
|||
install_node(&pbr_map_node);
|
||||
|
||||
/* debug */
|
||||
install_node(&debug_node);
|
||||
install_element(ENABLE_NODE, &debug_pbr_cmd);
|
||||
install_element(CONFIG_NODE, &debug_pbr_cmd);
|
||||
install_element(ENABLE_NODE, &show_debugging_pbr_cmd);
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
*/
|
||||
|
||||
/* clang-format off */
|
||||
struct debug static_dbg_events = {0, "Staticd events"};
|
||||
struct debug static_dbg_route = {0, "Staticd route"};
|
||||
struct debug static_dbg_bfd = {0, "Staticd bfd"};
|
||||
struct debug static_dbg_events = {0, "debug static events", "Staticd events"};
|
||||
struct debug static_dbg_route = {0, "debug static route", "Staticd route"};
|
||||
struct debug static_dbg_bfd = {0, "debug static bfd", "Staticd bfd"};
|
||||
|
||||
struct debug *static_debug_arr[] = {
|
||||
&static_dbg_events,
|
||||
|
@ -50,11 +50,6 @@ static int static_debug_config_write_helper(struct vty *vty, bool config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int static_config_write_debug(struct vty *vty)
|
||||
{
|
||||
return static_debug_config_write_helper(vty, true);
|
||||
}
|
||||
|
||||
int static_debug_status_write(struct vty *vty)
|
||||
{
|
||||
return static_debug_config_write_helper(vty, false);
|
||||
|
|
|
@ -28,14 +28,6 @@ extern struct debug static_dbg_bfd;
|
|||
*/
|
||||
void static_debug_init(void);
|
||||
|
||||
/*
|
||||
* Print staticd debugging configuration.
|
||||
*
|
||||
* vty
|
||||
* VTY to print debugging configuration to.
|
||||
*/
|
||||
int static_config_write_debug(struct vty *vty);
|
||||
|
||||
/*
|
||||
* Print staticd debugging configuration, human readable form.
|
||||
*
|
||||
|
|
|
@ -1646,19 +1646,11 @@ DEFUN_NOSH (show_debugging_static,
|
|||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static struct cmd_node debug_node = {
|
||||
.name = "debug",
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = static_config_write_debug,
|
||||
};
|
||||
|
||||
#endif /* ifndef INCLUDE_MGMTD_CMDDEFS_ONLY */
|
||||
|
||||
void static_vty_init(void)
|
||||
{
|
||||
#ifndef INCLUDE_MGMTD_CMDDEFS_ONLY
|
||||
install_node(&debug_node);
|
||||
install_element(ENABLE_NODE, &debug_staticd_cmd);
|
||||
install_element(CONFIG_NODE, &debug_staticd_cmd);
|
||||
install_element(ENABLE_NODE, &show_debugging_static_cmd);
|
||||
|
|
|
@ -409,7 +409,6 @@ domainname test.domain
|
|||
!
|
||||
!
|
||||
!
|
||||
!
|
||||
end
|
||||
test# conf t
|
||||
test(config)# hostname foohost
|
||||
|
@ -425,7 +424,6 @@ domainname test.domain
|
|||
!
|
||||
!
|
||||
!
|
||||
!
|
||||
end
|
||||
foohost(config)#
|
||||
end.
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
#include "vrrp_debug.h"
|
||||
|
||||
/* clang-format off */
|
||||
struct debug vrrp_dbg_arp = {0, "VRRP ARP"};
|
||||
struct debug vrrp_dbg_auto = {0, "VRRP autoconfiguration events"};
|
||||
struct debug vrrp_dbg_ndisc = {0, "VRRP Neighbor Discovery"};
|
||||
struct debug vrrp_dbg_pkt = {0, "VRRP packets"};
|
||||
struct debug vrrp_dbg_proto = {0, "VRRP protocol events"};
|
||||
struct debug vrrp_dbg_sock = {0, "VRRP sockets"};
|
||||
struct debug vrrp_dbg_zebra = {0, "VRRP Zebra events"};
|
||||
struct debug vrrp_dbg_arp = {0, "debug vrrp arp", "VRRP ARP"};
|
||||
struct debug vrrp_dbg_auto = {0, "debug vrrp autoconfigure", "VRRP autoconfiguration events"};
|
||||
struct debug vrrp_dbg_ndisc = {0, "debug vrrp ndisc", "VRRP Neighbor Discovery"};
|
||||
struct debug vrrp_dbg_pkt = {0, "debug vrrp packets", "VRRP packets"};
|
||||
struct debug vrrp_dbg_proto = {0, "debug vrrp protocol", "VRRP protocol events"};
|
||||
struct debug vrrp_dbg_sock = {0, "debug vrrp sockets", "VRRP sockets"};
|
||||
struct debug vrrp_dbg_zebra = {0, "debug vrrp zebra", "VRRP Zebra events"};
|
||||
|
||||
struct debug *vrrp_debugs[] = {
|
||||
&vrrp_dbg_arp,
|
||||
|
@ -56,11 +56,6 @@ static int vrrp_debug_config_write_helper(struct vty *vty, bool config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int vrrp_config_write_debug(struct vty *vty)
|
||||
{
|
||||
return vrrp_debug_config_write_helper(vty, true);
|
||||
}
|
||||
|
||||
int vrrp_debug_status_write(struct vty *vty)
|
||||
{
|
||||
return vrrp_debug_config_write_helper(vty, false);
|
||||
|
|
|
@ -27,14 +27,6 @@ extern struct debug vrrp_dbg_zebra;
|
|||
*/
|
||||
void vrrp_debug_init(void);
|
||||
|
||||
/*
|
||||
* Print VRRP debugging configuration.
|
||||
*
|
||||
* vty
|
||||
* VTY to print debugging configuration to.
|
||||
*/
|
||||
int vrrp_config_write_debug(struct vty *vty);
|
||||
|
||||
/*
|
||||
* Print VRRP debugging configuration, human readable form.
|
||||
*
|
||||
|
|
|
@ -747,13 +747,6 @@ DEFUN_NOSH (show_debugging_vrrp,
|
|||
|
||||
/* clang-format on */
|
||||
|
||||
static struct cmd_node debug_node = {
|
||||
.name = "debug",
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = vrrp_config_write_debug,
|
||||
};
|
||||
|
||||
static struct cmd_node vrrp_node = {
|
||||
.name = "vrrp",
|
||||
.node = VRRP_NODE,
|
||||
|
@ -763,7 +756,6 @@ static struct cmd_node vrrp_node = {
|
|||
|
||||
void vrrp_vty_init(void)
|
||||
{
|
||||
install_node(&debug_node);
|
||||
install_node(&vrrp_node);
|
||||
vrf_cmd_init(NULL);
|
||||
if_cmd_init_default();
|
||||
|
|
|
@ -453,10 +453,6 @@ void vtysh_config_parse_line(void *arg, const char *line)
|
|||
config = config_get(FORWARDING_NODE, line);
|
||||
else if (strncmp(line, "debug vrf", strlen("debug vrf")) == 0)
|
||||
config = config_get(VRF_DEBUG_NODE, line);
|
||||
else if (strncmp(line, "debug northbound",
|
||||
strlen("debug northbound"))
|
||||
== 0)
|
||||
config = config_get(NORTHBOUND_DEBUG_NODE, line);
|
||||
else if (strncmp(line, "debug route-map",
|
||||
strlen("debug route-map"))
|
||||
== 0)
|
||||
|
@ -464,12 +460,6 @@ void vtysh_config_parse_line(void *arg, const char *line)
|
|||
else if (strncmp(line, "debug resolver",
|
||||
strlen("debug resolver")) == 0)
|
||||
config = config_get(RESOLVER_DEBUG_NODE, line);
|
||||
else if (strncmp(line, "debug mgmt client frontend",
|
||||
strlen("debug mgmt client frontend")) == 0)
|
||||
config = config_get(MGMT_FE_DEBUG_NODE, line);
|
||||
else if (strncmp(line, "debug mgmt client backend",
|
||||
strlen("debug mgmt client backend")) == 0)
|
||||
config = config_get(MGMT_BE_DEBUG_NODE, line);
|
||||
else if (strncmp(line, "debug", strlen("debug")) == 0)
|
||||
config = config_get(DEBUG_NODE, line);
|
||||
else if (strncmp(line, "password", strlen("password")) == 0
|
||||
|
@ -537,9 +527,8 @@ void vtysh_config_parse_line(void *arg, const char *line)
|
|||
(I) == ACCESS_IPV6_NODE || (I) == ACCESS_MAC_NODE || \
|
||||
(I) == PREFIX_IPV6_NODE || (I) == FORWARDING_NODE || \
|
||||
(I) == DEBUG_NODE || (I) == AAA_NODE || (I) == VRF_DEBUG_NODE || \
|
||||
(I) == NORTHBOUND_DEBUG_NODE || (I) == RMAP_DEBUG_NODE || \
|
||||
(I) == RESOLVER_DEBUG_NODE || (I) == MPLS_NODE || \
|
||||
(I) == KEYCHAIN_KEY_NODE)
|
||||
(I) == RMAP_DEBUG_NODE || (I) == RESOLVER_DEBUG_NODE || \
|
||||
(I) == MPLS_NODE || (I) == KEYCHAIN_KEY_NODE)
|
||||
|
||||
static void configvec_dump(vector vec, bool nested)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue