OpenVPN 3 Core Library
Loading...
Searching...
No Matches
ipcommon.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 declarations for IPv4 and IPv6
13
14
#pragma once
15
16
#include <cstdint>
// for std::uint32_t, uint16_t, uint8_t
17
18
namespace
openvpn::IPCommon
{
19
20
enum
21
{
22
ICMPv4
= 1,
/* ICMPv4 protocol */
23
ICMPv6
= 58,
/* ICMPv6 protocol */
24
IGMP
= 2,
/* IGMP protocol */
25
TCP
= 6,
/* TCP protocol */
26
UDP
= 17,
/* UDP protocol */
27
};
28
29
enum
30
{
31
IPv4
= 4,
32
IPv6
= 6
33
};
34
35
inline
unsigned
int
version
(
const
std::uint8_t version_len_prio)
36
{
37
return
(version_len_prio >> 4) & 0x0F;
38
}
39
40
}
// namespace openvpn::IPCommon
openvpn::IPCommon
Definition
ipcommon.hpp:18
openvpn::IPCommon::IPv4
@ IPv4
Definition
ipcommon.hpp:31
openvpn::IPCommon::IPv6
@ IPv6
Definition
ipcommon.hpp:32
openvpn::IPCommon::UDP
@ UDP
Definition
ipcommon.hpp:26
openvpn::IPCommon::IGMP
@ IGMP
Definition
ipcommon.hpp:24
openvpn::IPCommon::TCP
@ TCP
Definition
ipcommon.hpp:25
openvpn::IPCommon::version
unsigned int version(const std::uint8_t version_len_prio)
Definition
ipcommon.hpp:35
openvpn::ICMPv4
Definition
icmp4.hpp:25
openvpn::ICMPv6
Definition
icmp6.hpp:26
openvpn
ip
ipcommon.hpp
Generated by
1.9.8