Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jenny Ryan
ouinet
Commits
c3e066a7
Commit
c3e066a7
authored
Jul 02, 2020
by
Ivan Vilata-i-Balaguer
Browse files
Enable creating IPv6 DoH requests.
parent
8cf786ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/doh.cpp
View file @
c3e066a7
...
...
@@ -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
src/doh.h
View file @
c3e066a7
...
...
@@ -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.
//
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment