6 from vpp_object import VppObject
9 def find_teib(test, ne):
10 ns = test.vapi.teib_dump()
12 if ne.peer == str(n.entry.peer) \
13 and ne.itf._sw_if_index == n.entry.sw_if_index:
18 class VppTeib(VppObject):
20 def __init__(self, test, itf, peer, nh, table_id=0):
22 self.table_id = table_id
27 def add_vpp_config(self):
28 r = self._test.vapi.teib_entry_add_del(
31 'nh_table_id': self.table_id,
32 'sw_if_index': self.itf.sw_if_index,
36 self._test.registry.register(self, self._test.logger)
39 def remove_vpp_config(self):
40 r = self._test.vapi.teib_entry_add_del(
43 'nh_table_id': self.table_id,
44 'sw_if_index': self.itf.sw_if_index,
48 def query_vpp_config(self):
49 return find_teib(self._test, self)
52 return ("teib-%s-%s" % (self.itf, self.peer))