1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:47:34 +00:00

IPv4: More work on the TCP implementation.

I can now establish a connection to my little test server on the host.
This commit is contained in:
Andreas Kling 2019-03-14 00:20:44 +01:00
parent 032d9d7065
commit 66d55f8e0c
9 changed files with 36 additions and 18 deletions

View file

@ -18,6 +18,8 @@ public:
TCPPacket() { }
~TCPPacket() { }
size_t header_size() const { return data_offset() * sizeof(dword); }
word source_port() const { return m_source_port; }
void set_source_port(word port) { m_source_port = port; }
@ -48,8 +50,8 @@ public:
word urgent() const { return m_urgent; }
void set_urgent(word urgent) { m_urgent = urgent; }
const void* payload() const { return this + 1; }
void* payload() { return this + 1; }
const void* payload() const { return ((const byte*)this) + header_size(); }
void* payload() { return ((byte*)this) + header_size(); }
private:
NetworkOrdered<word> m_source_port;