forked from Bananymous/banan-os
Kernel: Make better abstractions for networking
This commit is contained in:
24
kernel/include/kernel/Networking/ICMP.h
Normal file
24
kernel/include/kernel/Networking/ICMP.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <BAN/Endianness.h>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
|
||||
struct ICMPHeader
|
||||
{
|
||||
uint8_t type;
|
||||
uint8_t code;
|
||||
BAN::NetworkEndian<uint16_t> checksum;
|
||||
BAN::NetworkEndian<uint32_t> rest;
|
||||
};
|
||||
static_assert(sizeof(ICMPHeader) == 8);
|
||||
|
||||
enum ICMPType : uint8_t
|
||||
{
|
||||
EchoReply = 0x00,
|
||||
EchoRequest = 0x08,
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user