mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
Kernel: More work on the ICMP and IPv4 support.
This commit is contained in:
parent
9858be636f
commit
87ecf290f4
9 changed files with 63 additions and 53 deletions
|
@ -4,10 +4,10 @@
|
|||
#include <Kernel/IPv4Address.h>
|
||||
#include <Kernel/NetworkOrdered.h>
|
||||
|
||||
struct IPv4Protocol {
|
||||
enum {
|
||||
enum class IPv4Protocol : word {
|
||||
ICMP = 1,
|
||||
};
|
||||
TCP = 6,
|
||||
UDP = 17,
|
||||
};
|
||||
|
||||
NetworkOrdered<word> internet_checksum(const void*, size_t);
|
||||
|
@ -44,6 +44,8 @@ public:
|
|||
void* payload() { return this + 1; }
|
||||
const void* payload() const { return this + 1; }
|
||||
|
||||
word payload_size() const { return m_length - sizeof(IPv4Packet); }
|
||||
|
||||
NetworkOrdered<word> compute_checksum() const
|
||||
{
|
||||
ASSERT(!m_checksum);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue