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(iphtable_t *hp, int fd, char *name, int opts, wordtab_t *fields)
15 iphtent_t entry, zero;
20 if ((name != NULL) && strncmp(name, hp->iph_name, FR_GROUPLEN))
21 return (hp->iph_next);
24 printhashdata(hp, opts);
26 if ((hp->iph_flags & IPHASH_DELETE) != 0)
29 if ((opts & OPT_DEBUG) == 0)
32 obj.ipfo_rev = IPFILTER_VERSION;
33 obj.ipfo_type = IPFOBJ_LOOKUPITER;
35 obj.ipfo_size = sizeof(iter);
37 iter.ili_data = &entry;
38 iter.ili_type = IPLT_HASH;
39 iter.ili_otype = IPFLOOKUPITER_NODE;
40 iter.ili_ival = IPFGENITER_LOOKUP;
41 iter.ili_unit = hp->iph_unit;
42 strncpy(iter.ili_name, hp->iph_name, FR_GROUPLEN);
46 bzero((char *)&zero, sizeof(zero));
48 while (!last && (ioctl(fd, SIOCLOOKUPITER, &obj) == 0)) {
49 if (entry.ipe_next == NULL)
51 if (bcmp(&zero, &entry, sizeof(zero)) == 0)
53 (void) printhashnode(hp, &entry, bcopywrap, opts, fields);
57 ipferror(fd, "walking hash nodes");
62 if ((opts & OPT_DEBUG) == 0)
64 return (hp->iph_next);