From: Francois-Xavier Le Bail Date: Tue, 19 Mar 2019 13:49:34 +0000 (+0100) Subject: Add the nd_print_protocol() function X-Git-Tag: tcpdump-4.99-bp~895 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/1fabc59c1320bac1c19e8f86d07c29a83a88bdab Add the nd_print_protocol() function Use the ndo->ndo_protocol field to print the protocol name. --- diff --git a/netdissect.h b/netdissect.h index adc17175..ff5da636 100644 --- a/netdissect.h +++ b/netdissect.h @@ -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); diff --git a/util-print.c b/util-print.c index 83bcca66..5d9056a1 100644 --- a/util-print.c +++ b/util-print.c @@ -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) {