1*f4b3ec61Sdh /*
2*f4b3ec61Sdh  * Copyright (C) 2002 by Darren Reed.
3*f4b3ec61Sdh  *
4*f4b3ec61Sdh  * See the IPFILTER.LICENCE file for details on licencing.
5*f4b3ec61Sdh  *
6*f4b3ec61Sdh  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
7*f4b3ec61Sdh  * Use is subject to license terms.
8*f4b3ec61Sdh  */
9*f4b3ec61Sdh 
10*f4b3ec61Sdh #pragma ident	"%Z%%M%	%I%	%E% SMI"
11*f4b3ec61Sdh 
12*f4b3ec61Sdh #include "ipf.h"
13*f4b3ec61Sdh 
14*f4b3ec61Sdh #define	PRINTF	(void)printf
15*f4b3ec61Sdh #define	FPRINTF	(void)fprintf
16*f4b3ec61Sdh 
printpooldata(pool,opts)17*f4b3ec61Sdh void printpooldata(pool, opts)
18*f4b3ec61Sdh ip_pool_t *pool;
19*f4b3ec61Sdh int opts;
20*f4b3ec61Sdh {
21*f4b3ec61Sdh 
22*f4b3ec61Sdh 	if ((opts & OPT_DEBUG) == 0) {
23*f4b3ec61Sdh 		if ((pool->ipo_flags & IPOOL_ANON) != 0)
24*f4b3ec61Sdh 			PRINTF("# 'anonymous' tree %s\n", pool->ipo_name);
25*f4b3ec61Sdh 		PRINTF("table role = ");
26*f4b3ec61Sdh 	} else {
27*f4b3ec61Sdh 		PRINTF("Name: %s", pool->ipo_name);
28*f4b3ec61Sdh 		if ((pool->ipo_flags & IPOOL_ANON) == IPOOL_ANON)
29*f4b3ec61Sdh 			PRINTF("(anon)");
30*f4b3ec61Sdh 		putchar(' ');
31*f4b3ec61Sdh 		PRINTF("Role: ");
32*f4b3ec61Sdh 	}
33*f4b3ec61Sdh 
34*f4b3ec61Sdh 	switch (pool->ipo_unit)
35*f4b3ec61Sdh 	{
36*f4b3ec61Sdh 	case IPL_LOGIPF :
37*f4b3ec61Sdh 		PRINTF("ipf");
38*f4b3ec61Sdh 		break;
39*f4b3ec61Sdh 	case IPL_LOGNAT :
40*f4b3ec61Sdh 		PRINTF("nat");
41*f4b3ec61Sdh 		break;
42*f4b3ec61Sdh 	case IPL_LOGSTATE :
43*f4b3ec61Sdh 		PRINTF("state");
44*f4b3ec61Sdh 		break;
45*f4b3ec61Sdh 	case IPL_LOGAUTH :
46*f4b3ec61Sdh 		PRINTF("auth");
47*f4b3ec61Sdh 		break;
48*f4b3ec61Sdh 	case IPL_LOGSYNC :
49*f4b3ec61Sdh 		PRINTF("sync");
50*f4b3ec61Sdh 		break;
51*f4b3ec61Sdh 	case IPL_LOGSCAN :
52*f4b3ec61Sdh 		PRINTF("scan");
53*f4b3ec61Sdh 		break;
54*f4b3ec61Sdh 	case IPL_LOGLOOKUP :
55*f4b3ec61Sdh 		PRINTF("lookup");
56*f4b3ec61Sdh 		break;
57*f4b3ec61Sdh 	case IPL_LOGCOUNT :
58*f4b3ec61Sdh 		PRINTF("count");
59*f4b3ec61Sdh 		break;
60*f4b3ec61Sdh 	default :
61*f4b3ec61Sdh 		PRINTF("unknown(%d)", pool->ipo_unit);
62*f4b3ec61Sdh 	}
63*f4b3ec61Sdh 
64*f4b3ec61Sdh 	if ((opts & OPT_DEBUG) == 0) {
65*f4b3ec61Sdh 		PRINTF(" type = tree number = %s\n", pool->ipo_name);
66*f4b3ec61Sdh 	} else {
67*f4b3ec61Sdh 		putchar(' ');
68*f4b3ec61Sdh 
69*f4b3ec61Sdh 		PRINTF("\tReferences: %d\tHits: %lu\n", pool->ipo_ref,
70*f4b3ec61Sdh 			pool->ipo_hits);
71*f4b3ec61Sdh 		PRINTF("\tNodes Starting at %p\n", pool->ipo_list);
72*f4b3ec61Sdh 	}
73*f4b3ec61Sdh }
74