Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

private networks and utility functions #46

Merged
merged 7 commits into from
Oct 18, 2018
Merged

Conversation

vyzo
Copy link
Contributor

@vyzo vyzo commented Oct 16, 2018

extracted from go-libp2p-autonat

@raulk
Copy link
Member

raulk commented Oct 16, 2018

Heads-up, I'm working on the Routability() logic that we discussed on libp2p/go-libp2p#436 (comment), which overlaps with this PR.

Probably worth waiting until I'm done with that, because I'm also taking into consideration reserved and special purpose addresses. And I think the Routability API is more extensible going forward.

@Stebalien
Copy link
Member

@raulk how long will that take? Basically, I asked @vyzo to do this because he would have otherwise exposed these as public methods from the autonat service (which I didn't want on the API). We could just do that and say "these aren't really public" but I'd prefer to do this the right way first.

@vyzo vyzo changed the title private networks and IsPublicAddr private networks and utility functions Oct 16, 2018
@raulk
Copy link
Member

raulk commented Oct 16, 2018

Here's where I'm headed: raulk@5630917

I need to finishing populating the segment tables (using rfc6890 as a reference) and write tests.

Feel free to proceed with this PR if it's urgent. I'd be done today with Routability() anyway.

@vyzo
Copy link
Contributor Author

vyzo commented Oct 16, 2018

I think we can extend IsPublicAddr to take into account all non-routable addrs.
IsPrivateAddr is fine only checking the private networks.

@vyzo
Copy link
Contributor Author

vyzo commented Oct 16, 2018

Added all the unroutable address ranges in the IsPublicAddr test

@raulk
Copy link
Member

raulk commented Oct 16, 2018

Multicast ranges added in the SpecialPurpose segment: https://github.com/raulk/go-multiaddr-net/blob/routability/routability.go

Next step is to treat IPv4-IPv6 translation ranges properly.

@vyzo vyzo mentioned this pull request Oct 17, 2018
8 tasks
This now means that addresses must *start* with the an IP address, we won't just
pull one out of the middle.
…resses

(would have failed with ValueForProtocol)
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(with my patches approved by @vyzo)

@Stebalien Stebalien merged commit 3ce601c into master Oct 18, 2018
@Stebalien Stebalien deleted the feat/private-net branch October 18, 2018 13:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants