]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-telnet.c
Add program_name field in the netdissect_options structure
[tcpdump] / print-telnet.c
index 7c5a737d33252d8e3f2c59d3a8cabdcfca132bc3..ae29b4749a21092f088f8844a2e34d3241884062 100644 (file)
@@ -45,7 +45,6 @@
  *      are preserved in all copies.
  */
 
-#define NETDISSECT_REWORKED
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -54,7 +53,7 @@
 
 #include <stdio.h>
 
-#include "interface.h"
+#include "netdissect.h"
 
 #define TELCMDS
 #define TELOPTS
@@ -509,12 +508,11 @@ telnet_print(netdissect_options *ndo, const u_char *sp, u_int length)
 
        osp = sp;
 
-       if (ndo->ndo_qflag) {
-               ND_PRINT((ndo, "[telnet]"));
-               return;
-       }
-
        while (length > 0 && *sp == IAC) {
+               /*
+                * Parse the Telnet command without printing it,
+                * to determine its length.
+                */
                l = telnet_parse(ndo, sp, length, 0);
                if (l < 0)
                        break;