OpenVPN 3 Core Library
Loading...
Searching...
No Matches
peerstats.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_SERVER_PEERSTATS_H
13#define OPENVPN_SERVER_PEERSTATS_H
14
15#include <string>
16#include <cstdint> // for std::uint32_t, uint64_t, etc.
17
18namespace openvpn {
19
21{
22 std::string to_string() const
23 {
24 std::string ret;
25 ret.reserve(64);
26 ret += "[rx=";
27 ret += std::to_string(rx_bytes);
28 ret += " tx=";
29 ret += std::to_string(tx_bytes);
30 ret += " status=";
31 ret += std::to_string(status);
32 ret += ']';
33 return ret;
34 }
35
36 std::uint64_t rx_bytes = 0;
37 std::uint64_t tx_bytes = 0;
38 int status = 0;
39};
40
41} // namespace openvpn
42
43#endif
std::uint64_t tx_bytes
Definition peerstats.hpp:37
std::uint64_t rx_bytes
Definition peerstats.hpp:36
std::string to_string() const
Definition peerstats.hpp:22
std::string ret