DOI: 10.21227/0q2w-4692
title: CRAWDAD tools/process/pcap/Wifipcap

description: A simple C++ wrapper around libpcap for parsing 802.11 frames from the pcap file.A simple C++ wrapper around libpcap that allows applications to selectively demultiplex 802.11 frames, and the most common layer 2 and layer 3 protocols contained within them. Basically, the wifipcap library handles all the parsing of 802.11 frames (and/or layer 2/3 packets) from the pcap file (or stream). wifipcap is now embedded in tcpflow, a TCP/IP session reassembler maintained by Simson Garfinkel.Lastmodified :2009-07-09Dataname :tools/process/pcap/WifipcapFile :wifipcap.tar.gzReleasedate :2008-02-01Change :the initial version.References :klasnja-wifi-privacy
Tool WebsiteWebsite :https://github.com/simsong/tcpflowKeyword :802.11
802.11 frames
RFMON
packet trace
tcpdumpLicense :////////////////////////////////////////////////////////////////////////////////
// Mercury and Colyseus Software Distribution
//
// Copyright (C) 2004-2005 Ashwin Bharambe (ashu@cs.cmu.edu)
//               2004-2005 Jeffrey Pang    (jeffpang@cs.cmu.edu)
//                    2004 Mukesh Agrawal  (mukesh@cs.cmu.edu)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2, or (at
// your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
////////////////////////////////////////////////////////////////////////////////Build :- How to compile wifipcap.

In Linux:
Enter this directory and type:

make

In Windows:
Open wifipcap.sln in Visual Studio and build it.
You will need to have the winpcap include and library files
in the appropriate search paths.Usage :For an overview see wifipcap.h.

(1) Include the header "wifipcap.h" in your application C++ file(s).

(2) Implement a subclass of WifipcapCallbacks. This class has one
member function for each type of 802.11 frame and layer 2/3
packets. Each of these functions will be called as a frame/packet
is parsed.

(3) Create an instance of Wifipcap with either a pcap trace file or
a live device to capture packets from.

(4) Call Wifipcap::Run with your instance of WifipcapCallbacks.

(5) Compile your program linking to libpcap and wifipcap.a.

On Linux:
g++ -o myprogram myprogram.c /path/to/wifipcap.a -lpcap

On Windows:
Link the following libraries:
wpcap.lib ws2_32.lib WINMM.LIB wifipcap.lib

Make sure wifipcap.lib is in the library path.Example :Please see sample.cpp.Algorithm :Most of the code is derived from tcpdump.

Linux: Requires libpcap &gt;= 0.9.4 on Linux.

Windows: Requires WinPcap &gt;= 4.0.2 and AirPcap for 802.11 capture
See: http://www.cacetech.com/support/downloads.htm