2 * Copyright (C) 2012 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
12 printhashdata(hp, opts)
17 if ((opts & OPT_DEBUG) == 0) {
18 if ((hp->iph_type & IPHASH_ANON) == IPHASH_ANON)
19 PRINTF("# 'anonymous' table refs %d\n", hp->iph_ref);
20 if ((hp->iph_flags & IPHASH_DELETE) == IPHASH_DELETE)
22 switch (hp->iph_type & ~IPHASH_ANON)
27 case IPHASH_GROUPMAP :
29 if (hp->iph_flags & FR_INQUE)
31 else if (hp->iph_flags & FR_OUTQUE)
37 PRINTF("%#x", hp->iph_type);
42 PRINTF("Hash Table %s: %s",
43 ISDIGIT(*hp->iph_name) ? "Number" : "Name",
45 if ((hp->iph_type & IPHASH_ANON) == IPHASH_ANON)
51 printunit(hp->iph_unit);
53 if ((opts & OPT_DEBUG) == 0) {
54 if ((hp->iph_type & ~IPHASH_ANON) == IPHASH_LOOKUP)
56 PRINTF(" %s=%s size=%lu",
57 ISDIGIT(*hp->iph_name) ? "number" : "name",
58 hp->iph_name, (u_long)hp->iph_size);
59 if (hp->iph_seed != 0)
60 PRINTF(" seed=%lu", hp->iph_seed);
64 switch (hp->iph_type & ~IPHASH_ANON)
69 case IPHASH_GROUPMAP :
70 PRINTF("groupmap Group. %s", hp->iph_name);
77 PRINTF("\t\tSize: %lu\tSeed: %lu",
78 (u_long)hp->iph_size, hp->iph_seed);
79 PRINTF("\tRef. Count: %d\tMasks: %#x\n", hp->iph_ref,
83 if ((opts & OPT_DEBUG) != 0) {
87 for (i = 0; i < 32; i++) {
88 if ((1 << i) & hp->iph_maskset[0]) {
89 ntomask(AF_INET, i, &m.s_addr);
90 PRINTF("\t\tMask: %s\n", inet_ntoa(m));