1 /* * Copyright (c) 2011-2016 Cisco and/or its affiliates.
2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * You may obtain a copy of the License at:
6 * http://www.apache.org/licenses/LICENSE-2.0
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
16 * @brief BFD UDP transport layer declarations
19 #ifndef __included_bfd_udp_h__
20 #define __included_bfd_udp_h__
22 #include <vppinfra/clib.h>
23 #include <vnet/adj/adj_types.h>
24 #include <vnet/ip/ip6_packet.h>
25 #include <vnet/bfd/bfd_api.h>
28 /** identifier of BFD session based on UDP transport only */
29 typedef CLIB_PACKED (struct {
30 /** interface to which the session is tied */
33 ip46_address_t local_addr;
35 ip46_address_t peer_addr;
39 /** UDP transport specific data embedded in bfd_session's union */
42 /** key identifying this session */
44 /** adjacency index returned from adj lock call */
45 adj_index_t adj_index;
48 /** bfd udp echo packet trace capture */
53 } bfd_udp_echo_input_trace_t;
58 * @brief add the necessary transport layer by prepending it to existing data
60 * @param is_echo 1 if this is echo packet, 0 if control frame
62 * @return 1 on success, 0 on failure
64 int bfd_add_udp4_transport (vlib_main_t * vm, vlib_buffer_t * b,
65 const struct bfd_session_s *bs, int is_echo);
68 * @brief add the necessary transport layer by prepending it to existing data
70 * @param is_echo 1 if this is echo packet, 0 if control frame
72 * @return 1 on success, 0 on failure
74 int bfd_add_udp6_transport (vlib_main_t * vm, vlib_buffer_t * b,
75 const struct bfd_session_s *bs, int is_echo);
78 * @brief check if the bfd udp layer is echo-capable at this time
80 * @return 1 if available, 0 otherwise
82 int bfd_udp_is_echo_available (bfd_transport_e transport);
85 * @brief get echo source information - used by CLI
87 void bfd_udp_get_echo_source (int *is_set, u32 * sw_if_index,
88 int *have_usable_ip4, ip4_address_t * ip4,
89 int *have_usable_ip6, ip6_address_t * ip6);
91 #endif /* __included_bfd_udp_h__ */
94 * fd.io coding-style-patch-verification: ON
97 * eval: (c-set-style "gnu")