vnet: move format_vl_api_address_union() from vpp to vnet

format_vl_api_address_union() is used by vnet, creating a linkage
dependency from vnet to vpp.

Type: fix

Change-Id: I298a90d521e51b7527ef140d66130062824e1d16
Signed-off-by: Benoît Ganne <bganne@cisco.com>
diff --git a/src/vnet/fib/fib_api.c b/src/vnet/fib/fib_api.c
index 1b1c0d1..426161b 100644
--- a/src/vnet/fib/fib_api.c
+++ b/src/vnet/fib/fib_api.c
@@ -494,6 +494,21 @@
     return (0);
 }
 
+u8 *
+format_vl_api_address_union (u8 * s, va_list * args)
+{
+  const vl_api_address_union_t *addr =
+    va_arg (*args, vl_api_address_union_t *);
+  vl_api_address_family_t af = va_arg (*args, int);
+
+  if (ADDRESS_IP6 == af)
+    s = format (s, "%U", format_ip6_address, addr->ip6);
+  else
+    s = format (s, "%U", format_ip4_address, addr->ip4);
+
+  return s;
+}
+
 u8*
 format_vl_api_fib_path (u8 * s, va_list * args)
 {
diff --git a/src/vnet/fib/fib_api.h b/src/vnet/fib/fib_api.h
index 0c59531..9eac62f 100644
--- a/src/vnet/fib/fib_api.h
+++ b/src/vnet/fib/fib_api.h
@@ -51,6 +51,7 @@
                                   fib_entry_flag_t entry_flags,
                                   fib_route_path_t *rpaths);
 
+extern u8 *format_vl_api_address_union (u8 * s, va_list * args);
 extern u8* format_vl_api_fib_path(u8 * s, va_list * args);