Lines Matching refs:sidx
634 if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af)) in pf_packet_rework_nat()
636 &th->th_sum, &nk->addr[pd->sidx], in pf_packet_rework_nat()
637 nk->port[pd->sidx], 0, pd->af, pd->naf); in pf_packet_rework_nat()
648 if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af)) in pf_packet_rework_nat()
650 &uh->uh_sum, &nk->addr[pd->sidx], in pf_packet_rework_nat()
651 nk->port[pd->sidx], 1, pd->af, pd->naf); in pf_packet_rework_nat()
663 if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af)) { in pf_packet_rework_nat()
665 &checksum, &nk->addr[pd->sidx], in pf_packet_rework_nat()
666 nk->port[pd->sidx], 1, pd->af, pd->naf); in pf_packet_rework_nat()
679 if (nk->port[pd->sidx] != ih->icmp_id) { in pf_packet_rework_nat()
682 nk->port[pd->sidx], 0); in pf_packet_rework_nat()
683 ih->icmp_id = nk->port[pd->sidx]; in pf_packet_rework_nat()
691 if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af)) { in pf_packet_rework_nat()
695 pd->ip_sum, nk->addr[pd->sidx].v4.s_addr, in pf_packet_rework_nat()
699 PF_ACPY(pd->src, &nk->addr[pd->sidx], pd->af); in pf_packet_rework_nat()
1696 key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; in pf_state_key_addr_setup()
1697 key->addr[pd->sidx].addr32[1] = 0; in pf_state_key_addr_setup()
1698 key->addr[pd->sidx].addr32[2] = 0; in pf_state_key_addr_setup()
1699 key->addr[pd->sidx].addr32[3] = IPV6_ADDR_INT32_ONE; in pf_state_key_addr_setup()
1706 PF_ACPY(&key->addr[pd->sidx], saddr, pd->af); in pf_state_key_addr_setup()
1728 (*sk)->port[pd->sidx] = sport; in pf_state_key_setup()
1741 (*sk)->port[pd->sidx] = pd->osport; in pf_state_key_setup()
1754 PF_ACPY(&(*nk)->addr[pd->sidx], &pd->ndaddr, pd->naf); in pf_state_key_setup()
1756 (*nk)->port[pd->sidx] = pd->ndport; in pf_state_key_setup()
1758 PF_ACPY(&(*nk)->addr[pd->sidx], &pd->nsaddr, pd->naf); in pf_state_key_setup()
1760 (*nk)->port[pd->sidx] = pd->nsport; in pf_state_key_setup()
5585 if (PF_ANEQ(&pd->nsaddr, &nk->addr[pd->sidx], pd->af) || in pf_test_rule()
5586 nk->port[pd->sidx] != pd->nsport) { in pf_test_rule()
5588 pd->ip_sum, &th->th_sum, &nk->addr[pd->sidx], in pf_test_rule()
5589 nk->port[pd->sidx], 0, pd->af, pd->naf); in pf_test_rule()
5609 if (PF_ANEQ(&pd->nsaddr, &nk->addr[pd->sidx], pd->af) || in pf_test_rule()
5610 nk->port[pd->sidx] != pd->nsport) { in pf_test_rule()
5614 &nk->addr[pd->sidx], in pf_test_rule()
5615 nk->port[pd->sidx], 1, pd->af, pd->naf); in pf_test_rule()
5637 if (PF_ANEQ(&pd->nsaddr, &nk->addr[pd->sidx], pd->af) || in pf_test_rule()
5638 nk->port[pd->sidx] != pd->nsport) { in pf_test_rule()
5641 &nk->addr[pd->sidx], in pf_test_rule()
5642 nk->port[pd->sidx], 1, pd->af, pd->naf); in pf_test_rule()
5661 if (PF_ANEQ(&pd->nsaddr, &nk->addr[pd->sidx], AF_INET)) { in pf_test_rule()
5663 nk->addr[pd->sidx].v4.s_addr, 0); in pf_test_rule()
5674 nk->port[pd->sidx] != pd->hdr.icmp.icmp_id) { in pf_test_rule()
5677 nk->port[pd->sidx], 0); in pf_test_rule()
5678 pd->hdr.icmp.icmp_id = nk->port[pd->sidx]; in pf_test_rule()
5686 if (PF_ANEQ(&pd->nsaddr, &nk->addr[pd->sidx], AF_INET6)) { in pf_test_rule()
5688 &nk->addr[pd->sidx], 0); in pf_test_rule()
5705 &nk->addr[pd->sidx], AF_INET)) { in pf_test_rule()
5708 nk->addr[pd->sidx].v4.s_addr, 0); in pf_test_rule()
5724 &nk->addr[pd->sidx], AF_INET6)) { in pf_test_rule()
5725 PF_ACPY(&pd->nsaddr, &nk->addr[pd->sidx], pd->af); in pf_test_rule()
5726 PF_ACPY(pd->src, &nk->addr[pd->sidx], pd->af); in pf_test_rule()
5983 sk->port[pd->didx], &sk->addr[pd->sidx], in pf_test_rule()
5984 sk->port[pd->sidx], virtual_type, in pf_test_rule()
5987 ret = pf_translate(pd, &sk->addr[pd->sidx], in pf_test_rule()
5988 sk->port[pd->sidx], &sk->addr[pd->didx], in pf_test_rule()
6089 (sn_reason = pf_insert_src_node(sns, snhs, nr, &sk->addr[pd->sidx], in pf_create_state()
6861 &sk->addr[pd->sidx], &sk->addr[pd->didx], in pf_synproxy()
6862 sk->port[pd->sidx], sk->port[pd->didx], in pf_synproxy()
6883 &sk->addr[pd->sidx], &sk->addr[pd->didx], in pf_synproxy()
6884 sk->port[pd->sidx], sk->port[pd->didx], in pf_synproxy()
6919 PF_ACPY(&key.addr[pd->sidx], pd->src, key.af); in pf_test_state()
6921 key.port[pd->sidx] = pd->osport; in pf_test_state()
7077 int afto, sidx, didx; in pf_test_state() local
7080 nk = (*state)->key[pd->sidx]; in pf_test_state()
7087 sidx = pd->didx; in pf_test_state()
7088 didx = pd->sidx; in pf_test_state()
7090 sidx = pd->sidx; in pf_test_state()
7094 if (afto || PF_ANEQ(pd->src, &nk->addr[sidx], pd->af) || in pf_test_state()
7095 nk->port[sidx] != pd->osport) in pf_test_state()
7097 pd->pcksum, &nk->addr[sidx], in pf_test_state()
7098 nk->port[sidx], pd->virtual_proto == IPPROTO_UDP, in pf_test_state()
7109 PF_ACPY(&pd->nsaddr, &nk->addr[sidx], nk->af); in pf_test_state()
7591 *iidx = pd->sidx; in pf_icmp_state_lookup()
7592 key->port[pd->sidx] = icmpid; in pf_icmp_state_lookup()
7596 key->port[pd->sidx] = type; in pf_icmp_state_lookup()
7695 int afto, sidx, didx; in pf_test_state_icmp() local
7698 nk = (*state)->key[pd->sidx]; in pf_test_state_icmp()
7705 sidx = pd->didx; in pf_test_state_icmp()
7706 didx = pd->sidx; in pf_test_state_icmp()
7709 sidx = pd->sidx; in pf_test_state_icmp()
7725 PF_ANEQ(pd->src, &nk->addr[sidx], AF_INET)) in pf_test_state_icmp()
7728 nk->addr[sidx].v4.s_addr, in pf_test_state_icmp()
7762 PF_ANEQ(pd->src, &nk->addr[sidx], AF_INET6)) in pf_test_state_icmp()
7765 &nk->addr[sidx], 0); in pf_test_state_icmp()
7783 PF_ACPY(&pd->nsaddr, &nk->addr[sidx], nk->af); in pf_test_state_icmp()
7810 pd2.sidx = (pd->dir == PF_IN) ? 1 : 0; in pf_test_state_icmp()
7912 PF_ACPY(&key.addr[pd2.sidx], pd2.src, key.af); in pf_test_state_icmp()
7914 key.port[pd2.sidx] = th.th_sport; in pf_test_state_icmp()
7985 nk = (*state)->key[pd->sidx]; in pf_test_state_icmp()
7990 int afto, sidx, didx; in pf_test_state_icmp() local
7996 sidx = pd2.didx; in pf_test_state_icmp()
7997 didx = pd2.sidx; in pf_test_state_icmp()
7999 sidx = pd2.sidx; in pf_test_state_icmp()
8011 &pd2, &nk->addr[sidx], in pf_test_state_icmp()
8016 pd->ip_sum, &dummy_cksum, &nk->addr[pd2.sidx], in pf_test_state_icmp()
8017 nk->port[sidx], 1, pd->af, nk->af); in pf_test_state_icmp()
8022 PF_ACPY(&pd->nsaddr, &nk->addr[pd2.sidx], in pf_test_state_icmp()
8046 &nk->addr[pd2.sidx], pd2.af) || in pf_test_state_icmp()
8047 nk->port[pd2.sidx] != th.th_sport) in pf_test_state_icmp()
8049 daddr, &nk->addr[pd2.sidx], in pf_test_state_icmp()
8050 nk->port[pd2.sidx], NULL, in pf_test_state_icmp()
8106 PF_ACPY(&key.addr[pd2.sidx], pd2.src, key.af); in pf_test_state_icmp()
8108 key.port[pd2.sidx] = uh.uh_sport; in pf_test_state_icmp()
8119 nk = (*state)->key[pd->sidx]; in pf_test_state_icmp()
8124 int afto, sidx, didx; in pf_test_state_icmp() local
8129 sidx = pd2.didx; in pf_test_state_icmp()
8130 didx = pd2.sidx; in pf_test_state_icmp()
8132 sidx = pd2.sidx; in pf_test_state_icmp()
8144 &pd2, &nk->addr[sidx], in pf_test_state_icmp()
8149 pd->ip_sum, &uh.uh_sum, &nk->addr[pd2.sidx], in pf_test_state_icmp()
8150 nk->port[sidx], 1, pd->af, nk->af); in pf_test_state_icmp()
8157 &nk->addr[pd2.sidx], nk->af); in pf_test_state_icmp()
8180 &nk->addr[pd2.sidx], pd2.af) || in pf_test_state_icmp()
8181 nk->port[pd2.sidx] != uh.uh_sport) in pf_test_state_icmp()
8183 daddr, &nk->addr[pd2.sidx], in pf_test_state_icmp()
8184 nk->port[pd2.sidx], &uh.uh_sum, in pf_test_state_icmp()
8236 PF_ACPY(&key.addr[pd2.sidx], pd2.src, key.af); in pf_test_state_icmp()
8238 key.port[pd2.sidx] = sh.src_port; in pf_test_state_icmp()
8269 nk = (*state)->key[pd->sidx]; in pf_test_state_icmp()
8274 int afto, sidx, didx; in pf_test_state_icmp() local
8279 sidx = pd2.didx; in pf_test_state_icmp()
8280 didx = pd2.sidx; in pf_test_state_icmp()
8282 sidx = pd2.sidx; in pf_test_state_icmp()
8294 &pd2, &nk->addr[sidx], in pf_test_state_icmp()
8298 sh.src_port = nk->port[sidx]; in pf_test_state_icmp()
8302 &nk->addr[pd2.sidx], nk->af); in pf_test_state_icmp()
8325 &nk->addr[pd2.sidx], pd2.af) || in pf_test_state_icmp()
8326 nk->port[pd2.sidx] != sh.src_port) in pf_test_state_icmp()
8328 daddr, &nk->addr[pd2.sidx], in pf_test_state_icmp()
8329 nk->port[pd2.sidx], NULL, in pf_test_state_icmp()
8403 nk = (*state)->key[pd->sidx]; in pf_test_state_icmp()
8408 int afto, sidx, didx; in pf_test_state_icmp() local
8413 sidx = pd2.didx; in pf_test_state_icmp()
8414 didx = pd2.sidx; in pf_test_state_icmp()
8417 sidx = pd2.sidx; in pf_test_state_icmp()
8431 &pd2, &nk->addr[sidx], in pf_test_state_icmp()
8444 &nk->addr[pd2.sidx], nk->af); in pf_test_state_icmp()
8461 &nk->addr[pd2.sidx], pd2.af) || in pf_test_state_icmp()
8467 daddr, &nk->addr[pd2.sidx], in pf_test_state_icmp()
8529 nk = (*state)->key[pd->sidx]; in pf_test_state_icmp()
8534 int afto, sidx, didx; in pf_test_state_icmp() local
8539 sidx = pd2.didx; in pf_test_state_icmp()
8540 didx = pd2.sidx; in pf_test_state_icmp()
8543 sidx = pd2.sidx; in pf_test_state_icmp()
8557 &pd2, &nk->addr[sidx], in pf_test_state_icmp()
8571 &nk->addr[pd2.sidx], nk->af); in pf_test_state_icmp()
8580 &nk->addr[pd2.sidx], pd2.af) || in pf_test_state_icmp()
8582 nk->port[pd2.sidx] != iih->icmp6_id)) in pf_test_state_icmp()
8586 daddr, &nk->addr[pd2.sidx], in pf_test_state_icmp()
8612 PF_ACPY(&key.addr[pd2.sidx], pd2.src, key.af); in pf_test_state_icmp()
8625 &nk->addr[pd2.sidx], pd2.af)) in pf_test_state_icmp()
8627 &nk->addr[pd2.sidx], 0, NULL, in pf_test_state_icmp()
9818 pd->sidx = (dir == PF_IN) ? 0 : 1; in pf_setup_pdesc()