2 * Copyright (C) 2012 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
9 #include "netinet/ipl.h"
13 printpool_live(pool, fd, name, opts, fields)
25 if ((name != NULL) && strncmp(name, pool->ipo_name, FR_GROUPLEN))
26 return pool->ipo_next;
29 printpooldata(pool, opts);
31 if ((pool->ipo_flags & IPOOL_DELETE) != 0)
33 if ((opts & OPT_DEBUG) == 0)
36 obj.ipfo_rev = IPFILTER_VERSION;
37 obj.ipfo_type = IPFOBJ_LOOKUPITER;
39 obj.ipfo_size = sizeof(iter);
41 iter.ili_data = &entry;
42 iter.ili_type = IPLT_POOL;
43 iter.ili_otype = IPFLOOKUPITER_NODE;
44 iter.ili_ival = IPFGENITER_LOOKUP;
45 iter.ili_unit = pool->ipo_unit;
46 strncpy(iter.ili_name, pool->ipo_name, FR_GROUPLEN);
51 if (pool->ipo_list != NULL) {
52 while (!last && (ioctl(fd, SIOCLOOKUPITER, &obj) == 0)) {
53 if (entry.ipn_next == NULL)
55 (void) printpoolnode(&entry, opts, fields);
56 if ((opts & OPT_DEBUG) == 0)
65 if ((opts & OPT_DEBUG) == 0)
68 (void) ioctl(fd,SIOCIPFDELTOK, &iter.ili_key);
70 return pool->ipo_next;