2 * Copyright (C) 2002 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
7 * Use is subject to license terms.
10 #pragma ident "%Z%%M% %I% %E% SMI"
14 #define PRINTF (void)printf
15 #define FPRINTF (void)fprintf
18 void printhashdata(hp
, opts
)
23 if ((opts
& OPT_DEBUG
) == 0) {
24 if ((hp
->iph_type
& IPHASH_ANON
) == IPHASH_ANON
)
25 PRINTF("# 'anonymous' table\n");
26 switch (hp
->iph_type
& ~IPHASH_ANON
)
31 case IPHASH_GROUPMAP
:
33 if (hp
->iph_flags
& FR_INQUE
)
35 else if (hp
->iph_flags
& FR_OUTQUE
)
41 PRINTF("%#x", hp
->iph_type
);
46 PRINTF("Hash Table Number: %s", hp
->iph_name
);
47 if ((hp
->iph_type
& IPHASH_ANON
) == IPHASH_ANON
)
68 PRINTF("#%d", hp
->iph_unit
);
72 if ((opts
& OPT_DEBUG
) == 0) {
73 if ((hp
->iph_type
& ~IPHASH_ANON
) == IPHASH_LOOKUP
)
74 PRINTF(" type = hash");
75 PRINTF(" number = %s size = %lu",
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
[0]) {
107 ntomask(4, i
, &m
.s_addr
);
108 PRINTF("\t\tMask: %s\n", inet_ntoa(m
));