Lines Matching refs:vrf

144 	struct sctp_vrf *vrf = NULL;  in sctp_allocate_vrf()  local
148 vrf = sctp_find_vrf(vrf_id); in sctp_allocate_vrf()
149 if (vrf) { in sctp_allocate_vrf()
151 return (vrf); in sctp_allocate_vrf()
153 SCTP_MALLOC(vrf, struct sctp_vrf *, sizeof(struct sctp_vrf), in sctp_allocate_vrf()
155 if (vrf == NULL) { in sctp_allocate_vrf()
163 memset(vrf, 0, sizeof(struct sctp_vrf)); in sctp_allocate_vrf()
164 vrf->vrf_id = vrf_id; in sctp_allocate_vrf()
165 LIST_INIT(&vrf->ifnlist); in sctp_allocate_vrf()
166 vrf->total_ifa_count = 0; in sctp_allocate_vrf()
167 vrf->refcount = 0; in sctp_allocate_vrf()
169 SCTP_INIT_VRF_TABLEID(vrf); in sctp_allocate_vrf()
171 vrf->vrf_addr_hash = SCTP_HASH_INIT(SCTP_VRF_ADDR_HASH_SIZE, in sctp_allocate_vrf()
172 &vrf->vrf_addr_hashmark); in sctp_allocate_vrf()
173 if (vrf->vrf_addr_hash == NULL) { in sctp_allocate_vrf()
178 SCTP_FREE(vrf, SCTP_M_VRF); in sctp_allocate_vrf()
184 LIST_INSERT_HEAD(bucket, vrf, next_vrf); in sctp_allocate_vrf()
186 return (vrf); in sctp_allocate_vrf()
223 sctp_free_vrf(struct sctp_vrf *vrf) in sctp_free_vrf() argument
225 if (SCTP_DECREMENT_AND_CHECK_REFCOUNT(&vrf->refcount)) { in sctp_free_vrf()
226 if (vrf->vrf_addr_hash) { in sctp_free_vrf()
227 SCTP_HASH_FREE(vrf->vrf_addr_hash, vrf->vrf_addr_hashmark); in sctp_free_vrf()
228 vrf->vrf_addr_hash = NULL; in sctp_free_vrf()
231 LIST_REMOVE(vrf, next_vrf); in sctp_free_vrf()
232 SCTP_FREE(vrf, SCTP_M_VRF); in sctp_free_vrf()
242 if (sctp_ifnp->vrf) { in sctp_free_ifn()
243 sctp_free_vrf(sctp_ifnp->vrf); in sctp_free_ifn()
367 struct sctp_vrf *vrf; in sctp_add_addr_to_vrf() local
398 vrf = sctp_ifnp->vrf; in sctp_add_addr_to_vrf()
400 vrf = sctp_find_vrf(vrf_id); in sctp_add_addr_to_vrf()
401 if (vrf == NULL) { in sctp_add_addr_to_vrf()
402 vrf = sctp_allocate_vrf(vrf_id); in sctp_add_addr_to_vrf()
403 if (vrf == NULL) { in sctp_add_addr_to_vrf()
423 sctp_ifnp->vrf = vrf; in sctp_add_addr_to_vrf()
424 atomic_add_int(&vrf->refcount, 1); in sctp_add_addr_to_vrf()
434 LIST_INSERT_HEAD(&vrf->ifnlist, sctp_ifnp, next_ifn); in sctp_add_addr_to_vrf()
437 sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED); in sctp_add_addr_to_vrf()
553 hash_addr_head = &vrf->vrf_addr_hash[(hash_of_addr & vrf->vrf_addr_hashmark)]; in sctp_add_addr_to_vrf()
558 vrf->total_ifa_count++; in sctp_add_addr_to_vrf()
608 struct sctp_vrf *vrf; in sctp_del_addr_from_vrf() local
612 vrf = sctp_find_vrf(vrf_id); in sctp_del_addr_from_vrf()
613 if (vrf == NULL) { in sctp_del_addr_from_vrf()
623 sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED); in sctp_del_addr_from_vrf()
647 vrf->total_ifa_count--; in sctp_del_addr_from_vrf()
705 struct sctp_vrf *vrf; in sctp_does_stcb_own_this_addr() local
721 vrf = sctp_find_vrf(stcb->asoc.vrf_id); in sctp_does_stcb_own_this_addr()
722 if (vrf == NULL) { in sctp_does_stcb_own_this_addr()
729 LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { in sctp_does_stcb_own_this_addr()
5709 struct sctp_vrf *vrf, *nvrf; in sctp_pcb_finish() local
5779 LIST_FOREACH_SAFE(vrf, vrf_bucket, next_vrf, nvrf) { in sctp_pcb_finish()
5780 LIST_FOREACH_SAFE(ifn, &vrf->ifnlist, next_ifn, nifn) { in sctp_pcb_finish()
5792 SCTP_HASH_FREE(vrf->vrf_addr_hash, vrf->vrf_addr_hashmark); in sctp_pcb_finish()
5794 LIST_REMOVE(vrf, next_vrf); in sctp_pcb_finish()
5795 SCTP_FREE(vrf, SCTP_M_VRF); in sctp_pcb_finish()