8b6f3fc9a076ace347a7ea5e5892446c83afa57a
[librecmc/librecmc.git] / package / libs / libnl-tiny / src / include / linux / gen_stats.h
1 #ifndef __LINUX_GEN_STATS_H
2 #define __LINUX_GEN_STATS_H
3
4 #include <linux/types.h>
5
6 enum {
7         TCA_STATS_UNSPEC,
8         TCA_STATS_BASIC,
9         TCA_STATS_RATE_EST,
10         TCA_STATS_QUEUE,
11         TCA_STATS_APP,
12         TCA_STATS_RATE_EST64,
13         __TCA_STATS_MAX,
14 };
15 #define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
16
17 /**
18  * struct gnet_stats_basic - byte/packet throughput statistics
19  * @bytes: number of seen bytes
20  * @packets: number of seen packets
21  */
22 struct gnet_stats_basic
23 {
24         __u64   bytes;
25         __u32   packets;
26 };
27
28 /**
29  * struct gnet_stats_rate_est - rate estimator
30  * @bps: current byte rate
31  * @pps: current packet rate
32  */
33 struct gnet_stats_rate_est
34 {
35         __u32   bps;
36         __u32   pps;
37 };
38
39 /**
40  * struct gnet_stats_rate_est64 - rate estimator
41  * @bps: current byte rate
42  * @pps: current packet rate
43  */
44 struct gnet_stats_rate_est64
45 {
46         __u64   bps;
47         __u64   pps;
48 };
49
50 /**
51  * struct gnet_stats_queue - queuing statistics
52  * @qlen: queue length
53  * @backlog: backlog size of queue
54  * @drops: number of dropped packets
55  * @requeues: number of requeues
56  * @overlimits: number of enqueues over the limit
57  */
58 struct gnet_stats_queue
59 {
60         __u32   qlen;
61         __u32   backlog;
62         __u32   drops;
63         __u32   requeues;
64         __u32   overlimits;
65 };
66
67 /**
68  * struct gnet_estimator - rate estimator configuration
69  * @interval: sampling period
70  * @ewma_log: the log of measurement window weight
71  */
72 struct gnet_estimator
73 {
74         signed char     interval;
75         unsigned char   ewma_log;
76 };
77
78
79 #endif /* __LINUX_GEN_STATS_H */