1 #ifndef PCAPPP_PF_RING_DEVICE 2 #define PCAPPP_PF_RING_DEVICE 16 typedef struct __pfring pfring;
27 typedef void (*OnPfRingPacketsArriveCallback)(RawPacket* packets, uint32_t numOfPackets, uint8_t threadId, PfRingDevice* device,
void* userCookie);
39 struct CoreConfiguration
50 pfring** m_PfRingDescriptors;
51 uint8_t m_NumOfOpenedRxChannels;
52 char m_DeviceName[30];
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 static void* captureThreadMain(
void *ptr);
69 int openSingleRxChannel(
const char* deviceName, pfring** ring);
71 inline bool getIsHwClockEnable() { setPfRingDeviceAttributes();
return m_HwClockEnabled; }
72 bool setPfRingDeviceClock(pfring* ring);
74 void clearCoreConfiguration();
75 int getCoresInUseCount();
77 void setPfRingDeviceAttributes();
79 bool sendData(
const uint8_t* packetData,
int packetDataLength,
bool flushTxQueues);
118 int getMtu() { setPfRingDeviceAttributes();
return m_DeviceMTU; }
151 bool startCaptureMultiThread(OnPfRingPacketsArriveCallback onPacketsArrive,
void* onPacketsArriveUserCookie, CoreMask coreMask);
166 bool openSingleRxChannel(uint8_t channelId);
260 bool setFilter(std::string filterAsString);
297 bool sendPacket(
const uint8_t* packetData,
int packetDataLength);
MacAddress getMacAddress()
Definition: PfRingDevice.h:106
bool setFilter(GeneralFilter &filter)
void getCurrentThreadStatistics(pcap_stat &stats)
ChannelDistribution
Definition: PfRingDevice.h:85
bool startCaptureSingleThread(OnPfRingPacketsArriveCallback onPacketsArrive, void *onPacketsArriveUserCookie)
std::string getDeviceName()
Definition: PfRingDevice.h:131
uint8_t getNumOfOpenedRxChannels()
Definition: PfRingDevice.h:198
Definition: RawPacket.h:220
Definition: PcapDevice.h:38
The main namespace for the PcapPlusPlus lib.
void getThreadStatistics(SystemCore core, pcap_stat &stats)
Definition: PcapFilter.h:72
Definition: SystemUtils.h:32
void getStatistics(pcap_stat &stats)
bool startCaptureMultiThread(OnPfRingPacketsArriveCallback onPacketsArrive, void *onPacketsArriveUserCookie, CoreMask coreMask)
Definition: PointerVector.h:24
Definition: PfRingDevice.h:34
SystemCore getCurrentCoreId()
Definition: PfRingDevice.h:90
uint8_t getTotalNumOfRxChannels()
bool isHwClockEnabledForDevice()
Definition: PfRingDevice.h:125
Definition: PfRingDeviceList.h:20
Definition: MacAddress.h:21
int getMtu()
Definition: PfRingDevice.h:118
int getInterfaceIndex()
Definition: PfRingDevice.h:112
bool isFilterCurrentlySet()
Definition: PfRingDevice.h:94
bool sendPacket(const RawPacket &rawPacket)
int sendPackets(const RawPacket *rawPacketsArr, int arrLength)
bool openMultiRxChannels(const uint8_t *channelIds, int numOfChannelIds)