summaryrefslogtreecommitdiff
path: root/zebra/zebra_mlag.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2019-12-16 13:45:36 +0100
committerGitHub <noreply@github.com>2019-12-16 13:45:36 +0100
commitd45fdd536403c3bbcc29b47a0df3a0d804686e3f (patch)
tree393f2d44c4da68f4c7e2c2faf25b4c42b835249c /zebra/zebra_mlag.c
parent04dd9e420ee6f5a7d5c47cd50333879f78abc094 (diff)
parentfd193241e9d404cb9b730ea82ebbd93977b500f0 (diff)
Merge pull request #5523 from donaldsharp/mlag_single_compile
mlag compile issue fixups
Diffstat (limited to 'zebra/zebra_mlag.c')
-rw-r--r--zebra/zebra_mlag.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/zebra/zebra_mlag.c b/zebra/zebra_mlag.c
index 7fbc9c118b..f6bd5f4586 100644
--- a/zebra/zebra_mlag.c
+++ b/zebra/zebra_mlag.c
@@ -27,15 +27,12 @@
#include "mlag.h"
#include "zebra/zebra_mlag.h"
+#include "zebra/zebra_mlag_vty.h"
#include "zebra/zebra_router.h"
#include "zebra/zebra_memory.h"
#include "zebra/zapi_msg.h"
#include "zebra/debug.h"
-#ifndef VTYSH_EXTRACT_PL
-#include "zebra/zebra_mlag_clippy.c"
-#endif
-
DEFINE_HOOK(zebra_mlag_private_write_data,
(uint8_t *data, uint32_t len), (data, len))
DEFINE_HOOK(zebra_mlag_private_monitor_state, (), ())
@@ -586,29 +583,8 @@ enum mlag_role zebra_mlag_get_role(void)
return zrouter.mlag_info.role;
}
-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 <none$none|primary$primary|secondary$secondary>",
- "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")
+int32_t zebra_mlag_test_mlag_internal(const char *none, const char *primary,
+ const char *secondary)
{
enum mlag_role orig = zrouter.mlag_info.role;
char buf1[MLAG_ROLE_STRSIZE], buf2[MLAG_ROLE_STRSIZE];
@@ -650,8 +626,7 @@ DEFPY_HIDDEN(test_mlag, test_mlag_cmd,
void zebra_mlag_init(void)
{
- install_element(VIEW_NODE, &show_mlag_cmd);
- install_element(ENABLE_NODE, &test_mlag_cmd);
+ zebra_mlag_vty_init();
/*
* Intialiaze the MLAG Global variables
@@ -679,7 +654,7 @@ void zebra_mlag_terminate(void)
* ProtoBuf Encoding APIs
*/
-#ifdef HAVE_PROTOBUF
+#ifdef HAVE_PROTOBUF_VERSION_3
DEFINE_MTYPE_STATIC(ZEBRA, MLAG_PBUF, "ZEBRA MLAG PROTOBUF")