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