summaryrefslogtreecommitdiff
path: root/zebra/zebra_dplane.h
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2019-12-10 14:53:46 -0500
committerRafael Zalamena <rzalamena@opensourcerouting.org>2020-04-14 11:44:39 -0300
commitf73a84672dc2a190dbef6a6625da998846ef1d95 (patch)
treee849f5ddbbf66b373c751e27a95fee95dd79af82 /zebra/zebra_dplane.h
parentf78fe8f3d60d23f96adf35f589dd7f257a4a40f4 (diff)
zebra: dataplane context reset and init apis
Add a public reset api, so a context can be reset and reused; add apis to init a context for a route or mac update. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/zebra_dplane.h')
-rw-r--r--zebra/zebra_dplane.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h
index 9ce4df197c..9fe8b3b513 100644
--- a/zebra/zebra_dplane.h
+++ b/zebra/zebra_dplane.h
@@ -180,6 +180,12 @@ TAILQ_HEAD(dplane_ctx_q, zebra_dplane_ctx);
/* Allocate a context object */
struct zebra_dplane_ctx *dplane_ctx_alloc(void);
+/*
+ * Reset an allocated context object for re-use. All internal allocations are
+ * freed.
+ */
+void dplane_ctx_reset(struct zebra_dplane_ctx *ctx);
+
/* Return a dataplane results context block after use; the caller's pointer will
* be cleared.
*/
@@ -451,6 +457,15 @@ enum zebra_dplane_result dplane_mac_del(const struct interface *ifp,
const struct ethaddr *mac,
struct in_addr vtep_ip);
+/* Helper api to init an empty or new context for a MAC update */
+void dplane_mac_init(struct zebra_dplane_ctx *ctx,
+ const struct interface *ifp,
+ const struct interface *br_ifp,
+ vlanid_t vid,
+ const struct ethaddr *mac,
+ struct in_addr vtep_ip,
+ bool sticky);
+
/*
* Enqueue evpn neighbor updates for the dataplane.
*/