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_hash(iphp, iocfunc)
26 if (pool_open() == -1)
29 op.iplo_type = IPLT_HASH;
30 op.iplo_unit = iphp->iph_unit;
31 strncpy(op.iplo_name, iphp->iph_name, sizeof(op.iplo_name));
32 if (*op.iplo_name == '\0')
33 op.iplo_arg = IPHASH_ANON;
34 op.iplo_size = sizeof(iph);
35 op.iplo_struct = &iph;
37 bzero((char *)&iph, sizeof(iph));
38 iph.iph_unit = iphp->iph_unit;
39 iph.iph_type = iphp->iph_type;
40 strncpy(iph.iph_name, iphp->iph_name, sizeof(iph.iph_name));
41 iph.iph_flags = iphp->iph_flags;
43 if (pool_ioctl(iocfunc, SIOCLOOKUPDELTABLE, &op)) {
44 if ((opts & OPT_DONOTHING) == 0) {
45 return ipf_perror_fd(pool_fd(), iocfunc,
46 "remove lookup hash table");