2015-04-16 06:29:42 +02:00
|
|
|
// OpenVPN -- An application to securely tunnel IP networks
|
|
|
|
// over a single port, with support for SSL/TLS-based
|
|
|
|
// session authentication and key exchange,
|
|
|
|
// packet encryption, packet authentication, and
|
|
|
|
// packet compression.
|
|
|
|
//
|
2022-09-29 11:41:13 +02:00
|
|
|
// Copyright (C) 2012-2022 OpenVPN Inc.
|
2015-04-16 06:29:42 +02:00
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
2017-12-21 21:42:20 +01:00
|
|
|
// it under the terms of the GNU Affero General Public License Version 3
|
2015-04-16 06:29:42 +02:00
|
|
|
// as published by the Free Software Foundation.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2017-12-21 21:42:20 +01:00
|
|
|
// GNU Affero General Public License for more details.
|
2015-04-16 06:29:42 +02:00
|
|
|
//
|
2017-12-21 21:42:20 +01:00
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
2015-04-16 06:29:42 +02:00
|
|
|
// along with this program in the COPYING file.
|
|
|
|
// If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2018-04-06 01:41:22 +02:00
|
|
|
// Define the ICMPv4 header
|
2015-04-16 06:29:42 +02:00
|
|
|
|
2018-04-06 01:41:22 +02:00
|
|
|
#pragma once
|
2015-04-16 06:29:42 +02:00
|
|
|
|
|
|
|
#include <cstdint> // for std::uint32_t, uint16_t, uint8_t
|
|
|
|
|
2018-04-06 01:41:22 +02:00
|
|
|
#include <openvpn/ip/ip4.hpp>
|
2015-04-16 06:29:42 +02:00
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
|
|
|
|
|
|
|
namespace openvpn {
|
2018-04-06 01:41:22 +02:00
|
|
|
struct ICMPv4
|
2015-04-16 06:29:42 +02:00
|
|
|
{
|
|
|
|
enum
|
2023-01-11 20:43:22 +01:00
|
|
|
{
|
2019-01-15 10:23:02 +01:00
|
|
|
ECHO_REQUEST = 8,
|
|
|
|
ECHO_REPLY = 0,
|
|
|
|
DEST_UNREACH = 3,
|
|
|
|
FRAG_NEEDED = 4,
|
|
|
|
MIN_DATA_SIZE = 8
|
2015-04-16 06:29:42 +02:00
|
|
|
};
|
|
|
|
|
2018-04-06 01:41:22 +02:00
|
|
|
struct IPv4Header head;
|
2015-04-16 06:29:42 +02:00
|
|
|
|
2018-04-06 01:41:22 +02:00
|
|
|
union {
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
std::uint8_t type;
|
|
|
|
std::uint8_t code;
|
|
|
|
};
|
|
|
|
std::uint16_t type_code;
|
|
|
|
};
|
2015-04-16 06:29:42 +02:00
|
|
|
std::uint16_t checksum;
|
|
|
|
|
|
|
|
union {
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
std::uint16_t id;
|
|
|
|
std::uint16_t seq_num;
|
2018-04-06 01:41:22 +02:00
|
|
|
};
|
2019-01-15 10:23:02 +01:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
std::uint16_t unused;
|
|
|
|
std::uint16_t nexthop_mtu;
|
|
|
|
};
|
2018-04-06 01:41:22 +02:00
|
|
|
};
|
2015-04-16 06:29:42 +02:00
|
|
|
};
|
|
|
|
} // namespace openvpn
|
|
|
|
|
|
|
|
#pragma pack(pop)
|