2018-11-24 21:46:05 -08:00
|
|
|
import abc
|
2018-06-24 22:49:55 +02:00
|
|
|
from vpp_pg_interface import is_ipv6_misc
|
|
|
|
from vpp_interface import VppInterface
|
|
|
|
|
|
|
|
|
2020-12-03 00:42:46 -05:00
|
|
|
class VppTunnelInterface(VppInterface, metaclass=abc.ABCMeta):
|
2022-04-26 19:02:15 +02:00
|
|
|
"""VPP tunnel interface abstraction"""
|
2018-06-24 22:49:55 +02:00
|
|
|
|
|
|
|
def __init__(self, test, parent_if):
|
|
|
|
super(VppTunnelInterface, self).__init__(test)
|
|
|
|
self.parent_if = parent_if
|
|
|
|
|
|
|
|
@property
|
|
|
|
def local_mac(self):
|
|
|
|
return self.parent_if.local_mac
|
|
|
|
|
|
|
|
@property
|
|
|
|
def remote_mac(self):
|
|
|
|
return self.parent_if.remote_mac
|
|
|
|
|
|
|
|
def enable_capture(self):
|
|
|
|
return self.parent_if.enable_capture()
|
|
|
|
|
|
|
|
def add_stream(self, pkts):
|
|
|
|
return self.parent_if.add_stream(pkts)
|
|
|
|
|
2022-04-26 19:02:15 +02:00
|
|
|
def get_capture(
|
|
|
|
self, expected_count=None, remark=None, timeout=1, filter_out_fn=is_ipv6_misc
|
|
|
|
):
|
|
|
|
return self.parent_if.get_capture(
|
|
|
|
expected_count, remark, timeout, filter_out_fn
|
|
|
|
)
|