OpenVPN 3 Core Library
Loading...
Searching...
No Matches
hostname.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- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12// Get hostname
13
14#ifndef OPENVPN_COMMON_HOSTNAME_H
15#define OPENVPN_COMMON_HOSTNAME_H
16
17#include <string>
18
19#ifdef USE_ASIO
20#include <asio/ip/host_name.hpp>
21#endif
22
23namespace openvpn {
24inline std::string get_hostname()
25{
26#ifdef USE_ASIO
27 return asio::ip::host_name();
28#else
29 return "HOSTNAME_UNDEFINED";
30#endif
31}
32} // namespace openvpn
33
34#endif
Support deferred server-side state creation when client connects.
Definition ovpncli.cpp:95
std::string get_hostname()
Definition hostname.hpp:24