| from socket import inet_pton, inet_ntop, AF_INET, AF_INET6 |
| def find_udp_encap(test, ue): |
| encaps = test.vapi.udp_encap_dump() |
| if ue.id == e.udp_encap.id \ |
| and compare_ip_address(e.udp_encap.src_ip.un, |
| ue.src_ip.addr.ip_addr) \ |
| and compare_ip_address(e.udp_encap.dst_ip.un, |
| ue.dst_ip.addr.ip_addr) \ |
| and e.udp_encap.dst_port == ue.dst_port \ |
| and e.udp_encap.src_port == ue.src_port: |
| class VppUdpEncap(VppObject): |
| self.src_ip = VppIpAddress(src_ip) |
| self.dst_ip = VppIpAddress(dst_ip) |
| def add_vpp_config(self): |
| self._test.vapi.udp_encap_add( |
| self._test.registry.register(self, self._test.logger) |
| def remove_vpp_config(self): |
| self._test.vapi.udp_encap_del(self.id) |
| def query_vpp_config(self): |
| return find_udp_encap(self._test, self) |
| return ("udp-encap-%d" % self.id) |