yes using raw sockets to capture packets works fine in Linux... but
not on BSDs. that is... unless you are throwing around the term "raw
socket" to mean "whatever capture method is available such as the BSD
BPF etc.".
gopacket can use libpcap... but i don't see any reason to use libpcap
since gopacket also supports other packet capture methods that are
much faster and safer (without linking to an old C library)... such as
AF_PACKET which is Linux only. And if you want to capture packets on a
BSD system then gopacket supports BPF. I've tested it on OpenBSD,
NetBSD and FreeBSD.
if you do care about having super duper performance then you must
write your go library that uses faster capture methods such as netmap
or DPDK; oh but then you have memory safety issues with DPDK. Do you
want it fast, safe or correct?
You might be able to have all three properties;
Safe, Correct, and Fast Low-Level Networking by Robert Clipsham
http://octarineparrot.com/assets/msci_paper.pdf
Cheers,
David
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
golang-nuts...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.