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).
Reflect a packet to the network device.
- Parameters
-
ref_dev | Reflection handle |
pkt | Pointer 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. |
length | The length of the packet, excluding the trailing 4 CRC bytes. |
- Return values
-
0 | Successful. The packet is buffered by SNF. |
- Postcondition
- If succcessful, the packet is completely buffered into the network device receive path.
Enable a network device for packet reflection.
- Parameters
-
hsnf | handle for network device to reflect onto, obtained by snf_open |
handle | Reflection handle. |
- Return values
-
0 | Success. An reflection handle is enabled. |