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 | |
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>
-rw-r--r-- | src/vnet/fib/fib_api.c | 15 | ||||
-rw-r--r-- | src/vnet/fib/fib_api.h | 1 | ||||
-rw-r--r-- | src/vpp/api/types.c | 15 | ||||
-rw-r--r-- | src/vpp/api/types.h | 1 |
4 files changed, 16 insertions, 16 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); diff --git a/src/vpp/api/types.c b/src/vpp/api/types.c index 92bbdb30ac9..8e118109492 100644 --- a/src/vpp/api/types.c +++ b/src/vpp/api/types.c @@ -49,21 +49,6 @@ format_vl_api_address (u8 * s, va_list * args) } 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_ip4_address (u8 * s, va_list * args) { const vl_api_ip4_address_t *addr = va_arg (*args, vl_api_ip4_address_t *); diff --git a/src/vpp/api/types.h b/src/vpp/api/types.h index 9864e8c38a8..7a546dbdc0d 100644 --- a/src/vpp/api/types.h +++ b/src/vpp/api/types.h @@ -40,7 +40,6 @@ extern u8 *format_vl_api_address (u8 * s, va_list * args); extern u8 *format_vl_api_address_family (u8 * s, va_list * args); extern u8 *format_vl_api_ip4_address (u8 * s, va_list * args); extern u8 *format_vl_api_ip6_address (u8 * s, va_list * args); -extern u8 *format_vl_api_address_union (u8 * s, va_list * args); extern u8 *format_vl_api_prefix (u8 * s, va_list * args); extern u8 *format_vl_api_mprefix (u8 * s, va_list * args); extern u8 *format_vl_api_mac_address (u8 * s, va_list * args); |