4 * Copyright (C) 2002 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
11 #define PRINTF (void)printf
12 #define FPRINTF (void)fprintf
15 void printhashdata(hp
, opts
)
20 if ((opts
& OPT_DEBUG
) == 0) {
21 if ((hp
->iph_type
& IPHASH_ANON
) == IPHASH_ANON
)
22 PRINTF("# 'anonymous' table\n");
23 if ((hp
->iph_flags
& IPHASH_DELETE
) == IPHASH_DELETE
)
25 switch (hp
->iph_type
& ~IPHASH_ANON
)
30 case IPHASH_GROUPMAP
:
32 if (hp
->iph_flags
& FR_INQUE
)
34 else if (hp
->iph_flags
& FR_OUTQUE
)
40 PRINTF("%#x", hp
->iph_type
);
45 PRINTF("Hash Table %s: %s",
46 isdigit(*hp
->iph_name
) ? "Number" : "Name",
48 if ((hp
->iph_type
& IPHASH_ANON
) == IPHASH_ANON
)
69 PRINTF("#%d", hp
->iph_unit
);
73 if ((opts
& OPT_DEBUG
) == 0) {
74 if ((hp
->iph_type
& ~IPHASH_ANON
) == IPHASH_LOOKUP
)
75 PRINTF(" type = hash");
76 PRINTF(" %s = %s size = %lu",
77 isdigit(*hp
->iph_name
) ? "number" : "name",
78 hp
->iph_name
, (u_long
)hp
->iph_size
);
79 if (hp
->iph_seed
!= 0)
80 PRINTF(" seed = %lu", hp
->iph_seed
);
84 switch (hp
->iph_type
& ~IPHASH_ANON
)
89 case IPHASH_GROUPMAP
:
90 PRINTF("groupmap Group. %s", hp
->iph_name
);
97 PRINTF("\t\tSize: %lu\tSeed: %lu",
98 (u_long
)hp
->iph_size
, hp
->iph_seed
);
99 PRINTF("\tRef. Count: %d\tMasks: %#x\n", hp
->iph_ref
,
103 if ((opts
& OPT_DEBUG
) != 0) {
107 for (i
= 0; i
< 32; i
++) {
108 if ((1 << i
) & hp
->iph_masks
) {
109 ntomask(4, i
, &m
.s_addr
);
110 PRINTF("\t\tMask: %s\n", inet_ntoa(m
));