blob: 950a0f080e69f4148cf4c2be072ca3cd7f1bc6cc [file] [log] [blame] [raw]
/*
* Copyright (C) 2009 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* $Id$
*/
#include "ipf.h"
void
printhost(family, addr)
int family;
u_32_t *addr;
{
#ifdef USE_INET6
char ipbuf[64];
#else
struct in_addr ipa;
#endif
if ((family == -1) || !*addr)
PRINTF("any");
else {
void *ptr = addr;
#ifdef USE_INET6
PRINTF("%s", inet_ntop(family, ptr, ipbuf, sizeof(ipbuf)));
#else
ipa.s_addr = *addr;
PRINTF("%s", inet_ntoa(ipa));
#endif
}
}