blob: 6a336eb72d9ab9a8c59ebe506e9b826b9258560d [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):
Paul Vinciguerra3bce8eb2018-11-24 21:46:05 -08007 """ 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
27 def get_capture(self, expected_count=None, remark=None, timeout=1,
28 filter_out_fn=is_ipv6_misc):
29 return self.parent_if.get_capture(expected_count, remark, timeout,
30 filter_out_fn)