Sync usage with man page.
[netbsd-mini2440.git] / dist / ipf / lib / printmask.c
blob5d335cb8efad6e9ecffcc9c104ae3726e19c39f8
1 /* $NetBSD$ */
3 /*
4 * Copyright (C) 2000-2005 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
8 * Id: printmask.c,v 1.5.4.1 2006/06/16 17:21:13 darrenr Exp
9 */
11 #include "ipf.h"
14 void printmask(mask)
15 u_32_t *mask;
17 struct in_addr ipa;
18 int ones;
20 #ifdef USE_INET6
21 if (use_inet6)
22 printf("/%d", count6bits(mask));
23 else
24 #endif
25 if ((ones = count4bits(*mask)) == -1) {
26 ipa.s_addr = *mask;
27 printf("/%s", inet_ntoa(ipa));
28 } else
29 printf("/%d", ones);