21 #include "modules/system/network-stack/NetworkStack.h" 22 #include "pedigree/kernel/Log.h" 23 #include "pedigree/kernel/machine/Machine.h" 24 #include "pedigree/kernel/machine/Network.h" 25 #include "pedigree/kernel/processor/Processor.h" 27 #include "modules/system/network-stack/RoutingTable.h" 31 static uint8_t g_LocalIpv6[16] = {0, 0, 0, 0, 0, 0, 0, 0,
32 0, 0, 0, 0, 0, 0, 0, 1};
34 Loopback::Loopback() :
Network()
36 setSpecificType(
String(
"Loopback-card"));
42 m_StationInfo.mac.setMac(static_cast<uint8_t>(0));
44 m_StationInfo.ipv6 =
new IpAddress(g_LocalIpv6);
45 m_StationInfo.ipv6->setIpv6Prefix(128);
46 m_StationInfo.nIpv6Addresses = 1;
51 setSpecificType(
String(
"Loopback-card"));
57 m_StationInfo.mac.setMac(static_cast<uint8_t>(0));
59 m_StationInfo.ipv6 =
new IpAddress(g_LocalIpv6);
60 m_StationInfo.ipv6->setIpv6Prefix(128);
61 m_StationInfo.nIpv6Addresses = 1;
72 ERROR(
"Loopback: Attempt to send a packet with size > 64 KB");
virtual bool send(size_t nBytes, uintptr_t buffer)
static EXPORTED_PUBLIC uint32_t convertToIpv4(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
void receive(size_t nBytes, uintptr_t packet, Network *pCard, uint32_t offset)
static NetworkStack & instance()
void registerDevice(Network *pDevice)
virtual StationInfo getStationInfo()
void setLoopback(Network *pCard)