diff options
author | Milan Lenco <milan.lenco@pantheon.tech> | 2017-12-14 10:04:25 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-12-14 11:08:49 +0000 |
commit | 73e7f427e8865b0af71740c5ecfa55c7ee78dbd1 (patch) | |
tree | dfd02ef5ad15eda2143d5a092bfd9d5628d47ef6 /src/vat | |
parent | 545d9eaeff62af74b6c1d2c27e6067f40685af93 (diff) |
tap_v2: include host-side parameters in the dump binary API
Change-Id: I097a738b96a304621520f1842dcac7dbf61a8e3f
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
Diffstat (limited to 'src/vat')
-rw-r--r-- | src/vat/api_format.c | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c index e8d6bd5b1c1..445b4962b36 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -12439,8 +12439,20 @@ static void vl_api_sw_interface_tap_v2_details_t_handler { vat_main_t *vam = &vat_main; - print (vam->ofp, "%-16s %d", - mp->dev_name, clib_net_to_host_u32 (mp->sw_if_index)); + 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); + + print (vam->ofp, + "\n%-16s %-12d %-5d %-12d %-12d %-14U %-30s %-20s %-20s %-30s", + mp->dev_name, ntohl (mp->sw_if_index), ntohl (mp->id), + ntohs (mp->rx_ring_sz), ntohs (mp->tx_ring_sz), + format_ethernet_address, mp->host_mac_addr, mp->host_namespace, + mp->host_bridge, ip4, ip6); + + vec_free (ip4); + vec_free (ip6); } static void vl_api_sw_interface_tap_v2_details_t_handler_json @@ -12457,8 +12469,26 @@ static void vl_api_sw_interface_tap_v2_details_t_handler_json node = vat_json_array_add (&vam->json_tree); vat_json_init_object (node); + vat_json_object_add_uint (node, "id", ntohl (mp->id)); vat_json_object_add_uint (node, "sw_if_index", ntohl (mp->sw_if_index)); vat_json_object_add_string_copy (node, "dev_name", mp->dev_name); + vat_json_object_add_uint (node, "rx_ring_sz", ntohs (mp->rx_ring_sz)); + vat_json_object_add_uint (node, "tx_ring_sz", ntohs (mp->tx_ring_sz)); + vat_json_object_add_string_copy (node, "host_mac_addr", + format (0, "%U", format_ethernet_address, + &mp->host_mac_addr)); + vat_json_object_add_string_copy (node, "host_namespace", + mp->host_namespace); + 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", + format (0, "%U/%d", format_ip6_address, + mp->host_ip6_addr, + mp->host_ip6_prefix_len)); + } static int @@ -12468,7 +12498,12 @@ api_sw_interface_tap_v2_dump (vat_main_t * vam) vl_api_control_ping_t *mp_ping; int ret; - print (vam->ofp, "\n%-16s %s", "dev_name", "sw_if_index"); + print (vam->ofp, + "\n%-16s %-12s %-5s %-12s %-12s %-14s %-30s %-20s %-20s %-30s", + "dev_name", "sw_if_index", "id", "rx_ring_sz", "tx_ring_sz", + "host_mac_addr", "host_namespace", "host_bridge", "host_ip4_addr", + "host_ip6_addr"); + /* Get list of tap interfaces */ M (SW_INTERFACE_TAP_V2_DUMP, mp); S (mp); |