summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-12-18 08:01:50 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-01-04 12:21:00 -0500
commitff1fb8d5f6171ed66f00339152f3e8433a7ff65d (patch)
tree23ccfabf8dfa642ee26d878622892a34506a4939
parentdf3956009145194f4025c136ded9942d9564c455 (diff)
zebra: Add a retrieve the mlag role function
Add the ability to retrieve the current role of mlag for this machine. If mlag is not setup we will always return MLAG_ROLE_NONE. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--zebra/zebra_mlag.c7
-rw-r--r--zebra/zebra_mlag.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/zebra/zebra_mlag.c b/zebra/zebra_mlag.c
index d1fc71a5a0..26470ed5c0 100644
--- a/zebra/zebra_mlag.c
+++ b/zebra/zebra_mlag.c
@@ -25,6 +25,13 @@
#include "zebra/zebra_mlag.h"
+enum mlag_role role = MLAG_ROLE_NONE;
+
+enum mlag_role zebra_mlag_get_role(void)
+{
+ return role;
+}
+
void zebra_mlag_init(void)
{
}
diff --git a/zebra/zebra_mlag.h b/zebra/zebra_mlag.h
index 97065bb841..c5c147c833 100644
--- a/zebra/zebra_mlag.h
+++ b/zebra/zebra_mlag.h
@@ -26,4 +26,6 @@
void zebra_mlag_init(void);
void zebra_mlag_terminate(void);
+
+enum mlag_role zebra_mlag_get_role(void);
#endif