summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/vrf.c7
-rw-r--r--lib/vrf.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/vrf.c b/lib/vrf.c
index 498aef4580..046e468f20 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -1022,3 +1022,10 @@ int vrf_sockunion_socket(const union sockunion *su, vrf_id_t vrf_id,
}
return ret;
}
+
+vrf_id_t vrf_generate_id(void)
+{
+ static int vrf_id_local;
+
+ return ++vrf_id_local;
+}
diff --git a/lib/vrf.h b/lib/vrf.h
index 04a8f70f5f..3bc88e610a 100644
--- a/lib/vrf.h
+++ b/lib/vrf.h
@@ -293,5 +293,6 @@ extern int vrf_netns_handler_create(struct vty *vty, struct vrf *vrf,
extern void vrf_disable(struct vrf *vrf);
extern int vrf_enable(struct vrf *vrf);
extern void vrf_delete(struct vrf *vrf);
+extern vrf_id_t vrf_generate_id(void);
#endif /*_ZEBRA_VRF_H*/