PREREQS

First, you need a driver for your Wi-Fi NIC that support monitor mode. It suppose to return frames in wlan_ng format. For example acx100 does that. There is one bug in acx100 driver - it returns nose in signal field and vise versa. Change idma.c file to fix it.

Second, you need to dowload and install libpcap.

And third, you lickly need wireless tools to configure your NIC and put it in monitor mode.


COMPILATION

Edit INCLUDE and SNIF_LIBS in makefile to point to correct libpcap locations.
Run make.


RUN

Load you NIC driver (insmod acx100_pci.o debug=0x01 firmware_dir=/lib/modules/acx100_frmwe for example).

Config you wireless parameters (iwconfig wlan0 cannel 6 etc.).

Bring up you interface (ifconfig wlan0 192.168.0.10 f.e).

Put your NIC in monitor mode (iwpriv wlan0 1 6).

1.
Run sniffer <interface> <timeout> < <infile> > <outfile>, where <timeout> is the time the sniffer exits after, <infile> is the saved <outfile> from previous run or just empty file for the first run, <outfile> is the file where sniffed Wi-Fi nodes will be printed out.

2.
Manually edit <outfile> from 1 to set coordinates of receivers or/and trasmitters or distance between them for calibration and type of the record. Initial type of all new records is 0x1. Record with known receiver coordinates will hav type 0x9, transmitter coordinates - 0x5, radius - 0x3, receiver and transmitter coordinates - 0xd. Last 2 types are for calibration records.

3. 
Run calibrate < <infile> > <outfile>. It will calculate and update parameters of attenuatinon function, approximated by calibration data, type will be updated also. Type for the calibrated record will be incremented by 0x10 and for records with calculated distance - 0x80.

4.
Run triangulate < <infile> > <outfile>. It will try to triangulate location of all receivers and transmitters if data for the triangulation are available. Type of the record with calculated transmitter locations will be incremented by 0x4 and for receiver locations by 0x8.