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

Use pure rust libraries to get host interfaces #1514

Closed

Conversation

tcharding
Copy link
Contributor

For the sake of not having to compile any C code, let's try use only pure Rust dependencies. To get the host interface information we can use the pnet and ipnetwork libraries. These are both pure Rust.

pnet v0.25 depends on ipnetwork v0.15 so we use that also instead of the latest ipnetwork v0.16.

Resolves: #1489

For the sake of not having to compile any C code, let's try use only
pure Rust dependencies.  To get the host interface information we can
use the `pnet` and `ipnetwork` libraries.  These are both pure Rust.

`pnet` v0.25 depends on `ipnetwork` v0.15 so we use that also instead of
the latest `ipnetwork` v0.16.
@tcharding tcharding force-pushed the 1489-replace-get_if_addresses branch from f732f56 to f5ad435 Compare March 25, 2020 09:36
@tomaka
Copy link
Member

tomaka commented Mar 25, 2020

Thanks. The PR in itself has my green mark, but I'm not super confident about pnet.
It's quite a huge beast for "just" getting the interface addresses, and this section suggests that building libp2p (and anything that depends on it) for Windows would become extremely painful.

@tcharding
Copy link
Contributor Author

Thanks. The PR in itself has my green mark, but I'm not super confident about pnet.
It's quite a huge beast for "just" getting the interface addresses, and this section suggests that building libp2p (and anything that depends on it) for Windows would become extremely painful.

Thanks for the review, I was a bit unsure at the choice of libraries in this PR also. I wanted to put up a PR to start the conversation to demonstrate some effort instead of just talking. I'm more than happy to redo it with other libraries if you (or anyone) can suggest a better alternative. Was fun to write this anyways.

@tcharding
Copy link
Contributor Author

Not really sure what to do about this right now, closing it so as to not clutter the place up with stale open PRs.

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 this pull request may close these issues.

Replace get_if_addrs with a pure Rust library
2 participants