Permalink
Browse files

pass on ident string to hex_print()

  • Loading branch information...
1 parent 5c739af commit 60263ffef678ebb7d0d139a8c4d06446c2ea15f4 hannes committed Dec 29, 2003
Showing with 11 additions and 11 deletions.
  1. +3 −3 interface.h
  2. +6 −6 print-ascii.c
  3. +2 −2 print-telnet.c
View
@@ -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 *);
View
@@ -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,15 +145,15 @@ 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++;
(void)printf(" %02x%02x", s, *cp++);
}
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
View
@@ -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

0 comments on commit 60263ff

Please sign in to comment.