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

Kernel+ifconfig: Add an MTU value to NetworkAdapter

This defaults to 1500 for all adapters, but LoopbackAdapter increases
it to 65536 on construction.

If an IPv4 packet is larger than the MTU, we'll need to break it into
smaller fragments before transmitting it. This part is a FIXME. :^)
This commit is contained in:
Andreas Kling 2019-11-28 07:12:05 +01:00
parent 70fadbad37
commit 75ed262fe5
5 changed files with 18 additions and 4 deletions

View file

@ -41,6 +41,9 @@ public:
bool has_queued_packets() const { return !m_packet_queue.is_empty(); }
u32 mtu() const { return m_mtu; }
void set_mtu(u32 mtu) { m_mtu = mtu; }
u32 packets_in() const { return m_packets_in; }
u32 bytes_in() const { return m_bytes_in; }
u32 packets_out() const { return m_packets_out; }
@ -66,4 +69,5 @@ private:
u32 m_bytes_in { 0 };
u32 m_packets_out { 0 };
u32 m_bytes_out { 0 };
u32 m_mtu { 1500 };
};