Home | History | Annotate | Download | only in net

Lines Matching defs:sk

292 #define	STATE_TRANSLATE(sk) \
293 (sk)->lan.addr.addr32[0] != (sk)->gwy.addr.addr32[0] || \
294 ((sk)->af == AF_INET6 && \
295 ((sk)->lan.addr.addr32[1] != (sk)->gwy.addr.addr32[1] || \
296 (sk)->lan.addr.addr32[2] != (sk)->gwy.addr.addr32[2] || \
297 (sk)->lan.addr.addr32[3] != (sk)->gwy.addr.addr32[3])) || \
298 (sk)->lan.port != (sk)->gwy.port
586 struct pf_state_key *sk;
593 sk = RB_FIND(pf_state_tree_lan_ext, &pf_statetbl_lan_ext,
597 sk = RB_FIND(pf_state_tree_ext_gwy, &pf_statetbl_ext_gwy,
605 if (sk != NULL)
606 TAILQ_FOREACH(s, &sk->states, next)
616 struct pf_state_key *sk;
623 sk = RB_FIND(pf_state_tree_lan_ext,
627 sk = RB_FIND(pf_state_tree_ext_gwy,
634 if (sk != NULL) {
635 ret = TAILQ_FIRST(&sk->states);
639 TAILQ_FOREACH(s, &sk->states, next)
734 struct pf_state_key *sk;
739 sk = st->state_key;
745 if (sk->af ==
750 &sk->lan.addr, sk->af)) ||
753 &sk->ext.addr, sk->af))) &&
843 struct pf_state_key *sk = s->state_key;
848 pf_print_host(&sk->lan.addr, sk->lan.port,
849 sk->af);
851 pf_print_host(&sk->gwy.addr, sk->gwy.port,
852 sk->af);
854 pf_print_host(&sk->ext.addr, sk->ext.port,
855 sk->af);
888 /* must not happen. we must have found the sk above! */
1262 struct pf_state_key *sk = s->state_key;
1263 switch (sk->proto) {
1277 printf("%u ", sk->proto);
1280 pf_print_host(&sk->lan.addr, sk->lan.port, sk->af);
1282 pf_print_host(&sk->gwy.addr, sk->gwy.port, sk->af);
1284 pf_print_host(&sk->ext.addr, sk->ext.port, sk->af);
3022 pf_attach_state(struct pf_state_key *sk, struct pf_state *s, int tail)
3024 s->state_key = sk;
3025 sk->refcnt++;
3029 TAILQ_INSERT_TAIL(&sk->states, s, next);
3031 TAILQ_INSERT_HEAD(&sk->states, s, next);
3037 struct pf_state_key *sk = s->state_key;
3039 if (sk == NULL)
3043 TAILQ_REMOVE(&sk->states, s, next);
3044 if (--sk->refcnt == 0) {
3047 &pf_statetbl_ext_gwy, sk);
3050 &pf_statetbl_lan_ext, sk);
3051 pool_put(&pf_state_key_pl, sk);
3058 struct pf_state_key *sk;
3060 if ((sk = pool_get(&pf_state_key_pl, PR_NOWAIT)) == NULL)
3062 bzero(sk, sizeof(*sk));
3063 TAILQ_INIT(&sk->states);
3064 pf_attach_state(sk, s, 0);
3066 return (sk);
3483 struct pf_state_key *sk = NULL;
3524 if (sk != NULL) {
3525 pool_put(&pf_state_key_pl, sk);
3629 if ((sk = pf_alloc_state_key(s)) == NULL) {
3634 sk->proto = pd->proto;
3635 sk->direction = direction;
3636 sk->af = af;
3638 PF_ACPY(&sk->gwy.addr, saddr, af);
3639 PF_ACPY(&sk->ext.addr, daddr, af);
3645 sk->gwy.port = nport;
3646 sk->ext.port = 0;
3649 sk->gwy.port = sport;
3650 sk->ext.port = dport;
3653 PF_ACPY(&sk->lan.addr, &pd->baddr, af);
3654 sk->lan.port = bport;
3656 PF_ACPY(&sk->lan.addr, &sk->gwy.addr, af);
3657 sk->lan.port = sk->gwy.port;
3660 PF_ACPY(&sk->lan.addr, daddr, af);
3661 PF_ACPY(&sk->ext.addr, saddr, af);
3667 sk->lan.port = nport;
3668 sk->ext.port = 0;
3671 sk->lan.port = dport;
3672 sk->ext.port = sport;
3675 PF_ACPY(&sk->gwy.addr, &pd->baddr, af);
3676 sk->gwy.port = bport;
3678 PF_ACPY(&sk->gwy.addr, &sk->lan.addr, af);
3679 sk->gwy.port = sk->lan.port;
5718 struct pf_state_key *sk = NULL;
6000 sk = s->state_key;
6013 dirndx = (dir == sk->direction) ? 0 : 1;
6028 x = (sk == NULL || sk->direction == dir) ?
6031 x = (sk == NULL || sk->direction == dir) ?
6042 pfr_update_stats(tr->src.addr.p.tbl, (sk == NULL ||
6043 sk->direction == dir) ?
6048 pfr_update_stats(tr->dst.addr.p.tbl, (sk == NULL ||
6049 sk->direction == dir) ? pd.dst : pd.src, pd.af,
6078 struct pf_state_key *sk = NULL;
6422 sk = s->state_key;
6435 dirndx = (dir == sk->direction) ? 0 : 1;
6450 x = (s == NULL || sk->direction == dir) ?
6453 x = (s == NULL || sk->direction == dir) ?
6464 pfr_update_stats(tr->src.addr.p.tbl, (sk == NULL ||
6465 sk->direction == dir) ? pd.src : pd.dst, pd.af,
6469 pfr_update_stats(tr->dst.addr.p.tbl, (sk == NULL ||
6470 sk->direction == dir) ? pd.dst : pd.src, pd.af,