diff options
| author | Stephen Worley <sworley@cumulusnetworks.com> | 2019-12-03 16:14:34 -0500 |
|---|---|---|
| committer | Stephen Worley <sworley@cumulusnetworks.com> | 2019-12-03 16:14:34 -0500 |
| commit | eb5d458b3f5e2813ad6c473323b2b37e243aad4f (patch) | |
| tree | 881ec6e757644b4abd225b3f1795f4f6dc91fc7d /lib/zclient.h | |
| parent | 47f94d175a6f52cde83c3ff319304cd918acbb93 (diff) | |
lib: Add zapi_rule_notify_owner2str() function
Add a function for converting the zapi_rule_notify_owner enum
type to a string for ease of use.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'lib/zclient.h')
| -rw-r--r-- | lib/zclient.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/zclient.h b/lib/zclient.h index 7adb294a31..99ed34138e 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -485,6 +485,29 @@ enum zapi_iptable_notify_owner { ZAPI_IPTABLE_FAIL_REMOVE, }; +static inline const char * +zapi_rule_notify_owner2str(enum zapi_rule_notify_owner note) +{ + const char *ret = "UNKNOWN"; + + switch (note) { + case ZAPI_RULE_FAIL_INSTALL: + ret = "ZAPI_RULE_FAIL_INSTALL"; + break; + case ZAPI_RULE_INSTALLED: + ret = "ZAPI_RULE_INSTALLED"; + break; + case ZAPI_RULE_FAIL_REMOVE: + ret = "ZAPI_RULE_FAIL_REMOVE"; + break; + case ZAPI_RULE_REMOVED: + ret = "ZAPI_RULE_REMOVED"; + break; + } + + return ret; +} + /* Zebra MAC types */ #define ZEBRA_MACIP_TYPE_STICKY 0x01 /* Sticky MAC*/ #define ZEBRA_MACIP_TYPE_GW 0x02 /* gateway (SVI) mac*/ |
