diff options
author | Klement Sekera <ksekera@cisco.com> | 2018-06-24 22:49:55 +0200 |
---|---|---|
committer | Klement Sekera <ksekera@cisco.com> | 2018-06-24 22:53:37 +0200 |
commit | 31da2e30317bc1fcb4586e1dc0d560600d9b29d3 (patch) | |
tree | 4c025f26e8aa9e4f6499144deea9028154b63fe0 /test/vpp_ipsec_tun_interface.py | |
parent | 2a8d02df15e71881754bab0bb16b85ccd65f8f74 (diff) |
Revert "Revert "ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums""
This reverts commit e0d2bd6bd7fc59c0c6ac48195d7f825dc99bfd91.
Change-Id: If491e16f9ea66b2493a6a7c7f3c684ed585f8f51
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.py | 43 |
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 |