2 * netlink/route/tc.h Traffic Control
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
9 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
15 #include <netlink/netlink.h>
16 #include <netlink/cache.h>
17 #include <netlink/data.h>
20 * TC statistics identifiers
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 */
36 #define RTNL_TC_STATS_MAX (__RTNL_TC_STATS_MAX - 1)
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);
43 * Number of entries in a transmission time lookup table
46 #define RTNL_TC_RTABLE_SIZE 256
48 extern int rtnl_tc_build_rate_table(uint32_t *, uint8_t, uint8_t, int, int);
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 *);