summaryrefslogtreecommitdiffstats
path: root/src/vat/api_format.c
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-06-06 14:07:55 -0400
committerNeale Ranns <nranns@cisco.com>2019-06-26 11:36:57 +0000
commitab05508e1eb96749b68de8ccd2f6f88ff3e64fad (patch)
tree05f290dfff68a24810d0a3bdb2f7227ac4608114 /src/vat/api_format.c
parent941da4a224bbfc153bfe7c2344ae00e294d92798 (diff)
api: refactor format_vl_api_prefix_t return keys
format_vl_api_prefix_t returns a dict with keys 'address' and 'address_length', but other format_vl_api_prefix functions return a dict with 'prefix', and 'len'. Refactor all format_vl_api_prefix_t to return consistent keys 'address' and 'len'. Type: refactor Change-Id: I5f9558fc2da8742a303266e011102f5b2db80aad Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/vat/api_format.c')
-rw-r--r--src/vat/api_format.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index 992060df394..d9c13ad8644 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -788,8 +788,8 @@ static void
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
@@ -2663,7 +2663,7 @@ static void vl_api_ip_address_details_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
}
@@ -19201,8 +19201,7 @@ vl_api_ip_route_details_t_handler (vl_api_ip_route_details_t * mp)
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];
@@ -19242,8 +19241,7 @@ static void vl_api_ip_route_details_t_handler_json
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++)
{
@@ -21310,7 +21308,7 @@ api_ip_container_proxy_add_del (vat_main_t * vam)
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;