1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * Copyright (C) 1993-2001 by Darren Reed. 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * See the IPFILTER.LICENCE file for details on licencing. 5*0Sstevel@tonic-gate * 6*0Sstevel@tonic-gate * $Id: binprint.c,v 1.8 2002/05/14 15:18:56 darrenr Exp $ 7*0Sstevel@tonic-gate */ 8*0Sstevel@tonic-gate 9*0Sstevel@tonic-gate #include "ipf.h" 10*0Sstevel@tonic-gate 11*0Sstevel@tonic-gate binprint(ptr,size)12*0Sstevel@tonic-gatevoid binprint(ptr, size) 13*0Sstevel@tonic-gate void *ptr; 14*0Sstevel@tonic-gate size_t size; 15*0Sstevel@tonic-gate { 16*0Sstevel@tonic-gate u_char *s; 17*0Sstevel@tonic-gate int i, j; 18*0Sstevel@tonic-gate 19*0Sstevel@tonic-gate for (i = size, j = 0, s = (u_char *)ptr; i; i--, s++) { 20*0Sstevel@tonic-gate j++; 21*0Sstevel@tonic-gate printf("%02x ", *s); 22*0Sstevel@tonic-gate if (j == 16) { 23*0Sstevel@tonic-gate printf("\n"); 24*0Sstevel@tonic-gate j = 0; 25*0Sstevel@tonic-gate } 26*0Sstevel@tonic-gate } 27*0Sstevel@tonic-gate putchar('\n'); 28*0Sstevel@tonic-gate (void)fflush(stdout); 29*0Sstevel@tonic-gate } 30