* 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
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 *);
#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>
* 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;
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++;
}
if (length & 1) {
if ((i % 8) == 0)
- (void)printf("\n0x%04x\t", oset);
+ (void)printf("%s0x%04x: ", ident, oset);
(void)printf(" %02x", *cp);
}
}
* 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
#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>
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