1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright (C) 2018 Cumulus Networks, Inc.
12 static struct debug_cb_list_head cb_head
;
14 DECLARE_LIST(debug_cb_list
, struct debug_callbacks
, item
);
16 /* All code in this section should be reentrant and MT-safe */
18 DEFUN_NOSH(debug_all
, debug_all_cmd
, "[no] debug all",
19 NO_STR DEBUG_STR
"Toggle all debugging output\n")
21 struct debug_callbacks
*cb
;
23 bool set
= !strmatch(argv
[0]->text
, "no");
24 uint32_t mode
= DEBUG_NODE2MODE(vty
->node
);
26 frr_each (debug_cb_list
, &cb_head
, cb
)
27 cb
->debug_set_all(mode
, set
);
32 /* ------------------------------------------------------------------------- */
34 void debug_init(struct debug_callbacks
*cb
)
36 static bool inited
= false;
40 debug_cb_list_init(&cb_head
);
43 debug_cb_list_add_head(&cb_head
, cb
);
46 void debug_init_cli(void)
48 install_element(ENABLE_NODE
, &debug_all_cmd
);
49 install_element(CONFIG_NODE
, &debug_all_cmd
);