hammer2 - cluster / libdmsg circuit work
[dragonfly.git] / lib / libdmsg / subs.c
index fc744d4..492d815 100644 (file)
@@ -67,6 +67,52 @@ dmsg_uuid_to_str(uuid_t *uuid, char **strp)
        return (*strp);
 }
 
+const char *
+dmsg_peer_type_to_str(uint8_t type)
+{
+       switch(type) {
+       case DMSG_PEER_NONE:
+               return("NONE");
+       case DMSG_PEER_CLUSTER:
+               return("CLUSTER");
+       case DMSG_PEER_BLOCK:
+               return("BLOCK");
+       case DMSG_PEER_HAMMER2:
+               return("HAMMER2");
+       default:
+               return("?PEERTYPE?");
+       }
+}
+
+const char *
+dmsg_pfs_type_to_str(uint8_t type)
+{
+       switch(type) {
+       case DMSG_PFSTYPE_NONE:
+               return("NONE");
+       case DMSG_PFSTYPE_ADMIN:
+               return("ADMIN");
+       case DMSG_PFSTYPE_CLIENT:
+               return("CLIENT");
+       case DMSG_PFSTYPE_CACHE:
+               return("CACHE");
+       case DMSG_PFSTYPE_COPY:
+               return("COPY");
+       case DMSG_PFSTYPE_SLAVE:
+               return("SLAVE");
+       case DMSG_PFSTYPE_SOFT_SLAVE:
+               return("SOFT_SLAVE");
+       case DMSG_PFSTYPE_SOFT_MASTER:
+               return("SOFT_MASTER");
+       case DMSG_PFSTYPE_MASTER:
+               return("MASTER");
+       case DMSG_PFSTYPE_SERVER:
+               return("SERVER");
+       default:
+               return("?PFSTYPE?");
+       }
+}
+
 int
 dmsg_connect(const char *hostname)
 {