summaryrefslogtreecommitdiffstats
path: root/src/plugins/ikev2/ikev2_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-02-11 13:53:32 +0000
committerDamjan Marion <dmarion@me.com>2020-02-11 23:10:25 +0000
commit44476c6b271bdebb7458590398b5f140c9a7d353 (patch)
tree662c2f3f95c7a8ff5a845bb0e0714c735a704543 /src/plugins/ikev2/ikev2_api.c
parentbdfa4d37812dbd2c1037cc0d55d5900d17aeb10c (diff)
ikev2: Configure a profile with an existing interface
Type: feature ... rather than always creating a new interface. Change-Id: If8a22ad5a8a3a4e511bea7cab7d8bbf7e6af9433 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/plugins/ikev2/ikev2_api.c')
-rw-r--r--src/plugins/ikev2/ikev2_api.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/plugins/ikev2/ikev2_api.c b/src/plugins/ikev2/ikev2_api.c
index 365e6e8932f..ae1672c1da4 100644
--- a/src/plugins/ikev2/ikev2_api.c
+++ b/src/plugins/ikev2/ikev2_api.c
@@ -290,6 +290,33 @@ vl_api_ikev2_set_sa_lifetime_t_handler (vl_api_ikev2_set_sa_lifetime_t * mp)
}
static void
+ vl_api_ikev2_set_tunnel_interface_t_handler
+ (vl_api_ikev2_set_tunnel_interface_t * mp)
+{
+ vl_api_ikev2_set_tunnel_interface_reply_t *rmp;
+ int rv = 0;
+
+ VALIDATE_SW_IF_INDEX (mp);
+
+#if WITH_LIBSSL > 0
+ u8 *tmp = format (0, "%s", mp->name);
+ clib_error_t *error;
+
+ error = ikev2_set_profile_tunnel_interface (vlib_get_main (), tmp,
+ ntohl (mp->sw_if_index));
+
+ if (error)
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ vec_free (tmp);
+#else
+ rv = VNET_API_ERROR_UNIMPLEMENTED;
+#endif
+
+ BAD_SW_IF_INDEX_LABEL;
+ REPLY_MACRO (VL_API_IKEV2_SET_TUNNEL_INTERFACE_REPLY);
+}
+
+static void
vl_api_ikev2_initiate_sa_init_t_handler (vl_api_ikev2_initiate_sa_init_t * mp)
{
vl_api_ikev2_initiate_sa_init_reply_t *rmp;