rmp->profile.udp_encap = profile->udp_encap;
rmp->profile.tun_itf = profile->tun_itf;
-
+ rmp->profile.natt_disabled = profile->natt_disabled;
rmp->profile.ipsec_over_udp_port = profile->ipsec_over_udp_port;
rmp->profile.lifetime = profile->lifetime;
return;
/* *INDENT-OFF* */
- pool_foreach (profile, im->profiles,
- ({
+ pool_foreach (profile, im->profiles)
+ {
send_profile (profile, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
+static void
+ikev2_copy_stats (vl_api_ikev2_sa_stats_t *dst, const ikev2_stats_t *src)
+{
+ dst->n_rekey_req = src->n_rekey_req;
+ dst->n_keepalives = src->n_keepalives;
+ dst->n_retransmit = src->n_retransmit;
+ dst->n_init_sa_retransmit = src->n_init_retransmit;
+ dst->n_sa_init_req = src->n_sa_init_req;
+ dst->n_sa_auth_req = src->n_sa_auth_req;
+}
+
static void
send_sa (ikev2_sa_t * sa, vl_api_ikev2_sa_dump_t * mp, u32 api_sa_index)
{
k->sk_pr_len = vec_len (sa->sk_pr);
clib_memcpy (&k->sk_pr, sa->sk_pr, k->sk_pr_len);
+ ikev2_copy_stats (&rsa->stats, &sa->stats);
+
vl_api_ikev2_sa_t_endian(rsa);
});
/* *INDENT-ON* */
vec_foreach (tkm, km->per_thread_data)
{
/* *INDENT-OFF* */
- pool_foreach (sa, tkm->sas,
- ({
+ pool_foreach (sa, tkm->sas)
+ {
u32 api_sa_index = ikev2_encode_sa_index (sa - tkm->sas,
tkm - km->per_thread_data);
send_sa (sa, mp, api_sa_index);
- }));
+ }
/* *INDENT-ON* */
}
}
error = ikev2_set_liveness_params (clib_net_to_host_u32 (mp->period),
clib_net_to_host_u32 (mp->max_retries));
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
error = ikev2_add_del_profile (vm, tmp, mp->is_add);
vec_free (tmp);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
vec_free (tmp);
vec_free (data);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
vec_free (tmp);
vec_free (data);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
error = ikev2_set_profile_udp_encap (vm, tmp);
vec_free (tmp);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
start_addr, end_addr, mp->ts.is_local);
vec_free (tmp);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
error = ikev2_set_local_key (vm, mp->key_file);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
error = ikev2_set_profile_responder (vm, tmp, sw_if_index, ip);
vec_free (tmp);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
ntohl (mp->tr.crypto_key_size));
vec_free (tmp);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
ntohl (mp->tr.crypto_key_size));
vec_free (tmp);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
(mp->lifetime_maxdata));
vec_free (tmp);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
ntohl (mp->sw_if_index));
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
vec_free (tmp);
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
error = ikev2_initiate_sa_init (vm, tmp);
vec_free (tmp);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
error = ikev2_initiate_delete_ike_sa (vm, mp->ispi);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
error = ikev2_initiate_delete_child_sa (vm, mp->ispi);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif
REPLY_MACRO (VL_API_IKEV2_INITIATE_DEL_CHILD_SA_REPLY);
}
+static void
+ vl_api_ikev2_profile_disable_natt_t_handler
+ (vl_api_ikev2_profile_disable_natt_t * mp)
+{
+ vl_api_ikev2_profile_disable_natt_reply_t *rmp;
+ int rv = 0;
+
+#if WITH_LIBSSL > 0
+ clib_error_t *error;
+
+ u8 *tmp = format (0, "%s", mp->name);
+ error = ikev2_profile_natt_disable (tmp);
+ vec_free (tmp);
+ if (error)
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
+#else
+ rv = VNET_API_ERROR_UNIMPLEMENTED;
+#endif
+
+ REPLY_MACRO (VL_API_IKEV2_PROFILE_DISABLE_NATT_REPLY);
+}
+
static void
vl_api_ikev2_initiate_rekey_child_sa_t_handler
(vl_api_ikev2_initiate_rekey_child_sa_t * mp)
error = ikev2_initiate_rekey_child_sa (vm, mp->ispi);
if (error)
- rv = VNET_API_ERROR_UNSPECIFIED;
+ {
+ ikev2_log_error ("%U", format_clib_error, error);
+ clib_error_free (error);
+ rv = VNET_API_ERROR_UNSPECIFIED;
+ }
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
#endif