blob: 9e2a12e1f9b26c271e2afd084c5784ec02cb35f1 [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_main_h__
20#define __included_bfd_main_h__
21
22#include <vppinfra/timing_wheel.h>
23#include <vnet/vnet.h>
24#include <vnet/bfd/bfd_protocol.h>
25#include <vnet/bfd/bfd_udp.h>
Damjan Marion07a38572018-01-21 06:44:18 -080026#include <vlib/log.h>
Klement Sekera0e3c0de2016-09-29 14:43:44 +020027
Klement Sekera0e3c0de2016-09-29 14:43:44 +020028#define foreach_bfd_mode(F) \
29 F (asynchronous) \
30 F (demand)
31
32typedef enum
33{
34#define F(x) BFD_MODE_##x,
35 foreach_bfd_mode (F)
36#undef F
37} bfd_mode_e;
38
39typedef struct
40{
Klement Sekerab16bfe32017-02-28 11:56:48 +010041 /** global configuration key ID */
Klement Sekerab17dd962017-01-09 07:43:48 +010042 u32 conf_key_id;
43
Klement Sekerab16bfe32017-02-28 11:56:48 +010044 /** keeps track of how many sessions reference this key */
Klement Sekerab17dd962017-01-09 07:43:48 +010045 u32 use_count;
46
Klement Sekerab16bfe32017-02-28 11:56:48 +010047 /**
Klement Sekerab17dd962017-01-09 07:43:48 +010048 * key data directly usable for bfd purposes - already padded with zeroes
49 * (so we don't need the actual length)
50 */
51 u8 key[20];
52
Klement Sekerab16bfe32017-02-28 11:56:48 +010053 /** authentication type for this key */
Klement Sekerab17dd962017-01-09 07:43:48 +010054 bfd_auth_type_e auth_type;
55} bfd_auth_key_t;
56
Klement Sekera239790f2017-02-16 10:53:53 +010057#define foreach_bfd_poll_state(F) \
58 F (NOT_NEEDED) \
59 F (NEEDED) \
60 F (IN_PROGRESS) \
61 F (IN_PROGRESS_AND_QUEUED)
Klement Sekeraa57a9702017-02-02 06:58:07 +010062
63typedef enum
64{
Klement Sekera239790f2017-02-16 10:53:53 +010065#define F(x) BFD_POLL_##x,
Klement Sekeraa57a9702017-02-02 06:58:07 +010066 foreach_bfd_poll_state (F)
67#undef F
68} bfd_poll_state_e;
69
Neale Ranns88fc83e2017-04-05 08:11:14 -070070/**
71 * hop types
72 */
73#define foreach_bfd_hop(F) \
74 F (SINGLE, "single") \
75 F (MULTI, "multi") \
76
77typedef enum
78{
79#define F(sym, str) BFD_HOP_TYPE_##sym,
80 foreach_bfd_hop (F)
81#undef F
82} bfd_hop_type_e;
83
Klement Sekera2bce0332017-02-09 06:03:46 +010084typedef struct bfd_session_s
Klement Sekerab17dd962017-01-09 07:43:48 +010085{
Klement Sekerab16bfe32017-02-28 11:56:48 +010086 /** index in bfd_main.sessions pool */
Klement Sekera637b9c42016-12-08 05:19:14 +010087 u32 bs_idx;
Klement Sekera0e3c0de2016-09-29 14:43:44 +020088
Klement Sekerab16bfe32017-02-28 11:56:48 +010089 /** session state */
Klement Sekera0e3c0de2016-09-29 14:43:44 +020090 bfd_state_e local_state;
91
Klement Sekerab16bfe32017-02-28 11:56:48 +010092 /** remote session state */
Klement Sekera73884482017-02-23 09:26:30 +010093 bfd_state_e remote_state;
94
Neale Ranns88fc83e2017-04-05 08:11:14 -070095 /** BFD hop type */
96 bfd_hop_type_e hop_type;
97
Klement Sekerab16bfe32017-02-28 11:56:48 +010098 /** local diagnostics */
Klement Sekera0e3c0de2016-09-29 14:43:44 +020099 bfd_diag_code_e local_diag;
100
Klement Sekerab16bfe32017-02-28 11:56:48 +0100101 /** remote diagnostics */
Klement Sekera73884482017-02-23 09:26:30 +0100102 bfd_diag_code_e remote_diag;
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200103
Klement Sekerab16bfe32017-02-28 11:56:48 +0100104 /** local discriminator */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200105 u32 local_discr;
106
Klement Sekerab16bfe32017-02-28 11:56:48 +0100107 /** remote discriminator */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200108 u32 remote_discr;
109
Klement Sekerab16bfe32017-02-28 11:56:48 +0100110 /** configured desired min tx interval (microseconds) */
Klement Sekeraa57a9702017-02-02 06:58:07 +0100111 u32 config_desired_min_tx_usec;
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200112
Klement Sekerab16bfe32017-02-28 11:56:48 +0100113 /** configured desired min tx interval (clocks) */
Klement Sekeraa57a9702017-02-02 06:58:07 +0100114 u64 config_desired_min_tx_clocks;
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200115
Klement Sekerab16bfe32017-02-28 11:56:48 +0100116 /** effective desired min tx interval (clocks) */
Klement Sekeraa57a9702017-02-02 06:58:07 +0100117 u64 effective_desired_min_tx_clocks;
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200118
Klement Sekerab16bfe32017-02-28 11:56:48 +0100119 /** configured required min rx interval (microseconds) */
Klement Sekeraa57a9702017-02-02 06:58:07 +0100120 u32 config_required_min_rx_usec;
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200121
Klement Sekerab16bfe32017-02-28 11:56:48 +0100122 /** configured required min rx interval (clocks) */
Klement Sekeraa57a9702017-02-02 06:58:07 +0100123 u64 config_required_min_rx_clocks;
124
Klement Sekerab16bfe32017-02-28 11:56:48 +0100125 /** effective required min rx interval (clocks) */
Klement Sekeraa57a9702017-02-02 06:58:07 +0100126 u64 effective_required_min_rx_clocks;
Klement Sekera3e0a3562016-12-19 09:05:21 +0100127
Klement Sekerab16bfe32017-02-28 11:56:48 +0100128 /** remote min rx interval (microseconds) */
Klement Sekeraa57a9702017-02-02 06:58:07 +0100129 u64 remote_min_rx_usec;
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200130
Klement Sekerab16bfe32017-02-28 11:56:48 +0100131 /** remote min rx interval (clocks) */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200132 u64 remote_min_rx_clocks;
133
Klement Sekerab16bfe32017-02-28 11:56:48 +0100134 /** remote min echo rx interval (microseconds) */
Klement Sekera239790f2017-02-16 10:53:53 +0100135 u64 remote_min_echo_rx_usec;
136
Klement Sekerab16bfe32017-02-28 11:56:48 +0100137 /** remote min echo rx interval (clocks) */
Klement Sekera239790f2017-02-16 10:53:53 +0100138 u64 remote_min_echo_rx_clocks;
139
Klement Sekerab16bfe32017-02-28 11:56:48 +0100140 /** remote desired min tx interval (clocks) */
Klement Sekeraa57a9702017-02-02 06:58:07 +0100141 u64 remote_desired_min_tx_clocks;
142
Klement Sekerab16bfe32017-02-28 11:56:48 +0100143 /** configured detect multiplier */
Klement Sekeraa57a9702017-02-02 06:58:07 +0100144 u8 local_detect_mult;
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200145
Klement Sekerab16bfe32017-02-28 11:56:48 +0100146 /** 1 if remote system sets demand mode, 0 otherwise */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200147 u8 remote_demand;
148
Klement Sekerab16bfe32017-02-28 11:56:48 +0100149 /** remote detect multiplier */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200150 u8 remote_detect_mult;
151
Klement Sekerab16bfe32017-02-28 11:56:48 +0100152 /** 1 is echo function is active, 0 otherwise */
Klement Sekera239790f2017-02-16 10:53:53 +0100153 u8 echo;
154
Klement Sekerab16bfe32017-02-28 11:56:48 +0100155 /** set to value of timer in timing wheel, 0 if never set */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200156 u64 wheel_time_clocks;
157
Klement Sekerab16bfe32017-02-28 11:56:48 +0100158 /** transmit interval */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200159 u64 transmit_interval_clocks;
160
Klement Sekerab16bfe32017-02-28 11:56:48 +0100161 /** next time at which to transmit a packet */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200162 u64 tx_timeout_clocks;
163
Klement Sekerab16bfe32017-02-28 11:56:48 +0100164 /** timestamp of last packet transmitted */
Klement Sekera3e0a3562016-12-19 09:05:21 +0100165 u64 last_tx_clocks;
166
Klement Sekerab16bfe32017-02-28 11:56:48 +0100167 /** timestamp of last packet received */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200168 u64 last_rx_clocks;
169
Klement Sekerab16bfe32017-02-28 11:56:48 +0100170 /** transmit interval for echo packets */
Klement Sekera239790f2017-02-16 10:53:53 +0100171 u64 echo_transmit_interval_clocks;
172
Klement Sekerab16bfe32017-02-28 11:56:48 +0100173 /** next time at which to transmit echo packet */
Klement Sekera239790f2017-02-16 10:53:53 +0100174 u64 echo_tx_timeout_clocks;
175
Klement Sekerab16bfe32017-02-28 11:56:48 +0100176 /** timestamp of last echo packet transmitted */
Klement Sekera239790f2017-02-16 10:53:53 +0100177 u64 echo_last_tx_clocks;
178
Klement Sekerab16bfe32017-02-28 11:56:48 +0100179 /** timestamp of last echo packet received */
Klement Sekera239790f2017-02-16 10:53:53 +0100180 u64 echo_last_rx_clocks;
181
Klement Sekerab16bfe32017-02-28 11:56:48 +0100182 /** secret used for calculating/checking checksum of echo packets */
Klement Sekera239790f2017-02-16 10:53:53 +0100183 u32 echo_secret;
184
Klement Sekerab16bfe32017-02-28 11:56:48 +0100185 /** detection time */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200186 u64 detection_time_clocks;
187
Klement Sekerab16bfe32017-02-28 11:56:48 +0100188 /** state info regarding poll sequence */
Klement Sekeraa57a9702017-02-02 06:58:07 +0100189 bfd_poll_state_e poll_state;
190
Klement Sekerab16bfe32017-02-28 11:56:48 +0100191 /**
Klement Sekera239790f2017-02-16 10:53:53 +0100192 * helper for delayed poll sequence - marks either start of running poll
193 * sequence or timeout, after which we can start the next poll sequnce
194 */
195 u64 poll_state_start_or_timeout_clocks;
196
Klement Sekerab16bfe32017-02-28 11:56:48 +0100197 /** authentication information */
Klement Sekerab17dd962017-01-09 07:43:48 +0100198 struct
199 {
Klement Sekerab16bfe32017-02-28 11:56:48 +0100200 /** current key in use */
Klement Sekerab17dd962017-01-09 07:43:48 +0100201 bfd_auth_key_t *curr_key;
202
Klement Sekerab16bfe32017-02-28 11:56:48 +0100203 /**
Klement Sekerab17dd962017-01-09 07:43:48 +0100204 * set to next key to use if delayed switch is enabled - in that case
205 * the key is switched when first incoming packet is signed with next_key
206 */
207 bfd_auth_key_t *next_key;
208
Klement Sekerab16bfe32017-02-28 11:56:48 +0100209 /** sequence number incremented occasionally or always (if meticulous) */
Klement Sekerab17dd962017-01-09 07:43:48 +0100210 u32 local_seq_number;
211
Klement Sekerab16bfe32017-02-28 11:56:48 +0100212 /** remote sequence number */
Klement Sekerab17dd962017-01-09 07:43:48 +0100213 u32 remote_seq_number;
214
Klement Sekerab16bfe32017-02-28 11:56:48 +0100215 /** set to 1 if remote sequence number is known */
Klement Sekerab17dd962017-01-09 07:43:48 +0100216 u8 remote_seq_number_known;
217
Klement Sekerab16bfe32017-02-28 11:56:48 +0100218 /** current key ID sent out in bfd packet */
Klement Sekerab17dd962017-01-09 07:43:48 +0100219 u8 curr_bfd_key_id;
220
Klement Sekerab16bfe32017-02-28 11:56:48 +0100221 /** key ID to use when switched to next_key */
Klement Sekerab17dd962017-01-09 07:43:48 +0100222 u8 next_bfd_key_id;
223
Klement Sekerab16bfe32017-02-28 11:56:48 +0100224 /**
Klement Sekerab17dd962017-01-09 07:43:48 +0100225 * set to 1 if delayed action is pending, which might be activation
226 * of authentication, change of key or deactivation
227 */
228 u8 is_delayed;
229 } auth;
230
Klement Sekerab16bfe32017-02-28 11:56:48 +0100231 /** transport type for this session */
Klement Sekera239790f2017-02-16 10:53:53 +0100232 bfd_transport_e transport;
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200233
Klement Sekerab16bfe32017-02-28 11:56:48 +0100234 /** union of transport-specific data */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200235 union
236 {
237 bfd_udp_session_t udp;
238 };
239} bfd_session_t;
240
Neale Ranns88fc83e2017-04-05 08:11:14 -0700241/**
242 * listener events
243 */
244#define foreach_bfd_listen_event(F) \
245 F (CREATE, "sesion-created") \
246 F (UPDATE, "session-updated") \
247 F (DELETE, "session-deleted")
248
249typedef enum
250{
251#define F(sym, str) BFD_LISTEN_EVENT_##sym,
252 foreach_bfd_listen_event (F)
253#undef F
254} bfd_listen_event_e;
255
256/**
257 * session nitification call back function type
258 */
259typedef void (*bfd_notify_fn_t) (bfd_listen_event_e, const bfd_session_t *);
260
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200261typedef struct
262{
Klement Sekerab16bfe32017-02-28 11:56:48 +0100263 /** pool of bfd sessions context data */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200264 bfd_session_t *sessions;
265
Klement Sekerab16bfe32017-02-28 11:56:48 +0100266 /** timing wheel for scheduling timeouts */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200267 timing_wheel_t wheel;
268
Klement Sekerab16bfe32017-02-28 11:56:48 +0100269 /** timing wheel inaccuracy, in clocks */
Klement Sekera637b9c42016-12-08 05:19:14 +0100270 u64 wheel_inaccuracy;
271
Klement Sekerab16bfe32017-02-28 11:56:48 +0100272 /** hashmap - bfd session by discriminator */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200273 u32 *session_by_disc;
274
Klement Sekerab16bfe32017-02-28 11:56:48 +0100275 /** background process node index */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200276 u32 bfd_process_node_index;
277
Klement Sekerab16bfe32017-02-28 11:56:48 +0100278 /** convenience variables */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200279 vlib_main_t *vlib_main;
280 vnet_main_t *vnet_main;
281
Klement Sekerab16bfe32017-02-28 11:56:48 +0100282 /** cpu clocks per second */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200283 f64 cpu_cps;
284
Klement Sekerab16bfe32017-02-28 11:56:48 +0100285 /** default desired min tx in clocks */
Klement Sekeraa57a9702017-02-02 06:58:07 +0100286 u64 default_desired_min_tx_clocks;
287
Klement Sekerab16bfe32017-02-28 11:56:48 +0100288 /** minimum required min rx while echo function is active - clocks */
Klement Sekera239790f2017-02-16 10:53:53 +0100289 u64 min_required_min_rx_while_echo_clocks;
290
Klement Sekerab16bfe32017-02-28 11:56:48 +0100291 /** for generating random numbers */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200292 u32 random_seed;
293
Klement Sekerab16bfe32017-02-28 11:56:48 +0100294 /** pool of authentication keys */
Klement Sekerab17dd962017-01-09 07:43:48 +0100295 bfd_auth_key_t *auth_keys;
296
Klement Sekerab16bfe32017-02-28 11:56:48 +0100297 /** hashmap - index in pool auth_keys by conf_key_id */
Klement Sekerab17dd962017-01-09 07:43:48 +0100298 u32 *auth_key_by_conf_key_id;
299
Damjan Marion07a38572018-01-21 06:44:18 -0800300 /** vector of callback notification functions */
Neale Ranns88fc83e2017-04-05 08:11:14 -0700301 bfd_notify_fn_t *listeners;
Damjan Marion07a38572018-01-21 06:44:18 -0800302
303 /** log class */
304 vlib_log_class_t log_class;
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200305} bfd_main_t;
306
307extern bfd_main_t bfd_main;
308
Klement Sekerab16bfe32017-02-28 11:56:48 +0100309/** Packet counters */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200310#define foreach_bfd_error(F) \
311 F (NONE, "good bfd packets (processed)") \
312 F (BAD, "invalid bfd packets") \
313 F (DISABLED, "bfd packets received on disabled interfaces")
314
315typedef enum
316{
317#define F(sym, str) BFD_ERROR_##sym,
318 foreach_bfd_error (F)
319#undef F
320 BFD_N_ERROR,
321} bfd_error_t;
322
Klement Sekerab16bfe32017-02-28 11:56:48 +0100323/** bfd packet trace capture */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200324typedef struct
325{
326 u32 len;
327 u8 data[400];
328} bfd_input_trace_t;
329
330enum
331{
332 BFD_EVENT_RESCHEDULE = 1,
333 BFD_EVENT_NEW_SESSION,
Klement Sekeraa57a9702017-02-02 06:58:07 +0100334 BFD_EVENT_CONFIG_CHANGED,
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200335} bfd_process_event_e;
336
Klement Sekera239790f2017-02-16 10:53:53 +0100337/* *INDENT-OFF* */
Klement Sekerab16bfe32017-02-28 11:56:48 +0100338/** echo packet structure */
Klement Sekera239790f2017-02-16 10:53:53 +0100339typedef CLIB_PACKED (struct {
Klement Sekerab16bfe32017-02-28 11:56:48 +0100340 /** local discriminator */
Klement Sekera239790f2017-02-16 10:53:53 +0100341 u32 discriminator;
Klement Sekerab16bfe32017-02-28 11:56:48 +0100342 /** expire time of this packet - clocks */
Klement Sekera239790f2017-02-16 10:53:53 +0100343 u64 expire_time_clocks;
Klement Sekerab16bfe32017-02-28 11:56:48 +0100344 /** checksum - based on discriminator, local secret and expire time */
Klement Sekera239790f2017-02-16 10:53:53 +0100345 u64 checksum;
346}) bfd_echo_pkt_t;
347/* *INDENT-ON* */
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200348
Klement Sekera239790f2017-02-16 10:53:53 +0100349u8 *bfd_input_format_trace (u8 * s, va_list * args);
350bfd_session_t *bfd_get_session (bfd_main_t * bm, bfd_transport_e t);
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200351void bfd_put_session (bfd_main_t * bm, bfd_session_t * bs);
352bfd_session_t *bfd_find_session_by_idx (bfd_main_t * bm, uword bs_idx);
353bfd_session_t *bfd_find_session_by_disc (bfd_main_t * bm, u32 disc);
354void bfd_session_start (bfd_main_t * bm, bfd_session_t * bs);
355void bfd_consume_pkt (bfd_main_t * bm, const bfd_pkt_t * bfd, u32 bs_idx);
Klement Sekera239790f2017-02-16 10:53:53 +0100356int bfd_consume_echo_pkt (bfd_main_t * bm, vlib_buffer_t * b);
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200357int bfd_verify_pkt_common (const bfd_pkt_t * pkt);
Klement Sekerab17dd962017-01-09 07:43:48 +0100358int bfd_verify_pkt_auth (const bfd_pkt_t * pkt, u16 pkt_size,
359 bfd_session_t * bs);
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200360void bfd_event (bfd_main_t * bm, bfd_session_t * bs);
Klement Sekerab17dd962017-01-09 07:43:48 +0100361void bfd_init_final_control_frame (vlib_main_t * vm, vlib_buffer_t * b,
Klement Sekerae50e8562017-04-04 16:19:48 +0200362 bfd_main_t * bm, bfd_session_t * bs,
363 int is_local);
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200364u8 *format_bfd_session (u8 * s, va_list * args);
Damjan Marion07a38572018-01-21 06:44:18 -0800365u8 *format_bfd_session_brief (u8 * s, va_list * args);
Klement Sekera73884482017-02-23 09:26:30 +0100366u8 *format_bfd_auth_key (u8 * s, va_list * args);
Klement Sekerab17dd962017-01-09 07:43:48 +0100367void bfd_session_set_flags (bfd_session_t * bs, u8 admin_up_down);
368unsigned bfd_auth_type_supported (bfd_auth_type_e auth_type);
369vnet_api_error_t bfd_auth_activate (bfd_session_t * bs, u32 conf_key_id,
370 u8 bfd_key_id, u8 is_delayed);
371vnet_api_error_t bfd_auth_deactivate (bfd_session_t * bs, u8 is_delayed);
Klement Sekera239790f2017-02-16 10:53:53 +0100372vnet_api_error_t bfd_session_set_params (bfd_main_t * bm, bfd_session_t * bs,
373 u32 desired_min_tx_usec,
374 u32 required_min_rx_usec,
375 u8 detect_mult);
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200376
Klement Sekera73884482017-02-23 09:26:30 +0100377u32 bfd_clocks_to_usec (const bfd_main_t * bm, u64 clocks);
378const char *bfd_poll_state_string (bfd_poll_state_e state);
379
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200380#define USEC_PER_MS 1000LL
381#define USEC_PER_SECOND (1000 * USEC_PER_MS)
382
Klement Sekerab16bfe32017-02-28 11:56:48 +0100383/** default, slow transmission interval for BFD packets, per spec at least 1s */
Klement Sekera239790f2017-02-16 10:53:53 +0100384#define BFD_DEFAULT_DESIRED_MIN_TX_USEC USEC_PER_SECOND
385
Klement Sekerab16bfe32017-02-28 11:56:48 +0100386/**
Klement Sekera239790f2017-02-16 10:53:53 +0100387 * minimum required min rx set locally when echo function is used, per spec
388 * should be set to at least 1s
389 */
390#define BFD_REQUIRED_MIN_RX_USEC_WHILE_ECHO USEC_PER_SECOND
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200391
Neale Ranns88fc83e2017-04-05 08:11:14 -0700392/**
393 * Register a callback function to receive session notifications.
394 */
395void bfd_register_listener (bfd_notify_fn_t fn);
396
Klement Sekera0e3c0de2016-09-29 14:43:44 +0200397#endif /* __included_bfd_main_h__ */
398
399/*
400 * fd.io coding-style-patch-verification: ON
401 *
402 * Local Variables:
403 * eval: (c-set-style "gnu")
404 * End:
405 */