ZealOS/src/Home/Net/Tests/ICMPTest.ZC
TomAwezome 3a33e6baaf Rename CosmiC to ZealC.
Rename all .CC files to .ZC extension.
2021-12-11 06:21:22 -05:00

22 lines
No EOL
440 B
Text
Executable file

U8 dst_mac[6] = {0xF0, 0x0D, 0xBE, 0xAD, 0xDE, 0xAF};
U32 dst_ip = 0x01020304;
U0 ICMPTest()
{
U8 *data_payload = CAlloc(8);
*(data_payload(U64 *)) = EndianU64(0xDEADC0DEBEEFFADE);
ARPCachePut(dst_ip, dst_mac); // Force entry into ARP Cache so IPV4 can match it with IPV4AddressMACGet
while (TRUE)
{
ICMPReplySend(dst_ip, EndianU16(0xDEAD), EndianU16(0xBEEF), EndianU16(0xC0DE), data_payload, 8);
Sleep(300);
}
}
ICMPTest;