Have any of you implemented a program that captures packets using an AF_PACKET socket rather than using libpcap?
I want to write something to compile statically and run on embedded devices. libpcap is a bit big.
Have any of you implemented a program that captures packets using an AF_PACKET socket rather than using libpcap?
I want to write something to compile statically and run on embedded devices. libpcap is a bit big.
I've already figured out how to generate BPF program structures directly and bind them to the socket, which is the really annoying bit, and the packets per second will be low enough that I don't need a ring buffer or anything fancy.
@ryanc massscan may be useful reference code:
@ryanc just recvmsg should work, no?
@tychotithonus It does not appear to use AF_PACKET sockets.
@ryanc Erk - sorry!
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.