2 * Copyright (C) 2002 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
9 #define PRINTF (void)printf
10 #define FPRINTF (void)fprintf
13 void printhashdata(hp, opts)
18 if ((opts & OPT_DEBUG) == 0) {
19 if ((hp->iph_type & IPHASH_ANON) == IPHASH_ANON)
20 PRINTF("# 'anonymous' table\n");
21 if ((hp->iph_flags & IPHASH_DELETE) == IPHASH_DELETE)
23 switch (hp->iph_type & ~IPHASH_ANON)
28 case IPHASH_GROUPMAP :
30 if (hp->iph_flags & FR_INQUE)
32 else if (hp->iph_flags & FR_OUTQUE)
38 PRINTF("%#x", hp->iph_type);
43 PRINTF("Hash Table %s: %s",
44 isdigit(*hp->iph_name) ? "Number" : "Name",
46 if ((hp->iph_type & IPHASH_ANON) == IPHASH_ANON)
67 PRINTF("#%d", hp->iph_unit);
71 if ((opts & OPT_DEBUG) == 0) {
72 if ((hp->iph_type & ~IPHASH_ANON) == IPHASH_LOOKUP)
73 PRINTF(" type = hash");
74 PRINTF(" %s = %s size = %lu",
75 isdigit(*hp->iph_name) ? "number" : "name",
76 hp->iph_name, (u_long)hp->iph_size);
77 if (hp->iph_seed != 0)
78 PRINTF(" seed = %lu", hp->iph_seed);
82 switch (hp->iph_type & ~IPHASH_ANON)
87 case IPHASH_GROUPMAP :
88 PRINTF("groupmap Group. %s", hp->iph_name);
95 PRINTF("\t\tSize: %lu\tSeed: %lu",
96 (u_long)hp->iph_size, hp->iph_seed);
97 PRINTF("\tRef. Count: %d\tMasks: %#x\n", hp->iph_ref,
101 if ((opts & OPT_DEBUG) != 0) {
105 for (i = 0; i < 32; i++) {
106 if ((1 << i) & hp->iph_masks) {
107 ntomask(4, i, &m.s_addr);
108 PRINTF("\t\tMask: %s\n", inet_ntoa(m));