]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Add the nd_print_protocol() function
authorFrancois-Xavier Le Bail <[email protected]>
Tue, 19 Mar 2019 13:49:34 +0000 (14:49 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 19 Mar 2019 13:50:52 +0000 (14:50 +0100)
Use the ndo->ndo_protocol field to print the protocol name.

netdissect.h
util-print.c

index adc17175d3f91fc87d6938366c0e16d08edc1bfc..ff5da6366fbe60df900f86ff1d46431e1c489ab4 100644 (file)
@@ -685,6 +685,7 @@ extern uint16_t nextproto6_cksum(netdissect_options *, const struct ip6_hdr *, c
 
 /* Utilities */
 extern void nd_print_trunc(netdissect_options *);
+extern void nd_print_protocol(netdissect_options *);
 extern void nd_print_invalid(netdissect_options *);
 
 extern int mask2plen(uint32_t);
index 83bcca662f1c65b60924d3b2dab30ae2fe0443aa..5d9056a1ebe7cd369de5fb9bfe4346275b8ec876 100644 (file)
@@ -445,6 +445,12 @@ void nd_print_trunc(netdissect_options *ndo)
        ND_PRINT(" [|%s]", ndo->ndo_protocol);
 }
 
+/* Print the protocol name */
+void nd_print_protocol(netdissect_options *ndo)
+{
+       ND_PRINT("%s", ndo->ndo_protocol);
+}
+
 /* Print the invalid string */
 void nd_print_invalid(netdissect_options *ndo)
 {