Skip to content
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

no_std support #6

Closed
jelacious opened this issue Sep 15, 2022 · 2 comments · Fixed by #7
Closed

no_std support #6

jelacious opened this issue Sep 15, 2022 · 2 comments · Fixed by #7

Comments

@jelacious
Copy link
Contributor

Hiya!

From a quick cursory glance over the API of this crate it looks like it would be possible to support no_std without too much trouble, mostly just cfging all std uses with either core or alloc. Is this something you would be interested in? I could of course do so myself but thought I would ask first.

Supporting no_std would allow this crate to be more easily used on more under-powered systems and make it a tad-bit smaller when compiling as well, which would be quite handy in my use-case.

@yescallop
Copy link
Owner

It would be great for this crate to support no_std, but as Ip{v4, v6}Addr requires std we would need to decide what to exclude when std is gone. Any ideas?

@jelacious
Copy link
Contributor Author

There are a few different options depending on how much of the std::net functionality you want to retain.

I think just using no-std-net as a simple drop-in replacement could suffice, but that repo seems to be a bit stale. It does however implement all the stuff you would need. There seems to have been some discussion on if the net stuff should be used in core that just petered off.

smoltcp's solution to this was to implement their own quite thorough IP types:

You could also go the nuclear option like r-efi and have a very small IP Address implementation, but that might be too limiting.

I think from a perspective of minimizing the amount of dependencies something like what smoltcp has done would be preferable. Since the code is 0BSD licensed and actively maintained one could just copy that code into this project and replace everything related to std::net with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants