From 82bb5d99152b1fac5e2ed1542b38b172beddd1da Mon Sep 17 00:00:00 2001 From: Sepalani Date: Tue, 29 Aug 2017 22:14:01 +0100 Subject: NetworkCaptureLogger: PCAP support added Log TCP/UDP read/write with fake packet. --- Source/Core/Common/PcapFile.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Source/Core/Common/PcapFile.cpp') diff --git a/Source/Core/Common/PcapFile.cpp b/Source/Core/Common/PcapFile.cpp index 540f641d54..b7feb4f4eb 100644 --- a/Source/Core/Common/PcapFile.cpp +++ b/Source/Core/Common/PcapFile.cpp @@ -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)); } -- cgit v1.2.3