diff options
author | Sage Weil <sage@newdream.net> | 2010-01-27 14:26:11 -0800 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-01-27 14:29:11 -0800 |
commit | adeb0be15dc0d7d3f1604fdea0dd965095680f5a (patch) | |
tree | ef66241a9f6bc79c2fc7bb9798598402b6799e72 /src | |
parent | eebe6df5c2bb2bff8a0b2c7b9fba60ea159720f0 (diff) | |
download | ceph-adeb0be15dc0d7d3f1604fdea0dd965095680f5a.tar.gz |
msg: add type to ceph_entity_addr
Diffstat (limited to 'src')
-rw-r--r-- | src/include/msgr.h | 5 | ||||
-rw-r--r-- | src/msg/msg_types.h | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/include/msgr.h b/src/include/msgr.h index 40b6189aa9e..8aaab414f3f 100644 --- a/src/include/msgr.h +++ b/src/include/msgr.h @@ -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)); diff --git a/src/msg/msg_types.h b/src/msg/msg_types.h index cd4b1dd1342..f0560202307 100644 --- a/src/msg/msg_types.h +++ b/src/msg/msg_types.h @@ -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); } |