]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ipfilter/lib/binprint.c
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ipfilter / lib / binprint.c
1 /*      $FreeBSD$       */
2
3 /*
4  * Copyright (C) 2000-2002 by Darren Reed.
5  *
6  * See the IPFILTER.LICENCE file for details on licencing.
7  *
8  * $Id: binprint.c,v 1.8.4.1 2006/06/16 17:20:56 darrenr Exp $
9  */
10
11 #include "ipf.h"
12
13
14 void binprint(ptr, size)
15 void *ptr;
16 size_t size;
17 {
18         u_char *s;
19         int i, j;
20
21         for (i = size, j = 0, s = (u_char *)ptr; i; i--, s++) {
22                 j++;
23                 printf("%02x ", *s);
24                 if (j == 16) {
25                         printf("\n");
26                         j = 0;
27                 }
28         }
29         putchar('\n');
30         (void)fflush(stdout);
31 }