blob: d70328eb239dc11f6dbf710fd238df586d03bcd2 [file] [log] [blame]
Paul Vinciguerra3bce8eb2018-11-24 21:46:05 -08001import abc
Klement Sekera31da2e32018-06-24 22:49:55 +02002from vpp_pg_interface import is_ipv6_misc
3from vpp_interface import VppInterface
4
5
Paul Vinciguerra090096b2020-12-03 00:42:46 -05006class VppTunnelInterface(VppInterface, metaclass=abc.ABCMeta):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02007 """VPP tunnel interface abstraction"""
Klement Sekera31da2e32018-06-24 22:49:55 +02008
Klement Sekera31da2e32018-06-24 22:49:55 +02009 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 Sekerad9b0c6f2022-04-26 19:02:15 +020027 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 )