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>
This commit is contained in:
Donald Sharp 2018-12-18 08:01:50 -05:00
parent df39560091
commit ff1fb8d5f6
2 changed files with 9 additions and 0 deletions

View File

@ -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)
{
}

View File

@ -26,4 +26,6 @@
void zebra_mlag_init(void);
void zebra_mlag_terminate(void);
enum mlag_role zebra_mlag_get_role(void);
#endif