blob: f1b0de6e732433f012a529b02849be0076c8bed2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/* $FreeBSD: src/contrib/ipfilter/lib/printmask.c,v 1.4.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $ */
/*
* Copyright (C) 2000-2005 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* $Id: printmask.c,v 1.5.4.1 2006/06/16 17:21:13 darrenr Exp $
*/
#include "ipf.h"
void printmask(mask)
u_32_t *mask;
{
struct in_addr ipa;
int ones;
#ifdef USE_INET6
if (use_inet6)
printf("/%d", count6bits(mask));
else
#endif
if ((ones = count4bits(*mask)) == -1) {
ipa.s_addr = *mask;
printf("/%s", inet_ntoa(ipa));
} else
printf("/%d", ones);
}
|