2 * Copyright (C) 2002 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
9 #include "netinet/ipl.h"
11 #define PRINTF (void)printf
12 #define FPRINTF (void)fprintf
15 iphtable_t *printhash_live(hp, fd, name, opts)
21 iphtent_t entry, *top, *node;
26 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);
53 while (!last && (ioctl(fd, SIOCLOOKUPITER, &obj) == 0)) {
54 if (entry.ipe_next == NULL)
57 top = malloc(sizeof(*top));
60 bcopy(&entry, top, sizeof(entry));
65 (void) printhashnode(hp, node, bcopywrap, opts);
74 if ((opts & OPT_DEBUG) == 0)