1 /* 2 * Copyright (C) 2012 by Darren Reed. 3 * 4 * See the IPFILTER.LICENCE file for details on licencing. 5 */ 6 7 #include "ipf.h" 8 #include <ctype.h> 9 10 11 void 12 printpooldata(ip_pool_t *pool, int opts) 13 { 14 15 if ((opts & OPT_DEBUG) == 0) { 16 if ((pool->ipo_flags & IPOOL_ANON) != 0) 17 PRINTF("# 'anonymous' tree %s\n", pool->ipo_name); 18 if ((pool->ipo_flags & IPOOL_DELETE) != 0) 19 PRINTF("# "); 20 PRINTF("table role="); 21 } else { 22 if ((pool->ipo_flags & IPOOL_DELETE) != 0) 23 PRINTF("# "); 24 PRINTF("%s: %s", 25 ISDIGIT(*pool->ipo_name) ? "Number" : "Name", 26 pool->ipo_name); 27 if ((pool->ipo_flags & IPOOL_ANON) == IPOOL_ANON) 28 PRINTF("(anon)"); 29 putchar(' '); 30 PRINTF("Role: "); 31 } 32 33 printunit(pool->ipo_unit); 34 35 if ((opts & OPT_DEBUG) == 0) { 36 PRINTF(" type=tree %s=%s\n", 37 (!*pool->ipo_name || ISDIGIT(*pool->ipo_name)) ? \ 38 "number" : "name", pool->ipo_name); 39 } else { 40 putchar(' '); 41 42 PRINTF("\tReferences: %d\tHits: %lu\n", pool->ipo_ref, 43 pool->ipo_hits); 44 if ((pool->ipo_flags & IPOOL_DELETE) != 0) 45 PRINTF("# "); 46 PRINTF("\tNodes Starting at %p\n", pool->ipo_list); 47 } 48 } 49