tc/util: make local functions static

The tc util library parse/print has functions only used locally
(and some dead code removed).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Stephen Hemminger 2018-11-15 14:36:36 -08:00
parent 33043dfc9c
commit 9455bec52a
2 changed files with 3 additions and 19 deletions

View File

@ -190,7 +190,7 @@ static const struct rate_suffix {
{ NULL } { NULL }
}; };
int parse_percent_rate(char *rate, const char *str, const char *dev) static int parse_percent_rate(char *rate, const char *str, const char *dev)
{ {
long dev_mbit; long dev_mbit;
int ret; int ret;
@ -409,7 +409,7 @@ void print_devname(enum output_type type, int ifindex)
"dev", "%s ", ifname); "dev", "%s ", ifname);
} }
void print_size(char *buf, int len, __u32 sz) static void print_size(char *buf, int len, __u32 sz)
{ {
double tmp = sz; double tmp = sz;
@ -427,17 +427,6 @@ char *sprint_size(__u32 size, char *buf)
return buf; return buf;
} }
void print_qdisc_handle(char *buf, int len, __u32 h)
{
snprintf(buf, len, "%x:", TC_H_MAJ(h)>>16);
}
char *sprint_qdisc_handle(__u32 h, char *buf)
{
print_qdisc_handle(buf, SPRINT_BSIZE-1, h);
return buf;
}
static const char *action_n2a(int action) static const char *action_n2a(int action)
{ {
static char buf[64]; static char buf[64];
@ -709,7 +698,7 @@ int get_linklayer(unsigned int *val, const char *arg)
return 0; return 0;
} }
void print_linklayer(char *buf, int len, unsigned int linklayer) static void print_linklayer(char *buf, int len, unsigned int linklayer)
{ {
switch (linklayer) { switch (linklayer) {
case LINKLAYER_UNSPEC: case LINKLAYER_UNSPEC:

View File

@ -73,7 +73,6 @@ const char *get_tc_lib(void);
struct qdisc_util *get_qdisc_kind(const char *str); struct qdisc_util *get_qdisc_kind(const char *str);
struct filter_util *get_filter_kind(const char *str); struct filter_util *get_filter_kind(const char *str);
int parse_percent_rate(char *rate, const char *str, const char *dev);
int get_qdisc_handle(__u32 *h, const char *str); int get_qdisc_handle(__u32 *h, const char *str);
int get_rate(unsigned int *rate, const char *str); int get_rate(unsigned int *rate, const char *str);
int get_percent_rate(unsigned int *rate, const char *str, const char *dev); int get_percent_rate(unsigned int *rate, const char *str, const char *dev);
@ -84,14 +83,10 @@ int get_size_and_cell(unsigned int *size, int *cell_log, char *str);
int get_linklayer(unsigned int *val, const char *arg); int get_linklayer(unsigned int *val, const char *arg);
void print_rate(char *buf, int len, __u64 rate); void print_rate(char *buf, int len, __u64 rate);
void print_size(char *buf, int len, __u32 size);
void print_qdisc_handle(char *buf, int len, __u32 h);
void print_linklayer(char *buf, int len, unsigned int linklayer);
void print_devname(enum output_type type, int ifindex); void print_devname(enum output_type type, int ifindex);
char *sprint_rate(__u64 rate, char *buf); char *sprint_rate(__u64 rate, char *buf);
char *sprint_size(__u32 size, char *buf); char *sprint_size(__u32 size, char *buf);
char *sprint_qdisc_handle(__u32 h, char *buf);
char *sprint_tc_classid(__u32 h, char *buf); char *sprint_tc_classid(__u32 h, char *buf);
char *sprint_ticks(__u32 ticks, char *buf); char *sprint_ticks(__u32 ticks, char *buf);
char *sprint_linklayer(unsigned int linklayer, char *buf); char *sprint_linklayer(unsigned int linklayer, char *buf);