mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-26 22:38:34 +00:00
NetworkCaptureLogger: PCAP support added
Log TCP/UDP read/write with fake packet.
This commit is contained in:
parent
906fbf6c8e
commit
82bb5d9915
12 changed files with 485 additions and 29 deletions
|
@ -17,9 +17,6 @@ const u16 PCAP_VERSION_MAJOR = 2;
|
|||
const u16 PCAP_VERSION_MINOR = 4;
|
||||
const u32 PCAP_CAPTURE_LENGTH = 65535;
|
||||
|
||||
// TODO(delroth): Make this configurable at PCAP creation time?
|
||||
const u32 PCAP_DATA_LINK_TYPE = 147; // Reserved for internal use.
|
||||
|
||||
// Designed to be directly written into the PCAP file. The PCAP format is
|
||||
// endian independent, so this works just fine.
|
||||
#pragma pack(push, 1)
|
||||
|
@ -45,10 +42,10 @@ struct PCAPRecordHeader
|
|||
|
||||
} // namespace
|
||||
|
||||
void PCAP::AddHeader()
|
||||
void PCAP::AddHeader(u32 link_type)
|
||||
{
|
||||
PCAPHeader hdr = {PCAP_MAGIC, PCAP_VERSION_MAJOR, PCAP_VERSION_MINOR, 0,
|
||||
0, PCAP_CAPTURE_LENGTH, PCAP_DATA_LINK_TYPE};
|
||||
0, PCAP_CAPTURE_LENGTH, link_type};
|
||||
m_fp->WriteBytes(&hdr, sizeof(hdr));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue