Lines Matching defs:vrf

112  * hash-vrf-table
113 * vrf-> ifn-> ifn -> ifn
114 * vrf |
116 * vrf
150 struct sctp_vrf *vrf = NULL;
154 vrf = sctp_find_vrf(vrf_id);
155 if (vrf) {
157 return (vrf);
159 SCTP_MALLOC(vrf, struct sctp_vrf *, sizeof(struct sctp_vrf),
161 if (vrf == NULL) {
169 memset(vrf, 0, sizeof(struct sctp_vrf));
170 vrf->vrf_id = vrf_id;
171 LIST_INIT(&vrf->ifnlist);
172 vrf->total_ifa_count = 0;
173 vrf->refcount = 0;
175 SCTP_INIT_VRF_TABLEID(vrf);
177 vrf->vrf_addr_hash = SCTP_HASH_INIT(SCTP_VRF_ADDR_HASH_SIZE,
178 &vrf->vrf_addr_hashmark);
179 if (vrf->vrf_addr_hash == NULL) {
184 SCTP_FREE(vrf, SCTP_M_VRF);
189 LIST_INSERT_HEAD(bucket, vrf, next_vrf);
191 return (vrf);
235 sctp_free_vrf(struct sctp_vrf *vrf)
237 if (SCTP_DECREMENT_AND_CHECK_REFCOUNT(&vrf->refcount)) {
238 if (vrf->vrf_addr_hash) {
239 SCTP_HASH_FREE(vrf->vrf_addr_hash, vrf->vrf_addr_hashmark);
240 vrf->vrf_addr_hash = NULL;
243 LIST_REMOVE(vrf, next_vrf);
244 SCTP_FREE(vrf, SCTP_M_VRF);
255 if (sctp_ifnp->vrf) {
256 sctp_free_vrf(sctp_ifnp->vrf);
317 struct sctp_vrf *vrf;
321 vrf = sctp_find_vrf(vrf_id);
322 if (vrf == NULL) {
327 sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED);
361 struct sctp_vrf *vrf;
365 vrf = sctp_find_vrf(vrf_id);
366 if (vrf == NULL) {
371 sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED);
497 struct sctp_vrf *vrf;
512 vrf = sctp_ifnp->vrf;
514 vrf = sctp_find_vrf(vrf_id);
515 if (vrf == NULL) {
516 vrf = sctp_allocate_vrf(vrf_id);
517 if (vrf == NULL) {
542 sctp_ifnp->vrf = vrf;
543 atomic_add_int(&vrf->refcount, 1);
554 LIST_INSERT_HEAD(&vrf->ifnlist, sctp_ifnp, next_ifn);
558 sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED);
673 hash_addr_head = &vrf->vrf_addr_hash[(hash_of_addr & vrf->vrf_addr_hashmark)];
678 vrf->total_ifa_count++;
730 struct sctp_vrf *vrf;
734 vrf = sctp_find_vrf(vrf_id);
735 if (vrf == NULL) {
743 sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED);
785 vrf->total_ifa_count--;
849 struct sctp_vrf *vrf;
865 vrf = sctp_find_vrf(stcb->asoc.vrf_id);
866 if (vrf == NULL) {
867 /* no vrf, no addresses */
872 LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) {
5914 struct sctp_vrf *vrf, *nvrf;
5979 * free the vrf/ifn/ifa lists and hashes (be sure address monitor is
5983 LIST_FOREACH_SAFE(vrf, vrf_bucket, next_vrf, nvrf) {
5984 LIST_FOREACH_SAFE(ifn, &vrf->ifnlist, next_ifn, nifn) {
5996 SCTP_HASH_FREE(vrf->vrf_addr_hash, vrf->vrf_addr_hashmark);
5997 /* free the vrf */
5998 LIST_REMOVE(vrf, next_vrf);
5999 SCTP_FREE(vrf, SCTP_M_VRF);
6001 /* free the vrf hashes */