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_hashnode(unit, name, node, iocfunc)
28 if (pool_open() == -1)
31 op.iplo_type = IPLT_HASH;
33 op.iplo_size = sizeof(ipe);
34 op.iplo_struct = &ipe;
36 strncpy(op.iplo_name, name, sizeof(op.iplo_name));
38 bzero((char *)&ipe, sizeof(ipe));
39 bcopy((char *)&node->ipe_addr, (char *)&ipe.ipe_addr,
40 sizeof(ipe.ipe_addr));
41 bcopy((char *)&node->ipe_mask, (char *)&ipe.ipe_mask,
42 sizeof(ipe.ipe_mask));
44 if (opts & OPT_DEBUG) {
45 printf("\t%s - ", inet_ntoa(ipe.ipe_addr.in4));
46 printf("%s\n", inet_ntoa(ipe.ipe_mask.in4));
49 if (pool_ioctl(iocfunc, SIOCLOOKUPDELNODE, &op)) {
50 if (!(opts & OPT_DONOTHING)) {
51 return ipf_perror_fd(pool_fd(), iocfunc,
52 "remove lookup hash node");