xref: /titanic_50/usr/src/cmd/ipf/lib/common/printpoolnode.c (revision de22af4e795d4c10cbff9a60ec725aab46c03afe)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * Copyright (C) 2002 by Darren Reed.
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * See the IPFILTER.LICENCE file for details on licencing.
57663b816Sml37995  *
6*de22af4eSJohn Ojemann  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
77c478bd9Sstevel@tonic-gate  */
87c478bd9Sstevel@tonic-gate 
97c478bd9Sstevel@tonic-gate #include "ipf.h"
107c478bd9Sstevel@tonic-gate 
117c478bd9Sstevel@tonic-gate #define	PRINTF	(void)printf
127c478bd9Sstevel@tonic-gate 
printpoolnode(np,opts)137c478bd9Sstevel@tonic-gate ip_pool_node_t *printpoolnode(np, opts)
147c478bd9Sstevel@tonic-gate ip_pool_node_t *np;
157c478bd9Sstevel@tonic-gate int opts;
167c478bd9Sstevel@tonic-gate {
17*de22af4eSJohn Ojemann 	if ((opts & OPT_DEBUG) == 0)
18*de22af4eSJohn Ojemann 		PRINTF(" %s", np->ipn_info ? "! " : "");
19*de22af4eSJohn Ojemann 	else
20*de22af4eSJohn Ojemann 		PRINTF("\tAddress: %s", np->ipn_info ? "! " : "");
217663b816Sml37995 
227663b816Sml37995 #ifdef USE_INET6
237663b816Sml37995 	if (np->ipn_addr.adf_family == AF_INET6)
247663b816Sml37995 		printhostmask(6, (u_32_t *)&np->ipn_addr.adf_addr.in6,
257663b816Sml37995 				 (u_32_t *)&np->ipn_mask.adf_addr);
267663b816Sml37995 	else
277663b816Sml37995 #endif
287663b816Sml37995 	{
297c478bd9Sstevel@tonic-gate 		printip((u_32_t *)&np->ipn_addr.adf_addr.in4);
307663b816Sml37995 		printmask(4, (u_32_t *)&np->ipn_mask.adf_addr);
317663b816Sml37995 	}
327663b816Sml37995 
33*de22af4eSJohn Ojemann 	if ((opts & OPT_DEBUG) != 0)
34*de22af4eSJohn Ojemann #ifdef USE_QUAD_T
35*de22af4eSJohn Ojemann 		PRINTF("\t\tHits %qu\t\tBytes %qu\t\tName %s\n",
36*de22af4eSJohn Ojemann 			np->ipn_hits, np->ipn_bytes, np->ipn_name);
377663b816Sml37995 #else
38*de22af4eSJohn Ojemann 		PRINTF("\t\tHits %lu\t\tBytes %lu\t\tName %s\n",
39*de22af4eSJohn Ojemann 			np->ipn_hits, np->ipn_bytes, np->ipn_name);
407663b816Sml37995 #endif
417c478bd9Sstevel@tonic-gate 	return np->ipn_next;
427c478bd9Sstevel@tonic-gate }
43