#include #include "main.h" #include "util.h" #include "vars.h" void printx(unsigned char *pkt, int nb) { int i; int j; i = 0; while (nb > 8) { printf("%02x %02x %02x %02x %02x %02x %02x %02x .\n",pkt[i],pkt[i+1],pkt[i+2],pkt[i+3],pkt[i+4],pkt[i+5],pkt[i+6],pkt[i+7]); i += 8; nb -= 8; } for (j=0;j0;nb--,buf++) { if ( (*buf < 0x20) || ((*buf > 0x7e) && (*buf < 0xa0)) ) { putchar(0xb7); /* ISO Latin-1 centered-dot */ } else { putchar(*buf); } } } void printxu(unsigned char *pkt, int nb) { int i; int j; i = 0; while (nb > 8) { printf("%02x %02x %02x %02x %02x %02x %02x %02x ",pkt[i],pkt[i+1],pkt[i+2],pkt[i+3],pkt[i+4],pkt[i+5],pkt[i+6],pkt[i+7]); printu(pkt+i,8); putchar('\n'); i += 8; nb -= 8; } for (j=0;j maxfull) np = truncto; i = 0; while (np > 8) { printf("%02x %02x %02x %02x %02x %02x %02x %02x ",pkt[i],pkt[i+1],pkt[i+2],pkt[i+3],pkt[i+4],pkt[i+5],pkt[i+6],pkt[i+7]); printu(pkt+i,8); putchar('\n'); i += 8; nb -= 8; np -= 8; } for (j=0;j