Lines Matching refs:php

3536 ipsec_policy_delete(ipsec_policy_head_t *php, ipsec_selkey_t *keys, int dir,
3542 ipsec_policy_root_t *pr = &php->iph_root[dir];
3551 rw_enter(&php->iph_lock, RW_WRITER);
3565 IPPOL_UNCHAIN(php, ip);
3567 php->iph_gen++;
3570 rw_exit(&php->iph_lock);
3577 rw_exit(&php->iph_lock);
3583 ipsec_policy_delete_index(ipsec_policy_head_t *php, uint64_t policy_index,
3594 rw_enter(&php->iph_lock, RW_WRITER);
3602 ip = (ipsec_policy_t *)avl_find(&php->iph_rulebyid,
3606 ip = avl_nearest(&php->iph_rulebyid, where, AVL_AFTER);
3616 IPPOL_UNCHAIN(php, ip);
3621 php->iph_gen++;
3625 rw_exit(&php->iph_lock);
3640 ipsec_check_policy(ipsec_policy_head_t *php, ipsec_policy_t *ipp, int direction)
3642 ipsec_policy_root_t *pr = &php->iph_root[direction];
3659 ASSERT(RW_WRITE_HELD(&php->iph_lock));
3814 ipsec_enter_policy(ipsec_policy_head_t *php, ipsec_policy_t *ipp, int direction,
3817 ipsec_policy_root_t *pr = &php->iph_root[direction];
3823 ASSERT(RW_WRITE_HELD(&php->iph_lock));
3833 php->iph_gen++;
3843 ipsec_insert_always(&php->iph_rulebyid, ipp);
3849 ipsec_ipr_flush(ipsec_policy_head_t *php, ipsec_policy_root_t *ipr)
3857 IPPOL_UNCHAIN(php, ip);
3867 IPPOL_UNCHAIN(php, ip);
3898 ipsec_polhead_flush(ipsec_policy_head_t *php, netstack_t *ns)
3902 ASSERT(RW_WRITE_HELD(&php->iph_lock));
3905 ipsec_ipr_flush(php, &php->iph_root[dir]);
3907 php->iph_gen++;
3912 ipsec_polhead_free(ipsec_policy_head_t *php, netstack_t *ns)
3916 ASSERT(php->iph_refs == 0);
3918 rw_enter(&php->iph_lock, RW_WRITER);
3919 ipsec_polhead_flush(php, ns);
3920 rw_exit(&php->iph_lock);
3921 rw_destroy(&php->iph_lock);
3923 ipsec_policy_root_t *ipr = &php->iph_root[dir];
3930 ipsec_polhead_free_table(php);
3931 kmem_free(php, sizeof (*php));
3950 ipsec_policy_head_t *php;
3952 php = kmem_alloc(sizeof (*php), KM_NOSLEEP);
3953 if (php == NULL)
3954 return (php);
3956 rw_init(&php->iph_lock, NULL, RW_DEFAULT, NULL);
3957 php->iph_refs = 1;
3958 php->iph_gen = 0;
3960 ipsec_ipr_init(&php->iph_root[IPSEC_TYPE_INBOUND]);
3961 ipsec_ipr_init(&php->iph_root[IPSEC_TYPE_OUTBOUND]);
3963 avl_create(&php->iph_rulebyid, ipsec_policy_cmpbyid,
3966 return (php);
3975 ipsec_polhead_split(ipsec_policy_head_t *php, netstack_t *ns)
3979 if (php == NULL)
3981 else if (php->iph_refs == 1)
3982 return (php);
3988 if (ipsec_copy_polhead(php, nphp, ns) != 0) {
3992 IPPH_REFRELE(php, ns);