xref: /titanic_52/usr/src/cmd/ipf/lib/common/printpoolnode.c (revision 25c28e83beb90e7c80452a7c818c5e6f73a07dc8)
1 /*
2  * Copyright (C) 2002 by Darren Reed.
3  *
4  * See the IPFILTER.LICENCE file for details on licencing.
5  *
6  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
7  */
8 
9 #include "ipf.h"
10 
11 #define	PRINTF	(void)printf
12 
13 ip_pool_node_t *printpoolnode(np, opts)
14 ip_pool_node_t *np;
15 int opts;
16 {
17 	if ((opts & OPT_DEBUG) == 0)
18 		PRINTF(" %s", np->ipn_info ? "! " : "");
19 	else
20 		PRINTF("\tAddress: %s", np->ipn_info ? "! " : "");
21 
22 #ifdef USE_INET6
23 	if (np->ipn_addr.adf_family == AF_INET6)
24 		printhostmask(6, (u_32_t *)&np->ipn_addr.adf_addr.in6,
25 				 (u_32_t *)&np->ipn_mask.adf_addr);
26 	else
27 #endif
28 	{
29 		printip((u_32_t *)&np->ipn_addr.adf_addr.in4);
30 		printmask(4, (u_32_t *)&np->ipn_mask.adf_addr);
31 	}
32 
33 	if ((opts & OPT_DEBUG) != 0)
34 #ifdef USE_QUAD_T
35 		PRINTF("\t\tHits %qu\t\tBytes %qu\t\tName %s\n",
36 			np->ipn_hits, np->ipn_bytes, np->ipn_name);
37 #else
38 		PRINTF("\t\tHits %lu\t\tBytes %lu\t\tName %s\n",
39 			np->ipn_hits, np->ipn_bytes, np->ipn_name);
40 #endif
41 	return np->ipn_next;
42 }
43