/*
- * Copyright (c) 2018 Cisco and/or its affiliates.
+ * Copyright (c) 2018-2019 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
&ue->ue_hdrs.ip4.ue_ip4.src_address, 4);
clib_memcpy (&mp->udp_encap.dst_ip.un.ip4,
&ue->ue_hdrs.ip4.ue_ip4.dst_address, 4);
- mp->udp_encap.dst_ip.af = clib_host_to_net_u32 (ADDRESS_IP4);
- mp->udp_encap.src_ip.af = clib_host_to_net_u32 (ADDRESS_IP4);
+ mp->udp_encap.dst_ip.af = ip_address_family_encode (AF_IP4);
+ mp->udp_encap.src_ip.af = ip_address_family_encode (AF_IP4);
/* ports aren't byte swapped because they are stored in network
* byte order */
&ue->ue_hdrs.ip6.ue_ip6.src_address, 16);
clib_memcpy (&mp->udp_encap.dst_ip.un.ip6,
&ue->ue_hdrs.ip6.ue_ip6.dst_address, 16);
- mp->udp_encap.dst_ip.af = clib_host_to_net_u32 (ADDRESS_IP6);
- mp->udp_encap.src_ip.af = clib_host_to_net_u32 (ADDRESS_IP6);
+ mp->udp_encap.dst_ip.af = ip_address_family_encode (AF_IP6);
+ mp->udp_encap.src_ip.af = ip_address_family_encode (AF_IP6);
/* ports aren't byte swapped because they are stored in network
* byte order */
return;
/* *INDENT-OFF* */
- pool_foreach(ue, udp_encap_pool,
- ({
+ pool_foreach (ue, udp_encap_pool)
+ {
send_udp_encap_details(ue, reg, mp->context);
- }));
+ }
/* *INDENT-ON* */
}
static clib_error_t *
udp_api_hookup (vlib_main_t * vm)
{
- api_main_t *am = &api_main;
+ api_main_t *am = vlibapi_get_main ();
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \