aregm / nff-go

NFF-Go -Network Function Framework for GO (former YANFF)
BSD 3-Clause "New" or "Revised" License
1.38k stars 156 forks source link

Pcap support in fast generator #714

Closed mercimat closed 4 years ago

mercimat commented 4 years ago

SetFastGenerator currently builds packets based on a JSON structure that defines each header in the packets. This PR adds support for reading packets directly from pcap files.

Two ways to generate the packets from a pcap file are available: endlessly reading the file, or storing the packets in memory and use those when the EOF is reached. The boolean "inmemory" controls which method is used. Reading the file endlessly has the advantage of keeping the memory usage low. But the throughput might be limited by disk I/O.

Testing is added via run.sh.

mercimat commented 4 years ago

The CI test failed because Ubuntu Disco reached end-of-life. I created another PR to suggest a fix for the CI checks: https://github.com/intel-go/nff-go/pull/716