sk                223 net/if_pfsync.c 	struct pf_state_key *sk = NULL;
sk                262 net/if_pfsync.c 	if ((sk = pf_alloc_state_key(st)) == NULL) {
sk                275 net/if_pfsync.c 		pool_put(&pf_state_key_pl, sk);
sk                286 net/if_pfsync.c 	pf_state_host_ntoh(&sp->lan, &sk->lan);
sk                287 net/if_pfsync.c 	pf_state_host_ntoh(&sp->gwy, &sk->gwy);
sk                288 net/if_pfsync.c 	pf_state_host_ntoh(&sp->ext, &sk->ext);
sk                297 net/if_pfsync.c 	sk->af = sp->af;
sk                298 net/if_pfsync.c 	sk->proto = sp->proto;
sk                299 net/if_pfsync.c 	sk->direction = sp->direction;
sk                330 net/if_pfsync.c 	struct pf_state_key *sk;
sk                430 net/if_pfsync.c 			for (sk = RB_MIN(pf_state_tree_lan_ext,
sk                431 net/if_pfsync.c 			    &pf_statetbl_lan_ext); sk; sk = nextsk) {
sk                433 net/if_pfsync.c 				    &pf_statetbl_lan_ext, sk);
sk                434 net/if_pfsync.c 				TAILQ_FOREACH(st, &sk->states, next) {
sk                514 net/if_pfsync.c 			sk = st->state_key;
sk                516 net/if_pfsync.c 			if (sk->proto == IPPROTO_TCP) {
sk                651 net/if_pfsync.c 			sk = st->state_key;
sk                653 net/if_pfsync.c 			if (sk->proto == IPPROTO_TCP) {
sk               1103 net/if_pfsync.c 	struct pf_state_key *sk = st->state_key;
sk               1189 net/if_pfsync.c 		pf_state_host_hton(&sk->lan, &sp->lan);
sk               1190 net/if_pfsync.c 		pf_state_host_hton(&sk->gwy, &sp->gwy);
sk               1191 net/if_pfsync.c 		pf_state_host_hton(&sk->ext, &sp->ext);
sk               1208 net/if_pfsync.c 		sp->af = sk->af;
sk               1209 net/if_pfsync.c 		sp->proto = sk->proto;
sk               1210 net/if_pfsync.c 		sp->direction = sk->direction;
sk                252 net/pf.c       #define	STATE_TRANSLATE(sk) \
sk                253 net/pf.c       	(sk)->lan.addr.addr32[0] != (sk)->gwy.addr.addr32[0] || \
sk                254 net/pf.c       	((sk)->af == AF_INET6 && \
sk                255 net/pf.c       	((sk)->lan.addr.addr32[1] != (sk)->gwy.addr.addr32[1] || \
sk                256 net/pf.c       	(sk)->lan.addr.addr32[2] != (sk)->gwy.addr.addr32[2] || \
sk                257 net/pf.c       	(sk)->lan.addr.addr32[3] != (sk)->gwy.addr.addr32[3])) || \
sk                258 net/pf.c       	(sk)->lan.port != (sk)->gwy.port
sk                531 net/pf.c       	struct pf_state_key	*sk;
sk                538 net/pf.c       		sk = RB_FIND(pf_state_tree_lan_ext, &pf_statetbl_lan_ext,
sk                542 net/pf.c       		sk = RB_FIND(pf_state_tree_ext_gwy, &pf_statetbl_ext_gwy,
sk                550 net/pf.c       	if (sk != NULL)
sk                551 net/pf.c       		TAILQ_FOREACH(s, &sk->states, next)
sk                561 net/pf.c       	struct pf_state_key	*sk;
sk                568 net/pf.c       		sk = RB_FIND(pf_state_tree_lan_ext,
sk                572 net/pf.c       		sk = RB_FIND(pf_state_tree_ext_gwy,
sk                579 net/pf.c       	if (sk != NULL) {
sk                580 net/pf.c       		ret = TAILQ_FIRST(&sk->states);
sk                584 net/pf.c       		TAILQ_FOREACH(s, &sk->states, next)
sk                679 net/pf.c       			struct pf_state_key *sk;
sk                684 net/pf.c       				sk = st->state_key;
sk                690 net/pf.c       				if (sk->af ==
sk                695 net/pf.c       				        &sk->lan.addr, sk->af)) ||
sk                698 net/pf.c       				        &sk->ext.addr, sk->af))) &&
sk                788 net/pf.c       	struct pf_state_key	*sk = s->state_key;
sk                793 net/pf.c       		pf_print_host(&sk->lan.addr, sk->lan.port,
sk                794 net/pf.c       		    sk->af);
sk                796 net/pf.c       		pf_print_host(&sk->gwy.addr, sk->gwy.port,
sk                797 net/pf.c       		    sk->af);
sk                799 net/pf.c       		pf_print_host(&sk->ext.addr, sk->ext.port,
sk                800 net/pf.c       		    sk->af);
sk               1182 net/pf.c       	struct pf_state_key *sk = s->state_key;
sk               1183 net/pf.c       	switch (sk->proto) {
sk               1197 net/pf.c       		printf("%u ", sk->proto);
sk               1200 net/pf.c       	pf_print_host(&sk->lan.addr, sk->lan.port, sk->af);
sk               1202 net/pf.c       	pf_print_host(&sk->gwy.addr, sk->gwy.port, sk->af);
sk               1204 net/pf.c       	pf_print_host(&sk->ext.addr, sk->ext.port, sk->af);
sk               2792 net/pf.c       pf_attach_state(struct pf_state_key *sk, struct pf_state *s, int tail)
sk               2794 net/pf.c       	s->state_key = sk;
sk               2795 net/pf.c       	sk->refcnt++;
sk               2799 net/pf.c       		TAILQ_INSERT_TAIL(&sk->states, s, next);
sk               2801 net/pf.c       		TAILQ_INSERT_HEAD(&sk->states, s, next);
sk               2807 net/pf.c       	struct pf_state_key	*sk = s->state_key;
sk               2809 net/pf.c       	if (sk == NULL)
sk               2813 net/pf.c       	TAILQ_REMOVE(&sk->states, s, next);
sk               2814 net/pf.c       	if (--sk->refcnt == 0) {
sk               2817 net/pf.c       			    &pf_statetbl_ext_gwy, sk);
sk               2820 net/pf.c       			    &pf_statetbl_lan_ext, sk);
sk               2821 net/pf.c       		pool_put(&pf_state_key_pl, sk);
sk               2828 net/pf.c       	struct pf_state_key	*sk;
sk               2830 net/pf.c       	if ((sk = pool_get(&pf_state_key_pl, PR_NOWAIT)) == NULL)
sk               2832 net/pf.c       	bzero(sk, sizeof(*sk));
sk               2833 net/pf.c       	TAILQ_INIT(&sk->states);
sk               2834 net/pf.c       	pf_attach_state(sk, s, 0);
sk               2836 net/pf.c       	return (sk);
sk               3242 net/pf.c       		struct pf_state_key *sk = NULL;
sk               3283 net/pf.c       			if (sk != NULL) {
sk               3284 net/pf.c       				pool_put(&pf_state_key_pl, sk);
sk               3388 net/pf.c       		if ((sk = pf_alloc_state_key(s)) == NULL) {
sk               3393 net/pf.c       		sk->proto = pd->proto;
sk               3394 net/pf.c       		sk->direction = direction;
sk               3395 net/pf.c       		sk->af = af;
sk               3397 net/pf.c       			PF_ACPY(&sk->gwy.addr, saddr, af);
sk               3398 net/pf.c       			PF_ACPY(&sk->ext.addr, daddr, af);
sk               3404 net/pf.c       				sk->gwy.port = nport;
sk               3405 net/pf.c       				sk->ext.port = 0;
sk               3408 net/pf.c       				sk->gwy.port = sport;
sk               3409 net/pf.c       				sk->ext.port = dport;
sk               3412 net/pf.c       				PF_ACPY(&sk->lan.addr, &pd->baddr, af);
sk               3413 net/pf.c       				sk->lan.port = bport;
sk               3415 net/pf.c       				PF_ACPY(&sk->lan.addr, &sk->gwy.addr, af);
sk               3416 net/pf.c       				sk->lan.port = sk->gwy.port;
sk               3419 net/pf.c       			PF_ACPY(&sk->lan.addr, daddr, af);
sk               3420 net/pf.c       			PF_ACPY(&sk->ext.addr, saddr, af);
sk               3426 net/pf.c       				sk->lan.port = nport;
sk               3427 net/pf.c       				sk->ext.port = 0;
sk               3430 net/pf.c       				sk->lan.port = dport;
sk               3431 net/pf.c       				sk->ext.port = sport;
sk               3434 net/pf.c       				PF_ACPY(&sk->gwy.addr, &pd->baddr, af);
sk               3435 net/pf.c       				sk->gwy.port = bport;
sk               3437 net/pf.c       				PF_ACPY(&sk->gwy.addr, &sk->lan.addr, af);
sk               3438 net/pf.c       				sk->gwy.port = sk->lan.port;
sk               5352 net/pf.c       	struct pf_state_key	*sk = NULL;
sk               5583 net/pf.c       			sk = s->state_key;
sk               5596 net/pf.c       			dirndx = (dir == sk->direction) ? 0 : 1;
sk               5611 net/pf.c       				x = (sk == NULL || sk->direction == dir) ?
sk               5614 net/pf.c       				x = (sk == NULL || sk->direction == dir) ?
sk               5625 net/pf.c       			pfr_update_stats(tr->src.addr.p.tbl, (sk == NULL ||
sk               5626 net/pf.c       			    sk->direction == dir) ?
sk               5631 net/pf.c       			pfr_update_stats(tr->dst.addr.p.tbl, (sk == NULL ||
sk               5632 net/pf.c       			    sk->direction == dir) ? pd.dst : pd.src, pd.af,
sk               5661 net/pf.c       	struct pf_state_key	*sk = NULL;
sk               5959 net/pf.c       			sk = s->state_key;
sk               5972 net/pf.c       			dirndx = (dir == sk->direction) ? 0 : 1;
sk               5987 net/pf.c       				x = (s == NULL || sk->direction == dir) ?
sk               5990 net/pf.c       				x = (s == NULL || sk->direction == dir) ?
sk               6001 net/pf.c       			pfr_update_stats(tr->src.addr.p.tbl, (sk == NULL ||
sk               6002 net/pf.c       			    sk->direction == dir) ? pd.src : pd.dst, pd.af,
sk               6006 net/pf.c       			pfr_update_stats(tr->dst.addr.p.tbl, (sk == NULL ||
sk               6007 net/pf.c       			    sk->direction == dir) ? pd.dst : pd.src, pd.af,
sk                847 net/pf_ioctl.c pf_state_export(struct pfsync_state *sp, struct pf_state_key *sk,
sk                854 net/pf_ioctl.c 	sp->lan.addr = sk->lan.addr;
sk                855 net/pf_ioctl.c 	sp->lan.port = sk->lan.port;
sk                856 net/pf_ioctl.c 	sp->gwy.addr = sk->gwy.addr;
sk                857 net/pf_ioctl.c 	sp->gwy.port = sk->gwy.port;
sk                858 net/pf_ioctl.c 	sp->ext.addr = sk->ext.addr;
sk                859 net/pf_ioctl.c 	sp->ext.port = sk->ext.port;
sk                860 net/pf_ioctl.c 	sp->proto = sk->proto;
sk                861 net/pf_ioctl.c 	sp->af = sk->af;
sk                862 net/pf_ioctl.c 	sp->direction = sk->direction;
sk                898 net/pf_ioctl.c pf_state_import(struct pfsync_state *sp, struct pf_state_key *sk,
sk                902 net/pf_ioctl.c 	sk->lan.addr = sp->lan.addr;
sk                903 net/pf_ioctl.c 	sk->lan.port = sp->lan.port;
sk                904 net/pf_ioctl.c 	sk->gwy.addr = sp->gwy.addr;
sk                905 net/pf_ioctl.c 	sk->gwy.port = sp->gwy.port;
sk                906 net/pf_ioctl.c 	sk->ext.addr = sp->ext.addr;
sk                907 net/pf_ioctl.c 	sk->ext.port = sp->ext.port;
sk                908 net/pf_ioctl.c 	sk->proto = sp->proto;
sk                909 net/pf_ioctl.c 	sk->af = sp->af;
sk                910 net/pf_ioctl.c 	sk->direction = sp->direction;
sk               1583 net/pf_ioctl.c 		struct pf_state_key	*sk;
sk               1591 net/pf_ioctl.c 			sk = s->state_key;
sk               1593 net/pf_ioctl.c 			if (sk->direction == PF_OUT) {
sk               1594 net/pf_ioctl.c 				src = &sk->lan;
sk               1595 net/pf_ioctl.c 				dst = &sk->ext;
sk               1597 net/pf_ioctl.c 				src = &sk->ext;
sk               1598 net/pf_ioctl.c 				dst = &sk->lan;
sk               1600 net/pf_ioctl.c 			if ((!psk->psk_af || sk->af == psk->psk_af)
sk               1602 net/pf_ioctl.c 			    sk->proto) &&
sk               1606 net/pf_ioctl.c 			    &src->addr, sk->af) &&
sk               1610 net/pf_ioctl.c 			    &dst->addr, sk->af) &&
sk               1638 net/pf_ioctl.c 		struct pf_state_key	*sk;
sk               1652 net/pf_ioctl.c 		if ((sk = pf_alloc_state_key(s)) == NULL) {
sk               1656 net/pf_ioctl.c 		pf_state_import(sp, sk, s);
sk               1660 net/pf_ioctl.c 			pool_put(&pf_state_key_pl, sk);
sk               1667 net/pf_ioctl.c 			pool_put(&pf_state_key_pl, sk);
sk               1769 net/pf_ioctl.c 		struct pf_state_key	*sk;
sk               1807 net/pf_ioctl.c 				sk = state->state_key;
sk               1809 net/pf_ioctl.c 					PF_ACPY(&pnl->rsaddr, &sk->lan.addr,
sk               1810 net/pf_ioctl.c 					    sk->af);
sk               1811 net/pf_ioctl.c 					pnl->rsport = sk->lan.port;
sk               1816 net/pf_ioctl.c 					PF_ACPY(&pnl->rdaddr, &sk->gwy.addr,
sk               1817 net/pf_ioctl.c 					    sk->af);
sk               1818 net/pf_ioctl.c 					pnl->rdport = sk->gwy.port;