Commit c3e066a7 authored by Ivan Vilata-i-Balaguer's avatar Ivan Vilata-i-Balaguer
Browse files

Enable creating IPv6 DoH requests.

parent 8cf786ae
......@@ -123,10 +123,11 @@ dns_query(const std::string& name, bool ipv6)
}
boost::optional<Request>
build_request_ipv4( const std::string& name
, const Endpoint& ep)
build_request( const std::string& name
, const Endpoint& ep
, bool ipv6)
{
auto dq_o = dns_query(name, false);
auto dq_o = dns_query(name, ipv6);
if (!dq_o) return boost::none;
// DoH uses unpadded base64url as defined in RFC4648#5 (RFC8484#6).
......@@ -219,4 +220,18 @@ parse_response( const Response& rs
return answers;
}
boost::optional<Request>
build_request_ipv4( const std::string& name
, const Endpoint& ep)
{
return build_request(name, ep, false);
}
boost::optional<Request>
build_request_ipv6( const std::string& name
, const Endpoint& ep)
{
return build_request(name, ep, true);
}
}} // ouinet::doh namespace
......@@ -44,6 +44,10 @@ boost::optional<Endpoint> endpoint_from_base(const std::string&);
boost::optional<Request> build_request_ipv4( const std::string& name
, const Endpoint&);
// Same as above, for IPv6 (type AAAA) addresses.
boost::optional<Request> build_request_ipv6( const std::string& name
, const Endpoint&);
// Return the addresses in the answers for the given host
// in the given response.
//
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment