]> git.puffer.fish Git - matthieu/frr.git/commit
lib: Rework vrf_get
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 2 May 2016 19:30:55 +0000 (15:30 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 3 May 2016 19:58:26 +0000 (15:58 -0400)
commit34f8e6af374bfb913c016230804266b4137ae4f9
treeff2396ecbea227ce773df839df873e67de1c9051
parent9b16617197d46c839e0e4949ba834f3b9f6a5440
lib: Rework vrf_get

vrf_get has these possible lookup/creation ways of being called.

name = NULL, vrf_id = VRF_UNKNOWN
   Nothing to do here.

name = NULL, vrf_id != VRF_UNKNOWN
   Look up the vrf_id in the table.  Return that created vrf.
   If not found create a struct vrf to hold it properly.

name = <something>, vrf_id = VRF_UNKNOWN
   Look up the name in the vrf list, if found return that vrf.
   If not found create the vrf and zvrf

name = <something>, vrf_id != VRF_UNKNOWN
   Look up the name in the vrf list, if found check to see
   if the vrf->vrf_id is VRF_UNKNOWN, if so match up and return
   If not found, create the vrf and table entry and return

Ticket: CM-10139
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
lib/vrf.c
zebra/zebra_vrf.c