blob: 35ad3cda9ab157d433be9c7357323c5f9c8dc557 [file] [log] [blame]
Klement Sekera0e3c0de2016-09-29 14:43:44 +02001/*
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>
Klement Sekera0e3c0de2016-09-29 14:43:44 +020025
Klement Sekera239790f2017-02-16 10:53:53 +010026#define foreach_bfd_transport(F) \
27 F (UDP4, "ip4-rewrite") \
28 F (UDP6, "ip6-rewrite")
29
30typedef enum
31{
32#define F(t, n) BFD_TRANSPORT_##t,
33 foreach_bfd_transport (F)
34#undef F
35} bfd_transport_e;
36
Klement Sekerab17dd962017-01-09 07:43:48 +010037vnet_api_error_t
38bfd_udp_add_session (u32 sw_if_index, const ip46_address_t * local_addr,
Klement Sekeraa57a9702017-02-02 06:58:07 +010039 const ip46_address_t * peer_addr,
40 u32 desired_min_tx_usec, u32 required_min_rx_usec,
41 u8 detect_mult, u8 is_authenticated, u32 conf_key_id,
42 u8 bfd_key_id);
43
Klement Sekera239790f2017-02-16 10:53:53 +010044vnet_api_error_t
45bfd_udp_mod_session (u32 sw_if_index, const ip46_address_t * local_addr,
46 const ip46_address_t * peer_addr,
47 u32 desired_min_tx_usec, u32 required_min_rx_usec,
48 u8 detect_mult);
Klement Sekera0e3c0de2016-09-29 14:43:44 +020049
50vnet_api_error_t bfd_udp_del_session (u32 sw_if_index,
51 const ip46_address_t * local_addr,
52 const ip46_address_t * peer_addr);
53
Klement Sekerab17dd962017-01-09 07:43:48 +010054vnet_api_error_t bfd_udp_session_set_flags (u32 sw_if_index,
55 const ip46_address_t * local_addr,
56 const ip46_address_t * peer_addr,
57 u8 admin_up_down);
58
59vnet_api_error_t bfd_auth_set_key (u32 conf_key_id, u8 auth_type, u8 key_len,
60 const u8 * key);
61
62vnet_api_error_t bfd_auth_del_key (u32 conf_key_id);
63
64vnet_api_error_t bfd_udp_auth_activate (u32 sw_if_index,
65 const ip46_address_t * local_addr,
66 const ip46_address_t * peer_addr,
67 u32 conf_key_id, u8 bfd_key_id,
68 u8 is_delayed);
69
70vnet_api_error_t bfd_udp_auth_deactivate (u32 sw_if_index,
71 const ip46_address_t * local_addr,
72 const ip46_address_t * peer_addr,
73 u8 is_delayed);
Klement Sekera0e3c0de2016-09-29 14:43:44 +020074
Klement Sekera239790f2017-02-16 10:53:53 +010075vnet_api_error_t bfd_udp_set_echo_source (u32 loopback_sw_if_index);
76
77vnet_api_error_t bfd_udp_del_echo_source ();
78
Klement Sekera0e3c0de2016-09-29 14:43:44 +020079#endif /* __included_bfd_api_h__ */
80
81/*
82 * fd.io coding-style-patch-verification: ON
83 *
84 * Local Variables:
85 * eval: (c-set-style "gnu")
86 * End:
87 */