static void explain(void)
{
- fprintf(stderr, "Usage: tc qdisc { add | replace | change } ... gred setup vqs NUMBER\n");
- fprintf(stderr, " default DEFAULT_VQ [ grio ] [ limit BYTES ] [ecn] [harddrop]\n");
- fprintf(stderr, " tc qdisc change ... gred vq VQ [ prio VALUE ] limit BYTES\n");
- fprintf(stderr, " min BYTES max BYTES avpkt BYTES [ burst PACKETS ]\n");
- fprintf(stderr, " [ probability PROBABILITY ] [ bandwidth KBPS ] [ecn] [harddrop]\n");
+ fprintf(stderr,
+ "Usage: tc qdisc { add | replace | change } ... gred setup vqs NUMBER\n"
+ " default DEFAULT_VQ [ grio ] [ limit BYTES ] [ecn] [harddrop]\n"
+ " tc qdisc change ... gred vq VQ [ prio VALUE ] limit BYTES\n"
+ " min BYTES max BYTES avpkt BYTES [ burst PACKETS ]\n"
+ " [ probability PROBABILITY ] [ bandwidth KBPS ] [ecn] [harddrop]\n");
}
static int init_gred(struct qdisc_util *qu, int argc, char **argv,
{
__u64 bytes = info ? info->bytes : qopt->bytesin;
- SPRINT_BUF(b1);
-
if (!is_json_context())
printf("\n Queue size: ");
- print_uint(PRINT_JSON, "qave", NULL, qopt->qave);
- print_string(PRINT_FP, NULL, "average %s ",
- sprint_size(qopt->qave, b1));
-
- print_uint(PRINT_JSON, "backlog", NULL, qopt->backlog);
- print_string(PRINT_FP, NULL, "current %s ",
- sprint_size(qopt->backlog, b1));
+ print_size(PRINT_ANY, "qave", "average %s ", qopt->qave);
+ print_size(PRINT_ANY, "backlog", "current %s ", qopt->backlog);
if (!is_json_context())
printf("\n Dropped packets: ");
printf("\n Total packets: ");
print_uint(PRINT_ANY, "packets", "%u ", qopt->packets);
-
- print_uint(PRINT_JSON, "bytes", NULL, bytes);
- print_string(PRINT_FP, NULL, "(%s) ", sprint_size(bytes, b1));
+ print_size(PRINT_ANY, "bytes", "(%s) ", bytes);
}
static int gred_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
__u32 *limit = NULL;
unsigned int i;
- SPRINT_BUF(b1);
-
if (opt == NULL)
return 0;
else
print_bool(PRINT_ANY, "grio", NULL, false);
- if (limit) {
- print_uint(PRINT_JSON, "limit", NULL, *limit);
- print_string(PRINT_FP, NULL, "limit %s ",
- sprint_size(*limit, b1));
- }
+ if (limit)
+ print_size(PRINT_ANY, "limit", "limit %s ", *limit);
tc_red_print_flags(sopt->flags);
print_uint(PRINT_ANY, "vq", "\n vq %u ", qopt->DP);
print_hhu(PRINT_ANY, "prio", "prio %hhu ", qopt->prio);
-
- print_uint(PRINT_JSON, "limit", NULL, qopt->limit);
- print_string(PRINT_FP, NULL, "limit %s ",
- sprint_size(qopt->limit, b1));
-
- print_uint(PRINT_JSON, "min", NULL, qopt->qth_min);
- print_string(PRINT_FP, NULL, "min %s ",
- sprint_size(qopt->qth_min, b1));
-
- print_uint(PRINT_JSON, "max", NULL, qopt->qth_max);
- print_string(PRINT_FP, NULL, "max %s ",
- sprint_size(qopt->qth_max, b1));
+ print_size(PRINT_ANY, "limit", "limit %s ", qopt->limit);
+ print_size(PRINT_ANY, "min", "min %s ", qopt->qth_min);
+ print_size(PRINT_ANY, "max", "max %s ", qopt->qth_max);
if (infos[i].flags_present)
tc_red_print_flags(infos[i].flags);