@@ -56,9 +56,11 @@ static struct filter_util *filter_list;
static int print_noqopt(struct qdisc_util *qu, FILE *f,
struct rtattr *opt)
{
- if (opt && RTA_PAYLOAD(opt))
- fprintf(f, "[Unknown qdisc, optlen=%u] ",
- (unsigned int) RTA_PAYLOAD(opt));
+ if (opt && RTA_PAYLOAD(opt)) {
+ print_string(PRINT_JSON, "qdisc", NULL, "UNKNOWN");
+ print_uint(PRINT_ANY, "optlen", "[Unknown qdisc, optlen=%u] ",
+ RTA_PAYLOAD(opt));
+ }
return 0;
}
@@ -76,11 +78,12 @@ static int parse_noqopt(struct qdisc_util *qu, int argc, char **argv,
static int print_nofopt(struct filter_util *qu, FILE *f, struct rtattr *opt, __u32 fhandle)
{
- if (opt && RTA_PAYLOAD(opt))
- fprintf(f, "fh %08x [Unknown filter, optlen=%u] ",
- fhandle, (unsigned int) RTA_PAYLOAD(opt));
- else if (fhandle)
- fprintf(f, "fh %08x ", fhandle);
+ if (opt && RTA_PAYLOAD(opt)) {
+ print_0xhex(PRINT_ANY, "handle", "fh %08x ", fhandle);
+ print_uint(PRINT_ANY, "optlen", "[Unknown filter, optlen=%u] ",
+ RTA_PAYLOAD(opt));
+ } else if (fhandle)
+ print_0xhex(PRINT_ANY, "handle", "fh %08x ", fhandle);
return 0;
}