X-Git-Url: http://git.onelab.eu/?p=libnl.git;a=blobdiff_plain;f=include%2Fnetlink%2Froute%2Ftc.h;fp=include%2Fnetlink%2Froute%2Ftc.h;h=3834c55e9dc723b33d8088ed04d6332345907135;hp=0000000000000000000000000000000000000000;hb=4cee2ecb3b8afa0637e6f5fe4c57985a4bc740ff;hpb=2df2fbe518d5a221ce6e3ee88a3fb23fb1b94b27 diff --git a/include/netlink/route/tc.h b/include/netlink/route/tc.h new file mode 100644 index 0000000..3834c55 --- /dev/null +++ b/include/netlink/route/tc.h @@ -0,0 +1,55 @@ +/* + * netlink/route/tc.h Traffic Control + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version 2.1 + * of the License. + * + * Copyright (c) 2003-2006 Thomas Graf + */ + +#ifndef NETLINK_TC_H_ +#define NETLINK_TC_H_ + +#include +#include +#include + +/** + * TC statistics identifiers + * @ingroup tc + */ +enum rtnl_tc_stats_id { + RTNL_TC_PACKETS, /**< Packets seen */ + RTNL_TC_BYTES, /**< Bytes seen */ + RTNL_TC_RATE_BPS, /**< Current bits/s (rate estimator) */ + RTNL_TC_RATE_PPS, /**< Current packet/s (rate estimator) */ + RTNL_TC_QLEN, /**< Queue length */ + RTNL_TC_BACKLOG, /**< Backlog length */ + RTNL_TC_DROPS, /**< Packets dropped */ + RTNL_TC_REQUEUES, /**< Number of requeues */ + RTNL_TC_OVERLIMITS, /**< Number of overlimits */ + __RTNL_TC_STATS_MAX, +}; + +#define RTNL_TC_STATS_MAX (__RTNL_TC_STATS_MAX - 1) + +extern int rtnl_tc_calc_txtime(int, int); +extern int rtnl_tc_calc_bufsize(int, int); +extern int rtnl_tc_calc_cell_log(int); + +/** + * Number of entries in a transmission time lookup table + * @ingroup tc + */ +#define RTNL_TC_RTABLE_SIZE 256 + +extern int rtnl_tc_build_rate_table(uint32_t *, uint8_t, uint8_t, int, int); + + +/* TC Handle Translations */ +extern char * rtnl_tc_handle2str(uint32_t, char *, size_t); +extern int rtnl_tc_str2handle(const char *, uint32_t *); + +#endif