xref: /illumos-gate/usr/src/cmd/ipf/lib/common/printsbuf.c (revision ab25eeb5)
1*ab25eeb5Syz /*
2*ab25eeb5Syz  * Copyright (C) 1993-2005  by Darren Reed.
3*ab25eeb5Syz  * See the IPFILTER.LICENCE file for details on licencing.
4*ab25eeb5Syz  */
5*ab25eeb5Syz 
67c478bd9Sstevel@tonic-gate #ifdef	IPFILTER_SCAN
77c478bd9Sstevel@tonic-gate 
87c478bd9Sstevel@tonic-gate #include <ctype.h>
97c478bd9Sstevel@tonic-gate #include <stdio.h>
107c478bd9Sstevel@tonic-gate #include "ipf.h"
117c478bd9Sstevel@tonic-gate #include "netinet/ip_scan.h"
127c478bd9Sstevel@tonic-gate 
printsbuf(buf)137c478bd9Sstevel@tonic-gate void printsbuf(buf)
147c478bd9Sstevel@tonic-gate char *buf;
157c478bd9Sstevel@tonic-gate {
167c478bd9Sstevel@tonic-gate 	u_char *s;
177c478bd9Sstevel@tonic-gate 	int i;
187c478bd9Sstevel@tonic-gate 
197c478bd9Sstevel@tonic-gate 	for (s = (u_char *)buf, i = ISC_TLEN; i; i--, s++) {
20*ab25eeb5Syz 		if (ISPRINT(*s))
217c478bd9Sstevel@tonic-gate 			putchar(*s);
227c478bd9Sstevel@tonic-gate 		else
237c478bd9Sstevel@tonic-gate 			printf("\\%o", *s);
247c478bd9Sstevel@tonic-gate 	}
257c478bd9Sstevel@tonic-gate }
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #endif
28