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