Slightly off topic, but as part of a recent job recruitment process I wrote my 
own libpcap-like packet processor and in benchmarking it I noticed it was about 
6x faster than the actual libpcap which uses a bunch of expensive callbacks via 
function pointers internally. It's also pretty easy in Nim to define some 
`object` s with bitfields and do swapping as needed from network to host byte 
order, and might be surprisingly few lines of code. You can still use `tcpdump 
-w file` to capture data. Just pointing out there may be less value in libpcap 
vs writing it yourself than you might think at first glance.

Reply via email to