We already support a number of map/filter like operations on multiaddrs, which take as input a list of multiaddrs and sometimes certain conditions, and return as output a list of multiaddrs.
fmt (a.k.a. mafmt)
lets us define protocol schemata and filter addresses that match
e.g. the schema /ip6/udp matches /ip6/::1/udp/4002
implementations: go-multiaddr-fmt, js-mafmt
filter
lets us filter addresses based on membership of an IP CIDR block
e.g. /ip4/192.168.0.0/ipcidr/16 matches /ip4/192.168.1.42
implementations: libp2p/go-maddr-filter
addr-util
filters certain classes of IP addresses (link-local, transports that can't dial out, etc.)
We already support a number of
map
/filter
like operations on multiaddrs, which take as input a list of multiaddrs and sometimes certain conditions, and return as output a list of multiaddrs./ip6/udp
matches/ip6/::1/udp/4002
/ip4/192.168.0.0/ipcidr/16
matches/ip4/192.168.1.42
/dnsaddr
,/dns4
, and/dns6
addressesThe first three should probably be collapsed into a single package.
A minimal generalized API for these transformations should be part of the multiaddr spec.