From e2bbf175a2184bd76f6c54ccf8456babeb1a46fc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 9 Apr 2024 15:16:35 +0200 Subject: Adding upstream version 9.1. Signed-off-by: Daniel Baumann --- zebra/zebra_mlag_vty.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 zebra/zebra_mlag_vty.c (limited to 'zebra/zebra_mlag_vty.c') diff --git a/zebra/zebra_mlag_vty.c b/zebra/zebra_mlag_vty.c new file mode 100644 index 0000000..1145d12 --- /dev/null +++ b/zebra/zebra_mlag_vty.c @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* Zebra Mlag vty Code. + * Copyright (C) 2019 Cumulus Networks, Inc. + * Donald Sharp + */ +#include + +#include "vty.h" +#include "command.h" + +#include "zebra_router.h" +#include "zebra_mlag_vty.h" +#include "debug.h" +#include "zapi_msg.h" + +#include "zebra/zebra_mlag_vty_clippy.c" + +DEFUN_HIDDEN (show_mlag, + show_mlag_cmd, + "show zebra mlag", + SHOW_STR + ZEBRA_STR + "The mlag role on this machine\n") +{ + char buf[MLAG_ROLE_STRSIZE]; + + vty_out(vty, "MLag is configured to: %s\n", + mlag_role2str(zrouter.mlag_info.role, buf, sizeof(buf))); + + return CMD_SUCCESS; +} + +DEFPY_HIDDEN(test_mlag, test_mlag_cmd, + "test zebra mlag ", + "Test code\n" + ZEBRA_STR + "Modify the Mlag state\n" + "Mlag is not setup on the machine\n" + "Mlag is setup to be primary\n" + "Mlag is setup to be the secondary\n") +{ + return zebra_mlag_test_mlag_internal(none, primary, secondary); +} + +void zebra_mlag_vty_init(void) +{ + install_element(VIEW_NODE, &show_mlag_cmd); + install_element(ENABLE_NODE, &test_mlag_cmd); +} -- cgit v1.2.3