]>
Commit | Line | Data |
---|---|---|
aba5acdf SH |
1 | #ifndef _TC_UTIL_H_ |
2 | #define _TC_UTIL_H_ 1 | |
3 | ||
4 | #include <linux/pkt_sched.h> | |
5 | #include <linux/pkt_cls.h> | |
6 | #include "tc_core.h" | |
7 | ||
8 | struct qdisc_util | |
9 | { | |
10 | struct qdisc_util *next; | |
11 | char id[16]; | |
12 | int (*parse_qopt)(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n); | |
13 | int (*print_qopt)(struct qdisc_util *qu, FILE *f, struct rtattr *opt); | |
14 | int (*print_xstats)(struct qdisc_util *qu, FILE *f, struct rtattr *xstats); | |
15 | ||
16 | int (*parse_copt)(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n); | |
17 | int (*print_copt)(struct qdisc_util *qu, FILE *f, struct rtattr *opt); | |
18 | }; | |
19 | ||
20 | struct filter_util | |
21 | { | |
22 | struct filter_util *next; | |
23 | char id[16]; | |
24 | int (*parse_fopt)(struct filter_util *qu, char *fhandle, int argc, char **argv, struct nlmsghdr *n); | |
25 | int (*print_fopt)(struct filter_util *qu, FILE *f, struct rtattr *opt, __u32 fhandle); | |
26 | }; | |
27 | ||
28 | ||
4094db72 SH |
29 | extern struct qdisc_util *get_qdisc_kind(const char *str); |
30 | extern struct filter_util *get_filter_kind(const char *str); | |
aba5acdf | 31 | |
4094db72 SH |
32 | extern int get_qdisc_handle(__u32 *h, const char *str); |
33 | extern int get_rate(unsigned *rate, const char *str); | |
63e989f5 | 34 | extern int get_percent(unsigned *percent, const char *str); |
4094db72 | 35 | extern int get_size(unsigned *size, const char *str); |
aba5acdf | 36 | extern int get_size_and_cell(unsigned *size, int *cell_log, char *str); |
4094db72 | 37 | extern int get_usecs(unsigned *usecs, const char *str); |
9615dc1d SH |
38 | extern void print_rate(char *buf, int len, __u32 rate); |
39 | extern void print_size(char *buf, int len, __u32 size); | |
40 | extern void print_percent(char *buf, int len, __u32 percent); | |
41 | extern void print_qdisc_handle(char *buf, int len, __u32 h); | |
42 | extern void print_usecs(char *buf, int len, __u32 usecs); | |
aba5acdf SH |
43 | extern char * sprint_rate(__u32 rate, char *buf); |
44 | extern char * sprint_size(__u32 size, char *buf); | |
45 | extern char * sprint_qdisc_handle(__u32 h, char *buf); | |
46 | extern char * sprint_tc_classid(__u32 h, char *buf); | |
47 | extern char * sprint_usecs(__u32 usecs, char *buf); | |
63e989f5 | 48 | extern char * sprint_percent(__u32 percent, char *buf); |
aba5acdf SH |
49 | |
50 | extern void print_tcstats(FILE *fp, struct tc_stats *st); | |
51 | ||
4094db72 | 52 | extern int get_tc_classid(__u32 *h, const char *str); |
aba5acdf SH |
53 | extern int print_tc_classid(char *buf, int len, __u32 h); |
54 | extern char * sprint_tc_classid(__u32 h, char *buf); | |
55 | ||
56 | extern int tc_print_police(FILE *f, struct rtattr *tb); | |
57 | extern int parse_police(int *, char ***, int, struct nlmsghdr *); | |
58 | ||
59 | ||
60 | #endif |