Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c8e567d
Moved callbacks to anonymous functions local to the translation unit.
Dimi1010 May 31, 2025
9ed6ee9
Moved user callback validity checks to the start of the callbacks.
Dimi1010 May 31, 2025
1954ebc
Changed captureThreadMain to an internal function.
Dimi1010 May 31, 2025
e02c6b4
Fixed callback for statistics only capture.
Dimi1010 May 31, 2025
496938e
Changed isRunning flag to hasStarted.
Dimi1010 May 31, 2025
312247b
Replaced statistics worker with a procedure.
Dimi1010 May 31, 2025
35542a0
Added nullptr defaults to contexts.
Dimi1010 May 31, 2025
4483885
Added try catch blocks to catch exceptions bubbling out of dispatch c…
Dimi1010 Jun 1, 2025
e35b188
Merge branch 'dev' into refactor/standalone-capture-callbacks
Dimi1010 Jun 27, 2025
32fb349
Merge branch 'dev' into refactor/standalone-capture-callbacks
Dimi1010 Jul 2, 2025
2f39f93
Merge branch 'dev' into refactor/standalone-capture-callbacks
Dimi1010 Jul 21, 2025
573be14
Updated statistics to use chrono duration directly.
Dimi1010 Jul 24, 2025
01daa47
Replaced types with `auto`.
Dimi1010 Jul 24, 2025
dc1984c
Merge branch 'dev' into refactor/standalone-capture-callbacks
Dimi1010 Jul 24, 2025
1d2905e
Merge branch 'dev' into refactor/standalone-capture-callbacks
Dimi1010 Jul 27, 2025
9864e4c
Merge branch 'dev' into refactor/standalone-capture-callbacks
Dimi1010 Aug 6, 2025
0505cd8
Merge branch 'dev' into refactor/standalone-capture-callbacks
Dimi1010 Aug 14, 2025
425c8c3
Merge branch 'dev' into refactor/standalone-capture-callbacks
Dimi1010 Sep 2, 2025
c107d18
Merge branch 'dev' into refactor/standalone-capture-callbacks
Dimi1010 Sep 6, 2025
9c4f480
Merge remote-tracking branch 'upstream/dev' into refactor/standalone-…
Dimi1010 Sep 15, 2025
823f745
Merge branch 'dev' into refactor/standalone-capture-callbacks
Dimi1010 Sep 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions Pcap++/header/PcapLiveDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ namespace pcpp
uint32_t m_DeviceMtu;
MacAddress m_MacAddress;
IPv4Address m_DefaultGateway;

std::thread m_CaptureThread;
std::thread m_StatsThread;

Expand All @@ -103,12 +104,6 @@ namespace pcpp
// Should be set to true by the Callee for the Caller
std::atomic<bool> m_CaptureThreadStarted;

OnPacketArrivesCallback m_cbOnPacketArrives;
void* m_cbOnPacketArrivesUserCookie;
OnPacketArrivesStopBlocking m_cbOnPacketArrivesBlockingMode;
void* m_cbOnPacketArrivesBlockingModeUserCookie;
RawPacketVector* m_CapturedPackets;
bool m_CaptureCallbackMode;
LinkLayerType m_LinkType;
bool m_UsePoll;

Expand All @@ -124,13 +119,6 @@ namespace pcpp
void setDeviceMacAddress();
void setDefaultGateway();

// threads
void captureThreadMain();

static void onPacketArrives(uint8_t* user, const struct pcap_pkthdr* pkthdr, const uint8_t* packet);
static void onPacketArrivesNoCallback(uint8_t* user, const struct pcap_pkthdr* pkthdr, const uint8_t* packet);
static void onPacketArrivesBlockingMode(uint8_t* user, const struct pcap_pkthdr* pkthdr, const uint8_t* packet);

public:
/// The type of the live device
enum LiveDeviceType
Expand Down
Loading
Loading