multiformats / multiaddr

Composable and future-proof network addresses
https://multiformats.io/multiaddr
MIT License
419 stars 84 forks source link

Add ipcidr #129

Closed MarcoPolo closed 2 years ago

MarcoPolo commented 2 years ago

Adds ipcidr to multiaddr. See https://github.com/multiformats/go-multiaddr/pull/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.
MarcoPolo commented 2 years ago

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