New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose the packet parsing and crafting infrastructure as a separate crate #811
Comments
This idea came up more than once (matrix room of smoltcp). So I was working on this as well! I have a branch that is kind of ready. I'll create a pull request this afternoon. |
I discussed this a bit in the matrix room. The thing is that it would be difficult to maintain it. People might want to merge exotic protocols, however, these protocols might not fit the use case of smoltcp and there is not really someone that wants to commit to maintain it. Then there is a second problem: smoltcp has a lot of feature flags. With these feature flags, we can keep the memory footprint low, since I think most of the people use it for embedded. If we have two crates, then smolwire could enable What is your use case? Couldn't you just use |
So it seems what I need is basically the I still think separate crate makes sense and #812 is in the right direction. About the feature flags problem, from what I see, the only problem would be feature gated enum variants which disappear in pattern matching. Since The maintaining concern is valid, though you can always reject anything that you see undesirable for the |
there's not always a smoltcp/smoltcp/src/iface/interface/mod.rs Lines 1211 to 1216 in 8180cbc
forcing adding |
Cargo documentation recommends that enabling a feature flag should be a semver compatible change and adding variant to an exhaustive enum is a breaking change so smoltcp is already committing cargo crime and cargo police might catch us :) (that is, in a theoretical scenario, some library can depend on
|
Rust ecosystem lacks a mature packet parsing and crafting library similar to libtins in C++, the best I found is the packet crate which lacks some basic functionality like ARP packets (if a good library existed, I guess this crate would probably use it).
This crate has a great in house implementation of such functionality, which is zero copy, handles corner cases, is well maintained, ... . Would you accept a PR to exposing it as a separate crate, e.g.
smolpackets
? Currently most (all?) of that functionality is private, which is reasonable since it is not the intended job of thesmoltcp
crate. The new crate can still live in this repository, and I would expect no stability guarantees on it (it can even be published with the version of thesmoltcp
crate or in some auto release fashion) but it will still probably increase the maintenance cost a little.The text was updated successfully, but these errors were encountered: