summaryrefslogtreecommitdiffstats
path: root/lib/vrf.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2020-03-03 00:42:56 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2020-04-13 19:25:25 +0200
commit7239d3d9e6c131c859dae627c1238b5838a5ab8e (patch)
treee1c14fd330b2e8ad079ae9904d7166864cb766a2 /lib/vrf.h
parentlib: make all zclient.[ch] stream funcs safe (diff)
downloadfrr-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.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/vrf.h b/lib/vrf.h
index f231d2433..2dc264883 100644
--- a/lib/vrf.h
+++ b/lib/vrf.h
@@ -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);