Store lat/lon too for testing and future display use.

This commit is contained in:
Adam Ierymenko 2016-04-18 15:48:33 -07:00
parent 587b1e05d1
commit b3cac538cc
2 changed files with 8 additions and 8 deletions

View File

@ -123,8 +123,8 @@ void ClusterGeoIpService::_parseLine(const char *line,std::vector<_V4E> &v4db,st
v4db.push_back(_V4E()); v4db.push_back(_V4E());
v4db.back().start = Utils::ntoh((uint32_t)(reinterpret_cast<const struct sockaddr_in *>(&ipStart)->sin_addr.s_addr)); v4db.back().start = Utils::ntoh((uint32_t)(reinterpret_cast<const struct sockaddr_in *>(&ipStart)->sin_addr.s_addr));
v4db.back().end = Utils::ntoh((uint32_t)(reinterpret_cast<const struct sockaddr_in *>(&ipEnd)->sin_addr.s_addr)); v4db.back().end = Utils::ntoh((uint32_t)(reinterpret_cast<const struct sockaddr_in *>(&ipEnd)->sin_addr.s_addr));
//v4db.back().lat = (float)lat; v4db.back().lat = (float)lat;
//v4db.back().lon = (float)lon; v4db.back().lon = (float)lon;
v4db.back().x = x; v4db.back().x = x;
v4db.back().y = y; v4db.back().y = y;
v4db.back().z = z; v4db.back().z = z;
@ -133,8 +133,8 @@ void ClusterGeoIpService::_parseLine(const char *line,std::vector<_V4E> &v4db,st
v6db.push_back(_V6E()); v6db.push_back(_V6E());
memcpy(v6db.back().start,reinterpret_cast<const struct sockaddr_in6 *>(&ipStart)->sin6_addr.s6_addr,16); memcpy(v6db.back().start,reinterpret_cast<const struct sockaddr_in6 *>(&ipStart)->sin6_addr.s6_addr,16);
memcpy(v6db.back().end,reinterpret_cast<const struct sockaddr_in6 *>(&ipEnd)->sin6_addr.s6_addr,16); memcpy(v6db.back().end,reinterpret_cast<const struct sockaddr_in6 *>(&ipEnd)->sin6_addr.s6_addr,16);
//v6db.back().lat = (float)lat; v6db.back().lat = (float)lat;
//v6db.back().lon = (float)lon; v6db.back().lon = (float)lon;
v6db.back().x = x; v6db.back().x = x;
v6db.back().y = y; v6db.back().y = y;
v6db.back().z = z; v6db.back().z = z;

View File

@ -101,8 +101,8 @@ private:
{ {
uint32_t start; uint32_t start;
uint32_t end; uint32_t end;
//float lat,lon; float lat,lon;
int x,y,z; int16_t x,y,z;
inline bool operator<(const _V4E &e) const { return (start < e.start); } inline bool operator<(const _V4E &e) const { return (start < e.start); }
}; };
@ -111,8 +111,8 @@ private:
{ {
uint8_t start[16]; uint8_t start[16];
uint8_t end[16]; uint8_t end[16];
//float lat,lon; float lat,lon;
int x,y,z; int16_t x,y,z;
inline bool operator<(const _V6E &e) const { return (memcmp(start,e.start,16) < 0); } inline bool operator<(const _V6E &e) const { return (memcmp(start,e.start,16) < 0); }
}; };