-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathstats.h
67 lines (55 loc) · 1.14 KB
/
stats.h
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
#ifndef STATS_H
#define STATS_H
#include <string>
#include <map>
/* Default stats interval */
#define DEFAULT_INTERVAL 300
/* Fields identifiers */
#define TRAFFIC_ID 1
#define PACKETS_ID 2
#define PROTOCOL_ID 4
/* Number of groups and fields per groups */
#define GROUPS 3
#define PROTOCOLS_PER_GROUP 5
/* Statistics groups */
enum st_group {
FLOWS,
PACKETS,
TRAFFIC,
};
/* Statistics protocols */
enum st_protocol {
TOTAL,
TCP,
UDP,
ICMP,
OTHER
};
/* IPFIX protocol identifiers*/
enum ipfix_groups {
IG_ICMP = 1,
IG_TCP = 6,
IG_UDP = 17,
IG_ICMPv6 = 58,
};
/**
* Stats data per ODID
*/
struct stats_data {
uint64_t last; /**< Time of last update */
std::string file; /**< Path to RRD file */
uint64_t fields[GROUPS][PROTOCOLS_PER_GROUP]; /**< Stats fields per group */
};
/**
* \struct plugin_conf
*
* Plugin configuration
*/
struct plugin_conf {
std::string path; /**< Path to RRD files */
uint32_t interval; /**< Statistics interval */
void *ip_config; /**< intermediate process config */
std::string templ; /**< RRD template */
std::map<uint32_t, stats_data*> stats; /**< RRD stats per ODID */
};
#endif // STATS_H