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

Add ipcidr #129

Merged
merged 1 commit into from
Jun 17, 2022
Merged

Conversation

MarcoPolo
Copy link
Contributor

Adds ipcidr to multiaddr. See multiformats/go-multiaddr#177 for the Go implementation.

Why

We want to be able to specify a set of allowed ip addresses in the resource manager. These addresses will get some special treatment. We want to be able to specify a cidr range of ip addresses, and it's convenient to include this range directly in the multiaddr rather than a separate parameter.

Other use cases:

  1. Go multiaddr dns includes a potential example of resolving a dnsaddr and filtering with ipcidr.
  2. A node may be listening on a range of addresses (1.2.3.4/31) and can thus compress its multiaddr to a single multiaddr instead of two.

@@ -5,6 +5,7 @@ code, size, name, comment
33, 16, dccp,
41, 128, ip6,
42, V, ip6zone, rfc4007 IPv6 zone
43, 8, ipcidr, CIDR mask for IP addresses
Copy link
Member

@mxinden mxinden Jun 15, 2022

Choose a reason for hiding this comment

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

Would this be used for IPv4 only? In other words, isn't an IPv6 CIDR > 8 byte?

Never mind. Sorry. This is the CIDR suffix only.

@MarcoPolo
Copy link
Contributor Author

@marten-seemann can you merge? I don’t have write access

@marten-seemann marten-seemann merged commit 13eae01 into multiformats:master Jun 17, 2022
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.

None yet

3 participants