Skip to content

Commit

Permalink
Merge branch 'ubuntu24' of github.com:tigercosmos/PcapPlusPlus into u…
Browse files Browse the repository at this point in the history
…buntu24
  • Loading branch information
tigercosmos committed Aug 16, 2024
2 parents 5828da4 + 10b4866 commit 04a2216
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 47 deletions.
3 changes: 0 additions & 3 deletions Pcap++/header/PcapLiveDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ namespace pcpp
*/
using OnStatsUpdateCallback = std::function<void(IPcapDevice::PcapStats&, void*)>;

// for internal use only
typedef void* (*ThreadStart)(void*);

/**
* @class PcapLiveDevice
* A class that wraps a network interface (each of the interfaces listed in ifconfig/ipconfig).
Expand Down
5 changes: 0 additions & 5 deletions Pcap++/header/PcapRemoteDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ namespace pcpp
PcapRemoteDevice(pcap_if_t* iface, std::shared_ptr<PcapRemoteAuthentication> remoteAuthentication,
const IPAddress& remoteMachineIP, uint16_t remoteMachinePort);

static void* remoteDeviceCaptureThreadMain(void* ptr);

// overridden methods
ThreadStart getCaptureThreadStart();

public:
PcapRemoteDevice(const PcapRemoteDevice&) = delete;
PcapRemoteDevice(PcapRemoteDevice&&) noexcept = delete;
Expand Down
39 changes: 0 additions & 39 deletions Pcap++/src/PcapRemoteDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,45 +70,6 @@ namespace pcpp
return true;
}

void* PcapRemoteDevice::remoteDeviceCaptureThreadMain(void* ptr)
{
PcapRemoteDevice* pThis = static_cast<PcapRemoteDevice*>(ptr);
if (pThis == nullptr)
{
PCPP_LOG_ERROR("Capture thread: Unable to extract PcapLiveDevice instance");
return 0;
}

PCPP_LOG_DEBUG("Started capture thread for device '" << pThis->m_Name << "'");

pcap_pkthdr* pkthdr;
const uint8_t* pktData;

if (pThis->m_CaptureCallbackMode)
{
while (!pThis->m_StopThread)
{
if (pcap_next_ex(pThis->m_PcapDescriptor, &pkthdr, &pktData) > 0)
onPacketArrives(reinterpret_cast<uint8_t*>(pThis), pkthdr, pktData);
}
}
else
{
while (!pThis->m_StopThread)
{
if (pcap_next_ex(pThis->m_PcapDescriptor, &pkthdr, &pktData) > 0)
onPacketArrivesNoCallback(reinterpret_cast<uint8_t*>(pThis), pkthdr, pktData);
}
}
PCPP_LOG_DEBUG("Ended capture thread for device '" << pThis->m_Name << "'");
return 0;
}

ThreadStart PcapRemoteDevice::getCaptureThreadStart()
{
return &remoteDeviceCaptureThreadMain;
}

void PcapRemoteDevice::getStatistics(PcapStats& stats) const
{
int allocatedMemory;
Expand Down

0 comments on commit 04a2216

Please sign in to comment.