-
Notifications
You must be signed in to change notification settings - Fork 82
/
beaconscanner.hh
94 lines (66 loc) · 1.87 KB
/
beaconscanner.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef CLICK_BEACONSCANNER_HH
#define CLICK_BEACONSCANNER_HH
#include <click/element.hh>
#include <clicknet/ether.h>
#include <click/etheraddress.hh>
#include <elements/wifi/availablerates.hh>
#include <elements/wifi/wirelessinfo.hh>
CLICK_DECLS
/*
=c
BeaconScanner
=s Wifi, Wireless Station
Listens for 802.11 beacons and sends probe requests.
=d
=h scan read only
Statistics about access points that the element has received beacons from.
=h reset read/write
Clear the list of access points.
=h channel
If the channel is greater than 0, it will only record statistics for
beacons received with that channel in the packet.
If channel is 0, it will record statistics for all beacons received.
If channel is less than 0, it will discard all beaconds
=e
FromDevice(ath0)
-> Prism2Decap()
-> ExtraDecap()
-> Classifier(0/80%f0) // only beacon packets
-> bs :: BeaconScanner()
-> Discard;
=a
EtherEncap */
class BeaconScanner : public Element { public:
BeaconScanner() CLICK_COLD;
~BeaconScanner() CLICK_COLD;
const char *class_name() const override { return "BeaconScanner"; }
const char *port_count() const override { return PORTS_1_1; }
const char *processing() const override { return AGNOSTIC; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
bool can_live_reconfigure() const { return true; }
Packet *simple_action(Packet *);
void add_handlers() CLICK_COLD;
void reset();
bool _debug;
String scan_string();
private:
class wap {
public:
EtherAddress _eth;
String _ssid;
int _channel;
uint16_t _capability;
uint16_t _beacon_int;
Vector<int> _rates;
Vector<int> _basic_rates;
int _rssi;
Timestamp _last_rx;
};
typedef HashMap<EtherAddress, wap> APTable;
typedef APTable::const_iterator APIter;
APTable _waps;
AvailableRates *_rtable;
WirelessInfo *_winfo;
};
CLICK_ENDDECLS
#endif