OpenVPN 3 Core Library
Loading...
Searching...
No Matches
asioresolverres.hpp
Go to the documentation of this file.
1
// OpenVPN -- An application to securely tunnel IP networks
2
// over a single port, with support for SSL/TLS-based
3
// session authentication and key exchange,
4
// packet encryption, packet authentication, and
5
// packet compression.
6
//
7
// Copyright (C) 2012-2017 OpenVPN Technologies, Inc.
8
//
9
// This program is free software: you can redistribute it and/or modify
10
// it under the terms of the GNU General Public License Version 3
11
// as published by the Free Software Foundation.
12
//
13
// This program is distributed in the hope that it will be useful,
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
// GNU General Public License for more details.
17
//
18
// You should have received a copy of the GNU General Public License
19
// along with this program in the COPYING file.
20
// If not, see <http://www.gnu.org/licenses/>.
21
22
#pragma once
23
24
#include <string>
25
26
#include <
openvpn/common/to_string.hpp
>
27
28
namespace
openvpn
{
29
30
template
<
class
EPRANGE>
31
inline
std::string
asio_resolver_results_to_string
(
const
EPRANGE &endpoint_range)
32
{
33
std::string
ret
;
34
ret
.reserve(64);
35
bool
first =
true
;
36
for
(
const
auto
&i : endpoint_range)
37
{
38
if
(!first)
39
ret
+=
' '
;
40
ret
+=
'['
;
41
ret
+=
openvpn::to_string
(i.endpoint().address());
42
ret
+=
"]:"
;
43
ret
+=
openvpn::to_string
(i.endpoint().port());
44
first =
false
;
45
}
46
return
ret
;
47
}
48
49
}
// namespace openvpn
openvpn
Support deferred server-side state creation when client connects.
Definition
ovpncli.cpp:95
openvpn::to_string
std::string to_string(T value)
Definition
to_string.hpp:33
openvpn::asio_resolver_results_to_string
std::string asio_resolver_results_to_string(const EPRANGE &endpoint_range)
Definition
asioresolverres.hpp:31
ret
std::string ret
Definition
test_capture.cpp:267
to_string.hpp
openvpn
asio
asioresolverres.hpp
Generated by
1.9.8