| 1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
| 2 |
#ifndef _TC_CORE_H_ |
| 3 |
#define _TC_CORE_H_ 1 |
| 4 |
|
| 5 |
#include <asm/types.h> |
| 6 |
#include <linux/pkt_sched.h> |
| 7 |
|
| 8 |
enum link_layer { |
| 9 |
LINKLAYER_UNSPEC, |
| 10 |
LINKLAYER_ETHERNET, |
| 11 |
LINKLAYER_ATM, |
| 12 |
}; |
| 13 |
|
| 14 |
|
| 15 |
double tc_core_tick2time(double tick); |
| 16 |
unsigned tc_core_time2ktime(unsigned time); |
| 17 |
unsigned tc_core_ktime2time(unsigned ktime); |
| 18 |
unsigned tc_calc_xmittime(__u64 rate, __u64 size); |
| 19 |
__u64 tc_calc_xmitsize(__u64 rate, unsigned ticks); |
| 20 |
int tc_calc_rtable(struct tc_ratespec *r, __u32 *rtab, |
| 21 |
int cell_log, unsigned mtu, enum link_layer link_layer); |
| 22 |
int tc_calc_rtable_64(struct tc_ratespec *r, __u32 *rtab, |
| 23 |
int cell_log, unsigned mtu, enum link_layer link_layer, |
| 24 |
__u64 rate); |
| 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 |