summaryrefslogtreecommitdiff
path: root/zebra/zebra_dplane.c
diff options
context:
space:
mode:
authorKaren Schoener <karen@volta.io>2020-05-28 16:36:35 -0400
committerKaren Schoener <karen@volta.io>2020-06-01 13:21:37 -0400
commitfd563cc7f35e598decdbfd6a58bae2f050143b3f (patch)
tree682f7ce1aaa6b133803c0c61e31e2c6f55d387f9 /zebra/zebra_dplane.c
parent6b2210021cab645efa58a23d5a4d171fe37f305e (diff)
ldpd: Relay data plane pseudowire status in LDP notification
Provide a way for the data plane to indicate pseudowire status (such as: not forwarding, AC failure). On a data plane pseudowire install failure, data plane sets the pseudowire status. Zebra relays the pseudowire status to LDP. LDP includes the pseudowire status in the LDP notification to the LDP peer. Signed-off-by: Karen Schoener <karen@voltanet.io>
Diffstat (limited to 'zebra/zebra_dplane.c')
-rw-r--r--zebra/zebra_dplane.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
index 278e894d06..4bd95ba963 100644
--- a/zebra/zebra_dplane.c
+++ b/zebra/zebra_dplane.c
@@ -896,6 +896,7 @@ void dplane_ctx_set_notif_provider(struct zebra_dplane_ctx *ctx,
ctx->zd_notif_provider = id;
}
+
const char *dplane_ctx_get_ifname(const struct zebra_dplane_ctx *ctx)
{
DPLANE_CTX_VALID(ctx);
@@ -903,6 +904,16 @@ const char *dplane_ctx_get_ifname(const struct zebra_dplane_ctx *ctx)
return ctx->zd_ifname;
}
+void dplane_ctx_set_ifname(struct zebra_dplane_ctx *ctx, const char *ifname)
+{
+ DPLANE_CTX_VALID(ctx);
+
+ if (!ifname)
+ return;
+
+ strlcpy(ctx->zd_ifname, ifname, sizeof(ctx->zd_ifname));
+}
+
ifindex_t dplane_ctx_get_ifindex(const struct zebra_dplane_ctx *ctx)
{
DPLANE_CTX_VALID(ctx);
@@ -1310,6 +1321,13 @@ int dplane_ctx_get_pw_status(const struct zebra_dplane_ctx *ctx)
return ctx->u.pw.status;
}
+void dplane_ctx_set_pw_status(struct zebra_dplane_ctx *ctx, int status)
+{
+ DPLANE_CTX_VALID(ctx);
+
+ ctx->u.pw.status = status;
+}
+
const union g_addr *dplane_ctx_get_pw_dest(
const struct zebra_dplane_ctx *ctx)
{