BFD: echo function
[vpp.git] / src / vnet / bfd / bfd_api.h
1 /*
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:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15 /**
16  * @file
17  * @brief BFD global declarations
18  */
19 #ifndef __included_bfd_api_h__
20 #define __included_bfd_api_h__
21
22 #include <vnet/api_errno.h>
23 #include <vnet/vnet.h>
24 #include <vnet/ip/ip6_packet.h>
25 #include <vnet/bfd/bfd_udp.h>
26
27 #define foreach_bfd_transport(F) \
28   F (UDP4, "ip4-rewrite")        \
29   F (UDP6, "ip6-rewrite")
30
31 typedef enum
32 {
33 #define F(t, n) BFD_TRANSPORT_##t,
34   foreach_bfd_transport (F)
35 #undef F
36 } bfd_transport_e;
37
38 vnet_api_error_t
39 bfd_udp_add_session (u32 sw_if_index, const ip46_address_t * local_addr,
40                      const ip46_address_t * peer_addr,
41                      u32 desired_min_tx_usec, u32 required_min_rx_usec,
42                      u8 detect_mult, u8 is_authenticated, u32 conf_key_id,
43                      u8 bfd_key_id);
44
45 vnet_api_error_t
46 bfd_udp_mod_session (u32 sw_if_index, const ip46_address_t * local_addr,
47                      const ip46_address_t * peer_addr,
48                      u32 desired_min_tx_usec, u32 required_min_rx_usec,
49                      u8 detect_mult);
50
51 vnet_api_error_t bfd_udp_del_session (u32 sw_if_index,
52                                       const ip46_address_t * local_addr,
53                                       const ip46_address_t * peer_addr);
54
55 vnet_api_error_t bfd_udp_session_set_flags (u32 sw_if_index,
56                                             const ip46_address_t * local_addr,
57                                             const ip46_address_t * peer_addr,
58                                             u8 admin_up_down);
59
60 vnet_api_error_t bfd_auth_set_key (u32 conf_key_id, u8 auth_type, u8 key_len,
61                                    const u8 * key);
62
63 vnet_api_error_t bfd_auth_del_key (u32 conf_key_id);
64
65 vnet_api_error_t bfd_udp_auth_activate (u32 sw_if_index,
66                                         const ip46_address_t * local_addr,
67                                         const ip46_address_t * peer_addr,
68                                         u32 conf_key_id, u8 bfd_key_id,
69                                         u8 is_delayed);
70
71 vnet_api_error_t bfd_udp_auth_deactivate (u32 sw_if_index,
72                                           const ip46_address_t * local_addr,
73                                           const ip46_address_t * peer_addr,
74                                           u8 is_delayed);
75
76 vnet_api_error_t bfd_udp_set_echo_source (u32 loopback_sw_if_index);
77
78 vnet_api_error_t bfd_udp_del_echo_source ();
79
80 #endif /* __included_bfd_api_h__ */
81
82 /*
83  * fd.io coding-style-patch-verification: ON
84  *
85  * Local Variables:
86  * eval: (c-set-style "gnu")
87  * End:
88  */