Paul Vinciguerra | 3bce8eb | 2018-11-24 21:46:05 -0800 | [diff] [blame] | 1 | import abc |
Klement Sekera | 31da2e3 | 2018-06-24 22:49:55 +0200 | [diff] [blame] | 2 | from vpp_pg_interface import is_ipv6_misc |
| 3 | from vpp_interface import VppInterface |
| 4 | |
| 5 | |
Paul Vinciguerra | 090096b | 2020-12-03 00:42:46 -0500 | [diff] [blame] | 6 | class VppTunnelInterface(VppInterface, metaclass=abc.ABCMeta): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 7 | """VPP tunnel interface abstraction""" |
Klement Sekera | 31da2e3 | 2018-06-24 22:49:55 +0200 | [diff] [blame] | 8 | |
Klement Sekera | 31da2e3 | 2018-06-24 22:49:55 +0200 | [diff] [blame] | 9 | def __init__(self, test, parent_if): |
| 10 | super(VppTunnelInterface, self).__init__(test) |
| 11 | self.parent_if = parent_if |
| 12 | |
| 13 | @property |
| 14 | def local_mac(self): |
| 15 | return self.parent_if.local_mac |
| 16 | |
| 17 | @property |
| 18 | def remote_mac(self): |
| 19 | return self.parent_if.remote_mac |
| 20 | |
| 21 | def enable_capture(self): |
| 22 | return self.parent_if.enable_capture() |
| 23 | |
| 24 | def add_stream(self, pkts): |
| 25 | return self.parent_if.add_stream(pkts) |
| 26 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 27 | def get_capture( |
| 28 | self, expected_count=None, remark=None, timeout=1, filter_out_fn=is_ipv6_misc |
| 29 | ): |
| 30 | return self.parent_if.get_capture( |
| 31 | expected_count, remark, timeout, filter_out_fn |
| 32 | ) |