mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-11 07:19:20 +00:00
Update kernel
This commit is contained in:
@ -23,55 +23,55 @@
|
||||
|
||||
namespace NetworkICMPv4
|
||||
{
|
||||
ICMPv4::ICMPv4(NetworkInterfaceManager::DeviceInterface *Interface)
|
||||
{
|
||||
debug("ICMPv4 interface %#lx created.", this);
|
||||
this->Interface = Interface;
|
||||
}
|
||||
ICMPv4::ICMPv4(NetworkInterfaceManager::DeviceInterface *Interface)
|
||||
{
|
||||
debug("ICMPv4 interface %#lx created.", this);
|
||||
this->Interface = Interface;
|
||||
}
|
||||
|
||||
ICMPv4::~ICMPv4()
|
||||
{
|
||||
debug("ICMPv4 interface %#lx destroyed.", this);
|
||||
}
|
||||
ICMPv4::~ICMPv4()
|
||||
{
|
||||
debug("ICMPv4 interface %#lx destroyed.", this);
|
||||
}
|
||||
|
||||
void ICMPv4::Send(/* ???? */)
|
||||
{
|
||||
fixme("Unimplemented");
|
||||
}
|
||||
void ICMPv4::Send(/* ???? */)
|
||||
{
|
||||
fixme("Unimplemented");
|
||||
}
|
||||
|
||||
void ICMPv4::Receive(ICMPPacket *Packet)
|
||||
{
|
||||
if (Packet->Header.Type == ICMPv4Type::TYPE_ECHO)
|
||||
{
|
||||
// TODO: This probably doesn't work
|
||||
netdbg("Echo Request");
|
||||
Packet->Header.Type = ICMPv4Type::TYPE_ECHO_REPLY;
|
||||
Packet->Header.Code = 0x0;
|
||||
Packet->Header.Checksum = CalculateChecksum((uint16_t *)Packet, sizeof(ICMPHeader));
|
||||
NIManager->Send(this->Interface, (uint8_t *)Packet, sizeof(ICMPHeader) + 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
netdbg("Unknown type %d", Packet->Header.Type);
|
||||
}
|
||||
}
|
||||
void ICMPv4::Receive(ICMPPacket *Packet)
|
||||
{
|
||||
if (Packet->Header.Type == ICMPv4Type::TYPE_ECHO)
|
||||
{
|
||||
// TODO: This probably doesn't work
|
||||
netdbg("Echo Request");
|
||||
Packet->Header.Type = ICMPv4Type::TYPE_ECHO_REPLY;
|
||||
Packet->Header.Code = 0x0;
|
||||
Packet->Header.Checksum = CalculateChecksum((uint16_t *)Packet, sizeof(ICMPHeader));
|
||||
NIManager->Send(this->Interface, (uint8_t *)Packet, sizeof(ICMPHeader) + 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
netdbg("Unknown type %d", Packet->Header.Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace NetworkICMPv6
|
||||
{
|
||||
ICMPv6::ICMPv6(NetworkInterfaceManager::DeviceInterface *Interface) { this->Interface = Interface; }
|
||||
ICMPv6::~ICMPv6() {}
|
||||
ICMPv6::ICMPv6(NetworkInterfaceManager::DeviceInterface *Interface) { this->Interface = Interface; }
|
||||
ICMPv6::~ICMPv6() {}
|
||||
|
||||
void ICMPv6::Send(uint8_t *Data, size_t Length)
|
||||
{
|
||||
UNUSED(Data);
|
||||
UNUSED(Length);
|
||||
fixme("Unimplemented");
|
||||
}
|
||||
void ICMPv6::Send(uint8_t *Data, size_t Length)
|
||||
{
|
||||
UNUSED(Data);
|
||||
UNUSED(Length);
|
||||
fixme("Unimplemented");
|
||||
}
|
||||
|
||||
void ICMPv6::Receive(uint8_t *Data)
|
||||
{
|
||||
UNUSED(Data);
|
||||
fixme("Unimplemented");
|
||||
}
|
||||
void ICMPv6::Receive(uint8_t *Data)
|
||||
{
|
||||
UNUSED(Data);
|
||||
fixme("Unimplemented");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user