static void
increment_address (vl_api_address_t * a)
{
- if (a->af == ADDRESS_IP4)
+ if (clib_net_to_host_u32 (a->af) == ADDRESS_IP4)
increment_v4_address (&a->un.ip4);
- else if (a->af == ADDRESS_IP6)
+ else if (clib_net_to_host_u32 (a->af) == ADDRESS_IP6)
increment_v6_address (&a->un.ip6);
}
vat_json_object_add_prefix (vat_json_node_t * node,
const vl_api_prefix_t * prefix)
{
- vat_json_object_add_uint (node, "address_length", prefix->address_length);
- vat_json_object_add_address (node, "prefix", &prefix->address);
+ vat_json_object_add_uint (node, "len", prefix->len);
+ vat_json_object_add_address (node, "address", &prefix->address);
}
static void vl_api_create_loopback_reply_t_handler
address = vec_elt_at_index (addresses, vec_len (addresses) - 1);
clib_memcpy (&address->ip, &mp->prefix.address.un, sizeof (address->ip));
- address->prefix_length = mp->prefix.address_length;
+ address->prefix_length = mp->prefix.len;
#undef addresses
}
vl_api_mpls_route_details_t_handler (vl_api_mpls_route_details_t * mp)
{
vat_main_t *vam = &vat_main;
- int count = ntohl (mp->mr_route.mr_n_paths);
+ int count = (int) clib_net_to_host_u32 (mp->mr_route.mr_n_paths);
vl_api_fib_path_t *fp;
int i;
(vl_api_mpls_route_details_t * mp)
{
vat_main_t *vam = &vat_main;
- int count = ntohl (mp->mr_route.mr_n_paths);
+ int count = (int) clib_host_to_net_u32 (mp->mr_route.mr_n_paths);
vat_json_node_t *node = NULL;
vl_api_fib_path_t *fp;
int i;
print (vam->ofp,
"table-id %d, prefix %U/%d",
ntohl (mp->route.table_id),
- format_ip46_address,
- mp->route.prefix.address, mp->route.prefix.address_length);
+ format_ip46_address, mp->route.prefix.address, mp->route.prefix.len);
for (i = 0; i < count; i++)
{
fp = &mp->route.paths[i];
clib_memcpy (&ip4, &mp->route.prefix.address.un.ip4, sizeof (ip4));
vat_json_object_add_ip4 (node, "prefix", ip4);
}
- vat_json_object_add_uint (node, "mask_length",
- mp->route.prefix.address_length);
+ vat_json_object_add_uint (node, "mask_length", mp->route.prefix.len);
vat_json_object_add_uint (node, "path_count", count);
for (i = 0; i < count; i++)
{
else
break;
}
- if (sw_if_index == ~0 || pfx.address_length == 0)
+ if (sw_if_index == ~0 || pfx.len == 0)
{
errmsg ("address and sw_if_index must be set");
return -99;