2 from vpp_interface import VppInterface
5 class VppMPLSTunnelInterface(VppInterface):
7 VPP MPLS Tunnel interface
10 def __init__(self, test, paths, is_multicast=0, is_l2=0):
11 """ Create MPLS Tunnel interface """
12 super(VppMPLSTunnelInterface, self).__init__(test)
14 self.is_multicast = is_multicast
16 self.encoded_paths = []
17 for path in self.t_paths:
18 self.encoded_paths.append(path.encode())
20 def add_vpp_config(self):
21 reply = self.test.vapi.mpls_tunnel_add_del(
24 is_multicast=self.is_multicast,
26 self.set_sw_if_index(reply.sw_if_index)
27 self.tunnel_index = reply.tunnel_index
28 self._test.registry.register(self, self._test.logger)
30 def remove_vpp_config(self):
31 reply = self.test.vapi.mpls_tunnel_add_del(
36 def query_vpp_config(self):
37 dump = self._test.vapi.mpls_tunnel_dump()
39 if self.sw_if_index == t.mt_tunnel.mt_sw_if_index and \
40 self.tunnel_index == t.mt_tunnel.mt_tunnel_index:
45 return ("mpls-tunnel%d-%d" % (self.tunnel_index,