2 * Copyright (C) 2012 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
11 printdstlistnode(inp, copyfunc, opts, fields)
17 ipf_dstnode_t node, *np;
20 char buf[INET6_ADDRSTRLEN+1];
24 if ((*copyfunc)(inp, &node, sizeof(node)))
27 np = calloc(1, node.ipfd_size);
29 return node.ipfd_next;
30 if ((*copyfunc)(inp, np, node.ipfd_size))
34 for (i = 0; fields[i].w_value != 0; i++) {
35 printpoolfield(np, IPLT_DSTLIST, i);
36 if (fields[i + 1].w_value != 0)
40 } else if ((opts & OPT_DEBUG) == 0) {
42 if (np->ipfd_dest.fd_name >= 0)
43 PRINTF("%s:", np->ipfd_names);
44 if (np->ipfd_dest.fd_addr.adf_family == AF_INET) {
45 printip(AF_INET, (u_32_t *)&np->ipfd_dest.fd_ip);
48 str = inet_ntop(AF_INET6, &np->ipfd_dest.fd_ip6,
49 buf, sizeof(buf) - 1);
56 PRINTF("Interface: [%s]/%d\n", np->ipfd_names,
57 np->ipfd_dest.fd_name);
59 str = inet_ntop(np->ipfd_dest.fd_addr.adf_family,
60 &np->ipfd_dest.fd_ip6, buf, sizeof(buf) - 1);
62 PRINTF("\tAddress: %s\n", str);
65 PRINTF("\tAddress: %s\n", inet_ntoa(np->ipfd_dest.fd_ip));
69 "\t\tStates %d\tRef %d\tName [%s]\tUid %d\n",
71 "\t\tStates %d\tRef %d\tName [%s]\tUid %d\n",
73 np->ipfd_states, np->ipfd_ref,
74 np->ipfd_names, np->ipfd_uid);
77 return node.ipfd_next;