+ResolvProtoResponse::ResolvProtoResponse(std::string buf)
+{
+ memcpy(&ret, buf.c_str(), sizeof(uint8_t));
+ memcpy(&ttl, buf.c_str() + sizeof(uint8_t), sizeof(uint32_t));
+ uint8_t count;
+ memcpy(&count, buf.c_str() + sizeof(uint8_t) + sizeof(uint32_t),
+ sizeof(uint8_t));
+ ips.reserve(count);
+ for (uint8_t i = 0; i < count; ++i)
+ {
+ uint32_t ip;
+ memcpy(&ip, buf.c_str() + 2 * sizeof(uint8_t)
+ + sizeof(uint32_t) * (i + 1), sizeof(uint32_t));
+ ips.push_back(ip);
+ }
+}
+
+/// Constructor
+ResolvProtoResponse::ResolvProtoResponse(rp_pkt_type_t ret, uint32_t ttl,
+ const ipvec_t& ips):
+ ret(ret), ttl(ttl), ips(ips)