Move /var/svc/log to /var/log/svc
[unleashed/lotheac.git] / usr / src / cmd / ipf / lib / common / printmask.c
blob1a5efe8d7ee63a6660b445a190768951bbae2938
1 /*
2 * Copyright (C) 1993-2001 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 * $Id: printmask.c,v 1.5 2002/06/15 04:48:33 darrenr Exp $
7 *
8 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
9 * Use is subject to license terms.
12 #pragma ident "%Z%%M% %I% %E% SMI"
14 #include "ipf.h"
17 void printmask(v, mask)
18 int v;
19 u_32_t *mask;
21 struct in_addr ipa;
22 int ones;
24 #ifdef USE_INET6
25 if (v == 6)
26 printf("/%d", count6bits(mask));
27 else
28 #endif
29 if ((ones = count4bits(*mask)) == -1) {
30 ipa.s_addr = *mask;
31 printf("/%s", inet_ntoa(ipa));
32 } else
33 printf("/%d", ones);