OpenVPN 3 Core Library
Loading...
Searching...
No Matches
macver.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#ifndef OPENVPN_APPLE_MACVER_H
13#define OPENVPN_APPLE_MACVER_H
14
15#include <errno.h>
16#include <sys/sysctl.h>
17
18#include <string>
19#include <sstream>
20#include <vector>
21
24#include <openvpn/apple/ver.hpp>
25
26namespace openvpn::Mac {
27class Version : public AppleVersion
28{
29 public:
30 // Mac OS X versions
31 // 15.x.x OS X 10.11.x El Capitan
32 // 14.x.x OS X 10.10.x Yosemite
33 // 13.x.x OS X 10.9.x Mavericks
34 // 12.x.x OS X 10.8.x Mountain Lion
35 // 11.x.x OS X 10.7.x Lion
36 // 10.x.x OS X 10.6.x Snow Leopard
37 // 9.x.x OS X 10.5.x Leopard
38 // 8.x.x OS X 10.4.x Tiger
39 // 7.x.x OS X 10.3.x Panther
40 // 6.x.x OS X 10.2.x Jaguar
41 // 5.x OS X 10.1.x Puma
42
43 enum
44 {
51 };
52
54 {
55 char str[256];
56 size_t size = sizeof(str);
57 int ret = sysctlbyname("kern.osrelease", str, &size, nullptr, 0);
58 if (!ret)
59 init(std::string(str, size));
60 }
61};
62} // namespace openvpn::Mac
63
64#endif
void init(const std::string &verstr)
Definition ver.hpp:56
os<< "Session Name: "<< tbc-> session_name<< '\n';os<< "Layer: "<< tbc-> layer str()<< '\n'
std::string ret