def icmp_packet(self, setup, direction, ptfadapter, ip_version, src_ip=None, dst_ip=None, icmp_type=8, icmp_code=0):
    'Generate an ICMP packet for testing.'
    src_ip = (src_ip or DEFAULT_SRC_IP[ip_version])
    dst_ip = (dst_ip or self.get_dst_ip(direction, ip_version))
    if (ip_version == 'ipv4'):
        return testutils.simple_icmp_packet(eth_dst=setup['destination_mac'][direction][self.src_port], eth_src=ptfadapter.dataplane.get_mac(0, 0), ip_dst=dst_ip, ip_src=src_ip, icmp_type=icmp_type, icmp_code=icmp_code, ip_ttl=64)
    else:
        return testutils.simple_icmpv6_packet(eth_dst=setup['destination_mac'][direction][self.src_port], eth_src=ptfadapter.dataplane.get_mac(0, 0), ipv6_dst=dst_ip, ipv6_src=src_ip, icmp_type=icmp_type, icmp_code=icmp_code, ipv6_hlim=64)
Generate an ICMP packet for testing.
def icmp_packet(self, setup, direction, ptfadapter, ip_version, src_ip=None, dst_ip=None, icmp_type=8, icmp_code=0):
    
    src_ip = (src_ip or DEFAULT_SRC_IP[ip_version])
    dst_ip = (dst_ip or self.get_dst_ip(direction, ip_version))
    if (ip_version == 'ipv4'):
        return testutils.simple_icmp_packet(eth_dst=setup['destination_mac'][direction][self.src_port], eth_src=ptfadapter.dataplane.get_mac(0, 0), ip_dst=dst_ip, ip_src=src_ip, icmp_type=icmp_type, icmp_code=icmp_code, ip_ttl=64)
    else:
        return testutils.simple_icmpv6_packet(eth_dst=setup['destination_mac'][direction][self.src_port], eth_src=ptfadapter.dataplane.get_mac(0, 0), ipv6_dst=dst_ip, ipv6_src=src_ip, icmp_type=icmp_type, icmp_code=icmp_code, ipv6_hlim=64)