Neale Ranns | 192b13f | 2019-03-15 02:16:20 -0700 | [diff] [blame] | 1 | from vpp_object import VppObject |
| 2 | from vpp_interface import VppInterface |
| 3 | |
| 4 | |
| 5 | class VppBviInterface(VppInterface, VppObject): |
| 6 | """VPP bvi interface.""" |
| 7 | |
| 8 | def __init__(self, test): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 9 | """Create VPP BVI interface""" |
Neale Ranns | 192b13f | 2019-03-15 02:16:20 -0700 | [diff] [blame] | 10 | super(VppBviInterface, self).__init__(test) |
| 11 | self.add_vpp_config() |
| 12 | |
| 13 | def add_vpp_config(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 14 | r = self.test.vapi.bvi_create(user_instance=0xFFFFFFFF, mac="00:00:00:00:00:00") |
Neale Ranns | 192b13f | 2019-03-15 02:16:20 -0700 | [diff] [blame] | 15 | self.set_sw_if_index(r.sw_if_index) |
| 16 | |
| 17 | def remove_vpp_config(self): |
| 18 | self.test.vapi.bvi_delete(sw_if_index=self.sw_if_index) |
| 19 | |
| 20 | def object_id(self): |
| 21 | return "bvi-%d" % self._sw_if_index |