2 * Copyright (C) 2012 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
9 #include "netinet/ipl.h"
13 * Because the ipf_dstnode_t can vary in size because of the interface name,
14 * the size may be larger than just sizeof().
17 printdstl_live(d, fd, name, opts, fields)
24 ipf_dstnode_t *entry, *zero;
29 if ((name != NULL) && strncmp(name, d->ipld_name, FR_GROUPLEN))
32 entry = calloc(1, sizeof(*entry) + 64);
35 zero = calloc(1, sizeof(*zero) + 64);
42 printdstlistdata(d, opts);
44 if ((d->ipld_flags & IPHASH_DELETE) != 0)
47 if ((opts & OPT_DEBUG) == 0)
50 obj.ipfo_rev = IPFILTER_VERSION;
51 obj.ipfo_type = IPFOBJ_LOOKUPITER;
53 obj.ipfo_size = sizeof(iter);
55 iter.ili_data = entry;
56 iter.ili_type = IPLT_DSTLIST;
57 iter.ili_otype = IPFLOOKUPITER_NODE;
58 iter.ili_ival = IPFGENITER_LOOKUP;
59 iter.ili_unit = d->ipld_unit;
60 strncpy(iter.ili_name, d->ipld_name, FR_GROUPLEN);
65 while (!last && (ioctl(fd, SIOCLOOKUPITER, &obj) == 0)) {
66 if (entry->ipfd_next == NULL)
68 if (bcmp((char *)zero, (char *)entry, sizeof(*zero)) == 0)
70 (void) printdstlistnode(entry, bcopywrap, opts, fields);
74 (void) ioctl(fd, SIOCIPFDELTOK, &iter.ili_key);
81 if ((opts & OPT_DEBUG) == 0)