diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-05-02 17:15:04 +0200 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-05-04 13:47:49 +0200 |
commit | ba8936b39b0ce2ff02f3aeb307df4c27657652d8 (patch) | |
tree | 71f8f3b775d7adfb7b2be374c634f749525c10eb /print-wb.c | |
parent | c45392de183543487bfebf52a5d2ccbeb9cef462 (diff) | |
download | tcpdump-ba8936b39b0ce2ff02f3aeb307df4c27657652d8.tar.gz |
Print truncations with nd_print_trunc() instead of tstr[] strings
Remove the tstr[] strings.
Update the output of some tests accordingly.
Moreover:
Add or update some ndo_protocol fields.
Diffstat (limited to 'print-wb.c')
-rw-r--r-- | print-wb.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -31,7 +31,6 @@ #include "addrtoname.h" #include "extract.h" -static const char tstr[] = "[|wb]"; /* XXX need to add byte-swapping macros! */ /* XXX - you mean like the ones in "extract.h"? */ @@ -319,7 +318,7 @@ wb_dops(netdissect_options *ndo, const struct pkt_dop *dop, u_int t; if (!ND_TTEST_SIZE(dh)) { - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); break; } t = EXTRACT_U_1(dh->dh_type); @@ -405,7 +404,7 @@ wb_print(netdissect_options *ndo, ndo->ndo_protocol = "wb"; ph = (const struct pkt_hdr *)hdr; if (len < sizeof(*ph) || !ND_TTEST_SIZE(ph)) { - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); return; } len -= sizeof(*ph); @@ -422,37 +421,37 @@ wb_print(netdissect_options *ndo, case PT_ID: if (wb_id(ndo, (const struct pkt_id *)(ph + 1), len) >= 0) return; - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); break; case PT_RREQ: if (wb_rreq(ndo, (const struct pkt_rreq *)(ph + 1), len) >= 0) return; - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); break; case PT_RREP: if (wb_rrep(ndo, (const struct pkt_rrep *)(ph + 1), len) >= 0) return; - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); break; case PT_DRAWOP: if (wb_drawop(ndo, (const struct pkt_dop *)(ph + 1), len) >= 0) return; - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); break; case PT_PREQ: if (wb_preq(ndo, (const struct pkt_preq *)(ph + 1), len) >= 0) return; - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); break; case PT_PREP: if (wb_prep(ndo, (const struct pkt_prep *)(ph + 1), len) >= 0) return; - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); break; default: |