Lines Matching refs:php

3537 ipsec_policy_delete(ipsec_policy_head_t *php, ipsec_selkey_t *keys, int dir,  in ipsec_policy_delete()  argument
3543 ipsec_policy_root_t *pr = &php->iph_root[dir]; in ipsec_policy_delete()
3552 rw_enter(&php->iph_lock, RW_WRITER); in ipsec_policy_delete()
3566 IPPOL_UNCHAIN(php, ip); in ipsec_policy_delete()
3568 php->iph_gen++; in ipsec_policy_delete()
3571 rw_exit(&php->iph_lock); in ipsec_policy_delete()
3578 rw_exit(&php->iph_lock); in ipsec_policy_delete()
3584 ipsec_policy_delete_index(ipsec_policy_head_t *php, uint64_t policy_index, in ipsec_policy_delete_index() argument
3595 rw_enter(&php->iph_lock, RW_WRITER); in ipsec_policy_delete_index()
3603 ip = (ipsec_policy_t *)avl_find(&php->iph_rulebyid, in ipsec_policy_delete_index()
3607 ip = avl_nearest(&php->iph_rulebyid, where, AVL_AFTER); in ipsec_policy_delete_index()
3617 IPPOL_UNCHAIN(php, ip); in ipsec_policy_delete_index()
3622 php->iph_gen++; in ipsec_policy_delete_index()
3626 rw_exit(&php->iph_lock); in ipsec_policy_delete_index()
3641 ipsec_check_policy(ipsec_policy_head_t *php, ipsec_policy_t *ipp, int direction) in ipsec_check_policy() argument
3643 ipsec_policy_root_t *pr = &php->iph_root[direction]; in ipsec_check_policy()
3660 ASSERT(RW_WRITE_HELD(&php->iph_lock)); in ipsec_check_policy()
3815 ipsec_enter_policy(ipsec_policy_head_t *php, ipsec_policy_t *ipp, int direction, in ipsec_enter_policy() argument
3818 ipsec_policy_root_t *pr = &php->iph_root[direction]; in ipsec_enter_policy()
3824 ASSERT(RW_WRITE_HELD(&php->iph_lock)); in ipsec_enter_policy()
3834 php->iph_gen++; in ipsec_enter_policy()
3844 ipsec_insert_always(&php->iph_rulebyid, ipp); in ipsec_enter_policy()
3850 ipsec_ipr_flush(ipsec_policy_head_t *php, ipsec_policy_root_t *ipr) in ipsec_ipr_flush() argument
3858 IPPOL_UNCHAIN(php, ip); in ipsec_ipr_flush()
3868 IPPOL_UNCHAIN(php, ip); in ipsec_ipr_flush()
3899 ipsec_polhead_flush(ipsec_policy_head_t *php, netstack_t *ns) in ipsec_polhead_flush() argument
3903 ASSERT(RW_WRITE_HELD(&php->iph_lock)); in ipsec_polhead_flush()
3906 ipsec_ipr_flush(php, &php->iph_root[dir]); in ipsec_polhead_flush()
3908 php->iph_gen++; in ipsec_polhead_flush()
3913 ipsec_polhead_free(ipsec_policy_head_t *php, netstack_t *ns) in ipsec_polhead_free() argument
3917 ASSERT(php->iph_refs == 0); in ipsec_polhead_free()
3919 rw_enter(&php->iph_lock, RW_WRITER); in ipsec_polhead_free()
3920 ipsec_polhead_flush(php, ns); in ipsec_polhead_free()
3921 rw_exit(&php->iph_lock); in ipsec_polhead_free()
3922 rw_destroy(&php->iph_lock); in ipsec_polhead_free()
3924 ipsec_policy_root_t *ipr = &php->iph_root[dir]; in ipsec_polhead_free()
3931 ipsec_polhead_free_table(php); in ipsec_polhead_free()
3932 kmem_free(php, sizeof (*php)); in ipsec_polhead_free()
3951 ipsec_policy_head_t *php; in ipsec_polhead_create() local
3953 php = kmem_alloc(sizeof (*php), KM_NOSLEEP); in ipsec_polhead_create()
3954 if (php == NULL) in ipsec_polhead_create()
3955 return (php); in ipsec_polhead_create()
3957 rw_init(&php->iph_lock, NULL, RW_DEFAULT, NULL); in ipsec_polhead_create()
3958 php->iph_refs = 1; in ipsec_polhead_create()
3959 php->iph_gen = 0; in ipsec_polhead_create()
3961 ipsec_ipr_init(&php->iph_root[IPSEC_TYPE_INBOUND]); in ipsec_polhead_create()
3962 ipsec_ipr_init(&php->iph_root[IPSEC_TYPE_OUTBOUND]); in ipsec_polhead_create()
3964 avl_create(&php->iph_rulebyid, ipsec_policy_cmpbyid, in ipsec_polhead_create()
3967 return (php); in ipsec_polhead_create()
3976 ipsec_polhead_split(ipsec_policy_head_t *php, netstack_t *ns) in ipsec_polhead_split() argument
3980 if (php == NULL) in ipsec_polhead_split()
3982 else if (php->iph_refs == 1) in ipsec_polhead_split()
3983 return (php); in ipsec_polhead_split()
3989 if (ipsec_copy_polhead(php, nphp, ns) != 0) { in ipsec_polhead_split()
3993 IPPH_REFRELE(php, ns); in ipsec_polhead_split()