oops
[libnl.git] / include / netlink / route / tc.h
1 /*
2  * netlink/route/tc.h           Traffic Control
3  *
4  *      This library is free software; you can redistribute it and/or
5  *      modify it under the terms of the GNU Lesser General Public
6  *      License as published by the Free Software Foundation version 2.1
7  *      of the License.
8  *
9  * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
10  */
11
12 #ifndef NETLINK_TC_H_
13 #define NETLINK_TC_H_
14
15 #include <netlink/netlink.h>
16 #include <netlink/cache.h>
17 #include <netlink/data.h>
18
19 /**
20  * TC statistics identifiers
21  * @ingroup tc
22  */
23 enum rtnl_tc_stats_id {
24         RTNL_TC_PACKETS,        /**< Packets seen */
25         RTNL_TC_BYTES,          /**< Bytes seen */
26         RTNL_TC_RATE_BPS,       /**< Current bits/s (rate estimator) */
27         RTNL_TC_RATE_PPS,       /**< Current packet/s (rate estimator) */
28         RTNL_TC_QLEN,           /**< Queue length */
29         RTNL_TC_BACKLOG,        /**< Backlog length */
30         RTNL_TC_DROPS,          /**< Packets dropped */
31         RTNL_TC_REQUEUES,       /**< Number of requeues */
32         RTNL_TC_OVERLIMITS,     /**< Number of overlimits */
33         __RTNL_TC_STATS_MAX,
34 };
35
36 #define RTNL_TC_STATS_MAX (__RTNL_TC_STATS_MAX - 1)
37
38 extern int rtnl_tc_calc_txtime(int, int);
39 extern int rtnl_tc_calc_bufsize(int, int);
40 extern int rtnl_tc_calc_cell_log(int);
41
42 /**
43  * Number of entries in a transmission time lookup table
44  * @ingroup tc
45  */
46 #define RTNL_TC_RTABLE_SIZE     256
47
48 extern int rtnl_tc_build_rate_table(uint32_t *, uint8_t, uint8_t, int, int);
49
50
51 /* TC Handle Translations */
52 extern char *           rtnl_tc_handle2str(uint32_t, char *, size_t);
53 extern int              rtnl_tc_str2handle(const char *, uint32_t *);
54
55 #endif