1 from vpp_interface import VppInterface
4 class VppTAPInterface(VppInterface):
11 def __init__(self, test, tap_id=0xffffffff, mac_addr=None):
14 self._mac_addr = mac_addr
16 def get_vpp_dump(self):
17 dump = self._test.vapi.sw_interface_tap_v2_dump(
18 sw_if_index=self.sw_if_index)
21 def add_vpp_config(self):
22 reply = self._test.vapi.tap_create_v2(
24 use_random_mac=bool(self._mac_addr),
25 mac_address=self._mac_addr)
26 self.set_sw_if_index(reply.sw_if_index)
27 self._test.registry.register(self, self.test.logger)
29 def remove_vpp_config(self):
30 self._test.vapi.tap_delete_v2(sw_if_index=self.sw_if_index)
32 def query_vpp_config(self):
33 dump = self.get_vpp_dump()
37 return "tap-%s" % self._tap_id