PcapPlusPlus
22.11
|
#include <KniDeviceList.h>
Public Types | |
enum | KniCallbackVersion { CALLBACKS_NEW = 0, CALLBACKS_OLD = 1 } |
enum | KniCallbackType { CALLBACK_MTU, CALLBACK_LINK, CALLBACK_MAC, CALLBACK_PROMISC } |
Public Member Functions | |
bool | isInitialized () |
KniDevice * | createDevice (const KniDevice::KniDeviceConfiguration &config, const size_t mempoolSize) |
Factory method for KNI devices. Newly created device is remembered under portId and name provided in config and can be found later by them. If KNI device is not destroyed explicitly thru KniDeviceList::destroyDevice then it will be destroyed implicitly by the time application exits. More... | |
KniDevice * | getDeviceByPort (const uint16_t portId) |
Returns KNI device with specified portId. More... | |
KniDevice * | getDeviceByName (const std::string &name) |
Returns KNI device with specified name. More... | |
Static Public Member Functions | |
static KniDeviceList & | getInstance () |
Getter for singleton. More... | |
static KniCallbackVersion | callbackVersion () |
static bool | isCallbackSupported (const KniCallbackType cbType) |
A singleton class that encapsulates DPDK KNI module initialization and holds the list of KniDevice instances. As it's a singleton, it has only one active instance doesn't have a public c'tor.
Various callback types supported by KNI device
Enumerator | |
---|---|
CALLBACK_MTU | KniDevice::KniIoctlCallbacks::change_mtu and KniDevice::KniOldIoctlCallbacks::change_mtu callback |
CALLBACK_LINK | KniDevice::KniIoctlCallbacks::config_network_if and KniDevice::KniOldIoctlCallbacks::config_network_if callback |
CALLBACK_MAC | |
CALLBACK_PROMISC |
Callback related constants for KNI device
Enumerator | |
---|---|
CALLBACKS_NEW | Reports that DPDK supports only KniDevice::KniIoctlCallbacks callback structure |
CALLBACKS_OLD | Reports that DPDK supports only KniDevice::KniOldIoctlCallbacks callback structure |
|
static |
Returns KniCallbackVersion::CALLBACKS_NEW or KniCallbackVersion::CALLBACKS_OLD based on DPDK version used
KniDevice* pcpp::KniDeviceList::createDevice | ( | const KniDevice::KniDeviceConfiguration & | config, |
const size_t | mempoolSize | ||
) |
Factory method for KNI devices. Newly created device is remembered under portId and name provided in config and can be found later by them. If KNI device is not destroyed explicitly thru KniDeviceList::destroyDevice then it will be destroyed implicitly by the time application exits.
[in] | config | KNI device configuration structure |
[in] | mempoolSize | Size of packet mempool used by this device |
KniDevice* pcpp::KniDeviceList::getDeviceByName | ( | const std::string & | name | ) |
Returns KNI device with specified name.
[in] | name | Name of KNI device to find |
KniDevice* pcpp::KniDeviceList::getDeviceByPort | ( | const uint16_t | portId | ) |
Returns KNI device with specified portId.
[in] | portId | ID of KNI device to find |
|
static |
Getter for singleton.
|
static |
Returns true if provided callback type is supported by used DPDK version
[in] | cbType | One of KniCallbackType enum values |
|
inline |