-
Notifications
You must be signed in to change notification settings - Fork 82
/
rxstats.hh
79 lines (54 loc) · 1.33 KB
/
rxstats.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
#ifndef CLICK_RXSTATS_HH
#define CLICK_RXSTATS_HH
#include <click/element.hh>
#include <click/etheraddress.hh>
#include <click/bighashmap.hh>
#include <click/glue.hh>
CLICK_DECLS
/*
=c
RXStats
=s Wifi
Track RSSI for each ethernet source.
=d
Accumulate RSSI, noise for each ethernet source you hear a packet from.
=h stats
Print information accumulated for each source
=h reset
Clear all information for each source
=a ExtraDecap
*/
class RXStats : public Element { public:
RXStats() CLICK_COLD;
~RXStats() CLICK_COLD;
const char *class_name() const override { return "RXStats"; }
const char *port_count() const override { return PORTS_1_1; }
const char *processing() const override { return AGNOSTIC; }
Packet *simple_action(Packet *);
void add_handlers() CLICK_COLD;
class DstInfo {
public:
EtherAddress _eth;
int _rate;
int _noise;
int _signal;
int _packets;
unsigned _sum_signal;
unsigned _sum_noise;
Timestamp _last_received;
DstInfo() {
memset(this, 0, sizeof(*this));
}
DstInfo(EtherAddress eth) {
memset(this, 0, sizeof(*this));
_eth = eth;
}
};
typedef HashMap<EtherAddress, DstInfo> NeighborTable;
typedef NeighborTable::const_iterator NIter;
NeighborTable _neighbors;
EtherAddress _bcast;
int _tau;
};
CLICK_ENDDECLS
#endif