xref: /titanic_52/usr/src/cmd/ipf/lib/common/printip.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*
2  * Copyright (C) 1993-2001 by Darren Reed.
3  *
4  * See the IPFILTER.LICENCE file for details on licencing.
5  *
6  * $Id: printip.c,v 1.3 2002/07/13 12:10:27 darrenr Exp $
7  */
8 
9 #include "ipf.h"
10 
11 
12 void	printip(addr)
13 u_32_t	*addr;
14 {
15 	struct in_addr ipa;
16 
17 	ipa.s_addr = *addr;
18 	if (ntohl(ipa.s_addr) < 256)
19 		printf("%lu", (u_long)ntohl(ipa.s_addr));
20 	else
21 		printf("%s", inet_ntoa(ipa));
22 }
23