__le64 num;
} __attribute__ ((packed));
-#define CEPH_ENTITY_TYPE_MON 1
-#define CEPH_ENTITY_TYPE_MDS 2
-#define CEPH_ENTITY_TYPE_OSD 3
-#define CEPH_ENTITY_TYPE_CLIENT 4
-#define CEPH_ENTITY_TYPE_ADMIN 5
+#define CEPH_ENTITY_TYPE_MON 1
+#define CEPH_ENTITY_TYPE_MDS 2
+#define CEPH_ENTITY_TYPE_OSD 4
+#define CEPH_ENTITY_TYPE_CLIENT 8
+#define CEPH_ENTITY_TYPE_ADMIN 16
+
+const char *ceph_entity_type_name(int type);
/*
* entity_addr -- network address
__s64 num() const { return _num; }
int type() const { return _type; }
const char *type_str() const {
- switch (type()) {
- case TYPE_MDS: return "mds";
- case TYPE_OSD: return "osd";
- case TYPE_MON: return "mon";
- case TYPE_CLIENT: return "client";
- case TYPE_ADMIN: return "admin";
- default: return "unknown";
- }
+ return ceph_entity_type_name(type());
}
bool is_new() const { return num() < 0; }