2019-03-15 02:16:20 -07:00
|
|
|
from vpp_object import VppObject
|
|
|
|
from vpp_interface import VppInterface
|
|
|
|
|
|
|
|
|
|
|
|
class VppBviInterface(VppInterface, VppObject):
|
|
|
|
"""VPP bvi interface."""
|
|
|
|
|
|
|
|
def __init__(self, test):
|
2022-04-26 19:02:15 +02:00
|
|
|
"""Create VPP BVI interface"""
|
2019-03-15 02:16:20 -07:00
|
|
|
super(VppBviInterface, self).__init__(test)
|
|
|
|
self.add_vpp_config()
|
|
|
|
|
|
|
|
def add_vpp_config(self):
|
2022-04-26 19:02:15 +02:00
|
|
|
r = self.test.vapi.bvi_create(user_instance=0xFFFFFFFF, mac="00:00:00:00:00:00")
|
2019-03-15 02:16:20 -07:00
|
|
|
self.set_sw_if_index(r.sw_if_index)
|
|
|
|
|
|
|
|
def remove_vpp_config(self):
|
|
|
|
self.test.vapi.bvi_delete(sw_if_index=self.sw_if_index)
|
|
|
|
|
|
|
|
def object_id(self):
|
|
|
|
return "bvi-%d" % self._sw_if_index
|