blob: e55486e1675984d1dad731791dd61c8705513066 [file] [log] [blame]
Paul Vinciguerra3bce8eb2018-11-24 21:46:05 -08001import abc
2import six
Klement Sekera31da2e32018-06-24 22:49:55 +02003from vpp_pg_interface import is_ipv6_misc
4from vpp_interface import VppInterface
5
6
Paul Vinciguerra3bce8eb2018-11-24 21:46:05 -08007@six.add_metaclass(abc.ABCMeta)
Klement Sekera31da2e32018-06-24 22:49:55 +02008class VppTunnelInterface(VppInterface):
Paul Vinciguerra3bce8eb2018-11-24 21:46:05 -08009 """ VPP tunnel interface abstraction """
Klement Sekera31da2e32018-06-24 22:49:55 +020010
Klement Sekera31da2e32018-06-24 22:49:55 +020011 def __init__(self, test, parent_if):
12 super(VppTunnelInterface, self).__init__(test)
13 self.parent_if = parent_if
14
15 @property
16 def local_mac(self):
17 return self.parent_if.local_mac
18
19 @property
20 def remote_mac(self):
21 return self.parent_if.remote_mac
22
23 def enable_capture(self):
24 return self.parent_if.enable_capture()
25
26 def add_stream(self, pkts):
27 return self.parent_if.add_stream(pkts)
28
29 def get_capture(self, expected_count=None, remark=None, timeout=1,
30 filter_out_fn=is_ipv6_misc):
31 return self.parent_if.get_capture(expected_count, remark, timeout,
32 filter_out_fn)