packetsource_ipwlive.h 2.68 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
/*
    This file is part of Kismet

    Kismet 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 of the License, or
    (at your option) any later version.

    Kismet 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 Kismet; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

/*
 * WEXT is the linux wireless extensions tools subset of pcap capture devices.
 * Anything controlled by the standard wireless extensions will live here.
 */

#ifndef __PACKETSOURCE_IPWLIVE_H__
#define __PACKETSOURCE_IPWLIVE_H__

#include "config.h"

#if (defined(HAVE_LIBPCAP) && defined(SYS_LINUX) && defined(HAVE_LINUX_WIRELESS))

#include "packet.h"
#include "packet_ieee80211.h"
#include "packetsource.h"
#include "packetsource_pcap.h"
#include "ifcontrol.h"
#include "iwcontrol.h"

#ifdef HAVE_LINUX_SYS_RADIOTAP
#include <net/ieee80211_radiotap.h>
#endif

#ifdef HAVE_LOCALRADIOTAP
#include "local_ieee80211_radiotap.h"
#endif

#define USE_PACKETSOURCE_IPWLIVE

// Another pcap variant: ipwlivetap, for doing rfmon+managed
// For ipw2200 and ipw3945
class PacketSource_Ipwlive : public PacketSource_Pcap {
public:
	// HANDLED PACKET SOURCES:
	// ipwlivetap
	PacketSource_Ipwlive() {
		fprintf(stderr, "FATAL OOPS:  Packetsource_Ipwlive() called\n");
		exit(1);
	}

	PacketSource_Ipwlive(GlobalRegistry *in_globalreg) :
		PacketSource_Pcap(in_globalreg) {
	}

	virtual KisPacketSource *CreateSource(GlobalRegistry *in_globalreg, 
										  string in_interface,
										  vector<opt_pair> *in_opts) {
		return new PacketSource_Ipwlive(in_globalreg, in_interface, in_opts);
	}

	virtual int AutotypeProbe(string in_device);
	virtual int RegisterSources(Packetsourcetracker *tracker);

	PacketSource_Ipwlive(GlobalRegistry *in_globalreg, string in_interface,
						 vector<opt_pair> *in_opts) :
		PacketSource_Pcap(in_globalreg, in_interface, in_opts) { 
			// foo
		}
	virtual ~PacketSource_Ipwlive() { }

	// Should be, something can override if it needs
	virtual int FetchChannelCapable() { return 0; }

	// Generic-level functions
	virtual int EnableMonitor();
	virtual int DisableMonitor();
	virtual int SetChannel(unsigned int in_ch);
	virtual int FetchChannel();

protected:
	virtual void FetchRadioData(kis_packet *in_packet) { };
};	


#endif /* have_libpcap && sys_linux */

#endif