Closed robber-m closed 4 years ago
Hi, Thanks for the PR and the explanation. Your patch looks correct, I'm reviewing and running some tests, but I think there are no problems and that it will be merged soon.
Just to be sure of one thing: it is up to the crate user to check the precision, and use microseconds/nanoseconds depending on the header? There are similar problems (even more complex) with pcap-ng, so I added a function to extract the timestamp. Maybe this should be abstracted for both formats.
Merged (with some changes), thanks!
Thanks so much! Sorry I missed your earlier comments! I had my Github email notification settings misconfigured. Really, thanks again!
Hi, Thanks for the PR and the explanation. Your patch looks correct, I'm reviewing and running some tests, but I think there are no problems and that it will be merged soon.
Just to be sure of one thing: it is up to the crate user to check the precision, and use microseconds/nanoseconds depending on the header? There are similar problems (even more complex) with pcap-ng, so I added a function to extract the timestamp. Maybe this should be abstracted for both formats.
A function to extract the timestamp feels to me like it would be a nice addition here. Because I have so little Rust experience, I thought I would try to incorporate my changes in a way that had minimal impact on the library to avoid doing something unidiomatic
Hello, I'm just getting started with one of my first Rust projects and I'm hoping to make use of your crate!
In using your LegacyPcapReader, I ran into some trouble. The PCAP recordings I am working with are all Legacy PCAPs recorded with nanosecond-resolution timestamps, so they use a not-yet-supported magic number.
These excerpts from the Wireshark wiki cover the key information for interpreting nanosecond-resolution PCAPs:
Source: https://gitlab.com/wireshark/wireshark/-/wikis/Development/LibpcapFileFormat
I took a first pass at supporting this new magic number myself, but I'm very new to Rust (and nom as well), so please let me know if I did something ugly, unidiomatic, or different from the way you think this should be implemented. I'll be happy to rework my PR to incorporate your feedback!
Thanks for writing an awesome crate! I tried writing a similar-style pcap iterator using nom a few months ago and really struggled!