]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ascii.c
Fix build on FreeBSD.
[tcpdump] / print-ascii.c
index fa8793cb0641b6227506d9875f78a77593576dc8..9315edd2e3278fcd469d371e257d92286a8b0dd4 100644 (file)
 #include "config.h"
 #endif
 
-#ifndef lint
-static const char rcsid[] _U_ =
-     "@(#) $Header: /tcpdump/master/tcpdump/print-ascii.c,v 1.17 2005-07-06 20:53:32 guy Exp $";
-#endif
 #include <tcpdump-stdinc.h>
 #include <stdio.h>
 
+#include "netdissect.h"
 #include "interface.h"
 
 #define ASCII_LINELENGTH 300
@@ -131,8 +128,9 @@ hex_and_ascii_print(register const char *ident, register const u_char *cp,
  * telnet_print() wants this.  It is essentially default_print_unaligned()
  */
 void
-hex_print_with_offset(register const char *ident, register const u_char *cp, register u_int length,
-                     register u_int oset)
+hex_print_with_offset(netdissect_options *ndo,
+                      const char *ident, const u_char *cp, u_int length,
+                     u_int oset)
 {
        register u_int i, s;
        register int nshorts;
@@ -141,16 +139,16 @@ hex_print_with_offset(register const char *ident, register const u_char *cp, reg
        i = 0;
        while (--nshorts >= 0) {
                if ((i++ % 8) == 0) {
-                       (void)printf("%s0x%04x: ", ident, oset);
-                       oset += HEXDUMP_BYTES_PER_LINE;
+                  (void)ND_PRINT((ndo,"%s0x%04x: ", ident, oset));
+                  oset += HEXDUMP_BYTES_PER_LINE;
                }
                s = *cp++;
-               (void)printf(" %02x%02x", s, *cp++);
+               (void)ND_PRINT((ndo," %02x%02x", s, *cp++));
        }
        if (length & 1) {
                if ((i % 8) == 0)
-                       (void)printf("%s0x%04x: ", ident, oset);
-               (void)printf(" %02x", *cp);
+                  (void)ND_PRINT((ndo,"%s0x%04x: ", ident, oset));
+               (void)ND_PRINT((ndo," %02x", *cp));
        }
 }
 
@@ -158,9 +156,9 @@ hex_print_with_offset(register const char *ident, register const u_char *cp, reg
  * just for completeness
  */
 void
-hex_print(register const char *ident, register const u_char *cp, register u_int length)
+hex_print(netdissect_options *ndo,const char *ident, const u_char *cp, u_int length)
 {
-       hex_print_with_offset(ident, cp, length, 0);
+  hex_print_with_offset(ndo, ident, cp, length, 0);
 }
 
 #ifdef MAIN