xref: /onnv-gate/usr/src/cmd/ipf/lib/common/printsbuf.c (revision 2393:76e0289ce525)
1*2393Syz155240 /*
2*2393Syz155240  * Copyright (C) 1993-2005  by Darren Reed.
3*2393Syz155240  * See the IPFILTER.LICENCE file for details on licencing.
4*2393Syz155240  */
5*2393Syz155240 
60Sstevel@tonic-gate #ifdef	IPFILTER_SCAN
70Sstevel@tonic-gate 
80Sstevel@tonic-gate #include <ctype.h>
90Sstevel@tonic-gate #include <stdio.h>
100Sstevel@tonic-gate #include "ipf.h"
110Sstevel@tonic-gate #include "netinet/ip_scan.h"
120Sstevel@tonic-gate 
printsbuf(buf)130Sstevel@tonic-gate void printsbuf(buf)
140Sstevel@tonic-gate char *buf;
150Sstevel@tonic-gate {
160Sstevel@tonic-gate 	u_char *s;
170Sstevel@tonic-gate 	int i;
180Sstevel@tonic-gate 
190Sstevel@tonic-gate 	for (s = (u_char *)buf, i = ISC_TLEN; i; i--, s++) {
20*2393Syz155240 		if (ISPRINT(*s))
210Sstevel@tonic-gate 			putchar(*s);
220Sstevel@tonic-gate 		else
230Sstevel@tonic-gate 			printf("\\%o", *s);
240Sstevel@tonic-gate 	}
250Sstevel@tonic-gate }
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #endif
28