Hacker News new | ask | show | jobs
by VinzO 3979 days ago
Anyone knows what are the differences or advantages compared to pcap?
2 comments

This library uses libpcap to capture packets/read them from a pcap file. When you sniff using libpcap you just get a pointer to the packet and the packet size, you then have to parse the packet appropriately to do something useful with it.

What libtins adds is the ability to parse and assemble packets easily. Parsing is automatic, so you won't need to be checking protocol fields to determine how to parse it: it will all be handled by the library.

libpcap does not support WiFi AFAIK (or maybe Winpcap doesn't)....does libtins depend on an underlying driver on Windows for WiFi support? How good is the 802.11 support on Windows?
libpcap does support it. As for Winpcap, I don't know.

Yes, libtins uses libpcap to capture packets (and also to send, if you're using Windows), so basically if winpcap supports it, then it should work on libtins.

Winpcap it seems like does not support capturing raw 802.11 packets and instead presents a pseudo-ethernet interface to the packets captured on WiFi adapters and it only presents the actual ethernet packet to the application using it (not the raw 802.11 packets). To actually capture 802.11, it seems like you need to use 3rd party drivers like Airpcap (which are commercial and it seems like this is a driver/wifi adapter combo). See https://www.winpcap.org/devel.htm....
It is at the bottom of this page:

http://libtins.github.io/benchmark/

I wonder if someone compared it's performance to gopacket

I haven't compared the performance of gopacket. I'll add that to my to-do list!