OpenVPN 3 Core Library
Loading...
Searching...
No Matches
icmp4.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// Define the ICMPv4 header
13
14#pragma once
15
16#include <cstdint> // for std::uint32_t, uint16_t, uint8_t
17
18#include <openvpn/ip/ip4.hpp>
19
20#pragma pack(push)
21#pragma pack(1)
22
23namespace openvpn {
24struct ICMPv4
25{
26 enum
27 {
33 };
34
36
37 union {
38 struct
39 {
40 std::uint8_t type;
41 std::uint8_t code;
42 };
43 std::uint16_t type_code;
44 };
45 std::uint16_t checksum;
46
47 union {
48 struct
49 {
50 std::uint16_t id;
51 std::uint16_t seq_num;
52 };
53 struct
54 {
55 std::uint16_t unused;
56 std::uint16_t nexthop_mtu;
57 };
58 };
59};
60} // namespace openvpn
61
62#pragma pack(pop)
std::uint8_t type
Definition icmp4.hpp:40
std::uint16_t id
Definition icmp4.hpp:50
std::uint16_t checksum
Definition icmp4.hpp:45
std::uint8_t code
Definition icmp4.hpp:41
std::uint16_t seq_num
Definition icmp4.hpp:51
std::uint16_t nexthop_mtu
Definition icmp4.hpp:56
std::uint16_t type_code
Definition icmp4.hpp:43
std::uint16_t unused
Definition icmp4.hpp:55
struct IPv4Header head
Definition icmp4.hpp:35