X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fcommon%2Faddress_helper.cc;fp=src%2Fceph%2Fsrc%2Fcommon%2Faddress_helper.cc;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=8f625f8db4d1fed50f0be9ae0607668aa3636760;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/common/address_helper.cc b/src/ceph/src/common/address_helper.cc deleted file mode 100644 index 8f625f8..0000000 --- a/src/ceph/src/common/address_helper.cc +++ /dev/null @@ -1,42 +0,0 @@ -/* - * address_helper.cc - * - * Created on: Oct 27, 2013 - * Author: matt - */ - -#include - -#include "common/address_helper.h" -#include "boost/regex.hpp" - -using namespace std; - -// decode strings like "tcp://:" -int entity_addr_from_url(entity_addr_t *addr /* out */, const char *url) -{ - using namespace boost; - using std::endl; - - regex expr("(tcp|rdma)://([^:]*):([\\d]+)"); - cmatch m; - - if (regex_match(url, m, expr)) { - string host(m[2].first, m[2].second); - string port(m[3].first, m[3].second); - addrinfo hints; - memset(&hints, 0, sizeof(hints)); - hints.ai_family = PF_UNSPEC; - addrinfo *res; - int error = getaddrinfo(host.c_str(), NULL, &hints, &res); - if (! error) { - addr->set_sockaddr((sockaddr*)res->ai_addr); - addr->set_port(std::atoi(port.c_str())); - freeaddrinfo(res); - return 0; - } - } - - return 1; -} -