PcapPlusPlus  22.05
pcpp::KniDevice::KniIoctlCallbacks Struct Reference

New callbacks for KNI device events. This structure MUST be used ONLY when KniDeviceList::callbackVersion returns KniDeviceList::KniCallbackVersion::CALLBACKS_NEW. Or if You are sure that DPDK version used is 17.11 or higher. If some callback is not provided (NULL) the request will always succeeds if other is not specified in callback description. More...

#include <KniDevice.h>

Public Attributes

int(* change_mtu )(uint16_t port_id, unsigned int new_mtu)
 
int(* config_network_if )(uint16_t port_id, uint8_t if_up)
 
int(* config_mac_address )(uint16_t port_id, uint8_t mac_addr[])
 
int(* config_promiscusity )(uint16_t port_id, uint8_t to_on)
 

Detailed Description

New callbacks for KNI device events. This structure MUST be used ONLY when KniDeviceList::callbackVersion returns KniDeviceList::KniCallbackVersion::CALLBACKS_NEW. Or if You are sure that DPDK version used is 17.11 or higher. If some callback is not provided (NULL) the request will always succeeds if other is not specified in callback description.

Note
This callbacks are direct copy of one defined in rte_kni_ops. Future maintainers of KNI device feature MUST refer to rte_kni_ops structure in rte_kni.h header file of DPDK to track the difference in signatures

Member Data Documentation

◆ change_mtu

int(* pcpp::KniDevice::KniIoctlCallbacks::change_mtu) (uint16_t port_id, unsigned int new_mtu)

Pointer to function of changing MTU. Must return 0 in case of success or negative error code

◆ config_mac_address

int(* pcpp::KniDevice::KniIoctlCallbacks::config_mac_address) (uint16_t port_id, uint8_t mac_addr[])

Pointer to function of configuring mac address. If callback is not provided and port_id of KNI device is not UINT16_MAX then DPDK will use predefined callback witch sets MAC address of DPDK port port_id via rte_eth_dev_default_mac_addr_set. Must return 0 in case of success or negative error code

◆ config_network_if

int(* pcpp::KniDevice::KniIoctlCallbacks::config_network_if) (uint16_t port_id, uint8_t if_up)

Pointer to function of configuring network interface. Must return 0 in case of success or negative error code

◆ config_promiscusity

int(* pcpp::KniDevice::KniIoctlCallbacks::config_promiscusity) (uint16_t port_id, uint8_t to_on)

Pointer to function of configuring promiscuous mode. If callback is not provided and port_id of KNI device is not UINT16_MAX then DPDK will use predefined callback witch sets promiscuous mode of DPDK port port_id via rte_eth_promiscuous_enable/rte_eth_promiscuous_disable. Must return 0 in case of success or negative error code