On Mon, 6 Sep 2021 21:57:50 -0400
Wen Liang [off-list ref] wrote:
} else {
- fprintf(f, "??? ");
+ print_string(PRINT_ANY, NULL, "%s", "??? ");
}
This would be better handled by printing a real error message
on stderr, rather than continuing this confusing message.
+ print_lluint(PRINT_ANY, "rule hit", "(rule hit %llu ", (unsigned long long) pf->rcnt);
+ print_lluint(PRINT_ANY, "success", "success %llu)", (unsigned long long) pf->rhit);
+ }
There is print_u64 which is better than doing these casts.
+ print_hex(PRINT_ANY, "offset mask", "%04x", ntohs(sel->offmask));
+ print_int(PRINT_ANY, "offset shift", ">>%d ", sel->offshift);
+ print_int(PRINT_ANY, "offset off", "at %d ", sel->offoff);
Space is not valid in JSON tag.
Please test by running the output from your changes into a JSON parser.
Example:
tc -j ... | python3 -m json.tool