From 31da2e30317bc1fcb4586e1dc0d560600d9b29d3 Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Sun, 24 Jun 2018 22:49:55 +0200 Subject: Revert "Revert "ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums"" This reverts commit e0d2bd6bd7fc59c0c6ac48195d7f825dc99bfd91. Change-Id: If491e16f9ea66b2493a6a7c7f3c684ed585f8f51 Signed-off-by: Klement Sekera --- test/vpp_ipsec_tun_interface.py | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 test/vpp_ipsec_tun_interface.py (limited to 'test/vpp_ipsec_tun_interface.py') 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 -- cgit 1.2.3-korg