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_pool.h"
19 remove_poolnode(unit, name, node, iocfunc)
28 if (pool_open() == -1)
32 op.iplo_type = IPLT_POOL;
34 strncpy(op.iplo_name, name, sizeof(op.iplo_name));
36 op.iplo_size = sizeof(pn);
38 bzero((char *)&pn, sizeof(pn));
39 bcopy((char *)&node->ipn_addr, (char *)&pn.ipn_addr,
41 bcopy((char *)&node->ipn_mask, (char *)&pn.ipn_mask,
43 pn.ipn_info = node->ipn_info;
44 strncpy(pn.ipn_name, node->ipn_name, sizeof(pn.ipn_name));
46 if (pool_ioctl(iocfunc, SIOCLOOKUPDELNODE, &op)) {
47 if ((opts & OPT_DONOTHING) == 0) {
48 return ipf_perror_fd(pool_fd(), iocfunc,
49 "remove lookup pool node");