Go to file
Feng Lu e5bf3e1ed7 lib/vrf: enable / disable a VRF
A new API vrf_is_enabled() is defined to check whether a VRF is ready
to use, that is, to allocate resources in that VRF. Currently there's
only one type of resource: socket.

Two new hooks VRF_ENABLE_HOOK/VRF_DISABLE_HOOK are introduced to tell
the user when a VRF gets ready or to be unavailable.

The VRF_ENABLE_HOOK callback is called in the new function vrf_enable(),
which is used to let the VRF be ready to use. Till now, only the default
VRF can be enabled, and we need do nothing to enable the default, except
calling the hook.

The VRF_DISABLE_HOOK callback is called in the new function
vrf_disable(), which is used to let the VRF be unusable. Till now,
it is called only when the VRF is to be deleted.

A new utility vrf_socket() is defined to provide a socket in a given
VRF to the user.

Till now before introducing a way of VRF realization, only the default
VRF is enabled since its birth, and vrf_socket() creates socket for
only the default VRF.

This patch defines the framework of the VRF APIs. The way they serve
the users is:
- vrf_is_enabled() is used to tell the user whether a VRF is usable;
- users are informed by the VRF_ENABLE_HOOK that a VRF gets usable;
  they can allocate resources after that;
- users are informed by the VRF_DISABLE_HOOK that a VRF is to be
  unavailable, and they must release the resources instantly;
- vrf_socket() is used to provide a socket in a given VRF.

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>
2015-10-30 00:29:10 -07:00
babeld lib: zclient.c remove extern struct thread_master * 2015-09-23 13:26:56 -07:00
bgpd *: call if_init()/if_terminate() from vrf_init()/vrf_terminate() 2015-10-29 17:00:32 -07:00
cumulus/etc quagga netlink buffer size increase 2015-09-11 05:44:31 -07:00
debian Debian: Track dependencies so that rebuilds can work right 2015-10-29 11:22:49 -07:00
doc per-interface ospf enable and area set command. 2015-05-19 17:58:14 -07:00
fpm fpm: Add public header for Forwarding Plane Manager 2012-11-30 21:41:17 +01:00
init build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
isisd *: call if_init()/if_terminate() from vrf_init()/vrf_terminate() 2015-10-29 17:00:32 -07:00
lib lib/vrf: enable / disable a VRF 2015-10-30 00:29:10 -07:00
m4 build: fix "pragma weak" mixups 2013-02-09 03:00:12 +01:00
ospf6d *: call if_init()/if_terminate() from vrf_init()/vrf_terminate() 2015-10-29 17:00:32 -07:00
ospfclient Add --enable-werror to configure 2015-07-25 16:05:56 -07:00
ospfd *: call if_init()/if_terminate() from vrf_init()/vrf_terminate() 2015-10-29 17:00:32 -07:00
pkgsrc build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
ports build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
redhat build: update quagga.spec.in 2013-02-23 19:43:18 +01:00
ripd *: call if_init()/if_terminate() from vrf_init()/vrf_terminate() 2015-10-29 17:00:32 -07:00
ripngd *: call if_init()/if_terminate() from vrf_init()/vrf_terminate() 2015-10-29 17:00:32 -07:00
solaris build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
tests bgpd: backout change of bm->master and master 2015-10-13 13:00:55 -07:00
tools Display the BGP ipv4 unicast configuration under "address-family ipv4 unicast". 2015-10-20 22:00:40 +00:00
vtysh lib, zebra, vtysh: configure an interface in non-default VRF 2015-10-29 18:08:53 -07:00
watchquagga Fix watchquagga to watch just one daemon 2015-08-24 10:50:21 -07:00
zebra zebra: maintain the router-id per VRF 2015-10-30 00:19:15 -07:00
.gitignore git: add (generated) cscope files to .gitignore 2015-09-22 11:54:09 -07:00
AUTHORS Initial revision 2002-12-13 20:15:29 +00:00
bootstrap.sh autoreconf -i 2007-02-06 19:28:28 +00:00
buildtest.sh Add --enable-werror to configure 2015-07-25 16:05:56 -07:00
ChangeLog [trivia] Make 'make dist' happy about ChangeLog expunge 2008-08-23 08:36:42 +01:00
configure.ac Quagga: Restrict Shell Access 2015-08-12 16:11:07 -07:00
COPYING *: nuke ^L (page feed) 2014-06-04 06:58:02 +02:00
COPYING.LIB *: nuke ^L (page feed) 2014-06-04 06:58:02 +02:00
HACKING.pending HACKING.pending: Add Quagga-RE details 2012-03-02 11:56:38 +00:00
HACKING.tex HACKING.tex: Change to a LaTeX version of HACKING 2012-03-08 16:14:13 +00:00
INSTALL.quagga.txt build: improve backtrace support/detection 2014-04-01 17:20:44 +02:00
Makefile.am Add json output support for a few BGP show commands 2015-05-19 18:03:48 -07:00
NEWS doc: update NEWS for 0.99.23 changes 2014-06-24 07:12:01 +02:00
README 2004-11-12 Paul Jakma <paul@dishone.st> 2004-11-12 10:30:21 +00:00
README.NetBSD Omit --opaque-lsa from build (now default). 2011-06-28 15:05:05 -04:00
REPORTING-BUGS Update for git and emphasize asking for good reports. 2010-05-05 07:51:26 -04:00
SERVICES 2607/tcp is already used by ospfapi. 2003-12-23 10:42:45 +00:00
stamp-h.in Initial revision 2002-12-13 20:15:29 +00:00
TODO doc: update TODO for ospf6d work & bgp multipath 2013-04-16 11:56:11 +02:00
update-autotools * README.NetBSD: use update-autotools instead of autoreconf 2007-02-02 16:52:38 +00:00

Quagga is free software that manages various IPv4 and IPv6 routing
protocols.

Currently Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1,
RIPv2, and RIPng as well as very early support for IS-IS.
  
See the file INSTALL.quagga.txt for building and installation instructions.
  
See the file REPORTING-BUGS to report bugs.
  
Quagga is free software. See the file COPYING for copying conditions.