Documentation
¶
Index ¶
- Constants
- Variables
- func AddNeighbor(address string) error
- func BlockIP(ipAddressWithPort string)
- func End()
- func GetFormattedAddress(identifier string, port string) string
- func GetPreferredIP(knownIPs []*IPAddress, preferIPv6 bool) string
- func IsIPBlocked(ipAddressWithPort string) (blocked bool)
- func RemoveBlockedIPsOfNeighbor(neighbor *Neighbor)
- func RemoveNeighbor(address string) error
- func Start()
- func UpdateHostnameAddresses()
- type IPAddress
- type Message
- type Neighbor
- type RawMsg
- type Server
Constants ¶
View Source
const ( UDPPacketSize = 1650 UDP = "udp" TCP = "tcp" )
Variables ¶
Functions ¶
func AddNeighbor ¶
func GetFormattedAddress ¶
func GetPreferredIP ¶
func IsIPBlocked ¶
func RemoveBlockedIPsOfNeighbor ¶
func RemoveBlockedIPsOfNeighbor(neighbor *Neighbor)
func RemoveNeighbor ¶
func UpdateHostnameAddresses ¶
func UpdateHostnameAddresses()
Types ¶
type Neighbor ¶
type Neighbor struct {
Hostname string // Formatted like: <domainname> (Empty if its IP address)
Addr string // Formatted like: <ip>:<port> OR <domainname>:<port>
IP string // Formatted like: XXX.XXX.XXX.XXX (IPv4) OR [x:x:x:...] (IPv6)
Port string // Also saved separately from Addr for performance reasons
IPAddressWithPort string // Formatted like: XXX.XXX.XXX.XXX:x (IPv4) OR [x:x:x:...]:x (IPv6)
UDPAddr *net.UDPAddr
Incoming int32
New int32
Invalid int32
ConnectionType string // Formatted like: udp
PreferIPv6 bool
KnownIPs []*IPAddress
LastIncomingTime time.Time
}
func GetNeighborByAddress ¶
func (*Neighbor) GetPreferredIP ¶
func (*Neighbor) TrackIncoming ¶
func (*Neighbor) TrackInvalid ¶
func (*Neighbor) UpdateIPAddressWithPort ¶
Click to show internal directories.
Click to hide internal directories.