X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fikev2%2Fikev2_api.c;h=63d8760b0431d3ce05691d86c7a86ee314c87583;hb=d7fc12f07;hp=c73505b2421c7f956372d4d12f4a6f9546e743bd;hpb=a340fe1ac6a31d4e60affa7209ade48189b18eb4;p=vpp.git diff --git a/src/plugins/ikev2/ikev2_api.c b/src/plugins/ikev2/ikev2_api.c index c73505b2421..63d8760b043 100644 --- a/src/plugins/ikev2/ikev2_api.c +++ b/src/plugins/ikev2/ikev2_api.c @@ -98,8 +98,8 @@ cp_ts (vl_api_ikev2_ts_t * vl_api_ts, ikev2_ts_t * ts, u8 is_local) vl_api_ts->protocol_id = ts->protocol_id; vl_api_ts->start_port = ts->start_port; vl_api_ts->end_port = ts->end_port; - ip4_address_encode (&ts->start_addr, vl_api_ts->start_addr); - ip4_address_encode (&ts->end_addr, vl_api_ts->end_addr); + ip_address_encode2 (&ts->start_addr, &vl_api_ts->start_addr); + ip_address_encode2 (&ts->end_addr, &vl_api_ts->end_addr); } static void @@ -116,7 +116,7 @@ cp_responder (vl_api_ikev2_responder_t * vl_api_responder, ikev2_responder_t * responder) { vl_api_responder->sw_if_index = responder->sw_if_index; - ip4_address_encode (&responder->ip4, vl_api_responder->ip4); + ip_address_encode2 (&responder->addr, &vl_api_responder->addr); } void @@ -163,7 +163,7 @@ send_profile (ikev2_profile_t * profile, vl_api_registration_t * reg, 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; @@ -208,8 +208,8 @@ send_sa (ikev2_sa_t * sa, vl_api_ikev2_sa_dump_t * mp, u32 api_sa_index) vl_api_ikev2_keys_t* k = &rsa->keys; rsa->profile_index = rsa->profile_index; rsa->sa_index = api_sa_index; - ip4_address_encode (&sa->iaddr, rsa->iaddr); - ip4_address_encode (&sa->raddr, rsa->raddr); + ip_address_encode2 (&sa->iaddr, &rsa->iaddr); + ip_address_encode2 (&sa->raddr, &rsa->raddr); rsa->ispi = sa->ispi; rsa->rspi = sa->rspi; cp_id(&rsa->i_id, &sa->i_id); @@ -593,9 +593,9 @@ vl_api_ikev2_profile_set_ts_t_handler (vl_api_ikev2_profile_set_ts_t * mp) vlib_main_t *vm = vlib_get_main (); clib_error_t *error; u8 *tmp = format (0, "%s", mp->name); - ip4_address_t start_addr, end_addr; - ip4_address_decode (mp->ts.start_addr, &start_addr); - ip4_address_decode (mp->ts.end_addr, &end_addr); + ip_address_t start_addr, end_addr; + ip_address_decode2 (&mp->ts.start_addr, &start_addr); + ip_address_decode2 (&mp->ts.end_addr, &end_addr); error = ikev2_set_profile_ts (vm, tmp, mp->ts.protocol_id, clib_net_to_host_u16 (mp->ts.start_port), @@ -642,11 +642,11 @@ vl_api_ikev2_set_responder_t_handler (vl_api_ikev2_set_responder_t * mp) clib_error_t *error; u8 *tmp = format (0, "%s", mp->name); - ip4_address_t ip4; - ip4_address_decode (mp->responder.ip4, &ip4); + ip_address_t ip; + ip_address_decode2 (&mp->responder.addr, &ip); u32 sw_if_index = clib_net_to_host_u32 (mp->responder.sw_if_index); - error = ikev2_set_profile_responder (vm, tmp, sw_if_index, ip4); + error = ikev2_set_profile_responder (vm, tmp, sw_if_index, ip); vec_free (tmp); if (error) rv = VNET_API_ERROR_UNSPECIFIED; @@ -857,6 +857,28 @@ static void 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) + 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)