Documentation ¶
Index ¶
- func AddrInList(addr ma.Multiaddr, list []ma.Multiaddr) bool
- func AddrIsShareableOnWAN(addr ma.Multiaddr) bool
- func AddrOverNonLocalIP(a ma.Multiaddr) bool
- func CheckNATWarning(observed, expected ma.Multiaddr, listen []ma.Multiaddr)
- func FilterAddrs(a []ma.Multiaddr, filters ...func(ma.Multiaddr) bool) []ma.Multiaddr
- func FilterNeg(f func(ma.Multiaddr) bool) func(ma.Multiaddr) bool
- func InterfaceAddresses() ([]ma.Multiaddr, error)
- func ResolveUnspecifiedAddress(resolve ma.Multiaddr, ifaceAddrs []ma.Multiaddr) ([]ma.Multiaddr, error)
- func ResolveUnspecifiedAddresses(unspecAddrs, ifaceAddrs []ma.Multiaddr) ([]ma.Multiaddr, error)
- func Subtract(a, b []ma.Multiaddr) []ma.Multiaddr
- func SubtractFilter(addrs ...ma.Multiaddr) func(ma.Multiaddr) bool
- func WANShareableAddrs(inp []ma.Multiaddr) []ma.Multiaddr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddrInList ¶
AddrInList returns whether or not an address is part of a list. this is useful to check if NAT is happening (or other bugs?)
func AddrIsShareableOnWAN ¶
AddrIsShareableOnWAN returns whether the given address should be shareable on the wide area network (wide internet).
func AddrOverNonLocalIP ¶
AddrOverNonLocalIP returns whether the addr uses a non-local ip link
func CheckNATWarning ¶
CheckNATWarning checks if our observed addresses differ. if so, informs the user that certain things might not work yet
func FilterAddrs ¶
FilterAddrs is a filter that removes certain addresses, according to the given filters. If all filters return true, the address is kept.
func InterfaceAddresses ¶
InterfaceAddresses returns a list of addresses associated with local machine Note: we do not return link local addresses. IP loopback is ok, because we may be connecting to other nodes in the same machine.
func ResolveUnspecifiedAddress ¶
func ResolveUnspecifiedAddress(resolve ma.Multiaddr, ifaceAddrs []ma.Multiaddr) ([]ma.Multiaddr, error)
ResolveUnspecifiedAddress expands an unspecified ip addresses (/ip4/0.0.0.0, /ip6/::) to use the known local interfaces. If ifaceAddr is nil, we request interface addresses from the network stack. (this is so you can provide a cached value if resolving many addrs)
func ResolveUnspecifiedAddresses ¶
ResolveUnspecifiedAddresses expands unspecified ip addresses (/ip4/0.0.0.0, /ip6/::) to use the known local interfaces.
func SubtractFilter ¶
SubtractFilter returns a filter func that filters all of the given addresses
Types ¶
This section is empty.