printmask.c revision 145519
1/* $FreeBSD: head/contrib/ipfilter/lib/printmask.c 145519 2005-04-25 18:20:15Z darrenr $ */ 2 3/* 4 * Copyright (C) 1993-2001 by Darren Reed. 5 * 6 * See the IPFILTER.LICENCE file for details on licencing. 7 * 8 * Id: printmask.c,v 1.5 2002/06/15 04:48:33 darrenr Exp 9 */ 10 11#include "ipf.h" 12 13 14void printmask(mask) 15u_32_t *mask; 16{ 17 struct in_addr ipa; 18 int ones; 19 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); 30} 31