MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / SendIP

Method SendIP

pcsx2/DEV9/sockets.cpp:376–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374}
375
376bool SocketAdapter::SendIP(IP_Packet* ipPkt)
377{
378 if (ipPkt->VerifyChecksum() == false)
379 {
380 Console.Error("DEV9: Socket: IP packet with bad CSUM");
381 return false;
382 }
383 //Do Checksum in sub functions
384
385 ConnectionKey Key{};
386 Key.ip = ipPkt->destinationIP;
387 Key.protocol = ipPkt->protocol;
388
389 std::lock_guard deletelock(deleteRecvSentry);
390 switch (ipPkt->protocol) //(Prase Payload)
391 {
392 case (u8)IP_Type::ICMP:
393 return SendICMP(Key, ipPkt);
394 case (u8)IP_Type::IGMP:
395 return SendIGMP(Key, ipPkt);
396 case (u8)IP_Type::TCP:
397 return SendTCP(Key, ipPkt);
398 case (u8)IP_Type::UDP:
399 return SendUDP(Key, ipPkt);
400 default:
401 //Log_Error("Unkown Protocol");
402 Console.Error("DEV9: Socket: Unkown IPv4 Protocol %X", ipPkt->protocol);
403 return false;
404 }
405}
406
407bool SocketAdapter::SendICMP(ConnectionKey Key, IP_Packet* ipPkt)
408{

Callers

nothing calls this directly

Calls 2

VerifyChecksumMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected