]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
tc: cbs: add support for JSON output
authorLeslie Monis <lesliemonis@gmail.com>
Wed, 25 Dec 2019 19:04:09 +0000 (00:34 +0530)
committerStephen Hemminger <stephen@networkplumber.org>
Sun, 29 Dec 2019 17:57:27 +0000 (09:57 -0800)
Enable proper JSON output for the CBS Qdisc.

Signed-off-by: Leslie Monis <lesliemonis@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/q_cbs.c

index 9515a1f7feeb4168a8fee5ef207bd2b29ce2b59b..13bb08e97e4209cb071d2ca7755247c904a0b3a8 100644 (file)
@@ -125,11 +125,11 @@ static int cbs_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
        if (RTA_PAYLOAD(tb[TCA_CBS_PARMS])  < sizeof(*qopt))
                return -1;
 
-       fprintf(f, "hicredit %d ", qopt->hicredit);
-       fprintf(f, "locredit %d ", qopt->locredit);
-       fprintf(f, "sendslope %d ", qopt->sendslope);
-       fprintf(f, "idleslope %d ", qopt->idleslope);
-       fprintf(f, "offload %d ", qopt->offload);
+       print_int(PRINT_ANY, "hicredit", "hicredit %d ", qopt->hicredit);
+       print_int(PRINT_ANY, "locredit", "locredit %d ", qopt->locredit);
+       print_int(PRINT_ANY, "sendslope", "sendslope %d ", qopt->sendslope);
+       print_int(PRINT_ANY, "idleslope", "idleslope %d ", qopt->idleslope);
+       print_int(PRINT_ANY, "offload", "offload %d ", qopt->offload);
 
        return 0;
 }