2 * IS-IS Rout(e)ing protocol - isis_vty_common.c
4 * This file contains the CLI that is shared between OpenFabric and IS-IS
6 * Copyright (C) 2001,2002 Sampo Saaristo
7 * Tampere University of Technology
8 * Institute of Communications Engineering
9 * Copyright (C) 2016 David Lamparter, for NetDEF, Inc.
10 * Copyright (C) 2018 Christian Franke, for NetDEF, Inc.
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public Licenseas published by the Free
14 * Software Foundation; either version 2 of the License, or (at your option)
17 * This program is distributed in the hope that it will be useful,but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
22 * You should have received a copy of the GNU General Public License along
23 * with this program; see the file COPYING; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 #include "isis_circuit.h"
34 #include "isis_misc.h"
37 #include "isis_vty_common.h"
39 struct isis_circuit
*isis_circuit_lookup(struct vty
*vty
)
41 struct interface
*ifp
= VTY_GET_CONTEXT(interface
);
42 struct isis_circuit
*circuit
;
45 vty_out(vty
, "Invalid interface \n");
49 circuit
= circuit_scan_by_ifp(ifp
);
51 vty_out(vty
, "ISIS is not enabled on circuit %s\n", ifp
->name
);
62 "Enable BFD support\n")
64 struct isis_circuit
*circuit
= isis_circuit_lookup(vty
);
67 return CMD_ERR_NO_MATCH
;
70 && CHECK_FLAG(circuit
->bfd_info
->flags
, BFD_FLAG_PARAM_CFG
)) {
74 isis_bfd_circuit_param_set(circuit
, BFD_DEF_MIN_RX
,
75 BFD_DEF_MIN_TX
, BFD_DEF_DETECT_MULT
, true);
82 "no " PROTO_NAME
" bfd",
85 "Disables BFD support\n"
88 struct isis_circuit
*circuit
= isis_circuit_lookup(vty
);
91 return CMD_ERR_NO_MATCH
;
93 if (!circuit
->bfd_info
)
96 isis_bfd_circuit_cmd(circuit
, ZEBRA_BFD_DEST_DEREGISTER
);
97 bfd_info_free(&circuit
->bfd_info
);
101 void isis_vty_init(void)
103 install_element(INTERFACE_NODE
, &isis_bfd_cmd
);
104 install_element(INTERFACE_NODE
, &no_isis_bfd_cmd
);
106 isis_vty_daemon_init();