def _verify_acl_traffic(self, setup, direction, ptfadapter, pkt, dropped, ip_version):
    exp_pkt = self.expected_mask_routed_packet(pkt, ip_version)
    if (ip_version == 'ipv4'):
        downstream_dst_port = DOWNSTREAM_IP_PORT_MAP.get(pkt[packet.IP].dst)
    else:
        downstream_dst_port = DOWNSTREAM_IP_PORT_MAP.get(pkt[packet.IPv6].dst)
    ptfadapter.dataplane.flush()
    testutils.send(ptfadapter, self.src_port, pkt)
    if ((direction == 'uplink->downlink') and downstream_dst_port):
        if dropped:
            testutils.verify_no_packet(ptfadapter, exp_pkt, downstream_dst_port)
        else:
            testutils.verify_packet(ptfadapter, exp_pkt, downstream_dst_port)
    elif dropped:
        testutils.verify_no_packet_any(ptfadapter, exp_pkt, ports=self.get_dst_ports(setup, direction))
    else:
        testutils.verify_packet_any_port(ptfadapter, exp_pkt, ports=self.get_dst_ports(setup, direction), timeout=20)
def _verify_acl_traffic(self, setup, direction, ptfadapter, pkt, dropped, ip_version):
    exp_pkt = self.expected_mask_routed_packet(pkt, ip_version)
    if (ip_version == 'ipv4'):
        downstream_dst_port = DOWNSTREAM_IP_PORT_MAP.get(pkt[packet.IP].dst)
    else:
        downstream_dst_port = DOWNSTREAM_IP_PORT_MAP.get(pkt[packet.IPv6].dst)
    ptfadapter.dataplane.flush()
    testutils.send(ptfadapter, self.src_port, pkt)
    if ((direction == 'uplink->downlink') and downstream_dst_port):
        if dropped:
            testutils.verify_no_packet(ptfadapter, exp_pkt, downstream_dst_port)
        else:
            testutils.verify_packet(ptfadapter, exp_pkt, downstream_dst_port)
    elif dropped:
        testutils.verify_no_packet_any(ptfadapter, exp_pkt, ports=self.get_dst_ports(setup, direction))
    else:
        testutils.verify_packet_any_port(ptfadapter, exp_pkt, ports=self.get_dst_ports(setup, direction), timeout=20)