libnl 1.1
|
00001 /* 00002 * netlink/route/tc.h Traffic Control 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation version 2.1 00007 * of the License. 00008 * 00009 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> 00010 */ 00011 00012 #ifndef NETLINK_TC_H_ 00013 #define NETLINK_TC_H_ 00014 00015 #include <netlink/netlink.h> 00016 #include <netlink/cache.h> 00017 #include <netlink/data.h> 00018 00019 #ifdef __cplusplus 00020 extern "C" { 00021 #endif 00022 00023 /** 00024 * TC statistics identifiers 00025 * @ingroup tc 00026 */ 00027 enum rtnl_tc_stats_id { 00028 RTNL_TC_PACKETS, /**< Packets seen */ 00029 RTNL_TC_BYTES, /**< Bytes seen */ 00030 RTNL_TC_RATE_BPS, /**< Current bits/s (rate estimator) */ 00031 RTNL_TC_RATE_PPS, /**< Current packet/s (rate estimator) */ 00032 RTNL_TC_QLEN, /**< Queue length */ 00033 RTNL_TC_BACKLOG, /**< Backlog length */ 00034 RTNL_TC_DROPS, /**< Packets dropped */ 00035 RTNL_TC_REQUEUES, /**< Number of requeues */ 00036 RTNL_TC_OVERLIMITS, /**< Number of overlimits */ 00037 __RTNL_TC_STATS_MAX, 00038 }; 00039 00040 #define RTNL_TC_STATS_MAX (__RTNL_TC_STATS_MAX - 1) 00041 00042 extern int rtnl_tc_calc_txtime(int, int); 00043 extern int rtnl_tc_calc_bufsize(int, int); 00044 extern int rtnl_tc_calc_cell_log(int); 00045 00046 /** 00047 * Number of entries in a transmission time lookup table 00048 * @ingroup tc 00049 */ 00050 #define RTNL_TC_RTABLE_SIZE 256 00051 00052 extern int rtnl_tc_build_rate_table(uint32_t *, uint8_t, uint8_t, int, int); 00053 00054 00055 /* TC Handle Translations */ 00056 extern char * rtnl_tc_handle2str(uint32_t, char *, size_t); 00057 extern int rtnl_tc_str2handle(const char *, uint32_t *); 00058 00059 #ifdef __cplusplus 00060 } 00061 #endif 00062 00063 #endif