Closed thegwan closed 3 years ago
I think it would be better to expose it as an option in my opinion since that's what libpcap
does. pcap
provides Rust abstractions on top of libpcap
, but otherwise should just be the same API.
I'll hopefully fix the build failure tonight so if you update we can merge straight away.
I'll update the tests too at some point in the near future
@Wojtek242 any updates on the build failure fixes?
Yes, the builds are fixed on master. Your latest build fails due to cargo fmt
though. You just need to reformat your code to satisfy the formatter.
This is a curious failure now. Possibly very unlucky and we'll see exactly the same on master on the next scheduled run. I will investigate it.
Yea, so it looks like you were just unlucky. Rust 1.51 was released that day which came with a new clippy lint. It did show up later in the scheduled runs.
I have now fixed it on master so can you please rebase? If it passes, we can finally merge it : ). Thanks a lot for your patience!
tcpdump by default optimizes the generated bpf program, and I figured this crate should provide similar functionality.
An alternative could be to expose a parameter to the filter() and compile() methods to specify whether you want optimized programs.