forked from FRRouting/frr
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbgp_linkstate_vty.c
53 lines (45 loc) · 1.1 KB
/
bgp_linkstate_vty.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// SPDX-License-Identifier: GPL-2.0-or-later
/* BGP Link-State VTY
* Copyright 2023 6WIND S.A.
*/
#include <zebra.h>
#include "command.h"
#include "prefix.h"
#include "lib/json.h"
#include "lib/printfrr.h"
#include "stream.h"
#include "bgpd/bgpd.h"
#include "bgpd/bgp_linkstate_vty.h"
#include "bgpd/bgp_linkstate.h"
#include "bgpd/bgp_zebra.h"
#include "bgpd/bgp_vty.h"
#include "bgpd/bgp_debug.h"
#include "bgpd/bgp_linkstate_vty_clippy.c"
DEFPY (debug_bgp_linkstate,
debug_bgp_linkstate_cmd,
"[no] debug bgp linkstate",
NO_STR
DEBUG_STR
BGP_STR
"BGP allow linkstate debugging entries\n")
{
if (vty->node == CONFIG_NODE) {
if (no)
DEBUG_OFF(linkstate, LINKSTATE);
else
DEBUG_ON(linkstate, LINKSTATE);
} else {
if (no)
TERM_DEBUG_OFF(linkstate, LINKSTATE);
else
TERM_DEBUG_ON(linkstate, LINKSTATE);
vty_out(vty, "BGP linkstate debugging is %s\n",
no ? "off" : "on");
}
return CMD_SUCCESS;
}
void bgp_linkstate_vty_init(void)
{
install_element(ENABLE_NODE, &debug_bgp_linkstate_cmd);
install_element(CONFIG_NODE, &debug_bgp_linkstate_cmd);
}