struct pf_rule_addr	*src = NULL;
struct pf_rule_addr	*src = NULL, *dst = NULL;
pf_match_translation(int direction, struct ifnet *ifp, u_int8_t proto,    struct pf_addr *saddr, u_int16_t sport, struct pf_addr *daddr,    u_int16_t dport, sa_family_t af, int rs_num){	struct pf_rule		*r, *rm = NULL, *anchorrule = NULL;	struct pf_ruleset	*ruleset = NULL;	r = TAILQ_FIRST(pf_main_ruleset.rules[rs_num].active.ptr);	while (r && rm == NULL) {		struct pf_rule_addr	*src = NULL;		if (r->action == PF_BINAT && direction == PF_IN) {			if (r->rpool.cur != NULL)				src = &r->rpool.cur->addr;		} else			src = &r->src;		r->evaluations++;		if (r->ifp != NULL && ((r->ifp != ifp && !r->ifnot) ||		    (r->ifp == ifp && r->ifnot)))			r = r->skip[PF_SKIP_IFP].ptr;		else if (r->direction && r->direction != direction)			r = r->skip[PF_SKIP_DIR].ptr;		else if (r->af && r->af != af)			r = r->skip[PF_SKIP_AF].ptr;		else if (r->proto && r->proto != proto)			r = r->skip[PF_SKIP_PROTO].ptr;		else if (src != NULL &&		    PF_MISMATCHAW(&src->addr, saddr, af, src->not))			r = r->skip[PF_SKIP_SRC_ADDR].ptr;		else if (src != NULL && src->port_op &&		    !pf_match_port(src->port_op, src->port[0],		    src->port[1], sport))			r = r->skip[PF_SKIP_SRC_PORT].ptr;		else if (PF_MISMATCHAW(&r->dst.addr, daddr, af, r->dst.not))			r = r->skip[PF_SKIP_DST_ADDR].ptr;		else if (r->dst.port_op && !pf_match_port(r->dst.port_op,		    r->dst.port[0], r->dst.port[1], dport))			r = r->skip[PF_SKIP_DST_PORT].ptr;		else if (r->anchorname[0] && r->anchor == NULL)			r = TAILQ_NEXT(r, entries);		else if (r->anchor == NULL)				rm = r;		else			PF_STEP_INTO_ANCHOR(r, anchorrule, ruleset, rs_num);		if (r == NULL && anchorrule != NULL)			PF_STEP_OUT_OF_ANCHOR(r, anchorrule, ruleset,			    rs_num);	}	if (rm != NULL && (rm->action == PF_NONAT ||	    rm->action == PF_NORDR || rm->action == PF_NOBINAT))		return (NULL);	return (rm);}