From adeb0be15dc0d7d3f1604fdea0dd965095680f5a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 27 Jan 2010 14:26:11 -0800 Subject: [PATCH] msg: add type to ceph_entity_addr --- src/include/msgr.h | 5 +++-- 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 40b6189aa9e34..8aaab414f3f8a 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 cd4b1dd1342a8..f056020230780 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); } -- 2.39.5