]> git.proxmox.com Git - mirror_frr.git/commit - lib/vrf.h
lib: move the interface list into "struct vrf"
authorFeng Lu <lu.feng@6wind.com>
Fri, 22 May 2015 09:39:59 +0000 (11:39 +0200)
committerVipin Kumar <vipin@cumulusnetworks.com>
Fri, 30 Oct 2015 00:25:55 +0000 (17:25 -0700)
commit8736158a2b4b43e841b9a7dcfcc11da0ed30bf23
treefd0a1c20775568d991b40a96c1e60bf56838190a
parent6a69b354a6656f138a5f11e4542dc84f748f2bea
lib: move the interface list into "struct vrf"

An interface belongs to a specific VRF. So move the interface list
into the "struct vrf".

* vrf.c/vrf.h:
  - add a new member "struct list *iflist" to the the "struct vrf";
  - call if_init() in vrf_new();
  - call if_terminate() in vrf_delete();
  - add utilities to access the interface list and VRF ID in the
    specified VRF.

* if.c/if.h:
  - the global "iflist" now only exists for the default VRF;
  - the global "if_master" is initialized on the definition;
  - in if_create(), the interface is added into the list in the
    specified VRF; if the VRF does not exist, create one;
  - add parameters to if_init()/if_terminate() so that the
    interface list in the VRF can be initialized/destroyed;
  - in if_dump_all() scan the interfaces in all the VRFs;
  - add a command "show address vrf N" to show addresses in a
    specified VRF;
  - add a command "show address vrf all" to show addresses in all
    VRFs;
  - new APIs ifxxx_vrf() are added to access an interface in a
    specified VRF.

The old interface APIs (the global variable "iflist" and the API
functions) are not changed to keep the backward compatibility.
The new APIs are used in the daemons which support multiple VRFs
(till now only zebra).

Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Conflicts:
lib/if.c
lib/if.c
lib/if.h
lib/vrf.c
lib/vrf.h