4 * Copyright (C) 2012 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
13 printhashnode(iph, ipep, copyfunc, opts, fields)
24 if ((*copyfunc)(ipep, &ipe, sizeof(ipe)))
27 hv = IPE_V4_HASH_FN(ipe.ipe_addr.i6[0], ipe.ipe_mask.i6[0],
31 for (i = 0; fields[i].w_value != 0; i++) {
32 printpoolfield(&ipe, IPLT_HASH, i);
33 if (fields[i + 1].w_value != 0)
37 } else if ((opts & OPT_DEBUG) != 0) {
39 if (ipe.ipe_family == AF_INET6) {
40 char buf[INET6_ADDRSTRLEN + 1];
44 str = inet_ntop(AF_INET6, &ipe.ipe_addr.in6,
45 buf, sizeof(buf) - 1);
48 PRINTF("\t%d\tAddress: %s", hv, str);
49 printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr);
50 PRINTF("\tRef. Count: %d\tGroup: %s\n", ipe.ipe_ref,
53 PRINTF("\tHits: %"PRIu64"\tBytes: %"PRIu64"\n",
54 ipe.ipe_hits, ipe.ipe_bytes);
56 PRINTF("\tHits: %lu\tBytes: %lu\n",
57 ipe.ipe_hits, ipe.ipe_bytes);
58 #endif /* USE_QUAD_T */
59 } else if (ipe.ipe_family == AF_INET) {
61 if (ipe.ipe_family == AF_INET) {
62 #endif /* USE_INET6 */
63 PRINTF("\t%d\tAddress: %s", hv,
64 inet_ntoa(ipe.ipe_addr.in4));
65 printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr);
66 PRINTF("\tRef. Count: %d\tGroup: %s\n", ipe.ipe_ref,
69 PRINTF("\tHits: %"PRIu64"\tBytes: %"PRIu64"\n",
70 ipe.ipe_hits, ipe.ipe_bytes);
72 PRINTF("\tHits: %lu\tBytes: %lu\n",
73 ipe.ipe_hits, ipe.ipe_bytes);
74 #endif /* USE_QUAD_T */
76 PRINTF("\tAddress: family: %d\n",
81 printip(ipe.ipe_family, (u_32_t *)&ipe.ipe_addr.in4_addr);
82 printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr);
83 if (ipe.ipe_value != 0) {
84 switch (iph->iph_type & ~IPHASH_ANON)
86 case IPHASH_GROUPMAP :
87 if (strncmp(ipe.ipe_group, iph->iph_name,
89 PRINTF(", group=%s", ipe.ipe_group);