aboutsummaryrefslogtreecommitdiffstats
path: root/src/vat/api_format.c
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2019-09-03 10:40:01 +0200
committerOle Trøan <otroan@employees.org>2019-12-11 09:39:42 +0000
commit5de4fb7076a46ab75e2d3c30079dd6639af16a86 (patch)
tree3ac12410c3d0769f5d950df53d6abb43fe54e5b9 /src/vat/api_format.c
parent8dc75c0cc3ac0db13778a0a32f9aa81597b80556 (diff)
devices: tap API cleanup
Use consistent API types. Type: fix Change-Id: I11cc7f6347b7a60e5fd41e54f0c7994e2d81199f Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Diffstat (limited to 'src/vat/api_format.c')
-rw-r--r--src/vat/api_format.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index 218ae95e615..6e1ebf988b5 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -7474,8 +7474,8 @@ api_tap_create_v2 (vat_main_t * vam)
mp->id = ntohl (id);
mp->host_namespace_set = host_ns != 0;
mp->host_bridge_set = host_bridge != 0;
- mp->host_ip4_addr_set = host_ip4_prefix_len != 0;
- mp->host_ip6_addr_set = host_ip6_prefix_len != 0;
+ mp->host_ip4_prefix_set = host_ip4_prefix_len != 0;
+ mp->host_ip6_prefix_set = host_ip6_prefix_len != 0;
mp->rx_ring_sz = ntohs (rx_ring_sz);
mp->tx_ring_sz = ntohs (tx_ring_sz);
mp->host_mtu_set = host_mtu_set;
@@ -7493,9 +7493,9 @@ api_tap_create_v2 (vat_main_t * vam)
if (host_bridge)
clib_memcpy (mp->host_bridge, host_bridge, vec_len (host_bridge));
if (host_ip4_prefix_len)
- clib_memcpy (mp->host_ip4_addr, &host_ip4_addr, 4);
+ clib_memcpy (mp->host_ip4_prefix.address, &host_ip4_addr, 4);
if (host_ip6_prefix_len)
- clib_memcpy (mp->host_ip6_addr, &host_ip6_addr, 16);
+ clib_memcpy (mp->host_ip6_prefix.address, &host_ip6_addr, 16);
if (host_ip4_gw_set)
clib_memcpy (mp->host_ip4_gw, &host_ip4_gw, 4);
if (host_ip6_gw_set)
@@ -11859,10 +11859,12 @@ static void vl_api_sw_interface_tap_v2_details_t_handler
{
vat_main_t *vam = &vat_main;
- u8 *ip4 = format (0, "%U/%d", format_ip4_address, mp->host_ip4_addr,
- mp->host_ip4_prefix_len);
- u8 *ip6 = format (0, "%U/%d", format_ip6_address, mp->host_ip6_addr,
- mp->host_ip6_prefix_len);
+ u8 *ip4 =
+ format (0, "%U/%d", format_ip4_address, mp->host_ip4_prefix.address,
+ mp->host_ip4_prefix.len);
+ u8 *ip6 =
+ format (0, "%U/%d", format_ip6_address, mp->host_ip6_prefix.address,
+ mp->host_ip6_prefix.len);
print (vam->ofp,
"\n%-16s %-12d %-5d %-12d %-12d %-14U %-30s %-20s %-20s %-30s 0x%-08x",
@@ -11903,12 +11905,12 @@ static void vl_api_sw_interface_tap_v2_details_t_handler_json
vat_json_object_add_string_copy (node, "host_bridge", mp->host_bridge);
vat_json_object_add_string_copy (node, "host_ip4_addr",
format (0, "%U/%d", format_ip4_address,
- mp->host_ip4_addr,
- mp->host_ip4_prefix_len));
- vat_json_object_add_string_copy (node, "host_ip6_addr",
+ mp->host_ip4_prefix.address,
+ mp->host_ip4_prefix.len));
+ vat_json_object_add_string_copy (node, "host_ip6_prefix",
format (0, "%U/%d", format_ip6_address,
- mp->host_ip6_addr,
- mp->host_ip6_prefix_len));
+ mp->host_ip6_prefix.address,
+ mp->host_ip6_prefix.len));
}