summaryrefslogtreecommitdiff
path: root/tc
diff options
context:
space:
mode:
Diffstat (limited to 'tc')
-rw-r--r--tc/tc_common.h2
-rw-r--r--tc/tc_qdisc.c2
-rw-r--r--tc/tc_stab.c22
3 files changed, 16 insertions, 10 deletions
diff --git a/tc/tc_common.h b/tc/tc_common.h
index 58dc9d6a..f1561d80 100644
--- a/tc/tc_common.h
+++ b/tc/tc_common.h
@@ -16,7 +16,7 @@ int print_action(struct nlmsghdr *n, void *arg);
int print_filter(struct nlmsghdr *n, void *arg);
int print_qdisc(struct nlmsghdr *n, void *arg);
int print_class(struct nlmsghdr *n, void *arg);
-void print_size_table(FILE *fp, const char *prefix, struct rtattr *rta);
+void print_size_table(struct rtattr *rta);
struct tc_estimator;
int parse_estimator(int *p_argc, char ***p_argv, struct tc_estimator *est);
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
index b79029d9..33a6665e 100644
--- a/tc/tc_qdisc.c
+++ b/tc/tc_qdisc.c
@@ -329,7 +329,7 @@ int print_qdisc(struct nlmsghdr *n, void *arg)
print_nl();
if (show_details && tb[TCA_STAB]) {
- print_size_table(fp, " ", tb[TCA_STAB]);
+ print_size_table(tb[TCA_STAB]);
print_nl();
}
diff --git a/tc/tc_stab.c b/tc/tc_stab.c
index c61ecfd2..06dc1b13 100644
--- a/tc/tc_stab.c
+++ b/tc/tc_stab.c
@@ -103,7 +103,7 @@ int parse_size_table(int *argcp, char ***argvp, struct tc_sizespec *sp)
return 0;
}
-void print_size_table(FILE *fp, const char *prefix, struct rtattr *rta)
+void print_size_table(struct rtattr *rta)
{
struct rtattr *tb[TCA_STAB_MAX + 1];
@@ -117,17 +117,23 @@ void print_size_table(FILE *fp, const char *prefix, struct rtattr *rta)
memcpy(&s, RTA_DATA(tb[TCA_STAB_BASE]),
MIN(RTA_PAYLOAD(tb[TCA_STAB_BASE]), sizeof(s)));
- fprintf(fp, "%s", prefix);
+ print_string(PRINT_FP, NULL, " ", NULL);
+
if (s.linklayer)
- fprintf(fp, "linklayer %s ",
- sprint_linklayer(s.linklayer, b1));
+ print_string(PRINT_ANY, "linklayer",
+ "linklayer %s ",
+ sprint_linklayer(s.linklayer, b1));
if (s.overhead)
- fprintf(fp, "overhead %d ", s.overhead);
+ print_int(PRINT_ANY, "overhead",
+ "overhead %d ", s.overhead);
if (s.mpu)
- fprintf(fp, "mpu %u ", s.mpu);
+ print_uint(PRINT_ANY, "mpu",
+ "mpu %u ", s.mpu);
if (s.mtu)
- fprintf(fp, "mtu %u ", s.mtu);
+ print_uint(PRINT_ANY, "mtu",
+ "mtu %u ", s.mtu);
if (s.tsize)
- fprintf(fp, "tsize %u ", s.tsize);
+ print_uint(PRINT_ANY, "tsize",
+ "tsize %u ", s.tsize);
}
}