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

Method InternalServerRecv

pcsx2/DEV9/net.cpp:341–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341bool NetAdapter::InternalServerRecv(NetPacket* pkt)
342{
343 IP_Payload* ippay;
344 ippay = dhcpServer.Recv();
345 if (ippay != nullptr)
346 {
347 IP_Packet* ippkt = new IP_Packet(ippay);
348 ippkt->destinationIP = {{{255, 255, 255, 255}}};
349 ippkt->sourceIP = internalIP;
350 EthernetFrame frame(ippkt);
351 frame.sourceMAC = internalMAC;
352 frame.destinationMAC = ps2MAC;
353 frame.protocol = static_cast<u16>(EtherType::IPv4);
354 frame.WritePacket(pkt);
355 InspectRecv(pkt);
356 return true;
357 }
358
359 ippay = dnsServer.Recv();
360 if (ippay != nullptr)
361 {
362 IP_Packet* ippkt = new IP_Packet(ippay);
363 ippkt->destinationIP = ps2IP;
364 ippkt->sourceIP = internalIP;
365 EthernetFrame frame(ippkt);
366 frame.sourceMAC = internalMAC;
367 frame.destinationMAC = ps2MAC;
368 frame.protocol = static_cast<u16>(EtherType::IPv4);
369 frame.WritePacket(pkt);
370 InspectRecv(pkt);
371 return true;
372 }
373
374 return false;
375}
376
377bool NetAdapter::InternalServerSend(NetPacket* pkt)
378{

Callers

nothing calls this directly

Calls 2

WritePacketMethod · 0.80
RecvMethod · 0.45

Tested by

no test coverage detected