]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/msg_types: add get_legacy_str()
authorSage Weil <sage@redhat.com>
Fri, 21 Dec 2018 14:37:25 +0000 (08:37 -0600)
committerSage Weil <sage@redhat.com>
Thu, 3 Jan 2019 17:17:31 +0000 (11:17 -0600)
Render a pre-nautilus entity_addr_t string.

Signed-off-by: Sage Weil <sage@redhat.com>
src/msg/msg_types.h

index 1f5137e6c50fd46df2a1332d361421975388af68..422ee5c01aedc7e934092bd39cbe704674100dd9 100644 (file)
@@ -416,6 +416,12 @@ struct entity_addr_t {
 
   std::string ip_only_to_str() const;
 
+  std::string get_legacy_str() const {
+    ostringstream ss;
+    ss << get_sockaddr() << "/" << get_nonce();
+    return ss.str();
+  }
+
   bool parse(const char *s, const char **end = 0, int type=0);
 
   void decode_legacy_addr_after_marker(bufferlist::const_iterator& bl)
@@ -567,6 +573,9 @@ struct entity_addrvec_t {
     }
     return entity_addr_t();
   }
+  string get_legacy_str() const {
+    return legacy_or_front_addr().get_legacy_str();
+  }
 
   entity_addr_t msgr2_addr() const {
     for (auto &a : v) {