MCPcopy Create free account
hub / github.com/FDio/vpp / VppBFDUDPSession

Class VppBFDUDPSession

test/bfd.py:254–508  ·  view source on GitHub ↗

Represents BFD UDP session in VPP

Source from the content-addressed store, hash-verified

252
253
254class VppBFDUDPSession(VppObject):
255 """Represents BFD UDP session in VPP"""
256
257 def __init__(
258 self,
259 test,
260 interface,
261 peer_addr,
262 multihop=False,
263 local_addr=None,
264 af=AF_INET,
265 desired_min_tx=300000,
266 required_min_rx=300000,
267 detect_mult=3,
268 sha1_key=None,
269 bfd_key_id=None,
270 is_tunnel=False,
271 ):
272 self._test = test
273 self._multihop = multihop
274 self._interface = interface
275 self._af = af
276
277 if multihop:
278 self._sw_if_index = 0xFFFFFFFF
279 self.test.vapi.bfd_udp_enable_multihop()
280 else:
281 self._sw_if_index = self._interface.sw_if_index
282
283 if local_addr:
284 self._local_addr = local_addr
285 else:
286 if self.af == AF_INET:
287 self._local_addr = self.interface.local_ip4
288 else:
289 self._local_addr = self.interface.local_ip6
290
291 self._peer_addr = peer_addr
292 self._desired_min_tx = desired_min_tx
293 self._required_min_rx = required_min_rx
294 self._detect_mult = detect_mult
295 self._sha1_key = sha1_key
296 if bfd_key_id is not None:
297 self._bfd_key_id = bfd_key_id
298 else:
299 self._bfd_key_id = randint(0, 255)
300 self._is_tunnel = is_tunnel
301
302 @property
303 def test(self):
304 """Test which created this session"""
305 return self._test
306
307 @property
308 def interface(self):
309 """Interface on which this session lives"""
310 return self._interface
311

Callers 15

test_add_bfdMethod · 0.90
test_double_addMethod · 0.90
test_add_bfd6Method · 0.90
test_mod_bfdMethod · 0.90
test_upd_bfdMethod · 0.90
test_add_bfd_sha1Method · 0.90
test_double_add_sha1Method · 0.90
test_shared_sha1_keyMethod · 0.90
test_activate_authMethod · 0.90
test_deactivate_authMethod · 0.90
test_change_keyMethod · 0.90

Calls

no outgoing calls

Tested by 15

test_add_bfdMethod · 0.72
test_double_addMethod · 0.72
test_add_bfd6Method · 0.72
test_mod_bfdMethod · 0.72
test_upd_bfdMethod · 0.72
test_add_bfd_sha1Method · 0.72
test_double_add_sha1Method · 0.72
test_shared_sha1_keyMethod · 0.72
test_activate_authMethod · 0.72
test_deactivate_authMethod · 0.72
test_change_keyMethod · 0.72