From 32dc913e6f3a026fc8e1fec396b12e70dfeb4cf0 Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Mon, 17 Jun 2024 15:33:59 +0200 Subject: vnet: move format_vl_api_address_union() from vpp to vnet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/vnet/fib/fib_api.c | 15 +++++++++++++++ src/vnet/fib/fib_api.h | 1 + 2 files changed, 16 insertions(+) (limited to 'src/vnet/fib') diff --git a/src/vnet/fib/fib_api.c b/src/vnet/fib/fib_api.c index 1b1c0d113c0..426161b0670 100644 --- a/src/vnet/fib/fib_api.c +++ b/src/vnet/fib/fib_api.c @@ -494,6 +494,21 @@ fib_api_route_add_del (u8 is_add, 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 0c59531b438..9eac62fe1c6 100644 --- a/src/vnet/fib/fib_api.h +++ b/src/vnet/fib/fib_api.h @@ -51,6 +51,7 @@ extern int fib_api_route_add_del (u8 is_add, 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); -- cgit 1.2.3-korg