~ubuntu-branches/debian/sid/kismet/sid

« back to all changes in this revision

Viewing changes to airpcapsource.h

  • Committer: Bazaar Package Importer
  • Author(s): Francois Gurin
  • Date: 2008-07-04 15:36:20 UTC
  • mfrom: (3.1.10 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080704153620-e7ng9ccvd020sdhf
Tags: 2008-05-R1-4
* updated the copyright file 
* changed extra/manuf_update.sh to update the files in /etc/kismet (closes: #416105)
* updated the readme.debian (closes: #416107)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    This file is part of Kismet
 
3
 
 
4
    Kismet is free software; you can redistribute it and/or modify
 
5
    it under the terms of the GNU General Public License as published by
 
6
    the Free Software Foundation; either version 2 of the License, or
 
7
    (at your option) any later version.
 
8
 
 
9
    Kismet is distributed in the hope that it will be useful,
 
10
      but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
    GNU General Public License for more details.
 
13
 
 
14
    You should have received a copy of the GNU General Public License
 
15
    along with Kismet; if not, write to the Free Software
 
16
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
*/
 
18
 
 
19
// pcapsource is probably the most complex source handing the largest number of
 
20
// card types.  Ideally, everything should be part of the pcap source except
 
21
// wsp100 and drones.
 
22
 
 
23
#ifndef __AIRPCAPSOURCE_H__
 
24
#define __AIRPCAPSOURCE_H__
 
25
 
 
26
#include "config.h"
 
27
 
 
28
#if defined(HAVE_LIBPCAP) && defined(HAVE_LIBAIRPCAP) && defined(SYS_CYGWIN)
 
29
 
 
30
#include "pcapsource.h"
 
31
 
 
32
// This is a bad thing to do, but windows.h totally breaks c++ strings,
 
33
// which is also unacceptable.
 
34
 
 
35
extern "C" {
 
36
// Some Windows-specific definitions. They are normally imported by 
 
37
// including windows.h, but we don't do it because of conflicts with the 
 
38
// rest of cygwin
 
39
typedef unsigned int            ULONG, *PULONG;
 
40
typedef int                                     LONG, *PLONG;
 
41
typedef unsigned int            UINT, *PUINT;
 
42
typedef int                                     INT, *PINT;
 
43
typedef int                                     BOOL, *PBOOL;
 
44
typedef unsigned short          USHORT, *PUSHORT;
 
45
typedef short                           SHORT, *PSHORT;
 
46
typedef unsigned char           UCHAR, *PUCHAR;
 
47
typedef signed char                     CHAR, *PCHAR;
 
48
typedef unsigned char           BYTE, *PBYTE;
 
49
typedef void                            VOID, *PVOID;
 
50
typedef void                            *HANDLE;
 
51
 
 
52
#include <airpcap.h>
 
53
}
 
54
 
 
55
#include "cygwin_utils.h"
 
56
 
 
57
class AirPcapSource : public PcapSource {
 
58
public:
 
59
    AirPcapSource(string in_name, string in_dev) : PcapSource(in_name, in_dev) { 
 
60
    }
 
61
        virtual int OpenSource();
 
62
        virtual int FetchPacket(kis_packet *packet, uint8_t *data, uint8_t *moddata);
 
63
        virtual int FetchDescriptor();
 
64
        virtual int SetChannel(unsigned int in_ch, char *in_err);
 
65
 
 
66
protected:
 
67
    virtual int FetchSignalLevels(int *in_siglev, int *in_noiselev);
 
68
        PAirpcapHandle airpcap_handle;
 
69
        HANDLE winpcap_evthandle;
 
70
        Handle2Fd fd_mangle;
 
71
};
 
72
 
 
73
KisPacketSource *airpcapsource_registrant(string in_name, string in_device,
 
74
                                                                                  char *in_err);
 
75
KisPacketSource *airpcapsourceq_registrant(string in_name, string in_device,
 
76
                                                                                   char *in_err);
 
77
int chancontrol_airpcap(const char *in_dev, int in_ch, char *in_err, void *in_ext);
 
78
 
 
79
#endif
 
80
 
 
81
#endif
 
82