blob: 5f9ad270d03658e0a17da74a0862113bfcc44b9e [file] [log] [blame] [raw]
/*
* Copyright (C) 2000-2008 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* $Id$
*/
#include "ipf.h"
void
printhostmask(family, addr, mask)
int family;
u_32_t *addr, *mask;
{
#ifdef USE_INET6
char ipbuf[64];
#else
struct in_addr ipa;
#endif
if ((family == -1) || ((!addr || !*addr) && (!mask || !*mask)))
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
if (mask != NULL)
printmask(family, mask);
}
}