]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: add 2string for zapi nhg result codes
authorMark Stapp <mjs@voltanet.io>
Thu, 15 Apr 2021 18:17:02 +0000 (14:17 -0400)
committerMark Stapp <mjs@voltanet.io>
Thu, 15 Apr 2021 18:17:02 +0000 (14:17 -0400)
Add a utility '2string' function for daemon nhg result codes.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
lib/zclient.h

index bd952ea1e66d9c6b22a0532a1bf9208e45b29613..3d8500e9f1e9aeaa7a4e8102ece563b4b9075228 100644 (file)
@@ -741,6 +741,29 @@ enum zclient_send_status {
        ZCLIENT_SEND_BUFFERED = 1
 };
 
+static inline const char *
+zapi_nhg_notify_owner2str(enum zapi_nhg_notify_owner note)
+{
+       const char *ret = "UNKNOWN";
+
+       switch (note) {
+       case ZAPI_NHG_FAIL_INSTALL:
+               ret = "ZAPI_NHG_FAIL_INSTALL";
+               break;
+       case ZAPI_NHG_INSTALLED:
+               ret = "ZAPI_NHG_INSTALLED";
+               break;
+       case ZAPI_NHG_REMOVE_FAIL:
+               ret = "ZAPI_NHG_REMOVE_FAIL";
+               break;
+       case ZAPI_NHG_REMOVED:
+               ret = "ZAPI_NHG_REMOVED";
+               break;
+       }
+
+       return ret;
+}
+
 static inline const char *
 zapi_rule_notify_owner2str(enum zapi_rule_notify_owner note)
 {