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

Method SendICMP

pcsx2/DEV9/sockets.cpp:407–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405}
406
407bool SocketAdapter::SendICMP(ConnectionKey Key, IP_Packet* ipPkt)
408{
409 //IP_PayloadPtr* ipPayload = static_cast<IP_PayloadPtr*>(ipPkt->GetPayload());
410
411 ICMP_Session* s;
412
413 //Need custom SendFromConnection
414 BaseSession* existingSession = nullptr;
415 connections.TryGetValue(Key, &existingSession);
416 if (existingSession != nullptr)
417 {
418 s = static_cast<ICMP_Session*>(existingSession);
419 return s->Send(ipPkt->GetPayload(), ipPkt);
420 }
421
422 DevCon.WriteLn("DEV9: Socket: Creating New ICMP Connection");
423 s = new ICMP_Session(Key, adapterIP, &connections);
424
425 s->AddConnectionClosedHandler([&](BaseSession* session) { HandleConnectionClosed(session); });
426 s->destIP = ipPkt->destinationIP;
427 s->sourceIP = dhcpServer.ps2IP;
428 connections.Add(Key, s);
429 return s->Send(ipPkt->GetPayload(), ipPkt);
430}
431
432bool SocketAdapter::SendIGMP(ConnectionKey Key, IP_Packet* ipPkt)
433{

Callers

nothing calls this directly

Calls 6

TryGetValueMethod · 0.45
SendMethod · 0.45
GetPayloadMethod · 0.45
WriteLnMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected