Convert ipfilter userland function declarations from K&R to ANSI. This syncs our function declarations with NetBSD hg commit 75edcd7552a0 (apply our changes). Though not copied from NetBSD, this change was partially inspired by NetBSD's work and inspired by style(9). Reviewed by: glebius (for #network) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D33595
29 lines
434 B
C
29 lines
434 B
C
/* $FreeBSD$ */
|
|
|
|
/*
|
|
* Copyright (C) 2012 by Darren Reed.
|
|
*
|
|
* See the IPFILTER.LICENCE file for details on licencing.
|
|
*
|
|
* $Id$
|
|
*/
|
|
|
|
#include "ipf.h"
|
|
|
|
|
|
void
|
|
printmask(int family, u_32_t *mask)
|
|
{
|
|
struct in_addr ipa;
|
|
int ones;
|
|
|
|
if (family == AF_INET6) {
|
|
PRINTF("/%d", count6bits(mask));
|
|
} else if ((ones = count4bits(*mask)) == -1) {
|
|
ipa.s_addr = *mask;
|
|
PRINTF("/%s", inet_ntoa(ipa));
|
|
} else {
|
|
PRINTF("/%d", ones);
|
|
}
|
|
}
|