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
19
20enum
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
29enum
30{
31 IPv4 = 4,
32 IPv6 = 6
33};
34
35inline unsigned int version(const std::uint8_t version_len_prio)
36{
37 return (version_len_prio >> 4) & 0x0F;
38}
39
40} // namespace openvpn::IPCommon
unsigned int version(const std::uint8_t version_len_prio)
Definition ipcommon.hpp:35