summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/daemon/source/sniffer.hh
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/daemon/source/sniffer.hh') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/daemon/source/sniffer.hh8
1 files changed, 1 insertions, 7 deletions
diff --git a/noncore/net/wellenreiter/daemon/source/sniffer.hh b/noncore/net/wellenreiter/daemon/source/sniffer.hh
index d262353..7e1e3be 100644
--- a/noncore/net/wellenreiter/daemon/source/sniffer.hh
+++ b/noncore/net/wellenreiter/daemon/source/sniffer.hh
@@ -10,16 +10,14 @@
10#include <errno.h> 10#include <errno.h>
11#include <sys/socket.h> 11#include <sys/socket.h>
12#include <netinet/in.h> 12#include <netinet/in.h>
13#include <arpa/inet.h> 13#include <arpa/inet.h>
14#include <net/bpf.h> 14#include <net/bpf.h>
15 15
16
17#define NONBROADCASTING "non-broadcasting" 16#define NONBROADCASTING "non-broadcasting"
18 17
19
20/* holds all the interresting data */ 18/* holds all the interresting data */
21struct packetinfo 19struct packetinfo
22{ 20{
23 int isvalid; 21 int isvalid;
24 int pktlen; 22 int pktlen;
25 int fctype; 23 int fctype;
@@ -33,22 +31,18 @@ struct packetinfo
33 char desthwaddr[sizeof("00:00:00:00:00:00")]; 31 char desthwaddr[sizeof("00:00:00:00:00:00")];
34 char sndhwaddr[sizeof("00:00:00:00:00:00")]; 32 char sndhwaddr[sizeof("00:00:00:00:00:00")];
35 char *ssid; 33 char *ssid;
36 int ssid_len; 34 int ssid_len;
37}; 35};
38 36
39
40/* Prototypes */
41int sniffer(void);
42int start_sniffing (char * device);
43void process_packets(u_char *useless,const struct pcap_pkthdr* pkthdr,const u_char* packet); 37void process_packets(u_char *useless,const struct pcap_pkthdr* pkthdr,const u_char* packet);
44int decode_80211b_hdr(const u_char *p,struct packetinfo *ppinfo); 38int decode_80211b_hdr(const u_char *p,struct packetinfo *ppinfo);
45void etheraddr_string(register const u_char *ep,char * text); 39void etheraddr_string(register const u_char *ep,char * text);
46int handle_beacon(u_int16_t fc, const u_char *p,struct packetinfo *ppinfo); 40int handle_beacon(u_int16_t fc, const u_char *p,struct packetinfo *ppinfo);
47 41
48static int GetHeaderLength(u_int16_t fc); 42int GetHeaderLength(u_int16_t fc);
49 43
50/* 44/*
51 * True if "l" bytes of "var" were captured. 45 * True if "l" bytes of "var" were captured.
52 * 46 *
53 * The "snapend - (l) <= snapend" checks to make sure "l" isn't so large 47 * The "snapend - (l) <= snapend" checks to make sure "l" isn't so large
54 * that "snapend - (l)" underflows. 48 * that "snapend - (l)" underflows.