2 from vpp_interface import VppInterface
3 from vpp_ip_route import VppRoutePath
7 class VppMPLSTunnelInterface(VppInterface):
9 VPP MPLS Tunnel interface
12 def __init__(self, test, paths, is_multicast=0, is_l2=0):
13 """ Create MPLS Tunnel interface """
15 super(VppMPLSTunnelInterface, self).__init__(test)
18 self.is_multicast = is_multicast
21 def add_vpp_config(self):
22 self._sw_if_index = 0xffffffff
23 for path in self.t_paths:
24 reply = self.test.vapi.mpls_tunnel_add_del(
31 next_hop_out_label_stack=path.nh_labels,
32 next_hop_n_out_labels=len(path.nh_labels),
33 is_multicast=self.is_multicast,
35 self._sw_if_index = reply.sw_if_index
37 def remove_vpp_config(self):
38 for path in self.t_paths:
39 reply = self.test.vapi.mpls_tunnel_add_del(
46 next_hop_out_label_stack=path.nh_labels,
47 next_hop_n_out_labels=len(path.nh_labels),