OpenVPN 3 Core Library
Loading...
Searching...
No Matches
platform_string.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
#pragma once
13
14
#include <string>
15
#include <sstream>
16
17
#include <
openvpn/common/arch.hpp
>
18
#include <
openvpn/common/version.hpp
>
19
#include <
openvpn/common/platform_name.hpp
>
20
21
namespace
openvpn
{
22
inline
std::string
platform_string
(
const
std::string &title,
const
std::string &app_version)
23
{
24
std::ostringstream os;
25
26
os << title <<
" "
;
27
if
(!app_version.empty())
28
os << app_version <<
'/'
;
29
os <<
OPENVPN_VERSION
;
30
#if defined OPENVPN_CORE_GIT_VERSION
31
os <<
"("
<< OPENVPN_CORE_GIT_VERSION <<
")"
;
32
#endif
33
os <<
' '
<<
platform_name
();
34
#if defined(OPENVPN_ARCH_x86_64)
35
os <<
" x86_64"
;
36
#elif defined(OPENVPN_ARCH_i386)
37
os <<
" i386"
;
38
#elif defined(OPENVPN_ARCH_ARM64)
39
os <<
" arm64"
;
40
#elif defined(OPENVPN_ARCH_ARM)
41
#if defined(__ARM_ARCH_7S__) || defined(_ARM_ARCH_7S)
42
os <<
" armv7s"
;
43
#elif defined(__ARM_ARCH_7A__)
44
os <<
" armv7a"
;
45
#elif defined(__ARM_V7__) || defined(_ARM_ARCH_7)
46
os <<
" armv7"
;
47
#else
48
os <<
" arm"
;
49
#endif
50
#if defined(__thumb2__)
51
os <<
" thumb2"
;
52
#elif defined(__thumb__) || defined(_M_ARMT)
53
os <<
" thumb"
;
54
#endif
55
#endif
// defined(OPENVPN_ARCH_ARM)
56
57
os <<
' '
<< (
sizeof
(
void
*) * 8) <<
"-bit"
;
58
return
os.str();
59
}
60
61
inline
std::string
platform_string
()
62
{
63
return
platform_string
(
"OpenVPN core"
,
""
);
64
}
65
}
// namespace openvpn
arch.hpp
openvpn
Support deferred server-side state creation when client connects.
Definition
ovpncli.cpp:95
openvpn::platform_name
const char * platform_name()
Definition
platform_name.hpp:21
openvpn::platform_string
std::string platform_string()
Definition
platform_string.hpp:61
platform_name.hpp
version.hpp
OPENVPN_VERSION
#define OPENVPN_VERSION
Definition
version.hpp:17
openvpn
common
platform_string.hpp
Generated by
1.9.8