summaryrefslogtreecommitdiffstats
path: root/test/bfd.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2017-02-16 10:53:53 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2017-02-26 14:20:24 +0000
commit239790fd91b3f62e5eda1042a97f9216fe59856e (patch)
treeee72fc8e39c16f01249c72183f1a26904139fafe /test/bfd.py
parent263440e789d29e6e6b0038fcfd4e28e1c7160e83 (diff)
BFD: echo function
Change-Id: Ib1e301d62b687d4e42434239e7cd412065c28da0 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/bfd.py')
-rw-r--r--test/bfd.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/bfd.py b/test/bfd.py
index 8bd9f9a3446..b467cc79eea 100644
--- a/test/bfd.py
+++ b/test/bfd.py
@@ -152,6 +152,27 @@ class BFD(Packet):
bind_layers(UDP, BFD, dport=BFD.udp_dport)
+class BFD_vpp_echo(Packet):
+ """ BFD echo packet as used by VPP (non-rfc, as rfc doesn't define one) """
+
+ udp_dport = 3785 #: BFD echo destination port per RFC 5881
+ name = "BFD_VPP_ECHO"
+
+ fields_desc = [
+ BitField("discriminator", 0, 32),
+ BitField("expire_time_clocks", 0, 64),
+ BitField("checksum", 0, 64)
+ ]
+
+ def mysummary(self):
+ return self.sprintf(
+ "BFD_VPP_ECHO(disc=%BFD_VPP_ECHO.discriminator%,"
+ "expire_time_clocks=%BFD_VPP_ECHO.expire_time_clocks%)")
+
+# glue the BFD echo packet class to scapy parser
+bind_layers(UDP, BFD_vpp_echo, dport=BFD_vpp_echo.udp_dport)
+
+
class VppBFDAuthKey(VppObject):
""" Represents BFD authentication key in VPP """