author | mickeyl <mickeyl> | 2003-03-30 01:51:14 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-03-30 01:51:14 (UTC) |
commit | d11a0154e2d9732854c9a3d598857bc20f359849 (patch) (unidiff) | |
tree | af0e0273d01f4f6c64c9f230f22bb91a7a8a21d8 /noncore/net/wellenreiter/libwellenreiter/source/sniff.hh | |
parent | 99899abc80a8aa05044eeecd8a061b0a8efaa713 (diff) | |
download | opie-d11a0154e2d9732854c9a3d598857bc20f359849.zip opie-d11a0154e2d9732854c9a3d598857bc20f359849.tar.gz opie-d11a0154e2d9732854c9a3d598857bc20f359849.tar.bz2 |
- the network work for libopie2 pays off...
- good bye to wellenreiterd, t'was fun but always too unstable and too hard to maintain
- good bye to libwellenreiter
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.hh | 73 |
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 | |||
16 | extern "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 */ | ||
25 | struct 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 */ | ||
45 | int start_sniffer(const char *device, int cardtype); | ||
46 | int stop_sniffer(const char *device, int cardtype); | ||
47 | void process_packets(const struct pcap_pkthdr* pkthdr,const u_char* packet, char *, int); | ||
48 | int decode_80211b_hdr(const u_char *p,struct packetinfo *ppinfo); | ||
49 | void etheraddr_string(register const u_char *ep,char * text); | ||
50 | int handle_beacon(u_int16_t fc, const u_char *p,struct packetinfo *ppinfo); | ||
51 | int 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 */ | ||