diff options
| author | Sepalani <sepalani@hotmail.fr> | 2017-08-29 22:14:01 +0100 |
|---|---|---|
| committer | Sepalani <sepalani@hotmail.fr> | 2021-01-30 19:35:09 +0400 |
| commit | 82bb5d99152b1fac5e2ed1542b38b172beddd1da (patch) | |
| tree | 43325dbf5105dcde9b3a8c7197532e1768a7df54 /Source/Core/Common/PcapFile.cpp | |
| parent | 906fbf6c8e33b1f0247376b1f5d8f0ead5368c18 (diff) | |
NetworkCaptureLogger: PCAP support added
Log TCP/UDP read/write with fake packet.
Diffstat (limited to 'Source/Core/Common/PcapFile.cpp')
| -rw-r--r-- | Source/Core/Common/PcapFile.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
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)); } |
