1 #ifndef DNS_MESSAGE_DOT_HPP
2 #define DNS_MESSAGE_DOT_HPP
9 #include "iobuffer.hpp"
11 #include <glog/logging.h>
14 auto constexpr max_udp_sz
{uint16_t(4 * 1024)};
21 using octet
= unsigned char;
22 using container_t
= iobuffer
<octet
>;
26 explicit message(container_t::size_type sz
)
29 CHECK_LE(sz
, std::numeric_limits
<uint16_t>::max());
32 explicit message(container_t
&& buf
)
35 CHECK_LE(buf
.size(), std::numeric_limits
<uint16_t>::max());
38 operator std::span
<octet
>() { return {buf_
.data(), buf_
.size()}; }
39 operator std::span
<octet
const>() const { return {buf_
.data(), buf_
.size()}; }
43 static size_t min_sz();
50 create_question(char const* name
, DNS::RR_type type
, uint16_t cls
, uint16_t id
);
52 void check_answer(bool& nx_domain
,
53 bool& bogus_or_indeterminate
,
55 uint16_t& extended_rcode
,
59 message
const& question
,
60 message
const& answer
,
64 RR_collection
get_records(message
const& pkt
, bool& bogus_or_indeterminate
);
68 #endif // DNS_MESSAGE_DOT_HPP