aboutsummaryrefslogtreecommitdiffstats
path: root/vpp
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2016-05-09 09:39:26 +0200
committerFilip Tehlar <ftehlar@cisco.com>2016-05-10 13:52:48 +0200
commit46d4e36792e829ef96b43dbc6eec344700d54f13 (patch)
tree48ea7e6e35c2334892fd3e4717abdcfe15b2c65f /vpp
parent8a95a482cfaf05e89a9383f0446584c414cd71bf (diff)
ONE-4: Add LISP enable/disable API/CLI
This patch adds an enable/disable API/CLI for control plane which calls similar functions for data plane. When re-enabling it also re-populates dataplane with tunnels and interfaces. Change-Id: Id8c3d6af90ecc0be331d502756914b1f62824046 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'vpp')
-rw-r--r--vpp/api/api.c34
-rw-r--r--vpp/api/vpe.api27
2 files changed, 46 insertions, 15 deletions
diff --git a/vpp/api/api.c b/vpp/api/api.c
index 4d7a9192..c1f7fef6 100644
--- a/vpp/api/api.c
+++ b/vpp/api/api.c
@@ -326,14 +326,14 @@ _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \
_(LISP_GPE_ADD_DEL_FWD_ENTRY, lisp_gpe_add_del_fwd_entry) \
_(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \
_(LISP_GPE_ENABLE_DISABLE, lisp_gpe_enable_disable) \
+_(LISP_ENABLE_DISABLE, lisp_enable_disable) \
_(LISP_GPE_ADD_DEL_IFACE, lisp_gpe_add_del_iface) \
_(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \
_(LISP_LOCAL_EID_TABLE_DUMP, lisp_local_eid_table_dump) \
_(LISP_GPE_TUNNEL_DUMP, lisp_gpe_tunnel_dump) \
_(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \
-_(LISP_GPE_ENABLE_DISABLE_STATUS_DUMP, \
- lisp_gpe_enable_disable_status_dump) \
-_(SR_MULTICAST_MAP_ADD_DEL, sr_multicast_map_add_del) \
+_(LISP_ENABLE_DISABLE_STATUS_DUMP, \
+ lisp_enable_disable_status_dump) \
_(SR_MULTICAST_MAP_ADD_DEL, sr_multicast_map_add_del) \
_(AF_PACKET_CREATE, af_packet_create) \
_(AF_PACKET_DELETE, af_packet_delete)
@@ -4884,6 +4884,17 @@ vl_api_lisp_gpe_enable_disable_t_handler(
}
static void
+vl_api_lisp_enable_disable_t_handler(
+ vl_api_lisp_enable_disable_t *mp)
+{
+ vl_api_lisp_enable_disable_reply_t *rmp;
+ int rv = 0;
+
+ vnet_lisp_enable_disable (mp->is_en);
+ REPLY_MACRO(VL_API_LISP_ENABLE_DISABLE_REPLY);
+}
+
+static void
vl_api_lisp_gpe_add_del_iface_t_handler(
vl_api_lisp_gpe_add_del_iface_t *mp)
{
@@ -5119,26 +5130,25 @@ vl_api_lisp_map_resolver_dump_t_handler (
}
static void
-send_lisp_gpe_enable_disable_details (unix_shared_memory_queue_t *q,
+send_lisp_enable_disable_details (unix_shared_memory_queue_t *q,
u32 context)
{
- vl_api_lisp_gpe_enable_disable_status_details_t *rmp = NULL;
- u8 is_en;
+ vl_api_lisp_enable_disable_status_details_t *rmp = NULL;
rmp = vl_msg_api_alloc (sizeof (*rmp));
memset (rmp, 0, sizeof (*rmp));
- rmp->_vl_msg_id = ntohs(VL_API_LISP_GPE_ENABLE_DISABLE_STATUS_DETAILS);
+ rmp->_vl_msg_id = ntohs(VL_API_LISP_ENABLE_DISABLE_STATUS_DETAILS);
- is_en = vnet_lisp_gpe_enable_disable_status();
- rmp->is_en = is_en;
+ rmp->gpe_status = vnet_lisp_gpe_enable_disable_status ();
+ rmp->feature_status = vnet_lisp_enable_disable_status ();
rmp->context = context;
vl_msg_api_send_shmem (q, (u8 *)&rmp);
}
static void
-vl_api_lisp_gpe_enable_disable_status_dump_t_handler
-(vl_api_lisp_gpe_enable_disable_status_dump_t *mp)
+vl_api_lisp_enable_disable_status_dump_t_handler
+(vl_api_lisp_enable_disable_status_dump_t *mp)
{
unix_shared_memory_queue_t * q = NULL;
@@ -5147,7 +5157,7 @@ vl_api_lisp_gpe_enable_disable_status_dump_t_handler
return;
}
- send_lisp_gpe_enable_disable_details(q, mp->context);
+ send_lisp_enable_disable_details(q, mp->context);
}
static void
diff --git a/vpp/api/vpe.api b/vpp/api/vpe.api
index c92715f4..bef6ffb4 100644
--- a/vpp/api/vpe.api
+++ b/vpp/api/vpe.api
@@ -2323,6 +2323,26 @@ define lisp_gpe_enable_disable_reply {
i32 retval;
};
+/** \brief enable or disable LISP feature
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param is_en - enable protocol if non-zero, else disable
+*/
+define lisp_enable_disable {
+ u32 client_index;
+ u32 context;
+ u8 is_en;
+};
+
+/** \brief Reply for gpe enable/disable
+ @param context - returned sender context, to match reply w/ request
+ @param retval - return code
+*/
+define lisp_enable_disable_reply {
+ u32 context;
+ i32 retval;
+};
+
/** \brief add or delete gpe_iface
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
@@ -2441,16 +2461,17 @@ define lisp_map_resolver_dump {
@param context - sender context, to match reply w/ request
@param is_en - enable protocol if non-zero, else disable
*/
-manual_java define lisp_gpe_enable_disable_status_details {
+manual_java define lisp_enable_disable_status_details {
u32 context;
- u8 is_en;
+ u8 feature_status;
+ u8 gpe_status;
};
/** \brief Request for lisp-gpe protocol status
@param client_index - opaque cookie to identify the sender
@param context - sender context, to match reply w/ request
*/
-define lisp_gpe_enable_disable_status_dump {
+define lisp_enable_disable_status_dump {
u32 client_index;
u32 context;
};