+static void
+vl_api_bfd_udp_get_echo_source_t_handler (vl_api_bfd_udp_get_echo_source_t *
+ mp)
+{
+ vl_api_bfd_udp_get_echo_source_reply_t *rmp;
+ int rv = 0;
+ int is_set;
+ u32 sw_if_index;
+ int have_usable_ip4;
+ ip4_address_t ip4;
+ int have_usable_ip6;
+ ip6_address_t ip6;
+
+ bfd_udp_get_echo_source (&is_set, &sw_if_index, &have_usable_ip4, &ip4,
+ &have_usable_ip6, &ip6);
+
+ /* *INDENT-OFF* */
+ REPLY_MACRO2 (VL_API_BFD_UDP_GET_ECHO_SOURCE_REPLY,
+ ({
+ rmp->sw_if_index = ntohl (sw_if_index);
+ if (is_set)
+ {
+ rmp->is_set = 1;
+ rmp->sw_if_index = clib_host_to_net_u32 (sw_if_index);
+ if (have_usable_ip4)
+ {
+ rmp->have_usable_ip4 = 1;
+ clib_memcpy (rmp->ip4_addr, &ip4, sizeof (ip4));
+ }
+ else
+ {
+ rmp->have_usable_ip4 = 0;
+ }
+ if (have_usable_ip6)
+ {
+ rmp->have_usable_ip6 = 1;
+ clib_memcpy (rmp->ip6_addr, &ip6, sizeof (ip6));
+ }
+ else
+ {
+ rmp->have_usable_ip6 = 0;
+ }
+ }
+ else
+ {
+ rmp->is_set = 0;
+ rmp->have_usable_ip4 = 0;
+ rmp->have_usable_ip6 = 0;
+ }
+ }))
+ /* *INDENT-ON* */
+}
+