2 * Copyright (C) 2012 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
9 #include "netinet/ipl.h"
13 printhash_live(hp, fd, name, opts, fields)
20 iphtent_t entry, zero;
25 if ((name != NULL) && strncmp(name, hp->iph_name, FR_GROUPLEN))
29 printhashdata(hp, opts);
31 if ((hp->iph_flags & IPHASH_DELETE) != 0)
34 if ((opts & OPT_DEBUG) == 0)
37 obj.ipfo_rev = IPFILTER_VERSION;
38 obj.ipfo_type = IPFOBJ_LOOKUPITER;
40 obj.ipfo_size = sizeof(iter);
42 iter.ili_data = &entry;
43 iter.ili_type = IPLT_HASH;
44 iter.ili_otype = IPFLOOKUPITER_NODE;
45 iter.ili_ival = IPFGENITER_LOOKUP;
46 iter.ili_unit = hp->iph_unit;
47 strncpy(iter.ili_name, hp->iph_name, FR_GROUPLEN);
51 bzero((char *)&zero, sizeof(zero));
53 while (!last && (ioctl(fd, SIOCLOOKUPITER, &obj) == 0)) {
54 if (entry.ipe_next == NULL)
56 if (bcmp(&zero, &entry, sizeof(zero)) == 0)
58 (void) printhashnode(hp, &entry, bcopywrap, opts, fields);
62 ipferror(fd, "walking hash nodes:");
67 if ((opts & OPT_DEBUG) == 0)