network/uinet/sys/netinet/ipfw/ip_fw_nat.c
/*
 * delete the pointers for nat entry ix, or all of them if ix < 0
 */
delete the pointers for nat entry ix, or all of them if ix < 0
delete the pointers for nat entry ix or all of them if ix < 0
static void
flush_nat_ptrs(struct ip_fw_chain *chain, const int ix)
{
	int i;
	ipfw_insn_nat *cmd;
	IPFW_WLOCK_ASSERT(chain);
	for (i = 0; i < chain->n_rules; i++) {
		cmd = (ipfw_insn_nat *)ACTION_PTR(chain->map[i]);
		if (cmd->o.opcode == O_NAT && cmd->nat != NULL &&
			    (ix < 0 || cmd->nat->id == ix))
			cmd->nat = NULL;
	}
}
static void flush_nat_ptrs ( struct ip_fw_chain * chain , const int ix ) { int i ; ipfw_insn_nat * cmd ; IPFW_WLOCK_ASSERT ( chain ) ; for ( i = 0 ; i < chain -> n_rules ; i ++ ) { cmd = ( ipfw_insn_nat * ) ACTION_PTR ( chain -> map [ i ] ) ; if ( cmd -> o . opcode == O_NAT && cmd -> nat != NULL && ( ix < 0 || cmd -> nat -> id == ix ) ) cmd -> nat = NULL ; } }
delete the pointers for nat entry ix, or all of them if ix < 0
delete the pointers for nat entry ix or all of them if ix < 0
/* XXX skip log and the like ? */