4 * Copyright (C) 2012 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
13 printhashnode(iphtable_t *iph, iphtent_t *ipep, copyfunc_t copyfunc, int opts,
20 if ((*copyfunc)(ipep, &ipe, sizeof(ipe)))
23 hv = IPE_V4_HASH_FN(ipe.ipe_addr.i6[0], ipe.ipe_mask.i6[0],
27 for (i = 0; fields[i].w_value != 0; i++) {
28 printpoolfield(&ipe, IPLT_HASH, i);
29 if (fields[i + 1].w_value != 0)
33 } else if ((opts & OPT_DEBUG) != 0) {
35 if (ipe.ipe_family == AF_INET6) {
36 char buf[INET6_ADDRSTRLEN + 1];
40 str = inet_ntop(AF_INET6, &ipe.ipe_addr.in6,
41 buf, sizeof(buf) - 1);
44 PRINTF("\t%d\tAddress: %s", hv, str);
45 printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr);
46 PRINTF("\tRef. Count: %d\tGroup: %s\n", ipe.ipe_ref,
49 PRINTF("\tHits: %"PRIu64"\tBytes: %"PRIu64"\n",
50 ipe.ipe_hits, ipe.ipe_bytes);
52 PRINTF("\tHits: %lu\tBytes: %lu\n",
53 ipe.ipe_hits, ipe.ipe_bytes);
54 #endif /* USE_QUAD_T */
55 } else if (ipe.ipe_family == AF_INET) {
57 if (ipe.ipe_family == AF_INET) {
58 #endif /* USE_INET6 */
59 PRINTF("\t%d\tAddress: %s", hv,
60 inet_ntoa(ipe.ipe_addr.in4));
61 printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr);
62 PRINTF("\tRef. Count: %d\tGroup: %s\n", ipe.ipe_ref,
65 PRINTF("\tHits: %"PRIu64"\tBytes: %"PRIu64"\n",
66 ipe.ipe_hits, ipe.ipe_bytes);
68 PRINTF("\tHits: %lu\tBytes: %lu\n",
69 ipe.ipe_hits, ipe.ipe_bytes);
70 #endif /* USE_QUAD_T */
72 PRINTF("\tAddress: family: %d\n",
77 printip(ipe.ipe_family, (u_32_t *)&ipe.ipe_addr.in4_addr);
78 printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr);
79 if (ipe.ipe_value != 0) {
80 switch (iph->iph_type & ~IPHASH_ANON)
82 case IPHASH_GROUPMAP :
83 if (strncmp(ipe.ipe_group, iph->iph_name,
85 PRINTF(", group=%s", ipe.ipe_group);