nat_t *nat_lookupoutip(np, ip, tcp) register ipnat_t *np; ip_t *ip; tcphdr_t *tcp;
nat_lookupoutip(np, ip, tcp) register ipnat_t *np; ip_t *ip; tcphdr_t *tcp;
nat_t *nat_lookupoutip(np, ip, tcp)register ipnat_t *np;ip_t *ip;tcphdr_t *tcp;{	struct in_addr ipaddr;	u_short	port = tcp->th_dport;	nat_t *nat;	ipaddr.s_addr = ip->ip_dst.s_addr;	nat = nat_table[1][ipaddr.s_addr % NAT_SIZE];	if (np->in_redir == NAT_MAP) {		for (; nat; nat = nat->nat_next)			if (nat->nat_outip.s_addr == ipaddr.s_addr &&			    (!nat->nat_outport || (port == nat->nat_outport)))				return nat;	} else		for (; nat; nat = nat->nat_next)			if (nat->nat_outip.s_addr == ipaddr.s_addr &&			    nat->nat_oip.s_addr == ip->ip_src.s_addr &&			    port == nat->nat_outport &&			    tcp->th_sport == nat->nat_oport)				return nat;	return NULL;}