OpenVPN 3 Core Library
Loading...
Searching...
No Matches
relcommon.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
// Common reliability layer classes
13
14
#ifndef OPENVPN_RELIABLE_RELCOMMON_H
15
#define OPENVPN_RELIABLE_RELCOMMON_H
16
17
#include <
openvpn/crypto/packet_id_control.hpp
>
18
19
namespace
openvpn
{
20
21
namespace
reliable {
22
typedef
std::uint32_t
id_t
;
23
constexpr
static
std::size_t
id_size
=
sizeof
(
id_t
);
24
25
}
// namespace reliable
26
27
template
<
typename
PACKET>
28
class
ReliableMessageBase
29
{
30
public
:
31
typedef
reliable::id_t
id_t
;
32
33
ReliableMessageBase
()
34
:
id_
(0),
erased_
(false)
35
{
36
}
37
bool
defined
()
const
38
{
39
return
bool(
packet
);
40
}
41
bool
erased
()
const
42
{
43
return
erased_
;
44
}
45
46
void
erase
()
47
{
48
id_
=
id_t
(0);
49
packet
.reset();
50
erased_
=
true
;
51
}
52
53
id_t
id
()
const
54
{
55
return
id_
;
56
}
57
58
PACKET
packet
;
59
60
protected
:
61
id_t
id_
;
62
bool
erased_
;
63
};
64
65
}
// namespace openvpn
66
67
#endif
// OPENVPN_RELIABLE_RELCOMMON_H
openvpn::ReliableMessageBase
Definition
relcommon.hpp:29
openvpn::ReliableMessageBase::packet
PACKET packet
Definition
relcommon.hpp:58
openvpn::ReliableMessageBase::id_t
reliable::id_t id_t
Definition
relcommon.hpp:31
openvpn::ReliableMessageBase::erased
bool erased() const
Definition
relcommon.hpp:41
openvpn::ReliableMessageBase::erase
void erase()
Definition
relcommon.hpp:46
openvpn::ReliableMessageBase::id
id_t id() const
Definition
relcommon.hpp:53
openvpn::ReliableMessageBase::ReliableMessageBase
ReliableMessageBase()
Definition
relcommon.hpp:33
openvpn::ReliableMessageBase::erased_
bool erased_
Definition
relcommon.hpp:62
openvpn::ReliableMessageBase::id_
id_t id_
Definition
relcommon.hpp:61
openvpn::ReliableMessageBase::defined
bool defined() const
Definition
relcommon.hpp:37
openvpn::reliable::id_t
std::uint32_t id_t
Definition
relcommon.hpp:22
openvpn::reliable::id_size
static constexpr std::size_t id_size
Definition
relcommon.hpp:23
openvpn
Definition
ovpncli.cpp:97
packet_id_control.hpp
openvpn
reliable
relcommon.hpp
Generated by
1.9.8