diff options
author | Benoît Ganne <bganne@cisco.com> | 2024-06-17 15:33:59 +0200 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2024-06-17 18:44:59 +0000 |
commit | 32dc913e6f3a026fc8e1fec396b12e70dfeb4cf0 (patch) | |
tree | 9b1a488d1fd76015e6c04884692302513a126fac /src/vnet/fib | |
parent | 448f08b685e880f472790ad96ad35c19851ef481 (diff) |
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>
Diffstat (limited to 'src/vnet/fib')
-rw-r--r-- | src/vnet/fib/fib_api.c | 15 | ||||
-rw-r--r-- | src/vnet/fib/fib_api.h | 1 |
2 files changed, 16 insertions, 0 deletions
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); |