]>
git.proxmox.com Git - mirror_iproute2.git/blob - tc/tc_util.h
583a21a828ded9f950f52d264109d40b9ce76c21
6 #include <linux/pkt_sched.h>
7 #include <linux/pkt_cls.h>
8 #include <linux/gen_stats.h>
11 /* This is the deprecated multiqueue interface */
20 #define TCA_PRIO_MAX (__TCA_PRIO_MAX - 1)
24 struct qdisc_util
*next
;
26 int (*parse_qopt
)(struct qdisc_util
*qu
, int argc
,
27 char **argv
, struct nlmsghdr
*n
);
28 int (*print_qopt
)(struct qdisc_util
*qu
,
29 FILE *f
, struct rtattr
*opt
);
30 int (*print_xstats
)(struct qdisc_util
*qu
,
31 FILE *f
, struct rtattr
*xstats
);
33 int (*parse_copt
)(struct qdisc_util
*qu
, int argc
,
34 char **argv
, struct nlmsghdr
*n
);
35 int (*print_copt
)(struct qdisc_util
*qu
, FILE *f
, struct rtattr
*opt
);
40 struct filter_util
*next
;
42 int (*parse_fopt
)(struct filter_util
*qu
, char *fhandle
,
43 int argc
, char **argv
, struct nlmsghdr
*n
);
44 int (*print_fopt
)(struct filter_util
*qu
,
45 FILE *f
, struct rtattr
*opt
, __u32 fhandle
);
49 struct action_util
*next
;
51 int (*parse_aopt
)(struct action_util
*a
, int *argc
,
52 char ***argv
, int code
, struct nlmsghdr
*n
);
53 int (*print_aopt
)(struct action_util
*au
, FILE *f
, struct rtattr
*opt
);
54 int (*print_xstats
)(struct action_util
*au
,
55 FILE *f
, struct rtattr
*xstats
);
59 struct exec_util
*next
;
61 int (*parse_eopt
)(struct exec_util
*eu
, int argc
, char **argv
);
64 const char *get_tc_lib(void);
66 struct qdisc_util
*get_qdisc_kind(const char *str
);
67 struct filter_util
*get_filter_kind(const char *str
);
69 int get_qdisc_handle(__u32
*h
, const char *str
);
70 int get_rate(unsigned int *rate
, const char *str
);
71 int get_rate64(__u64
*rate
, const char *str
);
72 int get_size(unsigned int *size
, const char *str
);
73 int get_size_and_cell(unsigned int *size
, int *cell_log
, char *str
);
74 int get_time(unsigned int *time
, const char *str
);
75 int get_linklayer(unsigned int *val
, const char *arg
);
77 void print_rate(char *buf
, int len
, __u64 rate
);
78 void print_size(char *buf
, int len
, __u32 size
);
79 void print_qdisc_handle(char *buf
, int len
, __u32 h
);
80 void print_time(char *buf
, int len
, __u32 time
);
81 void print_linklayer(char *buf
, int len
, unsigned int linklayer
);
83 char *sprint_rate(__u64 rate
, char *buf
);
84 char *sprint_size(__u32 size
, char *buf
);
85 char *sprint_qdisc_handle(__u32 h
, char *buf
);
86 char *sprint_tc_classid(__u32 h
, char *buf
);
87 char *sprint_time(__u32 time
, char *buf
);
88 char *sprint_ticks(__u32 ticks
, char *buf
);
89 char *sprint_linklayer(unsigned int linklayer
, char *buf
);
91 void print_tcstats_attr(FILE *fp
, struct rtattr
*tb
[],
92 char *prefix
, struct rtattr
**xstats
);
93 void print_tcstats2_attr(FILE *fp
, struct rtattr
*rta
,
94 char *prefix
, struct rtattr
**xstats
);
96 int get_tc_classid(__u32
*h
, const char *str
);
97 int print_tc_classid(char *buf
, int len
, __u32 h
);
98 char *sprint_tc_classid(__u32 h
, char *buf
);
100 int tc_print_police(FILE *f
, struct rtattr
*tb
);
101 int parse_police(int *argc_p
, char ***argv_p
, int tca_id
, struct nlmsghdr
*n
);
103 int parse_action_control(int *argc_p
, char ***argv_p
,
104 int *result_p
, bool allow_num
);
105 void parse_action_control_dflt(int *argc_p
, char ***argv_p
,
106 int *result_p
, bool allow_num
,
108 int parse_action_control_slash(int *argc_p
, char ***argv_p
,
109 int *result1_p
, int *result2_p
, bool allow_num
);
110 void print_action_control(FILE *f
, const char *prefix
,
111 int action
, const char *suffix
);
112 int act_parse_police(struct action_util
*a
, int *argc_p
,
113 char ***argv_p
, int tca_id
, struct nlmsghdr
*n
);
114 int print_police(struct action_util
*a
, FILE *f
, struct rtattr
*tb
);
115 int police_print_xstats(struct action_util
*a
, FILE *f
, struct rtattr
*tb
);
116 int tc_print_action(FILE *f
, const struct rtattr
*tb
, unsigned short tot_acts
);
117 int tc_print_ipt(FILE *f
, const struct rtattr
*tb
);
118 int parse_action(int *argc_p
, char ***argv_p
, int tca_id
, struct nlmsghdr
*n
);
119 void print_tm(FILE *f
, const struct tcf_t
*tm
);
120 int prio_print_opt(struct qdisc_util
*qu
, FILE *f
, struct rtattr
*opt
);
122 int cls_names_init(char *path
);
123 void cls_names_uninit(void);