Myricom logo

Typedefs | Functions
Packet reflect to netdev (kernel stack)

Typedefs

typedef void * snf_netdev_reflect_t
 

Functions

int snf_netdev_reflect_enable (snf_handle_t hsnf, snf_netdev_reflect_t *handle)
 Enable a network device for packet reflection. More...
 
int snf_netdev_reflect (snf_netdev_reflect_t ref_dev, const void *pkt, uint32_t length)
 Reflect a packet to the network device. More...
 

Detailed Description

Network packets acquired through Sniffer can be reflected back into the kernel path as if the device had initially sent then through to the regular network stack.

While Sniffer users are typically expected to process a significant portion of their packets with less overhead in userspace, this feature is provided as a convenience to allow some packets to be processed back in the kernel. The implementation makes no explicit step to make the kernel-based processing any faster than it is when Sniffer is not being used (in fact, it is probably much slower).

Typedef Documentation

typedef void* snf_netdev_reflect_t

Opaque handle returned by snf_netdev_reflect_enable and used to reflect packets onto by snf_netdev_reflect.

Function Documentation

int snf_netdev_reflect ( snf_netdev_reflect_t  ref_dev,
const void *  pkt,
uint32_t  length 
)

Reflect a packet to the network device.

Parameters
ref_devReflection handle
pktPointer to the packet to be reflected to the network device. The packet must be a pointer to a complete Ethernet frame (without the trailing CRC) and start with a valid Ethernet header.
lengthThe length of the packet, excluding the trailing 4 CRC bytes.
Return values
0Successful. The packet is buffered by SNF.
Postcondition
If succcessful, the packet is completely buffered into the network device receive path.
int snf_netdev_reflect_enable ( snf_handle_t  hsnf,
snf_netdev_reflect_t handle 
)

Enable a network device for packet reflection.

Parameters
hsnfhandle for network device to reflect onto, obtained by snf_open
handleReflection handle.
Return values
0Success. An reflection handle is enabled.
Myricom banner
Wed Jan 26 2022 18:21:06 - SNF 3.0.26.50935