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 bool getIsHwClockEnable() { setPfRingDeviceAttributes();
return m_HwClockEnabled; }
70 bool setPfRingDeviceClock(pfring* ring);
72 void clearCoreConfiguration();
73 int getCoresInUseCount()
const;
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);
The main namespace for the PcapPlusPlus lib.
std::string getDeviceName() const
Definition: PfRingDevice.h:141
ChannelDistribution
Definition: PfRingDevice.h:83
uint64_t drop
Definition: PfRingDevice.h:104
Definition: SystemUtils.h:27
bool setFilter(std::string filterAsString)
Definition: PointerVector.h:24
Definition: RawPacket.h:252
Definition: PfRingDeviceList.h:20
void getStatistics(PfRingStats &stats) const
Definition: PfRingDevice.h:32
SystemCore getCurrentCoreId() const
uint64_t recv
Definition: PfRingDevice.h:102
Definition: PfRingDevice.h:92
void getThreadStatistics(SystemCore core, PfRingStats &stats) const
bool startCaptureMultiThread(OnPfRingPacketsArriveCallback onPacketsArrive, void *onPacketsArriveUserCookie, CoreMask coreMask)
Definition: PfRingDevice.h:99
void getCurrentThreadStatistics(PfRingStats &stats) const
int getMtu()
Definition: PfRingDevice.h:128
uint8_t getNumOfOpenedRxChannels() const
Definition: PfRingDevice.h:208
int sendPackets(const RawPacket *rawPacketsArr, int arrLength)
bool isFilterCurrentlySet() const
MacAddress getMacAddress()
Definition: PfRingDevice.h:116
int getInterfaceIndex()
Definition: PfRingDevice.h:122
bool startCaptureSingleThread(OnPfRingPacketsArriveCallback onPacketsArrive, void *onPacketsArriveUserCookie)
uint8_t getTotalNumOfRxChannels() const
bool sendPacket(const RawPacket &rawPacket)
Definition: PfRingDevice.h:88
virtual bool setFilter(GeneralFilter &filter)
Definition: Device.h:76
Definition: MacAddress.h:27
bool isHwClockEnabledForDevice()
Definition: PfRingDevice.h:135
bool openMultiRxChannels(const uint8_t *channelIds, int numOfChannelIds)