00001
00002
00003
00004
00005
00006
00007
00008
00009
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 #include <netlink/route/link.h>
00019 #include <linux/pkt_sched.h>
00020 #include <linux/pkt_cls.h>
00021
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025
00026
00027
00028
00029
00030 struct rtnl_tc;
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #define TC_CAST(ptr) ((struct rtnl_tc *) (ptr))
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 enum rtnl_tc_stat {
00051 RTNL_TC_PACKETS,
00052 RTNL_TC_BYTES,
00053 RTNL_TC_RATE_BPS,
00054 RTNL_TC_RATE_PPS,
00055 RTNL_TC_QLEN,
00056 RTNL_TC_BACKLOG,
00057 RTNL_TC_DROPS,
00058 RTNL_TC_REQUEUES,
00059 RTNL_TC_OVERLIMITS,
00060 __RTNL_TC_STATS_MAX,
00061 };
00062
00063 #define RTNL_TC_STATS_MAX (__RTNL_TC_STATS_MAX - 1)
00064
00065 extern void rtnl_tc_set_ifindex(struct rtnl_tc *, int);
00066 extern int rtnl_tc_get_ifindex(struct rtnl_tc *);
00067 extern void rtnl_tc_set_link(struct rtnl_tc *, struct rtnl_link *);
00068 extern void rtnl_tc_set_mtu(struct rtnl_tc *, uint32_t);
00069 extern uint32_t rtnl_tc_get_mtu(struct rtnl_tc *);
00070 extern void rtnl_tc_set_mpu(struct rtnl_tc *, uint32_t);
00071 extern uint32_t rtnl_tc_get_mpu(struct rtnl_tc *);
00072 extern void rtnl_tc_set_overhead(struct rtnl_tc *, uint32_t);
00073 extern uint32_t rtnl_tc_get_overhead(struct rtnl_tc *);
00074 extern void rtnl_tc_set_linktype(struct rtnl_tc *, uint32_t);
00075 extern uint32_t rtnl_tc_get_linktype(struct rtnl_tc *);
00076 extern void rtnl_tc_set_handle(struct rtnl_tc *, uint32_t);
00077 extern uint32_t rtnl_tc_get_handle(struct rtnl_tc *);
00078 extern void rtnl_tc_set_parent(struct rtnl_tc *, uint32_t);
00079 extern uint32_t rtnl_tc_get_parent(struct rtnl_tc *);
00080 extern int rtnl_tc_set_kind(struct rtnl_tc *, const char *);
00081 extern char * rtnl_tc_get_kind(struct rtnl_tc *);
00082 extern uint64_t rtnl_tc_get_stat(struct rtnl_tc *, enum rtnl_tc_stat);
00083
00084 extern int rtnl_tc_calc_txtime(int, int);
00085 extern int rtnl_tc_calc_bufsize(int, int);
00086 extern int rtnl_tc_calc_cell_log(int);
00087
00088 extern int rtnl_tc_read_classid_file(void);
00089 extern char * rtnl_tc_handle2str(uint32_t, char *, size_t);
00090 extern int rtnl_tc_str2handle(const char *, uint32_t *);
00091 extern int rtnl_classid_generate(const char *, uint32_t *,
00092 uint32_t);
00093
00094 #ifdef __cplusplus
00095 }
00096 #endif
00097
00098 #endif