/src/frr/zebra/zebra_mlag_vty.c
Line | Count | Source (jump to first uncovered line) |
1 | | // SPDX-License-Identifier: GPL-2.0-or-later |
2 | | /* Zebra Mlag vty Code. |
3 | | * Copyright (C) 2019 Cumulus Networks, Inc. |
4 | | * Donald Sharp |
5 | | */ |
6 | | #include <zebra.h> |
7 | | |
8 | | #include "vty.h" |
9 | | #include "command.h" |
10 | | |
11 | | #include "zebra_router.h" |
12 | | #include "zebra_mlag_vty.h" |
13 | | #include "debug.h" |
14 | | #include "zapi_msg.h" |
15 | | |
16 | | #include "zebra/zebra_mlag_vty_clippy.c" |
17 | | |
18 | | DEFUN_HIDDEN (show_mlag, |
19 | | show_mlag_cmd, |
20 | | "show zebra mlag", |
21 | | SHOW_STR |
22 | | ZEBRA_STR |
23 | | "The mlag role on this machine\n") |
24 | 0 | { |
25 | 0 | char buf[MLAG_ROLE_STRSIZE]; |
26 | |
|
27 | 0 | vty_out(vty, "MLag is configured to: %s\n", |
28 | 0 | mlag_role2str(zrouter.mlag_info.role, buf, sizeof(buf))); |
29 | |
|
30 | 0 | return CMD_SUCCESS; |
31 | 0 | } |
32 | | |
33 | | DEFPY_HIDDEN(test_mlag, test_mlag_cmd, |
34 | | "test zebra mlag <none$none|primary$primary|secondary$secondary>", |
35 | | "Test code\n" |
36 | | ZEBRA_STR |
37 | | "Modify the Mlag state\n" |
38 | | "Mlag is not setup on the machine\n" |
39 | | "Mlag is setup to be primary\n" |
40 | | "Mlag is setup to be the secondary\n") |
41 | 0 | { |
42 | 0 | return zebra_mlag_test_mlag_internal(none, primary, secondary); |
43 | 0 | } |
44 | | |
45 | | void zebra_mlag_vty_init(void) |
46 | 0 | { |
47 | 0 | install_element(VIEW_NODE, &show_mlag_cmd); |
48 | 0 | install_element(ENABLE_NODE, &test_mlag_cmd); |
49 | 0 | } |