bfd: API cleanup
Use consistent API types.
Type: fix
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I4b91ebe8aadbec8b95716ed1cde4b0a13eee3a3f
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
diff --git a/src/vnet/bfd/bfd.api b/src/vnet/bfd/bfd.api
index afbcc73..9fdd5b7 100644
--- a/src/vnet/bfd/bfd.api
+++ b/src/vnet/bfd/bfd.api
@@ -13,7 +13,17 @@
* limitations under the License.
*/
-option version = "1.0.0";
+option version = "2.0.0";
+
+import "vnet/interface_types.api";
+import "vnet/ip/ip_types.api";
+
+enum bfd_state {
+ BFD_STATE_API_ADMIN_DOWN = 0,
+ BFD_STATE_API_DOWN = 1,
+ BFD_STATE_API_INIT = 2,
+ BFD_STATE_API_UP = 3,
+};
/** \brief Set BFD echo source
@param client_index - opaque cookie to identify the sender
@@ -24,7 +34,7 @@
{
u32 client_index;
u32 context;
- u32 sw_if_index;
+ vl_api_interface_index_t sw_if_index;
};
/** \brief Delete BFD echo source
@@ -61,12 +71,12 @@
{
u32 context;
i32 retval;
- u32 sw_if_index;
- u8 is_set;
- u8 have_usable_ip4;
- u8 ip4_addr[4];
- u8 have_usable_ip6;
- u8 ip6_addr[16];
+ vl_api_interface_index_t sw_if_index;
+ bool is_set;
+ bool have_usable_ip4;
+ vl_api_ip4_address_t ip4_addr;
+ bool have_usable_ip6;
+ vl_api_ip6_address_t ip6_addr;
};
/** \brief Add UDP BFD session on interface
@@ -87,14 +97,13 @@
{
u32 client_index;
u32 context;
- u32 sw_if_index;
+ vl_api_interface_index_t sw_if_index;
u32 desired_min_tx;
u32 required_min_rx;
- u8 local_addr[16];
- u8 peer_addr[16];
- u8 is_ipv6;
+ vl_api_address_t local_addr;
+ vl_api_address_t peer_addr;
u8 detect_mult;
- u8 is_authenticated;
+ bool is_authenticated;
u8 bfd_key_id;
u32 conf_key_id;
};
@@ -114,12 +123,11 @@
{
u32 client_index;
u32 context;
- u32 sw_if_index;
+ vl_api_interface_index_t sw_if_index;
u32 desired_min_tx;
u32 required_min_rx;
- u8 local_addr[16];
- u8 peer_addr[16];
- u8 is_ipv6;
+ vl_api_address_t local_addr;
+ vl_api_address_t peer_addr;
u8 detect_mult;
};
@@ -135,10 +143,9 @@
{
u32 client_index;
u32 context;
- u32 sw_if_index;
- u8 local_addr[16];
- u8 peer_addr[16];
- u8 is_ipv6;
+ vl_api_interface_index_t sw_if_index;
+ vl_api_address_t local_addr;
+ vl_api_address_t peer_addr;
};
/** \brief Get all BFD sessions
@@ -168,12 +175,11 @@
define bfd_udp_session_details
{
u32 context;
- u32 sw_if_index;
- u8 local_addr[16];
- u8 peer_addr[16];
- u8 is_ipv6;
- u8 state;
- u8 is_authenticated;
+ vl_api_interface_index_t sw_if_index;
+ vl_api_address_t local_addr;
+ vl_api_address_t peer_addr;
+ vl_api_bfd_state_t state;
+ bool is_authenticated;
u8 bfd_key_id;
u32 conf_key_id;
u32 required_min_rx;
@@ -188,17 +194,16 @@
@param local_addr - local address
@param peer_addr - peer address
@param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
- @param admin_up_down - set the admin state, 1 = up, 0 = down
+ @param flags - set the admin state, 1 = up, 0 = down
*/
autoreply define bfd_udp_session_set_flags
{
u32 client_index;
u32 context;
- u32 sw_if_index;
- u8 local_addr[16];
- u8 peer_addr[16];
- u8 is_ipv6;
- u8 admin_up_down;
+ vl_api_interface_index_t sw_if_index;
+ vl_api_address_t local_addr;
+ vl_api_address_t peer_addr;
+ vl_api_if_status_flags_t flags;
};
/** \brief Register for BFD events
@@ -211,7 +216,7 @@
{
u32 client_index;
u32 context;
- u32 enable_disable;
+ bool enable_disable;
u32 pid;
};
@@ -286,11 +291,10 @@
{
u32 client_index;
u32 context;
- u32 sw_if_index;
- u8 local_addr[16];
- u8 peer_addr[16];
- u8 is_ipv6;
- u8 is_delayed;
+ vl_api_interface_index_t sw_if_index;
+ vl_api_address_t local_addr;
+ vl_api_address_t peer_addr;
+ bool is_delayed;
u8 bfd_key_id;
u32 conf_key_id;
};
@@ -308,11 +312,10 @@
{
u32 client_index;
u32 context;
- u32 sw_if_index;
- u8 local_addr[16];
- u8 peer_addr[16];
- u8 is_ipv6;
- u8 is_delayed;
+ vl_api_interface_index_t sw_if_index;
+ vl_api_address_t local_addr;
+ vl_api_address_t peer_addr;
+ bool is_delayed;
};
/*