]>
git.proxmox.com Git - mirror_frr.git/blob - lib/debug.c
3 * Copyright (C) 2018 Cumulus Networks, Inc.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 static const struct debug_callbacks
*callbacks
;
26 /* All code in this section should be reentrant and MT-safe */
28 DEFUN_NOSH(debug_all
, debug_all_cmd
, "[no] debug all",
29 NO_STR DEBUG_STR
"Toggle all debugging output\n")
31 bool set
= strmatch(argv
[0]->text
, "no");
32 uint32_t mode
= DEBUG_NODE2MODE(vty
->node
);
34 if (callbacks
->debug_set_all
)
35 callbacks
->debug_set_all(mode
, set
);
39 /* ------------------------------------------------------------------------- */
41 void debug_init(const struct debug_callbacks
*cb
)
44 install_element(ENABLE_NODE
, &debug_all_cmd
);
45 install_element(CONFIG_NODE
, &debug_all_cmd
);