Hi Srinivasa,
TRex Python API supports adding captures queues to the server.
A capture allows you define a queue with a specific size and then query it for its captured packets.
Please refer to our docs:
TRex Stateless Capture API Documentation
After you have queried for the packets, you can filter them using scapy however you like.
In the next version, packet captures will be enhanced to support BPF (Berkeley Packet Filters).
This means that even under high traffic you will be after to activate a capture and provide a BPF pattern to filter the correct traffic.
For example:
client.start_capture(rx_ports = [0, 1], bpf_filter = 'ether src 01:02:03:04:05:06')
this will capture only packets that their source Ethernet address is 01:02:03:04:05:06
BPF filter format is the same as supported by tcpdump and alike.
Thanks,
Itay