]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: add type to ceph_entity_addr
authorSage Weil <sage@newdream.net>
Wed, 27 Jan 2010 22:26:11 +0000 (14:26 -0800)
committerSage Weil <sage@newdream.net>
Wed, 27 Jan 2010 22:29:11 +0000 (14:29 -0800)
src/include/msgr.h
src/msg/msg_types.h

index 40b6189aa9e3497240f9efe0d5ebfa0ff2ff31da..8aaab414f3f8ab84dae8d08cbe7161f9fa425eed 100644 (file)
@@ -21,7 +21,7 @@
  * whenever the wire protocol changes.  try to keep this string length
  * constant.
  */
-#define CEPH_BANNER "ceph v026"
+#define CEPH_BANNER "ceph v027"
 #define CEPH_BANNER_MAX_LEN 30
 
 
@@ -61,7 +61,8 @@ extern const char *ceph_entity_type_name(int type);
  * entity_addr -- network address
  */
 struct ceph_entity_addr {
-       __le64 nonce;  /* unique id for process (e.g. pid) */
+       __le32 type;
+       __le32 nonce;  /* unique id for process (e.g. pid) */
        struct sockaddr_storage in_addr;
 } __attribute__ ((packed));
 
index cd4b1dd1342a804d9cc5983a9b2c1e939031590e..f056020230780127999f1cd30d6f47e050eddd9b 100644 (file)
@@ -129,13 +129,15 @@ static inline void decode(sockaddr_storage& a, bufferlist::iterator& bl) {
 }
 
 struct entity_addr_t {
-  __u64 nonce;
+  __u32 type;
+  __u32 nonce;
   sockaddr_storage addr;
 
-  entity_addr_t() : nonce(0) { 
+  entity_addr_t() : type(0), nonce(0) { 
     memset(&addr, 0, sizeof(addr));
   }
   entity_addr_t(const ceph_entity_addr &o) {
+    type = o.type;
     nonce = o.nonce;
     addr = o.in_addr;
     addr.ss_family = ntohs(addr.ss_family);
@@ -186,6 +188,7 @@ struct entity_addr_t {
 
   operator ceph_entity_addr() const {
     ceph_entity_addr a;
+    a.type = 0;
     a.nonce = nonce;
     a.in_addr = addr;
     a.in_addr.ss_family = htons(addr.ss_family);
@@ -223,10 +226,12 @@ struct entity_addr_t {
   }
 
   void encode(bufferlist& bl) const {
+    ::encode(type, bl);
     ::encode(nonce, bl);
     ::encode(addr, bl);
   }
   void decode(bufferlist::iterator& bl) {
+    ::decode(type, bl);
     ::decode(nonce, bl);
     ::decode(addr, bl);
   }