summaryrefslogtreecommitdiffstats
path: root/src/vnet/adj/adj_bfd.c
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2018-02-15 16:14:56 +0100
committerNeale Ranns <nranns@cisco.com>2018-02-16 13:45:05 +0000
commit793c7fe5fcb224c8bf8f9a051be82eef5fd62ca1 (patch)
tree40f8c53b961ca4184e630571cf2d2fc0d1596a02 /src/vnet/adj/adj_bfd.c
parentc819fc612f9a79eaba2981dc2e8f7c31552db5ea (diff)
Adj: VFTs for adjacency sub-blocks
Change-Id: I85602b0178315023bb512babdd5b7dd4263a322d Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vnet/adj/adj_bfd.c')
-rw-r--r--src/vnet/adj/adj_bfd.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/vnet/adj/adj_bfd.c b/src/vnet/adj/adj_bfd.c
index 3d294c4646e..2d845ffcfd8 100644
--- a/src/vnet/adj/adj_bfd.c
+++ b/src/vnet/adj/adj_bfd.c
@@ -168,6 +168,23 @@ adj_bfd_notify (bfd_listen_event_e event,
adj_unlock(ai);
}
+/**
+ * Print a delegate that represents BFD tracking
+ */
+static u8 *
+adj_delegate_fmt_bfd (const adj_delegate_t *aed, u8 *s)
+{
+ s = format(s, "BFD:[state:%d index:%d]",
+ aed->ad_bfd_state,
+ aed->ad_bfd_index);
+
+ return (s);
+}
+
+const static adj_delegate_vft_t adj_delegate_vft = {
+ .adv_format = adj_delegate_fmt_bfd,
+};
+
static clib_error_t *
adj_bfd_main_init (vlib_main_t * vm)
{
@@ -178,6 +195,8 @@ adj_bfd_main_init (vlib_main_t * vm)
bfd_register_listener(adj_bfd_notify);
+ adj_delegate_register_type (ADJ_DELEGATE_BFD, &adj_delegate_vft);
+
return (error);
}