summaryrefslogtreecommitdiffstats
path: root/vpp-api-test/vat
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-05-24 23:19:11 +0200
committerDamjan Marion <damarion@cisco.com>2016-06-13 19:04:12 +0200
commit86be48773c1833129317a3a0d6fe8165eb69ac3f (patch)
treeff6ddc2933e9a18aba8e3e841fb6f495bc7efe4a /vpp-api-test/vat
parenta38c3df5fd2bf1bf8b3389e882f6dcd5ac533202 (diff)
Explicity specify IP address type for format_ip46_address function
Change-Id: I3379517535a98a7a5fbd3173503f288a81378821 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vpp-api-test/vat')
-rw-r--r--vpp-api-test/vat/api_format.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c
index 666a4bd19c5..410bab50b31 100644
--- a/vpp-api-test/vat/api_format.c
+++ b/vpp-api-test/vat/api_format.c
@@ -474,7 +474,23 @@ u8 * format_ip6_address (u8 * s, va_list * args)
u8 * format_ip46_address (u8 * s, va_list * args)
{
ip46_address_t *ip46 = va_arg (*args, ip46_address_t *);
- return ip46_address_is_ip4(ip46)?
+ ip46_type_t type = va_arg (*args, ip46_type_t);
+ int is_ip4 = 1;
+
+ switch (type)
+ {
+ case IP46_TYPE_ANY:
+ is_ip4 = ip46_address_is_ip4(ip46);
+ break;
+ case IP46_TYPE_IP4:
+ is_ip4 = 1;
+ break;
+ case IP46_TYPE_IP6:
+ is_ip4 = 0;
+ break;
+ }
+
+ return is_ip4 ?
format(s, "%U", format_ip4_address, &ip46->ip4):
format(s, "%U", format_ip6_address, &ip46->ip6);
}
@@ -7522,7 +7538,9 @@ static void vl_api_vxlan_tunnel_details_t_handler
fformat(vam->ofp, "%11d%24U%24U%14d%18d%13d\n",
ntohl(mp->sw_if_index),
format_ip46_address, &(mp->src_address[0]),
+ IP46_TYPE_ANY,
format_ip46_address, &(mp->dst_address[0]),
+ IP46_TYPE_ANY,
ntohl(mp->encap_vrf_id),
ntohl(mp->decap_next_index),
ntohl(mp->vni));