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>
24 * TC statistics identifiers
27 enum rtnl_tc_stats_id {
28 RTNL_TC_PACKETS, /**< Packets seen */
29 RTNL_TC_BYTES, /**< Bytes seen */
30 RTNL_TC_RATE_BPS, /**< Current bits/s (rate estimator) */
31 RTNL_TC_RATE_PPS, /**< Current packet/s (rate estimator) */
32 RTNL_TC_QLEN, /**< Queue length */
33 RTNL_TC_BACKLOG, /**< Backlog length */
34 RTNL_TC_DROPS, /**< Packets dropped */
35 RTNL_TC_REQUEUES, /**< Number of requeues */
36 RTNL_TC_OVERLIMITS, /**< Number of overlimits */
40 #define RTNL_TC_STATS_MAX (__RTNL_TC_STATS_MAX - 1)
42 extern int rtnl_tc_calc_txtime(int, int);
43 extern int rtnl_tc_calc_bufsize(int, int);
44 extern int rtnl_tc_calc_cell_log(int);
47 * Number of entries in a transmission time lookup table
50 #define RTNL_TC_RTABLE_SIZE 256
52 extern int rtnl_tc_build_rate_table(uint32_t *, uint8_t, uint8_t, int, int);
55 /* TC Handle Translations */
56 extern char * rtnl_tc_handle2str(uint32_t, char *, size_t);
57 extern int rtnl_tc_str2handle(const char *, uint32_t *);