summaryrefslogtreecommitdiff
path: root/Source/Core/Common/PcapFile.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2021-02-11 00:15:37 +0100
committerGitHub <noreply@github.com>2021-02-11 00:15:37 +0100
commit1fc6fbc2c0c77d5ccde9440b54aba1b007b07136 (patch)
treeaf30d218c6c12f2fe5c31b8001c4251b7c24e424 /Source/Core/Common/PcapFile.cpp
parentddacbf83f65b9642f3c9cee9e075b7ec3d473321 (diff)
parent82bb5d99152b1fac5e2ed1542b38b172beddd1da (diff)
Merge pull request #6075 from sepalani/pcap-log
PCAP logging with fake TCP/UDP packet
Diffstat (limited to 'Source/Core/Common/PcapFile.cpp')
-rw-r--r--Source/Core/Common/PcapFile.cpp7
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));
}