mirror of
https://github.com/SerenityOS/serenity
synced 2026-04-25 17:15:42 +02:00
Commit ad73adef5d needlessly introduced an IPv4 directory.
If we were to keep it, sharing common headers between IPv4 and IPv6
would be much messier, and may potentially increase code duplication.
This change renames the IPv4 directory to IP to aid with later IPv6
porting efforts.
31 lines
592 B
C
31 lines
592 B
C
/*
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/MACAddress.h>
|
|
#include <Kernel/Net/IP/IPv4.h>
|
|
|
|
enum class ICMPType : u8 {
|
|
EchoReply = 0,
|
|
EchoRequest = 8,
|
|
};
|
|
|
|
struct [[gnu::packed]] ICMPHeader {
|
|
ICMPType type { 0 };
|
|
u8 code { 0 };
|
|
NetworkOrdered<u16> checksum { 0 };
|
|
};
|
|
|
|
static_assert(AssertSize<ICMPHeader, 4>());
|
|
|
|
struct [[gnu::packed]] ICMPEchoPacket {
|
|
ICMPHeader header;
|
|
NetworkOrdered<u16> identifier;
|
|
NetworkOrdered<u16> sequence_number;
|
|
u8 payload[];
|
|
};
|