FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
bfd_main.h
Go to the documentation of this file.
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_main_h__
20 #define __included_bfd_main_h__
21 
22 #include <vnet/vnet.h>
23 #include <vnet/bfd/bfd_protocol.h>
24 #include <vnet/bfd/bfd_udp.h>
25 #include <vlib/log.h>
26 #include <vppinfra/os.h>
28 
29 #define foreach_bfd_mode(F) \
30  F (asynchronous) \
31  F (demand)
32 
33 typedef enum
34 {
35 #define F(x) BFD_MODE_##x,
37 #undef F
38 } bfd_mode_e;
39 
40 typedef struct
41 {
42  /** global configuration key ID */
44 
45  /** keeps track of how many sessions reference this key */
47 
48  /**
49  * key data directly usable for bfd purposes - already padded with zeroes
50  * (so we don't need the actual length)
51  */
52  u8 key[20];
53 
54  /** authentication type for this key */
57 
58 #define foreach_bfd_poll_state(F) \
59  F (NOT_NEEDED) \
60  F (NEEDED) \
61  F (IN_PROGRESS) \
62  F (IN_PROGRESS_AND_QUEUED)
63 
64 typedef enum
65 {
66 #define F(x) BFD_POLL_##x,
68 #undef F
70 
71 /**
72  * hop types
73  */
74 #define foreach_bfd_hop(F) \
75  F (SINGLE, "single") \
76  F (MULTI, "multi") \
77 
78 typedef enum
79 {
80 #define F(sym, str) BFD_HOP_TYPE_##sym,
82 #undef F
84 
85 typedef struct bfd_session_s
86 {
87  /** index in bfd_main.sessions pool */
89 
90  /** session state */
92 
93  /** remote session state */
95 
96  /** BFD hop type */
98 
99  /** local diagnostics */
101 
102  /** remote diagnostics */
104 
105  /** local discriminator */
107 
108  /** remote discriminator */
110 
111  /** configured desired min tx interval (microseconds) */
113 
114  /** configured desired min tx interval (nsec) */
116 
117  /** effective desired min tx interval (nsec) */
119 
120  /** configured required min rx interval (microseconds) */
122 
123  /** configured required min rx interval (nsec) */
125 
126  /** effective required min rx interval (nsec) */
128 
129  /** remote min rx interval (microseconds) */
131 
132  /** remote min rx interval (nsec) */
134 
135  /** remote min echo rx interval (microseconds) */
137 
138  /** remote min echo rx interval (nsec) */
140 
141  /** remote desired min tx interval (nsec) */
143 
144  /** configured detect multiplier */
146 
147  /** 1 if remote system sets demand mode, 0 otherwise */
149 
150  /** remote detect multiplier */
152 
153  /** 1 is echo function is active, 0 otherwise */
155 
156  /** next event time in nsec for this session (0 if no event) */
158 
159  /** timing wheel internal id used to manipulate timer (if set) */
161 
162  /** transmit interval */
164 
165  /** next time at which to transmit a packet */
167 
168  /** timestamp of last packet transmitted */
170 
171  /** timestamp of last packet received */
173 
174  /** transmit interval for echo packets */
176 
177  /** next time at which to transmit echo packet */
179 
180  /** timestamp of last echo packet transmitted */
182 
183  /** timestamp of last echo packet received */
185 
186  /** secret used for calculating/checking checksum of echo packets */
188 
189  /** detection time */
191 
192  /** state info regarding poll sequence */
194 
195  /**
196  * helper for delayed poll sequence - marks either start of running poll
197  * sequence or timeout, after which we can start the next poll sequnce
198  */
200 
201  /** authentication information */
202  struct
203  {
204  /** current key in use */
206 
207  /**
208  * set to next key to use if delayed switch is enabled - in that case
209  * the key is switched when first incoming packet is signed with next_key
210  */
212 
213  /** sequence number incremented occasionally or always (if meticulous) */
215 
216  /** remote sequence number */
218 
219  /** set to 1 if remote sequence number is known */
221 
222  /** current key ID sent out in bfd packet */
224 
225  /** key ID to use when switched to next_key */
227 
228  /**
229  * set to 1 if delayed action is pending, which might be activation
230  * of authentication, change of key or deactivation
231  */
233  } auth;
234 
235  /** transport type for this session */
237 
238  /** union of transport-specific data */
239  union
240  {
242  };
243 } bfd_session_t;
244 
245 /**
246  * listener events
247  */
248 #define foreach_bfd_listen_event(F) \
249  F (CREATE, "sesion-created") \
250  F (UPDATE, "session-updated") \
251  F (DELETE, "session-deleted")
252 
253 typedef enum
254 {
255 #define F(sym, str) BFD_LISTEN_EVENT_##sym,
257 #undef F
259 
260 /**
261  * session nitification call back function type
262  */
264 
265 typedef struct
266 {
267  /** lock to protect data structures */
271 
272  /** Number of event wakeup RPCs in flight. Should be 0 or 1 */
274 
275  /** The timestamp of last wakeup event being sent */
277 
278  /** The time it took the last wakeup event to make it to handling */
280 
281  /** When the bfd process is supposed to wake up next */
283 
284  /** pool of bfd sessions context data */
286 
287  /** timing wheel for scheduling timeouts */
288  TWT (tw_timer_wheel) wheel;
289 
290  /** hashmap - bfd session by discriminator */
292 
293  /** background process node index */
295 
296  /** convenience variables */
299 
300  /** how many nanoseconds is one timing wheel tick */
302 
303  /** default desired min tx in nsec */
305 
306  /** minimum required min rx while echo function is active - nsec */
308 
309  /** for generating random numbers */
311 
312  /** pool of authentication keys */
314 
315  /** hashmap - index in pool auth_keys by conf_key_id */
317 
318  /** vector of callback notification functions */
320 
321  /** log class */
323 } bfd_main_t;
324 
325 extern bfd_main_t bfd_main;
326 
327 /** Packet counters */
328 #define foreach_bfd_error(F) \
329  F (NONE, "good bfd packets (processed)") \
330  F (BAD, "invalid bfd packets") \
331  F (DISABLED, "bfd packets received on disabled interfaces")
332 
333 typedef enum
334 {
335 #define F(sym, str) BFD_ERROR_##sym,
337 #undef F
338  BFD_N_ERROR,
339 } bfd_error_t;
340 
341 /** bfd packet trace capture */
342 typedef struct
343 {
345  u8 data[400];
347 
348 typedef enum
349 {
354 
355 /* *INDENT-OFF* */
356 /** echo packet structure */
357 typedef CLIB_PACKED (struct {
358  /** local discriminator */
359  u32 discriminator;
360  /** expire time of this packet - nsec */
361  u64 expire_time_nsec;
362  /** checksum - based on discriminator, local secret and expire time */
363  u64 checksum;
364 }) bfd_echo_pkt_t;
365 /* *INDENT-ON* */
366 
367 static inline void
369 {
370  uword my_thread_index = __os_thread_index;
371 
372  if (bm->owner_thread_index == my_thread_index
373  && bm->lock_recursion_count > 0)
374  {
375  bm->lock_recursion_count++;
376  return;
377  }
378 
380  bm->lock_recursion_count = 1;
381  bm->owner_thread_index = my_thread_index;
382 }
383 
384 static inline void
386 {
387  uword my_thread_index = __os_thread_index;
388  ASSERT (bm->owner_thread_index == my_thread_index);
389 
390  if (bm->lock_recursion_count > 1)
391  {
392  bm->lock_recursion_count--;
393  return;
394  }
395  bm->lock_recursion_count = 0;
396  bm->owner_thread_index = ~0;
398 }
399 
400 static inline void
402 {
403  if (PREDICT_FALSE (bm->lock_recursion_count < 1))
404  clib_warning ("lock check failure");
405 }
406 
407 u8 *bfd_input_format_trace (u8 * s, va_list * args);
409 void bfd_put_session (bfd_main_t * bm, bfd_session_t * bs);
412 void bfd_session_start (bfd_main_t * bm, bfd_session_t * bs);
414  const bfd_pkt_t * bfd, u32 bs_idx);
416  vlib_buffer_t * b);
417 int bfd_verify_pkt_common (const bfd_pkt_t * pkt);
418 int bfd_verify_pkt_auth (vlib_main_t * vm, const bfd_pkt_t * pkt,
419  u16 pkt_size, bfd_session_t * bs);
420 void bfd_event (bfd_main_t * bm, bfd_session_t * bs);
422  bfd_main_t * bm, bfd_session_t * bs,
423  int is_local);
424 u8 *format_bfd_session (u8 * s, va_list * args);
425 u8 *format_bfd_session_brief (u8 * s, va_list * args);
426 u8 *format_bfd_auth_key (u8 * s, va_list * args);
428  u8 admin_up_down);
429 unsigned bfd_auth_type_supported (bfd_auth_type_e auth_type);
431  u8 bfd_key_id, u8 is_delayed);
434  u32 desired_min_tx_usec,
435  u32 required_min_rx_usec,
436  u8 detect_mult);
437 
438 u32 bfd_nsec_to_usec (u64 nsec);
440 
441 #define USEC_PER_MS (1000LL)
442 #define MSEC_PER_SEC (1000LL)
443 #define NSEC_PER_USEC (1000LL)
444 #define USEC_PER_SEC (MSEC_PER_SEC * USEC_PER_MS)
445 #define NSEC_PER_SEC (NSEC_PER_USEC * USEC_PER_SEC)
446 #define SEC_PER_NSEC ((f64)1/NSEC_PER_SEC)
447 
448 /** timing wheel tick-rate, 1ms should be good enough */
449 #define BFD_TW_TPS (MSEC_PER_SEC)
450 
451 /** default, slow transmission interval for BFD packets, per spec at least 1s */
452 #define BFD_DEFAULT_DESIRED_MIN_TX_USEC USEC_PER_SEC
453 
454 /**
455  * minimum required min rx set locally when echo function is used, per spec
456  * should be set to at least 1s
457  */
458 #define BFD_REQUIRED_MIN_RX_USEC_WHILE_ECHO USEC_PER_SEC
459 
460 /**
461  * Register a callback function to receive session notifications.
462  */
464 
465 #endif /* __included_bfd_main_h__ */
466 
467 /*
468  * fd.io coding-style-patch-verification: ON
469  *
470  * Local Variables:
471  * eval: (c-set-style "gnu")
472  * End:
473  */
foreach_bfd_error
#define foreach_bfd_error(F)
Packet counters.
Definition: bfd_main.h:328
bfd_mode_e
bfd_mode_e
Definition: bfd_main.h:33
bfd_session_s::remote_desired_min_tx_nsec
u64 remote_desired_min_tx_nsec
remote desired min tx interval (nsec)
Definition: bfd_main.h:142
os.h
bfd_session_s::last_rx_nsec
u64 last_rx_nsec
timestamp of last packet received
Definition: bfd_main.h:172
bfd_session_s::remote_discr
u32 remote_discr
remote discriminator
Definition: bfd_main.h:109
bfd_session_s::remote_diag
bfd_diag_code_e remote_diag
remote diagnostics
Definition: bfd_main.h:103
bfd_main_t::vlib_main
vlib_main_t * vlib_main
convenience variables
Definition: bfd_main.h:297
CLIB_PACKED
typedef CLIB_PACKED(struct { u32 discriminator;u64 expire_time_nsec;u64 checksum;}) bfd_echo_pkt_t
echo packet structure
bfd_session_s::transport
bfd_transport_e transport
transport type for this session
Definition: bfd_main.h:236
bfd_session_s::effective_desired_min_tx_nsec
u64 effective_desired_min_tx_nsec
effective desired min tx interval (nsec)
Definition: bfd_main.h:118
bfd_notify_fn_t
void(* bfd_notify_fn_t)(bfd_listen_event_e, const bfd_session_t *)
session nitification call back function type
Definition: bfd_main.h:263
bfd_session_s::last_tx_nsec
u64 last_tx_nsec
timestamp of last packet transmitted
Definition: bfd_main.h:169
bfd_auth_type_e
bfd_auth_type_e
Definition: bfd_protocol.h:36
clib_spinlock_lock_if_init
static_always_inline void clib_spinlock_lock_if_init(clib_spinlock_t *p)
Definition: lock.h:106
bfd_lock
static void bfd_lock(bfd_main_t *bm)
Definition: bfd_main.h:368
bfd_register_listener
void bfd_register_listener(bfd_notify_fn_t fn)
Register a callback function to receive session notifications.
Definition: bfd_main.c:1313
format_bfd_session_brief
u8 * format_bfd_session_brief(u8 *s, va_list *args)
Definition: bfd_main.c:1984
vlib_log_class_t
u32 vlib_log_class_t
Definition: vlib.h:52
bfd_diag_code_e
bfd_diag_code_e
Definition: bfd_protocol.h:177
bfd_state_e
bfd_state_e
Definition: bfd_protocol.h:195
bfd_session_s::config_desired_min_tx_usec
u32 config_desired_min_tx_usec
configured desired min tx interval (microseconds)
Definition: bfd_main.h:112
bfd_session_s::next_key
bfd_auth_key_t * next_key
set to next key to use if delayed switch is enabled - in that case the key is switched when first inc...
Definition: bfd_main.h:211
bfd_transport_e
bfd_transport_e
Definition: bfd_api.h:30
bfd_session_s::hop_type
bfd_hop_type_e hop_type
BFD hop type.
Definition: bfd_main.h:97
u16
unsigned short u16
Definition: types.h:57
bfd_session_s::detection_time_nsec
u64 detection_time_nsec
detection time
Definition: bfd_main.h:190
BFD_EVENT_RESCHEDULE
@ BFD_EVENT_RESCHEDULE
Definition: bfd_main.h:350
bfd_session_s::local_discr
u32 local_discr
local discriminator
Definition: bfd_main.h:106
bfd_auth_key_t::conf_key_id
u32 conf_key_id
global configuration key ID
Definition: bfd_main.h:43
bfd_main_t::lock
clib_spinlock_t lock
lock to protect data structures
Definition: bfd_main.h:268
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
bfd_session_set_params
vnet_api_error_t bfd_session_set_params(bfd_main_t *bm, bfd_session_t *bs, u32 desired_min_tx_usec, u32 required_min_rx_usec, u8 detect_mult)
Definition: bfd_main.c:2091
state
vl_api_dhcp_client_state_t state
Definition: dhcp.api:201
bfd_main_t::session_by_disc
u32 * session_by_disc
hashmap - bfd session by discriminator
Definition: bfd_main.h:291
bfd_session_s::transmit_interval_nsec
u64 transmit_interval_nsec
transmit interval
Definition: bfd_main.h:163
BFD_EVENT_CONFIG_CHANGED
@ BFD_EVENT_CONFIG_CHANGED
Definition: bfd_main.h:352
bfd_session_s::effective_required_min_rx_nsec
u64 effective_required_min_rx_nsec
effective required min rx interval (nsec)
Definition: bfd_main.h:127
bfd_session_s::local_seq_number
u32 local_seq_number
sequence number incremented occasionally or always (if meticulous)
Definition: bfd_main.h:214
bfd_udp_session_t
UDP transport specific data embedded in bfd_session's union.
Definition: bfd_udp.h:44
bfd_main_t::vnet_main
vnet_main_t * vnet_main
Definition: bfd_main.h:298
bfd_session_s::event_time_nsec
u64 event_time_nsec
next event time in nsec for this session (0 if no event)
Definition: bfd_main.h:157
bfd_poll_state_e
bfd_poll_state_e
Definition: bfd_main.h:64
key
typedef key
Definition: ipsec_types.api:88
bfd_session_s::next_bfd_key_id
u8 next_bfd_key_id
key ID to use when switched to next_key
Definition: bfd_main.h:226
bfd_session_s::config_required_min_rx_nsec
u64 config_required_min_rx_nsec
configured required min rx interval (nsec)
Definition: bfd_main.h:124
bfd_session_s::config_desired_min_tx_nsec
u64 config_desired_min_tx_nsec
configured desired min tx interval (nsec)
Definition: bfd_main.h:115
bfd_session_s::bs_idx
u32 bs_idx
index in bfd_main.sessions pool
Definition: bfd_main.h:88
bfd_main_t
Definition: bfd_main.h:265
bfd_session_set_flags
void bfd_session_set_flags(vlib_main_t *vm, bfd_session_t *bs, u8 admin_up_down)
Definition: bfd_main.c:461
format_bfd_session
u8 * format_bfd_session(u8 *s, va_list *args)
Definition: bfd_main.c:1954
bfd_hop_type_e
bfd_hop_type_e
Definition: bfd_main.h:78
bfd_main_t::bfd_process_next_wakeup_nsec
u64 bfd_process_next_wakeup_nsec
When the bfd process is supposed to wake up next.
Definition: bfd_main.h:282
bfd_session_s::remote_detect_mult
u8 remote_detect_mult
remote detect multiplier
Definition: bfd_main.h:151
bfd_poll_state_string
const char * bfd_poll_state_string(bfd_poll_state_e state)
Definition: bfd_main.c:150
F
#define F(x)
Definition: bfd_main.h:335
bfd_session_s::remote_min_echo_rx_usec
u64 remote_min_echo_rx_usec
remote min echo rx interval (microseconds)
Definition: bfd_main.h:136
bfd_session_s
Definition: bfd_main.h:85
bfd_main_t::random_seed
u32 random_seed
for generating random numbers
Definition: bfd_main.h:310
bfd_session_s::poll_state_start_or_timeout_nsec
u64 poll_state_start_or_timeout_nsec
helper for delayed poll sequence - marks either start of running poll sequence or timeout,...
Definition: bfd_main.h:199
bfd_nsec_to_usec
u32 bfd_nsec_to_usec(u64 nsec)
Definition: bfd_main.c:54
bfd_lock_check
static void bfd_lock_check(bfd_main_t *bm)
Definition: bfd_main.h:401
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
bfd_session_s::local_state
bfd_state_e local_state
session state
Definition: bfd_main.h:91
bfd_protocol.h
BFD protocol declarations.
log.h
bfd_session_s::remote_min_rx_nsec
u64 remote_min_rx_nsec
remote min rx interval (nsec)
Definition: bfd_main.h:133
clib_spinlock_s
Definition: lock.h:51
bfd_session_s::remote_seq_number
u32 remote_seq_number
remote sequence number
Definition: bfd_main.h:217
uword
u64 uword
Definition: types.h:112
bfd_main_t::sessions
bfd_session_t * sessions
pool of bfd sessions context data
Definition: bfd_main.h:285
foreach_bfd_poll_state
#define foreach_bfd_poll_state(F)
Definition: bfd_main.h:58
bfd_event
void bfd_event(bfd_main_t *bm, bfd_session_t *bs)
Definition: bfd_api.c:220
bfd_main_t::bfd_process_node_index
u32 bfd_process_node_index
background process node index
Definition: bfd_main.h:294
bfd_main_t::bfd_process_wakeup_events_in_flight
int bfd_process_wakeup_events_in_flight
Number of event wakeup RPCs in flight.
Definition: bfd_main.h:273
TWT
#define TWT(a)
Definition: tw_timer_template.h:27
bfd_put_session
void bfd_put_session(bfd_main_t *bm, bfd_session_t *bs)
Definition: bfd_main.c:1389
bfd_session_s::curr_key
bfd_auth_key_t * curr_key
current key in use
Definition: bfd_main.h:205
foreach_bfd_mode
#define foreach_bfd_mode(F)
Definition: bfd_main.h:29
bfd_verify_pkt_auth
int bfd_verify_pkt_auth(vlib_main_t *vm, const bfd_pkt_t *pkt, u16 pkt_size, bfd_session_t *bs)
verify bfd packet - authentication
Definition: bfd_main.c:1705
bfd_session_s::remote_seq_number_known
u8 remote_seq_number_known
set to 1 if remote sequence number is known
Definition: bfd_main.h:220
bfd_main
bfd_main_t bfd_main
Definition: bfd_main.c:2236
bfd_get_session
bfd_session_t * bfd_get_session(bfd_main_t *bm, bfd_transport_e t)
Definition: bfd_main.c:1355
bfd_process_event_e
bfd_process_event_e
Definition: bfd_main.h:348
bfd_main_t::bfd_process_wakeup_event_start_nsec
u64 bfd_process_wakeup_event_start_nsec
The timestamp of last wakeup event being sent.
Definition: bfd_main.h:276
bfd_find_session_by_disc
bfd_session_t * bfd_find_session_by_disc(bfd_main_t *bm, u32 disc)
Definition: bfd_main.c:1421
bfd_session_s::tx_timeout_nsec
u64 tx_timeout_nsec
next time at which to transmit a packet
Definition: bfd_main.h:166
format_bfd_auth_key
u8 * format_bfd_auth_key(u8 *s, va_list *args)
Definition: bfd_main.c:71
bfd_session_start
void bfd_session_start(bfd_main_t *bm, bfd_session_t *bs)
Definition: bfd_main.c:448
bfd_main_t::auth_key_by_conf_key_id
u32 * auth_key_by_conf_key_id
hashmap - index in pool auth_keys by conf_key_id
Definition: bfd_main.h:316
data
u8 data[128]
Definition: ipsec_types.api:92
bfd_auth_key_t::use_count
u32 use_count
keeps track of how many sessions reference this key
Definition: bfd_main.h:46
vnet_main_t
Definition: vnet.h:76
bfd_main_t::bfd_process_wakeup_event_delay_nsec
u64 bfd_process_wakeup_event_delay_nsec
The time it took the last wakeup event to make it to handling.
Definition: bfd_main.h:279
bfd_session_s::curr_bfd_key_id
u8 curr_bfd_key_id
current key ID sent out in bfd packet
Definition: bfd_main.h:223
bfd_find_session_by_idx
bfd_session_t * bfd_find_session_by_idx(bfd_main_t *bm, uword bs_idx)
Definition: bfd_main.c:1410
bfd_session_s::local_detect_mult
u8 local_detect_mult
configured detect multiplier
Definition: bfd_main.h:145
foreach_bfd_listen_event
#define foreach_bfd_listen_event(F)
listener events
Definition: bfd_main.h:248
bfd_session_s::echo_tx_timeout_nsec
u64 echo_tx_timeout_nsec
next time at which to transmit echo packet
Definition: bfd_main.h:178
u64
unsigned long u64
Definition: types.h:89
bfd_unlock
static void bfd_unlock(bfd_main_t *bm)
Definition: bfd_main.h:385
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
bfd_session_s::local_diag
bfd_diag_code_e local_diag
local diagnostics
Definition: bfd_main.h:100
bfd_main_t::owner_thread_index
uword owner_thread_index
Definition: bfd_main.h:270
u32
unsigned int u32
Definition: types.h:88
bfd_main_t::listeners
bfd_notify_fn_t * listeners
vector of callback notification functions
Definition: bfd_main.h:319
bfd_session_s::remote_demand
u8 remote_demand
1 if remote system sets demand mode, 0 otherwise
Definition: bfd_main.h:148
bfd_input_format_trace
u8 * bfd_input_format_trace(u8 *s, va_list *args)
Definition: bfd_main.c:488
bfd_session_s::tw_id
u32 tw_id
timing wheel internal id used to manipulate timer (if set)
Definition: bfd_main.h:160
bfd_auth_type_supported
unsigned bfd_auth_type_supported(bfd_auth_type_e auth_type)
Definition: bfd_main.c:1995
bfd_session_s::remote_state
bfd_state_e remote_state
remote session state
Definition: bfd_main.h:94
bfd_main_t::log_class
vlib_log_class_t log_class
log class
Definition: bfd_main.h:322
bfd_main_t::nsec_per_tw_tick
u64 nsec_per_tw_tick
how many nanoseconds is one timing wheel tick
Definition: bfd_main.h:301
bfd_error_t
bfd_error_t
Definition: bfd_main.h:333
vlib_main_t
Definition: main.h:102
tw_timer_1t_3w_1024sl_ov.h
bfd_session_s::remote_min_echo_rx_nsec
u64 remote_min_echo_rx_nsec
remote min echo rx interval (nsec)
Definition: bfd_main.h:139
b
vlib_buffer_t ** b
Definition: nat44_ei_out2in.c:717
u8
unsigned char u8
Definition: types.h:56
bfd_auth_deactivate
vnet_api_error_t bfd_auth_deactivate(bfd_session_t *bs, u8 is_delayed)
Definition: bfd_main.c:2055
bfd_session_s::is_delayed
u8 is_delayed
set to 1 if delayed action is pending, which might be activation of authentication,...
Definition: bfd_main.h:232
bfd_main_t::min_required_min_rx_while_echo_nsec
u64 min_required_min_rx_while_echo_nsec
minimum required min rx while echo function is active - nsec
Definition: bfd_main.h:307
bfd_session_s::poll_state
bfd_poll_state_e poll_state
state info regarding poll sequence
Definition: bfd_main.h:193
bfd_main_t::default_desired_min_tx_nsec
u64 default_desired_min_tx_nsec
default desired min tx in nsec
Definition: bfd_main.h:304
foreach_bfd_hop
#define foreach_bfd_hop(F)
hop types
Definition: bfd_main.h:74
bfd_consume_pkt
void bfd_consume_pkt(vlib_main_t *vm, bfd_main_t *bm, const bfd_pkt_t *bfd, u32 bs_idx)
Definition: bfd_main.c:1784
clib_warning
#define clib_warning(format, args...)
Definition: error.h:59
bfd_listen_event_e
bfd_listen_event_e
Definition: bfd_main.h:253
bfd_init_final_control_frame
void bfd_init_final_control_frame(vlib_main_t *vm, vlib_buffer_t *b, bfd_main_t *bm, bfd_session_t *bs, int is_local)
Definition: bfd_main.c:1025
bfd_session_t
struct bfd_session_s bfd_session_t
bfd_verify_pkt_common
int bfd_verify_pkt_common(const bfd_pkt_t *pkt)
verify bfd packet - common checks
Definition: bfd_main.c:1440
vnet.h
bfd_auth_activate
vnet_api_error_t bfd_auth_activate(bfd_session_t *bs, u32 conf_key_id, u8 bfd_key_id, u8 is_delayed)
Definition: bfd_main.c:2006
bfd_auth_key_t
Definition: bfd_main.h:40
bfd_auth_key_t::auth_type
bfd_auth_type_e auth_type
authentication type for this key
Definition: bfd_main.h:55
bfd_input_trace_t::len
u32 len
Definition: bfd_main.h:344
bfd_session_s::remote_min_rx_usec
u64 remote_min_rx_usec
remote min rx interval (microseconds)
Definition: bfd_main.h:130
clib_spinlock_unlock_if_init
static_always_inline void clib_spinlock_unlock_if_init(clib_spinlock_t *p)
Definition: lock.h:129
bfd_session_s::auth
struct bfd_session_s::@149 auth
authentication information
bfd_udp.h
BFD UDP transport layer declarations.
is_local
bool is_local
Definition: ikev2_types.api:33
bfd_session_s::config_required_min_rx_usec
u32 config_required_min_rx_usec
configured required min rx interval (microseconds)
Definition: bfd_main.h:121
bfd_main_t::lock_recursion_count
int lock_recursion_count
Definition: bfd_main.h:269
BFD_EVENT_NEW_SESSION
@ BFD_EVENT_NEW_SESSION
Definition: bfd_main.h:351
bfd_session_s::udp
bfd_udp_session_t udp
Definition: bfd_main.h:241
bfd_main_t::auth_keys
bfd_auth_key_t * auth_keys
pool of authentication keys
Definition: bfd_main.h:313
bfd_session_s::echo_secret
u32 echo_secret
secret used for calculating/checking checksum of echo packets
Definition: bfd_main.h:187
bfd_session_s::echo_last_tx_nsec
u64 echo_last_tx_nsec
timestamp of last echo packet transmitted
Definition: bfd_main.h:181
bfd_consume_echo_pkt
int bfd_consume_echo_pkt(vlib_main_t *vm, bfd_main_t *bm, vlib_buffer_t *b)
Definition: bfd_main.c:1918
bfd_session_s::echo_transmit_interval_nsec
u64 echo_transmit_interval_nsec
transmit interval for echo packets
Definition: bfd_main.h:175
vnet_api_error_t
vnet_api_error_t
Definition: api_errno.h:162
bfd_input_trace_t
bfd packet trace capture
Definition: bfd_main.h:342
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
bfd_session_s::echo_last_rx_nsec
u64 echo_last_rx_nsec
timestamp of last echo packet received
Definition: bfd_main.h:184
bfd_session_s::echo
u8 echo
1 is echo function is active, 0 otherwise
Definition: bfd_main.h:154