CAPOPTIM - A wireless pcap analyzer and optimizer

What it does:
 - You need pcap file taken from wireless (from aircrack-ng, tcpdump, wireshark, kismet, etc)
 - It shows you a summary of what kind of packets there are. (Sizes do not include pcap header)
 - It can optimize it to eliminate redundant packets
 - Compression level varies. You could expect an average of 50% size reduction.

TECHNICAL INFO
 The idea is to keep a list of packets that appeared before and compare every packet with 
 previous ones. Gotchas:
 - Some fields should not be taken in account when comparing certain kind of packets like:
   o Retry bit (5th bit of 2nd byte) and Frame duration (byte 3 and 4).
   o Sequence number (byte 0x16 and 0x17 of data&mgt frames).
   o Timestamp (byte 0x18-0x20 of beacons and probe responses).
 - While management or control packets can appear repeated at any time, data packets
   tend to repeat in small bursts. You can keep only last 1024 data packets, keeping
   comparing operation quite fast, and hit most repeated packets.

COMPILE
 
 make capoptim
 # or
 gcc -o capoptim capoptim.c

EXAMPLES

 # Analyze a file
 ./capoptim -vv afile.cap 

 # Analyze a file and get stats for optimization
 ./capoptim -vv afile.cap /dev/null

 # Make a cap lose weight
 ./capoptim afile.cap tmp.cap && mv -f tmp.cap afile.cap

See capoptim.c for licensing (GPLv2)
SuD
