This is a simple example of a low-level script that uses the Snabb Switch 82599 10G ethernet device driver directly to feed packets into a C function provided as a shared library. Written for a discussion with Pavel Odintsov.
Here is now to run it:
- Compile snabbswitch to get
snabbexecutable. - Compile a C callback function to a shared library e.g.
capturecallback.cbelow. - Run:
sudo ./snabb snsh capture2c <pciaddress> <filename.so>
The output should look something like this: