X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/56d8c43b671a98e14b4a505c81bad036b5968e07..a8abce5c5e2dce2ba6dbccd5d3829da104b80f9c:/print-telnet.c diff --git a/print-telnet.c b/print-telnet.c index a9a517a0..3bfb19a2 100644 --- a/print-telnet.c +++ b/print-telnet.c @@ -48,17 +48,16 @@ /* \summary: Telnet option printer */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include #endif -#include +#include "netdissect-stdinc.h" #include #include "netdissect.h" #include "extract.h" -static const char tstr[] = " [|telnet]"; #define TELCMDS #define TELOPTS @@ -382,7 +381,7 @@ numstr(int x) { static char buf[20]; - snprintf(buf, sizeof(buf), "%#x", x); + nd_snprintf(buf, sizeof(buf), "%#x", x); return buf; } @@ -501,7 +500,7 @@ done: return sp - osp; trunc: - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); pktend: return -1; #undef FETCH @@ -514,6 +513,7 @@ telnet_print(netdissect_options *ndo, const u_char *sp, u_int length) const u_char *osp; int l; + ndo->ndo_protocol = "telnet"; osp = sp; ND_TCHECK_1(sp); @@ -555,5 +555,5 @@ telnet_print(netdissect_options *ndo, const u_char *sp, u_int length) } return; trunc: - ND_PRINT("%s", tstr); + nd_print_trunc(ndo); }