| * Copyright (C) 2003 by Darren Reed. |
| * See the IPFILTER.LICENCE file for details on licencing. |
| #include "netinet/ip_lookup.h" |
| #include "netinet/ip_htable.h" |
| int remove_hashnode(unit, name, node, iocfunc) |
| if ((hashfd == -1) && ((opts & OPT_DONOTHING) == 0)) |
| hashfd = open(IPLOOKUP_NAME, O_RDWR); |
| if ((hashfd == -1) && ((opts & OPT_DONOTHING) == 0)) |
| op.iplo_type = IPLT_HASH; |
| op.iplo_size = sizeof(ipe); |
| strncpy(op.iplo_name, name, sizeof(op.iplo_name)); |
| bzero((char *)&ipe, sizeof(ipe)); |
| bcopy((char *)&node->ipe_addr, (char *)&ipe.ipe_addr, |
| bcopy((char *)&node->ipe_mask, (char *)&ipe.ipe_mask, |
| printf("\t%s - ", inet_ntoa(ipe.ipe_addr.in4)); |
| printf("%s\n", inet_ntoa(ipe.ipe_mask.in4)); |
| if ((*iocfunc)(hashfd, SIOCLOOKUPDELNODE, &op)) |
| if (!(opts & OPT_DONOTHING)) { |
| perror("remove_hash:SIOCLOOKUPDELNODE"); |