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