From: Fredrik Tolf Date: Sat, 9 Aug 2008 14:17:30 +0000 (+0200) Subject: Print packet contents from test code. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=4f6c7408011df0741cff090df878b5b362a38747;p=mctap.git Print packet contents from test code. --- diff --git a/src/mctap.c b/src/mctap.c index 52dd294..8125c41 100644 --- a/src/mctap.c +++ b/src/mctap.c @@ -77,7 +77,7 @@ static int mkmcastsk4(struct in_addr group, int port) static void test(int fd) { char buf[65536]; - int ret; + int i, ret; struct sockaddr_storage nm; socklen_t nmlen; @@ -89,6 +89,11 @@ static void test(int fd) exit(1); } printf("%s %i:\n", formataddress((struct sockaddr *)&nm, nmlen), ret); + for(i = 0; i < ret; i++) { + printf("%02x ", (unsigned char)buf[i]); + if(i % 20 == 0) + putchar(10); + } } }