PcapPlusPlus  19.12
KniDeviceList.h
1 #ifndef PCAPPP_KNI_DEVICE_LIST
2 #define PCAPPP_KNI_DEVICE_LIST
3 
4 #include <vector>
5 
6 #include "KniDevice.h"
7 #include "DpdkDeviceList.h"
8 
13 namespace pcpp
14 {
15 
23  {
24  KniDeviceList();
25 
38  void destroyDevice(KniDevice* kniDevice);
39  public:
44  {
49  };
54  {
63  };
64 
65  ~KniDeviceList();
66 
72  static KniDeviceList& getInstance();
73 
77  inline bool isInitialized() { return m_Initialized; }
78 
79  /* Device manipulation */
80 
91  KniDevice* createDevice(const KniDevice::KniDeviceConfiguration& config, const size_t mempoolSize);
98  KniDevice* getDeviceByPort(const uint16_t portId);
105  KniDevice* getDeviceByName(const std::string& name);
106 
107  /* Static information */
108 
120  static bool isCallbackSupported(const KniCallbackType cbType);
121  private:
122  std::vector<KniDevice*> m_Devices;
123  bool m_Initialized;
124  int m_KniUniqueId;
125  };
126 } // namespace pcpp
127 #endif /* PCAPPP_KNI_DEVICE_LIST */
pcpp::KniDeviceList::isCallbackSupported
static bool isCallbackSupported(const KniCallbackType cbType)
pcpp::KniDeviceList::CALLBACK_MAC
Definition: KniDeviceList.h:60
pcpp::KniDevice::KniDeviceConfiguration
KNI device initialization data. Used to create new KNI device. Usage of callbacks member or oldCallba...
Definition: KniDevice.h:228
pcpp::KniDeviceList::getDeviceByName
KniDevice * getDeviceByName(const std::string &name)
Returns KNI device with specified name.
pcpp::KniDeviceList::createDevice
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 ...
pcpp::KniDeviceList::CALLBACK_MTU
Definition: KniDeviceList.h:56
pcpp::KniDevice
Definition: KniDevice.h:120
pcpp::KniDeviceList::CALLBACKS_OLD
Definition: KniDeviceList.h:48
pcpp::KniDeviceList::isInitialized
bool isInitialized()
Definition: KniDeviceList.h:77
pcpp::KniDeviceList::KniCallbackType
KniCallbackType
Definition: KniDeviceList.h:53
pcpp::KniDeviceList
Definition: KniDeviceList.h:22
pcpp::KniDeviceList::getInstance
static KniDeviceList & getInstance()
Getter for singleton.
pcpp::KniDeviceList::callbackVersion
static KniCallbackVersion callbackVersion()
pcpp
The main namespace for the PcapPlusPlus lib.
pcpp::KniDeviceList::CALLBACK_LINK
Definition: KniDeviceList.h:58
KniDevice.h
This file and KniDeviceList.h provide PcapPlusPlus C++ wrapper for DPDK KNI (Kernel Network Interace)...
pcpp::KniDeviceList::CALLBACKS_NEW
Definition: KniDeviceList.h:46
pcpp::KniDeviceList::KniCallbackVersion
KniCallbackVersion
Definition: KniDeviceList.h:43
pcpp::KniDeviceList::getDeviceByPort
KniDevice * getDeviceByPort(const uint16_t portId)
Returns KNI device with specified portId.
pcpp::KniDeviceList::CALLBACK_PROMISC
Definition: KniDeviceList.h:62
DpdkDeviceList.h