diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2019-06-11 17:52:07 +0200 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2019-06-11 18:06:48 +0200 |
commit | fdcb17452d1ba18cd27f2a3938688580d89b4ed4 (patch) | |
tree | 56f6e59b9862516199fca56107b682212a6cb680 /util-print.c | |
parent | 6c7369b89f7f3604c464606489d6c19b1febab2b (diff) | |
download | tcpdump-fdcb17452d1ba18cd27f2a3938688580d89b4ed4.tar.gz |
Add the nd_print_protocol_caps() function
Use the ndo->ndo_protocol field to print the protocol name in CAPS.
Diffstat (limited to 'util-print.c')
-rw-r--r-- | util-print.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/util-print.c b/util-print.c index 6296821e..94367111 100644 --- a/util-print.c +++ b/util-print.c @@ -451,6 +451,14 @@ void nd_print_protocol(netdissect_options *ndo) ND_PRINT("%s", ndo->ndo_protocol); } +/* Print the protocol name in caps (uppercases) */ +void nd_print_protocol_caps(netdissect_options *ndo) +{ + const char *p; + for (p = ndo->ndo_protocol; *p != '\0'; p++) + ND_PRINT("%c", ND_TOUPPER((u_char)*p)); +} + /* Print the invalid string */ void nd_print_invalid(netdissect_options *ndo) { |