]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Add the nd_print_trunc() function
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 2 May 2018 15:12:50 +0000 (17:12 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 4 May 2018 08:56:23 +0000 (10:56 +0200)
Use the ndo->ndo_protocol field to print a " [|protocol]" message.

netdissect.h
util-print.c

index 81c767e1938527f158deab5c389c1da508c67934..f601bc1165c995d9ebf05c772b57a4aaee67521b 100644 (file)
@@ -655,6 +655,8 @@ extern int nextproto4_cksum(netdissect_options *, const struct ip *, const uint8
 extern int nextproto6_cksum(netdissect_options *, const struct ip6_hdr *, const uint8_t *, u_int, u_int, u_int);
 
 /* Utilities */
+extern void nd_print_trunc(netdissect_options *);
+
 extern int mask2plen(uint32_t);
 extern int mask62plen(const u_char *);
 
index 1a54a42a1898256cb75ae9c740a898d190e51a3e..8cf0576b2d49186035218d89051a2e8f433ae18d 100644 (file)
@@ -426,6 +426,12 @@ signed_relts_print(netdissect_options *ndo,
        unsigned_relts_print(ndo, secs);
 }
 
+/* Print the truncated string */
+void nd_print_trunc(netdissect_options *ndo)
+{
+       ND_PRINT(" [|%s]", ndo->ndo_protocol);
+}
+
 /*
  *  this is a generic routine for printing unknown data;
  *  we pass on the linefeed plus indentation string to