ladybird/Kernel/Net/LoopbackAdapter.cpp
Andreas Kling 75ed262fe5 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. :^)
2019-11-28 14:14:26 +01:00

25 lines
481 B
C++

#include <Kernel/Net/LoopbackAdapter.h>
LoopbackAdapter& LoopbackAdapter::the()
{
static LoopbackAdapter* the;
if (!the)
the = new LoopbackAdapter;
return *the;
}
LoopbackAdapter::LoopbackAdapter()
{
set_interface_name("loop");
set_mtu(65536);
}
LoopbackAdapter::~LoopbackAdapter()
{
}
void LoopbackAdapter::send_raw(const u8* data, int size)
{
dbgprintf("LoopbackAdapter: Sending %d byte(s) to myself.\n", size);
did_receive(data, size);
}