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