2 * Copyright (c) 2011-2016 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
17 * @brief BFD API declarations
19 #ifndef __included_bfd_api_h__
20 #define __included_bfd_api_h__
22 #include <vnet/api_errno.h>
23 #include <vnet/vnet.h>
24 #include <vnet/ip/ip46_address.h>
26 #define foreach_bfd_transport(F) \
27 F (UDP4, "ip4-rewrite") \
28 F (UDP6, "ip6-rewrite")
32 #define F(t, n) BFD_TRANSPORT_##t,
33 foreach_bfd_transport (F)
38 * @brief create a new bfd session
41 bfd_udp_add_session (u32 sw_if_index, const ip46_address_t * local_addr,
42 const ip46_address_t * peer_addr,
43 u32 desired_min_tx_usec, u32 required_min_rx_usec,
44 u8 detect_mult, u8 is_authenticated, u32 conf_key_id,
48 * @brief create a new or modify and existing bfd session
51 bfd_udp_upd_session (u32 sw_if_index, const ip46_address_t *local_addr,
52 const ip46_address_t *peer_addr, u32 desired_min_tx_usec,
53 u32 required_min_rx_usec, u8 detect_mult,
54 u8 is_authenticated, u32 conf_key_id, u8 bfd_key_id);
57 * @brief modify existing session
60 bfd_udp_mod_session (u32 sw_if_index, const ip46_address_t * local_addr,
61 const ip46_address_t * peer_addr,
62 u32 desired_min_tx_usec, u32 required_min_rx_usec,
66 * @brief delete existing session
68 vnet_api_error_t bfd_udp_del_session (u32 sw_if_index,
69 const ip46_address_t * local_addr,
70 const ip46_address_t * peer_addr);
73 * @brief set session admin down/up
75 vnet_api_error_t bfd_udp_session_set_flags (vlib_main_t * vm, u32 sw_if_index,
76 const ip46_address_t * local_addr,
77 const ip46_address_t * peer_addr,
81 * @brief create or modify bfd authentication key
83 vnet_api_error_t bfd_auth_set_key (u32 conf_key_id, u8 auth_type, u8 key_len,
87 * @brief delete existing authentication key
89 vnet_api_error_t bfd_auth_del_key (u32 conf_key_id);
92 * @brief activate authentication for existing session
94 vnet_api_error_t bfd_udp_auth_activate (u32 sw_if_index,
95 const ip46_address_t * local_addr,
96 const ip46_address_t * peer_addr,
97 u32 conf_key_id, u8 bfd_key_id,
101 * @brief deactivate authentication for existing session
103 vnet_api_error_t bfd_udp_auth_deactivate (u32 sw_if_index,
104 const ip46_address_t * local_addr,
105 const ip46_address_t * peer_addr,
109 * @brief set echo-source interface
111 vnet_api_error_t bfd_udp_set_echo_source (u32 loopback_sw_if_index);
114 * @brief unset echo-source interface
116 vnet_api_error_t bfd_udp_del_echo_source ();
118 #endif /* __included_bfd_api_h__ */
121 * fd.io coding-style-patch-verification: ON
124 * eval: (c-set-style "gnu")