summaryrefslogtreecommitdiff
path: root/accel-pppd/shaper/tc_core.h
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-01-22 21:58:33 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-01-22 22:09:10 +0400
commitbdf5bd00fa21707a7f09c95e76106682355f0927 (patch)
tree0f72ae54b6fa21d3f546abde7573d85b4044f025 /accel-pppd/shaper/tc_core.h
parentf7b2ca85f9cda5d542aa0fe638926682ae86ddf4 (diff)
downloadaccel-ppp-xebd-bdf5bd00fa21707a7f09c95e76106682355f0927.tar.gz
accel-ppp-xebd-bdf5bd00fa21707a7f09c95e76106682355f0927.zip
implemented advanced shaper
Diffstat (limited to 'accel-pppd/shaper/tc_core.h')
-rw-r--r--accel-pppd/shaper/tc_core.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/accel-pppd/shaper/tc_core.h b/accel-pppd/shaper/tc_core.h
new file mode 100644
index 0000000..cb85cc4
--- /dev/null
+++ b/accel-pppd/shaper/tc_core.h
@@ -0,0 +1,33 @@
+#ifndef _TC_CORE_H_
+#define _TC_CORE_H_ 1
+
+#include <asm/types.h>
+#include <linux/pkt_sched.h>
+
+#define TIME_UNITS_PER_SEC 1000000
+
+enum link_layer {
+ LINKLAYER_UNSPEC,
+ LINKLAYER_ETHERNET,
+ LINKLAYER_ATM,
+};
+
+
+int tc_core_time2big(unsigned time);
+unsigned tc_core_time2tick(unsigned time);
+unsigned tc_core_tick2time(unsigned tick);
+unsigned tc_core_time2ktime(unsigned time);
+unsigned tc_core_ktime2time(unsigned ktime);
+unsigned tc_calc_xmittime(unsigned rate, unsigned size);
+unsigned tc_calc_xmitsize(unsigned rate, unsigned ticks);
+int tc_calc_rtable(struct tc_ratespec *r, __u32 *rtab,
+ int cell_log, unsigned mtu, enum link_layer link_layer);
+int tc_calc_size_table(struct tc_sizespec *s, __u16 **stab);
+
+int tc_setup_estimator(unsigned A, unsigned time_const, struct tc_estimator *est);
+
+int tc_core_init(void);
+
+extern struct rtnl_handle g_rth;
+
+#endif