]> git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_mlag_vty.c
Merge pull request #5789 from donaldsharp/bgp_ebgp_reason
[mirror_frr.git] / zebra / zebra_mlag_vty.c
1 /* Zebra Mlag vty Code.
2 * Copyright (C) 2019 Cumulus Networks, Inc.
3 * Donald Sharp
4 *
5 * This file is part of FRR.
6 *
7 * FRR is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
10 * later version.
11 *
12 * FRR is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with FRR; see the file COPYING. If not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 */
22 #include <zebra.h>
23
24 #include "vty.h"
25 #include "command.h"
26
27 #include "zebra_router.h"
28 #include "zebra_mlag_vty.h"
29 #include "debug.h"
30 #include "zapi_msg.h"
31
32 #ifndef VTYSH_EXTRACT_PL
33 #include "zebra/zebra_mlag_vty_clippy.c"
34 #endif
35
36 DEFUN_HIDDEN (show_mlag,
37 show_mlag_cmd,
38 "show zebra mlag",
39 SHOW_STR
40 ZEBRA_STR
41 "The mlag role on this machine\n")
42 {
43 char buf[MLAG_ROLE_STRSIZE];
44
45 vty_out(vty, "MLag is configured to: %s\n",
46 mlag_role2str(zrouter.mlag_info.role, buf, sizeof(buf)));
47
48 return CMD_SUCCESS;
49 }
50
51 DEFPY_HIDDEN(test_mlag, test_mlag_cmd,
52 "test zebra mlag <none$none|primary$primary|secondary$secondary>",
53 "Test code\n"
54 ZEBRA_STR
55 "Modify the Mlag state\n"
56 "Mlag is not setup on the machine\n"
57 "Mlag is setup to be primary\n"
58 "Mlag is setup to be the secondary\n")
59 {
60 return zebra_mlag_test_mlag_internal(none, primary, secondary);
61 }
62
63 void zebra_mlag_vty_init(void)
64 {
65 install_element(VIEW_NODE, &show_mlag_cmd);
66 install_element(ENABLE_NODE, &test_mlag_cmd);
67 }