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

Method SetMACBridgedSend

pcsx2/DEV9/pcap_io.cpp:379–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379void PCAPAdapter::SetMACBridgedSend(NetPacket* pkt)
380{
381 EthernetFrameEditor frame(pkt);
382 if (frame.GetProtocol() == static_cast<u16>(EtherType::IPv4)) // IP
383 {
384 PayloadPtrEditor* payload = frame.GetPayload();
385 IP_Packet ippkt(payload->data, payload->GetLength());
386 ps2IP = ippkt.sourceIP;
387 }
388 if (frame.GetProtocol() == static_cast<u16>(EtherType::ARP)) // ARP
389 {
390 ARP_PacketEditor arpPkt(frame.GetPayload());
391 ps2IP = *(IP_Address*)arpPkt.SenderProtocolAddress();
392 *(MAC_Address*)arpPkt.SenderHardwareAddress() = hostMAC;
393 }
394 frame.SetSourceMAC(hostMAC);
395}
396
397/*
398 * Strips the Frame Check Sequence if we manage to capture it.

Callers

nothing calls this directly

Calls 6

SenderProtocolAddressMethod · 0.80
SenderHardwareAddressMethod · 0.80
SetSourceMACMethod · 0.80
GetProtocolMethod · 0.45
GetPayloadMethod · 0.45
GetLengthMethod · 0.45

Tested by

no test coverage detected