#include <DpdkDeviceList.h>
There are two ways to capture packets using DpdkDevice: one of them is using worker threads and the other way is using a callback which is invoked on each a burst of packets are captured (see DpdkDevice::startCaptureSingleThread() ). This class is a base class for implementing workers. A worker is basically a class that is activated by DpdkDeviceList::startDpdkWorkerThreads() and runs on a designated core. When it runs it can do whatever the user wants it to do. The most common use it running in an endless loop and receive, analyze and send packets using one or more DpdkDevice instances. It can do all kinds of processing for these packets. The only restriction for a worker class is that it must implement the 3 abstract methods stated in this class-interface for start running, stop running and get the core ID the worker is running on.
◆ ~DpdkWorkerThread()
virtual pcpp::DpdkWorkerThread::~DpdkWorkerThread |
( |
| ) |
|
|
inlinevirtual |
A virtual d'tor. Can be overridden by child class if needed
◆ getCoreId()
virtual uint32_t pcpp::DpdkWorkerThread::getCoreId |
( |
| ) |
const |
|
pure virtual |
An abstract method that must be implemented by child class. Get the core ID the worker is running on (as sent to the run() method as a parameter)
- Returns
- The core ID the worker is running on
◆ run()
virtual bool pcpp::DpdkWorkerThread::run |
( |
uint32_t |
coreId | ) |
|
|
pure virtual |
An abstract method that must be implemented by child class. It's the indication for the worker to start running
- Parameters
-
[in] | coreId | The core ID the worker is running on (should be returned in getCoreId() ) |
- Returns
- True if all went well or false otherwise
◆ stop()
virtual void pcpp::DpdkWorkerThread::stop |
( |
| ) |
|
|
pure virtual |
An abstract method that must be implemented by child class. It's the indication for the worker to stop running. After this method is called the caller expects the worker to stop running as fast as possible
- Returns
- No return value