4 * Copyright (C) 2012 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
12 #include <sys/ioctl.h>
14 #include "netinet/ip_lookup.h"
15 #include "netinet/ip_htable.h"
19 remove_pool(poolp, iocfunc)
26 if (pool_open() == -1)
29 op.iplo_type = IPLT_POOL;
30 op.iplo_unit = poolp->ipo_unit;
31 strncpy(op.iplo_name, poolp->ipo_name, sizeof(op.iplo_name));
32 op.iplo_size = sizeof(pool);
33 op.iplo_struct = &pool;
35 bzero((char *)&pool, sizeof(pool));
36 pool.ipo_unit = poolp->ipo_unit;
37 strncpy(pool.ipo_name, poolp->ipo_name, sizeof(pool.ipo_name));
38 pool.ipo_flags = poolp->ipo_flags;
40 if (pool_ioctl(iocfunc, SIOCLOOKUPDELTABLE, &op)) {
41 if ((opts & OPT_DONOTHING) == 0) {
42 return ipf_perror_fd(pool_fd(), iocfunc,
43 "delete lookup pool");