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