author | mjm <mjm> | 2002-11-27 22:06:43 (UTC) |
---|---|---|
committer | mjm <mjm> | 2002-11-27 22:06:43 (UTC) |
commit | 31a16f8dc73d79178a4840d9e7aa4a07bfd65a26 (patch) (unidiff) | |
tree | 25ca113de74febde5d72a46d09315bd9d329ef8f /noncore/net/wellenreiter/daemon/source/sniffer.hh | |
parent | 2a84b561e50f8fd7973b56b3b0a87471f6b5f18c (diff) | |
download | opie-31a16f8dc73d79178a4840d9e7aa4a07bfd65a26.zip opie-31a16f8dc73d79178a4840d9e7aa4a07bfd65a26.tar.gz opie-31a16f8dc73d79178a4840d9e7aa4a07bfd65a26.tar.bz2 |
moved cardmode and sniffer to library to provide a generic lib.
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.hh | 64 |
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 */ | ||
19 | struct 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 | |||
37 | void process_packets(u_char *useless,const struct pcap_pkthdr* pkthdr,const u_char* packet); | ||
38 | int decode_80211b_hdr(const u_char *p,struct packetinfo *ppinfo); | ||
39 | void etheraddr_string(register const u_char *ep,char * text); | ||
40 | int handle_beacon(u_int16_t fc, const u_char *p,struct packetinfo *ppinfo); | ||
41 | |||
42 | int 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 */ | ||