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