Documentation
¶
Index ¶
- func GroupKey(na net.IP) string
- func IsIPv4(na net.IP) bool
- func IsLocal(na net.IP) bool
- func IsOnionCatTor(na net.IP) bool
- func IsRFC1918(na net.IP) bool
- func IsRFC2544(na net.IP) bool
- func IsRFC3849(na net.IP) bool
- func IsRFC3927(na net.IP) bool
- func IsRFC3964(na net.IP) bool
- func IsRFC4193(na net.IP) bool
- func IsRFC4380(na net.IP) bool
- func IsRFC4843(na net.IP) bool
- func IsRFC4862(na net.IP) bool
- func IsRFC5737(na net.IP) bool
- func IsRFC6052(na net.IP) bool
- func IsRFC6145(na net.IP) bool
- func IsRFC6598(na net.IP) bool
- func IsRoutable(na net.IP) bool
- func IsValid(na net.IP) bool
- type Config
- type Discovery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GroupKey ¶
GroupKey returns a string representing the network group an address is part of. This is the /16 for IPv4, the /32 (/36 for he.net) for IPv6, the string "localNode" for a localNode address, the string "tor:key" where key is the /4 of the onion address for Tor address, and the string "unroutable" for an unroutable address.
func IsOnionCatTor ¶
IsOnionCatTor returns whether or not the passed address is in the IPv6 range used by bitcoin to support Tor (fd87:d87e:eb43::/48). Note that this range is the same range used by OnionCat, which is part of the RFC4193 unique localNode IPv6 range.
func IsRFC1918 ¶
IsRFC1918 returns whether or not the passed address is part of the IPv4 private network address space as defined by RFC1918 (10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16).
func IsRFC2544 ¶
IsRFC2544 returns whether or not the passed address is part of the IPv4 address space as defined by RFC2544 (198.18.0.0/15).
func IsRFC3849 ¶
IsRFC3849 returns whether or not the passed address is part of the IPv6 documentation range as defined by RFC3849 (2001:DB8::/32).
func IsRFC3927 ¶
IsRFC3927 returns whether or not the passed address is part of the IPv4 autoconfiguration range as defined by RFC3927 (169.254.0.0/16).
func IsRFC3964 ¶
IsRFC3964 returns whether or not the passed address is part of the IPv6 to IPv4 encapsulation range as defined by RFC3964 (2002::/16).
func IsRFC4193 ¶
IsRFC4193 returns whether or not the passed address is part of the IPv6 unique localNode range as defined by RFC4193 (FC00::/7).
func IsRFC4380 ¶
IsRFC4380 returns whether or not the passed address is part of the IPv6 teredo tunneling over UDP range as defined by RFC4380 (2001::/32).
func IsRFC4843 ¶
IsRFC4843 returns whether or not the passed address is part of the IPv6 ORCHID range as defined by RFC4843 (2001:10::/28).
func IsRFC4862 ¶
IsRFC4862 returns whether or not the passed address is part of the IPv6 stateless address autoconfiguration range as defined by RFC4862 (FE80::/64).
func IsRFC5737 ¶
IsRFC5737 returns whether or not the passed address is part of the IPv4 documentation address space as defined by RFC5737 (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24).
func IsRFC6052 ¶
IsRFC6052 returns whether or not the passed address is part of the IPv6 well-known prefix range as defined by RFC6052 (64:FF9B::/96).
func IsRFC6145 ¶
IsRFC6145 returns whether or not the passed address is part of the IPv6 to IPv4 translated address range as defined by RFC6145 (::FFFF:0:0:0/96).
func IsRFC6598 ¶
IsRFC6598 returns whether or not the passed address is part of the IPv4 shared address space specified by RFC6598 (100.64.0.0/10).
func IsRoutable ¶
IsRoutable returns whether or not the passed address is routable over the public internet. This is true as long as the address is valid and is not in any reserved ranges.
Types ¶
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
Discovery is struct that holds the protocol components, the protocol definition, the addr book data structure and more.
func (*Discovery) Bootstrap ¶
Bootstrap runs a refresh and tries to get a minimum number of nodes in the addrBook.
func (*Discovery) ExternalPort ¶
ExternalPort returns currently configured external port.