NetBSD/dist/ipf/lib/printsbuf.c

33 lines
549 B
C
Raw Normal View History

2007-04-15 00:34:18 +04:00
/* $NetBSD: printsbuf.c,v 1.3 2007/04/14 20:34:31 martin Exp $ */
/*
* Copyright (C) 2002-2004 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: printsbuf.c,v 1.2.4.2 2006/06/16 17:21:14 darrenr Exp
*/
2004-03-28 12:55:20 +04:00
#ifdef IPFILTER_SCAN
#include <ctype.h>
#include <stdio.h>
#include "ipf.h"
#include "netinet/ip_scan.h"
void printsbuf(buf)
char *buf;
{
u_char *s;
int i;
for (s = (u_char *)buf, i = ISC_TLEN; i; i--, s++) {
if (ISPRINT(*s))
2004-03-28 12:55:20 +04:00
putchar(*s);
else
printf("\\%o", *s);
}
}
#endif