aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/mpls/mpls_tunnel.c
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-09-26 05:07:25 -0700
committerJohn Lo <loj@cisco.com>2018-09-26 16:54:46 +0000
commitf5fa5ae2b021f946fbb8ec56e692459cd34bc7fb (patch)
treec5ba2b4602d39d8a7b366706b5535c1c6ac01f81 /src/vnet/mpls/mpls_tunnel.c
parent2ac7edeeaf01dc21d9b87e764b6147c035a87c58 (diff)
MPLS tunnel dump: use sw_if_index not tunnel_index
Change-Id: I6c0d5aec6ee96a0d40358f0e09a0901b22265063 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vnet/mpls/mpls_tunnel.c')
-rw-r--r--src/vnet/mpls/mpls_tunnel.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vnet/mpls/mpls_tunnel.c b/src/vnet/mpls/mpls_tunnel.c
index 55b60cdb1e5..f6e5dabdd8f 100644
--- a/src/vnet/mpls/mpls_tunnel.c
+++ b/src/vnet/mpls/mpls_tunnel.c
@@ -763,6 +763,18 @@ vnet_mpls_tunnel_path_remove (u32 sw_if_index,
return (fib_path_list_get_n_paths(mt->mt_path_list));
}
+int
+vnet_mpls_tunnel_get_index (u32 sw_if_index)
+{
+ mpls_tunnel_t *mt;
+
+ mt = mpls_tunnel_get_from_sw_if_index(sw_if_index);
+
+ if (NULL == mt)
+ return (~0);
+
+ return (mt - mpls_tunnel_pool);
+}
static clib_error_t *
vnet_create_mpls_tunnel_command_fn (vlib_main_t * vm,