xref: /illumos-gate/usr/src/cmd/ipf/lib/printip.c (revision b62492765b5c32c36300b63e3e8107ccd93bd312)
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