summaryrefslogtreecommitdiffstats
path: root/src/vnet/mpls
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2017-11-10 06:53:54 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2017-11-10 21:10:46 +0000
commitb8d4481a93f919291d4b682ef0ac8948a9f1be32 (patch)
tree3505693e8a697635773fc54c9c7f1cc2aafaf6a1 /src/vnet/mpls
parente178399942c655d0fea162611527ea57192669c0 (diff)
Break up vpe.api
- makes the VAPI generated file more consumable. - VOM build times improve. Change-Id: I838488930bd23a0d3818adfdffdbca3eead382df Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vnet/mpls')
-rw-r--r--src/vnet/mpls/mpls.api14
-rw-r--r--src/vnet/mpls/mpls_api.c18
2 files changed, 32 insertions, 0 deletions
diff --git a/src/vnet/mpls/mpls.api b/src/vnet/mpls/mpls.api
index f9171bfe22e..ce8fbe79afc 100644
--- a/src/vnet/mpls/mpls.api
+++ b/src/vnet/mpls/mpls.api
@@ -241,6 +241,20 @@ manual_endian manual_print define mpls_fib_details
vl_api_fib_path2_t path[count];
};
+/** \brief Enable or Disable MPLS on and interface
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param sw_if_index - index of the interface
+ @param enable - if non-zero enable, else disable
+*/
+autoreply define sw_interface_set_mpls_enable
+{
+ u32 client_index;
+ u32 context;
+ u32 sw_if_index;
+ u8 enable;
+};
+
/*
* Local Variables:
* eval: (c-set-style "gnu")
diff --git a/src/vnet/mpls/mpls_api.c b/src/vnet/mpls/mpls_api.c
index f345ca6aeea..a772f7869ea 100644
--- a/src/vnet/mpls/mpls_api.c
+++ b/src/vnet/mpls/mpls_api.c
@@ -53,6 +53,7 @@ _(MPLS_ROUTE_ADD_DEL, mpls_route_add_del) \
_(MPLS_TABLE_ADD_DEL, mpls_table_add_del) \
_(MPLS_TUNNEL_ADD_DEL, mpls_tunnel_add_del) \
_(MPLS_TUNNEL_DUMP, mpls_tunnel_dump) \
+_(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
_(MPLS_FIB_DUMP, mpls_fib_dump)
extern void stats_dslock_with_hint (int hint, int tag);
@@ -356,6 +357,23 @@ vl_api_mpls_tunnel_add_del_t_handler (vl_api_mpls_tunnel_add_del_t * mp)
/* *INDENT-ON* */
}
+static void
+ vl_api_sw_interface_set_mpls_enable_t_handler
+ (vl_api_sw_interface_set_mpls_enable_t * mp)
+{
+ vl_api_sw_interface_set_mpls_enable_reply_t *rmp;
+ int rv = 0;
+
+ VALIDATE_SW_IF_INDEX (mp);
+
+ rv = mpls_sw_interface_enable_disable (&mpls_main,
+ ntohl (mp->sw_if_index),
+ mp->enable, 1);
+
+ BAD_SW_IF_INDEX_LABEL;
+ REPLY_MACRO (VL_API_SW_INTERFACE_SET_MPLS_ENABLE_REPLY);
+}
+
typedef struct mpls_tunnel_send_walk_ctx_t_
{
unix_shared_memory_queue_t *q;