• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _TC_CORE_H_
2 #define _TC_CORE_H_ 1
3 
4 #include <asm/types.h>
5 #include <linux/pkt_sched.h>
6 
7 #define TIME_UNITS_PER_SEC	1000000
8 
9 enum link_layer {
10 	LINKLAYER_UNSPEC,
11 	LINKLAYER_ETHERNET,
12 	LINKLAYER_ATM,
13 };
14 
15 
16 int  tc_core_time2big(unsigned time);
17 unsigned tc_core_time2tick(unsigned time);
18 unsigned tc_core_tick2time(unsigned tick);
19 unsigned tc_core_time2ktime(unsigned time);
20 unsigned tc_core_ktime2time(unsigned ktime);
21 unsigned tc_calc_xmittime(unsigned rate, unsigned size);
22 unsigned tc_calc_xmitsize(unsigned rate, unsigned ticks);
23 int tc_calc_rtable(struct tc_ratespec *r, __u32 *rtab,
24 		   int cell_log, unsigned mtu, enum link_layer link_layer);
25 int tc_calc_size_table(struct tc_sizespec *s, __u16 **stab);
26 
27 int tc_setup_estimator(unsigned A, unsigned time_const, struct tc_estimator *est);
28 
29 int tc_core_init(void);
30 
31 extern struct rtnl_handle g_rth;
32 extern int is_batch_mode;
33 
34 #endif
35