diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-03-03 00:42:56 +0100 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-04-13 19:25:25 +0200 |
commit | 7239d3d9e6c131c859dae627c1238b5838a5ab8e (patch) | |
tree | e1c14fd330b2e8ad079ae9904d7166864cb766a2 /lib/vrf.h | |
parent | lib: make all zclient.[ch] stream funcs safe (diff) | |
download | frr-7239d3d9e6c131c859dae627c1238b5838a5ab8e.tar.xz frr-7239d3d9e6c131c859dae627c1238b5838a5ab8e.zip |
lib: handle bogus VRF backend type
And use an enum...
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/vrf.h')
-rw-r--r-- | lib/vrf.h | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -101,9 +101,12 @@ RB_PROTOTYPE(vrf_name_head, vrf, name_entry, vrf_name_compare) DECLARE_QOBJ_TYPE(vrf) /* Allow VRF with netns as backend */ -#define VRF_BACKEND_VRF_LITE 0 -#define VRF_BACKEND_NETNS 1 -#define VRF_BACKEND_UNKNOWN 2 +enum vrf_backend_type { + VRF_BACKEND_VRF_LITE, + VRF_BACKEND_NETNS, + VRF_BACKEND_UNKNOWN, + VRF_BACKEND_MAX, +}; extern struct vrf_id_head vrfs_by_id; extern struct vrf_name_head vrfs_by_name; @@ -292,10 +295,10 @@ extern void vrf_install_commands(void); * VRF utilities */ -/* API for configuring VRF backend - * should be called from zebra only +/* + * API for configuring VRF backend */ -extern void vrf_configure_backend(int vrf_backend_netns); +extern int vrf_configure_backend(enum vrf_backend_type backend); extern int vrf_get_backend(void); extern int vrf_is_backend_netns(void); |