3 #include "DNS-iostream.hpp"
9 #include <glog/logging.h>
13 RR_A::RR_A(uint8_t const* rd
, size_t sz
)
15 CHECK_EQ(sz
, sizeof(addr_
.sin_addr
));
16 std::memcpy(&addr_
.sin_addr
, rd
, sizeof(addr_
.sin_addr
));
17 static_assert(sizeof(addr_
.sin_addr
) == 4);
18 PCHECK(inet_ntop(AF_INET
, &addr_
.sin_addr
, str_
, sizeof str_
));
21 RR_AAAA::RR_AAAA(uint8_t const* rd
, size_t sz
)
23 CHECK_EQ(sz
, sizeof(addr_
.sin6_addr
));
24 std::memcpy(&addr_
.sin6_addr
, rd
, sizeof(addr_
.sin6_addr
));
25 static_assert(sizeof(addr_
.sin6_addr
) == 16);
26 PCHECK(inet_ntop(AF_INET6
, &addr_
.sin6_addr
, str_
, sizeof str_
));
29 RR_TLSA::RR_TLSA(uint8_t cert_usage
,
31 uint8_t matching_type
,
32 uint8_t const* assoc_data
,
34 : cert_usage_(cert_usage
)
36 , matching_type_(matching_type
)
38 assoc_data_
.resize(assoc_data_sz
);
39 std::memcpy(assoc_data_
.data(), assoc_data
, assoc_data_sz
);