Minisniff, a network packet capture tool

Few years ago I wrote a packet capture tool as a support to one of my thesis for a computer master's degree at the University of Corsica.

This tool was aimed at demonstrating some specific techniques and knowledge targeted to network, data structures and multithreading.

Minisniff :

  • is multithreaded by use of Posix threads - one process handles packet capture, another one consumes them
  • provides multithread compliant queue and stack libraries (atomic operations while critical sections that allow several processes to access the same data)
  • demonstrates the use of a binary tree as a representation for reverse Polish notation expressions (for packet filtering)
  • demonstrates simple network packet capture mechanism with user level kernel calls only (no libpcap)

Minisniff is written in C and compiles right out of the box under Linux (tested with CentOS 4.7).

To play with Minisniff :

  • download the source code archive here
  • tar xfz minisniff.tgz
  • cd minisniff
  • cd Release
  • make
  • sudo minisniff -i eth0

-h will give you (very) few hints.
The document that I wrote about this tool is available here (in french language).