diff options
author | Ole Troan <ot@cisco.com> | 2019-12-09 14:25:09 +0100 |
---|---|---|
committer | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2019-12-10 04:11:04 +0000 |
commit | 0fa66d618e7d839782a896f75bc8b0337cc2a2b8 (patch) | |
tree | 9a9b8593063d59dbf66cc6d09914df072c6663e6 /src/plugins/ioam/udp-ping/udp_ping_api.c | |
parent | 668605fc873a6409f38df712106f4b1290d87648 (diff) |
ioam: use explicit api types
Also remove API boilerplate.
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I62e795f5af3843af7912707ade4ba178ff326942
Diffstat (limited to 'src/plugins/ioam/udp-ping/udp_ping_api.c')
-rw-r--r-- | src/plugins/ioam/udp-ping/udp_ping_api.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins/ioam/udp-ping/udp_ping_api.c b/src/plugins/ioam/udp-ping/udp_ping_api.c index 82f56aa01bf..6c54e0d9929 100644 --- a/src/plugins/ioam/udp-ping/udp_ping_api.c +++ b/src/plugins/ioam/udp-ping/udp_ping_api.c @@ -25,7 +25,8 @@ #include <vlibapi/api.h> #include <vlibmemory/api.h> - +#include <vnet/format_fns.h> +#include <vnet/ip/ip_types_api.h> /* define message IDs */ #include <ioam/udp-ping/udp_ping.api_enum.h> @@ -42,16 +43,13 @@ vl_api_udp_ping_add_del_t_handler (vl_api_udp_ping_add_del_t * mp) udp_ping_main_t *sm = &udp_ping_main; vl_api_udp_ping_add_del_reply_t *rmp; - if (mp->is_ipv4) + if (clib_net_to_host_u32 (mp->src_ip_address.af) == ADDRESS_IP4) { rv = -1; //Not supported goto ERROROUT; } - - clib_memcpy ((void *) &src.ip6, (void *) mp->src_ip_address, - sizeof (ip6_address_t)); - clib_memcpy ((void *) &dst.ip6, (void *) mp->dst_ip_address, - sizeof (ip6_address_t)); + ip_address_decode (&mp->src_ip_address, &src); + ip_address_decode (&mp->dst_ip_address, &dst); ip46_udp_ping_set_flow (src, dst, ntohs (mp->start_src_port), |