3 #include "DNS-iostream.hpp"
9 #include <glog/logging.h>
13 RR_A::RR_A(uint8_t const* rd
, size_t sz
)
15 static_assert(sizeof(addr_
.sin_addr
) == 4);
16 CHECK_EQ(sz
, sizeof(addr_
.sin_addr
));
17 std::memcpy(&addr_
.sin_addr
, rd
, sizeof(addr_
.sin_addr
));
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 static_assert(sizeof(addr_
.sin6_addr
) == 16);
24 CHECK_EQ(sz
, sizeof(addr_
.sin6_addr
));
25 std::memcpy(&addr_
.sin6_addr
, rd
, sizeof(addr_
.sin6_addr
));
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 std::span
<octet
const> data
)
33 : cert_usage_(cert_usage
)
35 , matching_type_(matching_type
)
37 assoc_data_
.resize(data
.size());
38 std::memcpy(assoc_data_
.data(), data
.data(), data
.size());