2019-04-02 15:46:44 +02:00
|
|
|
#include <Kernel/Net/LoopbackAdapter.h>
|
|
|
|
|
|
|
|
LoopbackAdapter& LoopbackAdapter::the()
|
|
|
|
{
|
2019-04-05 05:10:18 +02:00
|
|
|
static LoopbackAdapter* the;
|
|
|
|
if (!the)
|
|
|
|
the = new LoopbackAdapter;
|
|
|
|
return *the;
|
2019-04-02 15:46:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
LoopbackAdapter::LoopbackAdapter()
|
|
|
|
{
|
2019-06-16 07:06:49 +02:00
|
|
|
set_interface_name("loop");
|
2019-04-02 15:46:44 +02:00
|
|
|
set_ipv4_address({ 127, 0, 0, 1 });
|
|
|
|
}
|
|
|
|
|
|
|
|
LoopbackAdapter::~LoopbackAdapter()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-07-03 21:17:35 +02:00
|
|
|
void LoopbackAdapter::send_raw(const u8* data, int size)
|
2019-04-02 15:46:44 +02:00
|
|
|
{
|
|
|
|
dbgprintf("LoopbackAdapter: Sending %d byte(s) to myself.\n", size);
|
|
|
|
did_receive(data, size);
|
|
|
|
}
|