10 #include <condition_variable>
16 typedef struct __pfring pfring;
27 typedef void (*OnPfRingPacketsArriveCallback)(RawPacket* packets, uint32_t numOfPackets, uint8_t threadId,
28 PfRingDevice* device,
void* userCookie);
39 struct CoreConfiguration
50 pfring** m_PfRingDescriptors;
51 uint8_t m_NumOfOpenedRxChannels;
52 std::string m_DeviceName;
56 CoreConfiguration m_CoreConfiguration[MAX_NUM_OF_CORES];
58 OnPfRingPacketsArriveCallback m_OnPacketsArriveCallback;
59 void* m_OnPacketsArriveUserCookie;
61 bool m_HwClockEnabled;
62 bool m_IsFilterCurrentlySet;
66 bool initCoreConfigurationByCoreMask(CoreMask coreMask);
67 void captureThreadMain(std::condition_variable* startCond, std::mutex* startMutex,
const int* startState);
69 int openSingleRxChannel(
const char* deviceName, pfring** ring);
71 bool getIsHwClockEnable()
73 setPfRingDeviceAttributes();
74 return m_HwClockEnabled;
76 bool setPfRingDeviceClock(pfring* ring);
78 void clearCoreConfiguration();
79 int getCoresInUseCount()
const;
81 void setPfRingDeviceAttributes();
83 bool sendData(
const uint8_t* packetData,
int packetDataLength,
bool flushTxQueues);
124 setPfRingDeviceAttributes();
134 setPfRingDeviceAttributes();
135 return m_InterfaceIndex;
144 setPfRingDeviceAttributes();
155 setPfRingDeviceAttributes();
156 return m_HwClockEnabled;
236 return m_NumOfOpenedRxChannels;
302 bool sendPacket(
const uint8_t* packetData,
int packetDataLength);
virtual bool setFilter(GeneralFilter &filter)
Definition: Device.h:79
Definition: MacAddress.h:25
Definition: PfRingDevice.h:35
bool sendPacket(const RawPacket &rawPacket)
bool startCaptureMultiThread(OnPfRingPacketsArriveCallback onPacketsArrive, void *onPacketsArriveUserCookie, CoreMask coreMask)
ChannelDistribution
Definition: PfRingDevice.h:90
@ RoundRobin
Definition: PfRingDevice.h:94
@ PerFlow
Definition: PfRingDevice.h:98
bool startCaptureSingleThread(OnPfRingPacketsArriveCallback onPacketsArrive, void *onPacketsArriveUserCookie)
int getMtu()
Definition: PfRingDevice.h:142
bool isHwClockEnabledForDevice()
Definition: PfRingDevice.h:153
bool openMultiRxChannels(uint8_t numOfRxChannelsToOpen, ChannelDistribution dist)
bool openSingleRxChannel(uint8_t channelId)
uint8_t getTotalNumOfRxChannels() const
void getThreadStatistics(SystemCore core, PfRingStats &stats) const
bool sendPacket(const Packet &packet)
int sendPackets(const Packet **packetsArr, int arrLength)
bool openMultiRxChannels(const uint8_t *channelIds, int numOfChannelIds)
int sendPackets(const RawPacketVector &rawPackets)
uint8_t getNumOfOpenedRxChannels() const
Definition: PfRingDevice.h:234
std::string getDeviceName() const
Definition: PfRingDevice.h:163
int getInterfaceIndex()
Definition: PfRingDevice.h:132
bool isFilterCurrentlySet() const
SystemCore getCurrentCoreId() const
void getCurrentThreadStatistics(PfRingStats &stats) const
MacAddress getMacAddress()
Definition: PfRingDevice.h:122
bool sendPacket(const uint8_t *packetData, int packetDataLength)
bool setFilter(std::string filterAsString)
void getStatistics(PfRingStats &stats) const
int sendPackets(const RawPacket *rawPacketsArr, int arrLength)
Definition: PfRingDeviceList.h:23
Definition: PointerVector.h:29
Definition: RawPacket.h:269
The main namespace for the PcapPlusPlus lib.
Definition: PfRingDevice.h:106
uint64_t drop
Definition: PfRingDevice.h:110
uint64_t recv
Definition: PfRingDevice.h:108
Definition: SystemUtils.h:27