]> The Tcpdump Group git mirrors - tcpdump/commitdiff
pass on ident string to hex_print()
authorhannes <hannes>
Mon, 29 Dec 2003 11:05:09 +0000 (11:05 +0000)
committerhannes <hannes>
Mon, 29 Dec 2003 11:05:09 +0000 (11:05 +0000)
interface.h
print-ascii.c
print-telnet.c

index 284f0bbd2877fe7738ed7e561a55f6f5ab566a21..88f76bc02585e5383a7b160f19129b03ad40400c 100644 (file)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.221 2003-12-29 10:30:40 hannes Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.222 2003-12-29 11:05:09 hannes Exp $ (LBL)
  */
 
 #ifndef tcpdump_interface_h
@@ -193,9 +193,9 @@ extern const char *dnnum_string(u_short);
 extern int print_unknown_data(const u_char *, const char *,int);
 extern void ascii_print_with_offset(const u_char *, const u_char *, u_int, u_int);
 extern void ascii_print(const u_char *, const u_char *, u_int);
-extern void hex_print_with_offset(const u_char *, u_int, u_int);
+extern void hex_print_with_offset(const u_char *, const u_char *, u_int, u_int);
 extern void telnet_print(const u_char *, u_int);
-extern void hex_print(const u_char *, u_int);
+extern void hex_print(const u_char *, const u_char *, u_int);
 extern int ether_encap_print(u_short, const u_char *, u_int, u_int, u_short *);
 extern int llc_print(const u_char *, u_int, u_int, const u_char *,
        const u_char *, u_short *);
index 9d0f278f7b722f8f494c1790e3d0124a29a8ebda..78297c44605e367e835c8c294d6d8ff96606e5a3 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-     "@(#) $Header: /tcpdump/master/tcpdump/print-ascii.c,v 1.14 2003-12-29 10:51:34 hannes Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/print-ascii.c,v 1.15 2003-12-29 11:05:10 hannes Exp $";
 #endif
 #include <tcpdump-stdinc.h>
 #include <stdio.h>
@@ -135,7 +135,7 @@ ascii_print(register const u_char *ident, register const u_char *cp, register u_
  * telnet_print() wants this.  It is essentially default_print_unaligned()
  */
 void
-hex_print_with_offset(register const u_char *cp, register u_int length,
+hex_print_with_offset(register const u_char *ident, register const u_char *cp, register u_int length,
                      register u_int oset)
 {
        register u_int i, s;
@@ -145,7 +145,7 @@ hex_print_with_offset(register const u_char *cp, register u_int length,
        i = 0;
        while (--nshorts >= 0) {
                if ((i++ % 8) == 0) {
-                       (void)printf("\n0x%04x\t", oset);
+                       (void)printf("%s0x%04x: ", ident, oset);
                        oset += HEXDUMP_BYTES_PER_LINE;
                }
                s = *cp++;
@@ -153,7 +153,7 @@ hex_print_with_offset(register const u_char *cp, register u_int length,
        }
        if (length & 1) {
                if ((i % 8) == 0)
-                       (void)printf("\n0x%04x\t", oset);
+                       (void)printf("%s0x%04x: ", ident, oset);
                (void)printf(" %02x", *cp);
        }
 }
@@ -162,9 +162,9 @@ hex_print_with_offset(register const u_char *cp, register u_int length,
  * just for completeness
  */
 void
-hex_print(register const u_char *cp, register u_int length)
+hex_print(register const u_char *ident, register const u_char *cp, register u_int length)
 {
-       hex_print_with_offset(cp, length, 0);
+       hex_print_with_offset(ident, cp, length, 0);
 }
 
 #ifdef MAIN
index bf2f1719d76040a24ea27d8f1c168f7ed01e550e..4911e5caf2385375daae78d32a592216342f8c7c 100644 (file)
@@ -51,7 +51,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-     "@(#) $Header: /tcpdump/master/tcpdump/print-telnet.c,v 1.23 2003-11-16 09:36:39 guy Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/print-telnet.c,v 1.24 2003-12-29 11:05:10 hannes Exp $";
 #endif
 
 #include <tcpdump-stdinc.h>
@@ -244,7 +244,7 @@ telnet_print(const u_char *sp, u_int length)
                if (Xflag && 2 < vflag) {
                        if (first)
                                printf("\nTelnet:");
-                       hex_print_with_offset(sp, l, sp - osp);
+                       hex_print_with_offset("\n", sp, l, sp - osp);
                        if (l > 8)
                                printf("\n\t\t\t\t");
                        else