1 /* $FreeBSD: stable/9/contrib/ipfilter/lib/printpoolnode.c 170268 2007-06-04 02:54:36Z darrenr $ */ 2 3 /* 4 * Copyright (C) 2002-2005 by Darren Reed. 5 * 6 * See the IPFILTER.LICENCE file for details on licencing. 7 */ 8 9 #include "ipf.h" 10 11 #define PRINTF (void)printf 12 #define FPRINTF (void)fprintf 13 printpoolnode(np,opts)14ip_pool_node_t *printpoolnode(np, opts) 15 ip_pool_node_t *np; 16 int opts; 17 { 18 19 if ((opts & OPT_DEBUG) == 0) { 20 putchar(' '); 21 if (np->ipn_info == 1) 22 PRINTF("! "); 23 printip((u_32_t *)&np->ipn_addr.adf_addr.in4); 24 printmask((u_32_t *)&np->ipn_mask.adf_addr); 25 } else { 26 PRINTF("\tAddress: %s%s", np->ipn_info ? "! " : "", 27 inet_ntoa(np->ipn_addr.adf_addr.in4)); 28 printmask((u_32_t *)&np->ipn_mask.adf_addr); 29 PRINTF("\t\tHits %lu\tName %s\tRef %d\n", 30 np->ipn_hits, np->ipn_name, np->ipn_ref); 31 } 32 return np->ipn_next; 33 } 34