Lines Matching defs:vrf

106  * hash-vrf-table
107 * vrf-> ifn-> ifn -> ifn
108 * vrf |
110 * vrf
144 struct sctp_vrf *vrf = NULL;
148 vrf = sctp_find_vrf(vrf_id);
149 if (vrf) {
151 return (vrf);
153 SCTP_MALLOC(vrf, struct sctp_vrf *, sizeof(struct sctp_vrf),
155 if (vrf == NULL) {
163 memset(vrf, 0, sizeof(struct sctp_vrf));
164 vrf->vrf_id = vrf_id;
165 LIST_INIT(&vrf->ifnlist);
166 vrf->total_ifa_count = 0;
167 vrf->refcount = 0;
169 SCTP_INIT_VRF_TABLEID(vrf);
171 vrf->vrf_addr_hash = SCTP_HASH_INIT(SCTP_VRF_ADDR_HASH_SIZE,
172 &vrf->vrf_addr_hashmark);
173 if (vrf->vrf_addr_hash == NULL) {
178 SCTP_FREE(vrf, SCTP_M_VRF);
184 LIST_INSERT_HEAD(bucket, vrf, next_vrf);
186 return (vrf);
223 sctp_free_vrf(struct sctp_vrf *vrf)
225 if (SCTP_DECREMENT_AND_CHECK_REFCOUNT(&vrf->refcount)) {
226 if (vrf->vrf_addr_hash) {
227 SCTP_HASH_FREE(vrf->vrf_addr_hash, vrf->vrf_addr_hashmark);
228 vrf->vrf_addr_hash = NULL;
231 LIST_REMOVE(vrf, next_vrf);
232 SCTP_FREE(vrf, SCTP_M_VRF);
242 if (sctp_ifnp->vrf) {
243 sctp_free_vrf(sctp_ifnp->vrf);
367 struct sctp_vrf *vrf;
398 vrf = sctp_ifnp->vrf;
400 vrf = sctp_find_vrf(vrf_id);
401 if (vrf == NULL) {
402 vrf = sctp_allocate_vrf(vrf_id);
403 if (vrf == NULL) {
423 sctp_ifnp->vrf = vrf;
424 atomic_add_int(&vrf->refcount, 1);
434 LIST_INSERT_HEAD(&vrf->ifnlist, sctp_ifnp, next_ifn);
437 sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED);
553 hash_addr_head = &vrf->vrf_addr_hash[(hash_of_addr & vrf->vrf_addr_hashmark)];
558 vrf->total_ifa_count++;
608 struct sctp_vrf *vrf;
612 vrf = sctp_find_vrf(vrf_id);
613 if (vrf == NULL) {
623 sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED);
647 vrf->total_ifa_count--;
705 struct sctp_vrf *vrf;
721 vrf = sctp_find_vrf(stcb->asoc.vrf_id);
722 if (vrf == NULL) {
723 /* no vrf, no addresses */
729 LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) {
5710 struct sctp_vrf *vrf, *nvrf;
5775 * free the vrf/ifn/ifa lists and hashes (be sure address monitor is
5780 LIST_FOREACH_SAFE(vrf, vrf_bucket, next_vrf, nvrf) {
5781 LIST_FOREACH_SAFE(ifn, &vrf->ifnlist, next_ifn, nifn) {
5793 SCTP_HASH_FREE(vrf->vrf_addr_hash, vrf->vrf_addr_hashmark);
5794 /* free the vrf */
5795 LIST_REMOVE(vrf, next_vrf);
5796 SCTP_FREE(vrf, SCTP_M_VRF);
5799 /* free the vrf hashes */