1 --- tcpdump-3.4a5-orig/tcpdump.c Sat May 30 12:23:33 1998
2 +++ tcpdump-3.4a5/tcpdump.c Tue Dec 15 15:26:36 1998
5 default_print_unaligned(register const u_char *cp, register u_int length)
8 - register int nshorts;
9 + register u_int i,offs=0;
11 - nshorts = (u_int) length / sizeof(u_short);
13 - while (--nshorts >= 0) {
15 - (void)printf("\n\t\t\t");
17 - (void)printf(" %02x%02x", s, *cp++);
21 - (void)printf("\n\t\t\t");
22 - (void)printf(" %02x", *cp);
27 + printf("\n%5u=$%04X: ",offs,offs);
28 + for (i=0;i<prBYTES;i++) {
29 + if (i<length) printf("%02X ",cp[i]);
30 + else fputs(" ",stdout);
31 + if ((i&7)==7 && i!=prBYTES-1) putchar(' ');
34 + for (i=0;i<prBYTES && i<length;i++)
35 + if (cp[i]>=0x20 && cp[i]<0x7F) putchar(cp[i]);
40 +// For trailing ASCII space padding (too wide!)
42 + while (i++<prBYTES) putchar(' ');
52 default_print(register const u_char *bp, register u_int length)
54 - register const u_short *sp;
56 - register int nshorts;
59 - default_print_unaligned(bp, length);
63 - nshorts = (u_int) length / sizeof(u_short);
65 - while (--nshorts >= 0) {
67 - (void)printf("\n\t\t\t");
68 - (void)printf(" %04x", ntohs(*sp++));
72 - (void)printf("\n\t\t\t");
73 - (void)printf(" %02x", *(u_char *)sp);
75 + default_print_unaligned(bp, length);