Closed gmacon closed 1 year ago
We can set a default value for the linktype, but I didn't see an obvious default value. (I looked for a DLT_UNSPECIFIED
or similar, but didn't find one.) What linktype do you want to be the default?
It was an open question, if there is none so be it.
I find the motivation behind this PR good and would like to see it make into the code base, but I find the implementation highly inconsistent with the rest of the existing API.
In particular:
Capture<Inactive>
. Unfortunately, I don't think that's usable for Capture<Dead>
due to it requiring a devicedead
and dead_with_options
produce two different types which I find unexpected due to the inconsistencyI was contemplating having another Capture type to account for this, but that would also be inconsistent with the other captures as they all assume a NonNull
pcap pointer.
Whilst ugly, I would prefer for consistency's sake if rather than having a builder, you implement only a single new method on Capture<Dead>
called dead_with_precision
. The current requirements do not justify breaking consistency.
Oh and if you do implement the changes, please make sure to rebase first to pick up the clippy lint fixes so that we can run the CI on your PR.
OK, done.
And apologies for the extra work, but you might need to rebase again to avoid merge conflicts on the CHANGELOG.
Thanks!
I realized that using a builder isn't actually a backwards-breaking change if I keep the existing method as a shortcut, so here it is.
Fixes #243