1 #ifndef PCAPPP_PF_RING_DEVICE 2 #define PCAPPP_PF_RING_DEVICE 14 typedef struct __pfring pfring;
25 typedef void (*OnPfRingPacketsArriveCallback)(RawPacket* packets, uint32_t numOfPackets, uint8_t threadId, PfRingDevice* device,
void* userCookie);
37 struct CoreConfiguration
48 pfring** m_PfRingDescriptors;
49 uint8_t m_NumOfOpenedRxChannels;
50 char m_DeviceName[30];
54 CoreConfiguration m_CoreConfiguration[MAX_NUM_OF_CORES];
56 OnPfRingPacketsArriveCallback m_OnPacketsArriveCallback;
57 void* m_OnPacketsArriveUserCookie;
59 bool m_HwClockEnabled;
60 bool m_IsFilterCurrentlySet;
64 bool initCoreConfigurationByCoreMask(CoreMask coreMask);
65 static void* captureThreadMain(
void *ptr);
67 int openSingleRxChannel(
const char* deviceName, pfring** ring);
69 inline bool getIsHwClockEnable() { setPfRingDeviceAttributes();
return m_HwClockEnabled; }
70 bool setPfRingDeviceClock(pfring* ring);
72 void clearCoreConfiguration();
73 int getCoresInUseCount();
75 void setPfRingDeviceAttributes();
77 bool sendData(
const uint8_t* packetData,
int packetDataLength,
bool flushTxQueues);
128 int getMtu() { setPfRingDeviceAttributes();
return m_DeviceMTU; }
161 bool startCaptureMultiThread(OnPfRingPacketsArriveCallback onPacketsArrive,
void* onPacketsArriveUserCookie, CoreMask coreMask);
176 bool openSingleRxChannel(uint8_t channelId);
270 bool sendPacket(
const uint8_t* packetData,
int packetDataLength);
337 bool setFilter(std::string filterAsString);
void getThreadStatistics(SystemCore core, PfRingStats &stats)
uint64_t drop
Definition: PfRingDevice.h:104
int getMtu()
Definition: PfRingDevice.h:128
bool sendPacket(const RawPacket &rawPacket)
virtual bool setFilter(GeneralFilter &filter)
Definition: Device.h:76
Definition: PointerVector.h:24
int getInterfaceIndex()
Definition: PfRingDevice.h:122
Definition: SystemUtils.h:32
Definition: MacAddress.h:21
uint8_t getTotalNumOfRxChannels()
uint64_t recv
Definition: PfRingDevice.h:102
bool startCaptureMultiThread(OnPfRingPacketsArriveCallback onPacketsArrive, void *onPacketsArriveUserCookie, CoreMask coreMask)
bool setFilter(std::string filterAsString)
bool isFilterCurrentlySet()
uint8_t getNumOfOpenedRxChannels()
Definition: PfRingDevice.h:208
int sendPackets(const RawPacket *rawPacketsArr, int arrLength)
Definition: PfRingDevice.h:92
Definition: RawPacket.h:219
Definition: PfRingDeviceList.h:20
Definition: PfRingDevice.h:32
bool startCaptureSingleThread(OnPfRingPacketsArriveCallback onPacketsArrive, void *onPacketsArriveUserCookie)
SystemCore getCurrentCoreId()
void getCurrentThreadStatistics(PfRingStats &stats)
bool openMultiRxChannels(const uint8_t *channelIds, int numOfChannelIds)
MacAddress getMacAddress()
Definition: PfRingDevice.h:116
ChannelDistribution
Definition: PfRingDevice.h:83
Definition: PfRingDevice.h:99
bool isHwClockEnabledForDevice()
Definition: PfRingDevice.h:135
void getStatistics(PfRingStats &stats)
std::string getDeviceName()
Definition: PfRingDevice.h:141
The main namespace for the PcapPlusPlus lib.
Definition: PfRingDevice.h:88