Versions in this module Expand all Collapse all v0 v0.0.1 Oct 11, 2024 Changes in this version + func AddrAddr(addr net.Addr) netip.Addr + func AddrIsLAN(ip netip.Addr) bool + func AddrIsSpecialNetwork(ip netip.Addr) bool + func CheckRelayAddr(sender, addr netip.Addr) error + func CheckRelayIP(sender, addr net.IP) error + func IPToAddr(ip net.IP) netip.Addr + func IsLAN(ip net.IP) bool + func IsSpecialNetwork(ip net.IP) bool + func IsTemporaryError(err error) bool + func IsTimeout(err error) bool + func RandomAddr(rng *rand.Rand, ipv4 bool) netip.Addr + func SameNet(bits uint, ip, other net.IP) bool + type DistinctNetSet struct + Limit uint + Subnet uint + func (s *DistinctNetSet) Add(ip net.IP) bool + func (s *DistinctNetSet) AddAddr(ip netip.Addr) bool + func (s *DistinctNetSet) Remove(ip net.IP) + func (s *DistinctNetSet) RemoveAddr(ip netip.Addr) + func (s DistinctNetSet) Contains(ip net.IP) bool + func (s DistinctNetSet) ContainsAddr(ip netip.Addr) bool + func (s DistinctNetSet) Len() int + func (s DistinctNetSet) String() string + type IPTracker struct + func NewIPTracker(window, contactWindow time.Duration, minStatements int) *IPTracker + func (it *IPTracker) AddContact(host netip.Addr) + func (it *IPTracker) AddStatement(host netip.Addr, endpoint netip.AddrPort) + func (it *IPTracker) PredictEndpoint() netip.AddrPort + func (it *IPTracker) PredictFullConeNAT() bool + type Netlist []netip.Prefix + func ParseNetlist(s string) (*Netlist, error) + func (l *Netlist) Add(cidr string) + func (l *Netlist) Contains(ip net.IP) bool + func (l *Netlist) ContainsAddr(ip netip.Addr) bool + func (l *Netlist) UnmarshalTOML(fn func(interface{}) error) error + func (l Netlist) MarshalTOML() interface{}