summaryrefslogtreecommitdiff
path: root/zebra/zebra_dplane.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@cisco.com>2024-04-05 13:32:08 -0400
committerMark Stapp <mjs@cisco.com>2024-04-09 08:59:13 -0400
commit9f285dd0bc0d95ebaea4ee92ef6ef8ef45649162 (patch)
tree1e6d69c46696b7472414a07a4dbab77b89f9b26c /zebra/zebra_dplane.c
parentf090079390dd8e1aaea288ec1b69f8e8bb22de1a (diff)
zebra: add dataplane API version value
Add a version value and accessor API for the zebra dataplane; plugins can test this to detect API changes. Signed-off-by: Mark Stapp <mjs@cisco.com>
Diffstat (limited to 'zebra/zebra_dplane.c')
-rw-r--r--zebra/zebra_dplane.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
index 006ab504ef..06b34da209 100644
--- a/zebra/zebra_dplane.c
+++ b/zebra/zebra_dplane.c
@@ -39,6 +39,13 @@ DEFINE_MTYPE_STATIC(ZEBRA, DP_NS, "DPlane NSes");
# define AOK 0
#endif
+/*
+ * Dataplane API version. This must be updated when any incompatible changes
+ * are made. The minor version (at least) should be updated when new APIs
+ * are introduced.
+ */
+static uint32_t zdplane_version = MAKE_FRRVERSION(2, 0, 0);
+
/* Control for collection of extra interface info with route updates; a plugin
* can enable the extra info via a dplane api.
*/
@@ -664,6 +671,12 @@ neigh_update_internal(enum dplane_op_e op, const struct interface *ifp,
* Public APIs
*/
+/* Access the dplane API version */
+uint32_t zebra_dplane_get_version(void)
+{
+ return zdplane_version;
+}
+
/* Obtain thread_master for dataplane thread */
struct event_loop *dplane_get_thread_master(void)
{