aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_ipsec_tun_interface.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2018-05-16 10:52:45 +0200
committerFlorin Coras <florin.coras@gmail.com>2018-06-21 14:50:10 +0000
commita98346f664aae148d26a8e158008b773d73db96f (patch)
tree2a850b1925f3dd70817fb0e41324baef71fd7a05 /test/vpp_ipsec_tun_interface.py
parent56ba844d6a8b8f58b18fe51bf22707b0c37d3a87 (diff)
ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums
Calculate IP/TCP/UDP checksums in software before adding authentication. Change-Id: I3e121cb00aeba667764f39ade8d62170f18f8b6b Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/vpp_ipsec_tun_interface.py')
-rw-r--r--test/vpp_ipsec_tun_interface.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/vpp_ipsec_tun_interface.py b/test/vpp_ipsec_tun_interface.py
new file mode 100644
index 00000000000..bd635417f02
--- /dev/null
+++ b/test/vpp_ipsec_tun_interface.py
@@ -0,0 +1,43 @@
+from vpp_tunnel_interface import VppTunnelInterface
+
+
+class VppIpsecTunInterface(VppTunnelInterface):
+ """
+ VPP IPsec Tunnel interface
+ """
+
+ def __init__(self, test, parent_if, local_spi,
+ remote_spi, crypto_alg, local_crypto_key, remote_crypto_key,
+ integ_alg, local_integ_key, remote_integ_key):
+ super(VppIpsecTunInterface, self).__init__(test, parent_if)
+ self.local_spi = local_spi
+ self.remote_spi = remote_spi
+ self.crypto_alg = crypto_alg
+ self.local_crypto_key = local_crypto_key
+ self.remote_crypto_key = remote_crypto_key
+ self.integ_alg = integ_alg
+ self.local_integ_key = local_integ_key
+ self.remote_integ_key = remote_integ_key
+
+ def add_vpp_config(self):
+ r = self.test.vapi.ipsec_tunnel_if_add_del(
+ self.parent_if.local_ip4n, self.parent_if.remote_ip4n,
+ self.remote_spi, self.local_spi, self.crypto_alg,
+ self.local_crypto_key, self.remote_crypto_key, self.integ_alg,
+ self.local_integ_key, self.remote_integ_key)
+ self.set_sw_if_index(r.sw_if_index)
+ self.generate_remote_hosts()
+ self.test.registry.register(self, self.test.logger)
+
+ def remove_vpp_config(self):
+ self.test.vapi.ipsec_tunnel_if_add_del(
+ self.parent_if.local_ip4n, self.parent_if.remote_ip4n,
+ self.remote_spi, self.local_spi, self.crypto_alg,
+ self.local_crypto_key, self.remote_crypto_key, self.integ_alg,
+ self.local_integ_key, self.remote_integ_key, is_add=0)
+
+ def __str__(self):
+ return self.object_id()
+
+ def object_id(self):
+ return "ipsec-tun-if-%d" % self._sw_if_index