summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/libwellenreiter/source/sniff.hh
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter/source/sniff.hh') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/libwellenreiter/source/sniff.hh73
1 files changed, 0 insertions, 73 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/sniff.hh b/noncore/net/wellenreiter/libwellenreiter/source/sniff.hh
deleted file mode 100644
index a4cf4b7..0000000
--- a/noncore/net/wellenreiter/libwellenreiter/source/sniff.hh
+++ b/dev/null
@@ -1,73 +0,0 @@
1/* $Id$ */
2
3#ifndef SNIFF_HH
4#define SNIFF_HH
5
6#include <string.h>
7#include <stdio.h>
8#include <stdlib.h>
9#include <errno.h>
10#include <sys/types.h>
11#include <sys/time.h>
12#include <sys/socket.h>
13#include <netinet/in.h>
14#include <arpa/inet.h>
15
16extern "C"
17{
18#include <net/bpf.h>
19#include <pcap.h>
20}
21
22#define NONBROADCASTING "non-broadcasting"
23
24/* holds all the interresting data */
25struct packetinfo
26{
27 int isvalid;
28 int pktlen;
29 int fctype;
30 int fcsubtype;
31 int fc_wep;
32 int cap_WEP;
33 int cap_IBSS;
34 int cap_ESS;
35 int channel;
36 char bssid[sizeof("00:00:00:00:00:00") + 1];
37 char desthwaddr[sizeof("00:00:00:00:00:00") + 1];
38 char sndhwaddr[sizeof("00:00:00:00:00:00") + 1];
39 char ssid[128];
40 int ssid_len;
41};
42
43/* Function definitions */
44/* Used for stoping and starting the sniffer process */
45int start_sniffer(const char *device, int cardtype);
46int stop_sniffer(const char *device, int cardtype);
47void process_packets(const struct pcap_pkthdr* pkthdr,const u_char* packet, char *, int);
48int decode_80211b_hdr(const u_char *p,struct packetinfo *ppinfo);
49void etheraddr_string(register const u_char *ep,char * text);
50int handle_beacon(u_int16_t fc, const u_char *p,struct packetinfo *ppinfo);
51int GetHeaderLength(u_int16_t fc);
52
53/*
54 * True if "l" bytes of "var" were captured.
55 *
56 * The "snapend - (l) <= snapend" checks to make sure "l" isn't so large
57 * that "snapend - (l)" underflows.
58 *
59 * The check is for <= rather than < because "l" might be 0.
60 */
61#define TTEST2(var, l) (snapend - (l) <= snapend && \
62 (const u_char *)&(var) <= snapend - (l))
63
64/* True if "var" was captured */
65#define TTEST(var) TTEST2(var, sizeof(var))
66
67/* Bail if "l" bytes of "var" were not captured */
68#define TCHECK2(var, l) if (!TTEST2(var, l)) goto trunc
69
70/* Bail if "var" was not captured */
71#define TCHECK(var) TCHECK2(var, sizeof(var))
72
73#endif /* SNIFF_HH */