| from vpp_tunnel_interface import VppTunnelInterface |
| from ipaddress import ip_address |
| from vpp_papi import VppEnum |
| class VppIpIpTunInterface(VppTunnelInterface): |
| VPP IP-IP Tunnel interface |
| self, test, parent_if, src, dst, table_id=0, dscp=0x0, flags=0, mode=None |
| super(VppIpIpTunInterface, self).__init__(test, parent_if) |
| self.mode = VppEnum.vl_api_tunnel_mode_t.TUNNEL_API_MODE_P2P |
| def add_vpp_config(self): |
| r = self.test.vapi.ipip_add_tunnel( |
| "table_id": self.table_id, |
| self.set_sw_if_index(r.sw_if_index) |
| r = self.test.vapi.ipip_tunnel_dump(sw_if_index=self.sw_if_index) |
| self.instance = r[0].tunnel.instance |
| self.test.registry.register(self, self.test.logger) |
| def remove_vpp_config(self): |
| self.test.vapi.ipip_del_tunnel(sw_if_index=self._sw_if_index) |
| def query_vpp_config(self): |
| ts = self.test.vapi.ipip_tunnel_dump(sw_if_index=0xFFFFFFFF) |
| if t.tunnel.sw_if_index == self._sw_if_index: |
| return "ipip%d" % self.instance |