Versions in this module Expand all Collapse all v0 v0.0.2 Oct 1, 2023 v0.0.1 Sep 30, 2023 Changes in this version + const ErrNoHostsPaths + const ErrNoStaticIPInfo + func BroadcastFromPref(p netip.Prefix) (bc netip.Addr) + func CanBindPrivilegedPorts() (can bool, err error) + func CheckOtherDHCP(ifaceName string) (ok4, ok6 bool, err4, err6 error) + func CheckPort(network string, ipp netip.AddrPort) (err error) + func CollectAllIfacesAddrs() (addrs []netip.Addr, err error) + func DefaultHostsPaths() (paths []string) + func GatewayIP(ifaceName string) (ip netip.Addr) + func GenerateHostname(ip netip.Addr) (hostname string) + func GetSubnet(ifaceName string) (p netip.Prefix) + func IfaceDNSIPAddrs(iface NetIface, ipv IPVersion, maxAttempts int, backoff time.Duration) (addrs []net.IP, err error) + func IfaceHasStaticIP(ifaceName string) (has bool, err error) + func IfaceIPAddrs(iface NetIface, ipv IPVersion) (ips []net.IP, err error) + func IfaceSetStaticIP(ifaceName string) (err error) + func InterfaceByIP(ip netip.Addr) (ifaceName string) + func IsAddrInUse(err error) (ok bool) + func NewDomainNameSet(list []string) (set *stringutil.Set, err error) + func NormalizeDomain(host string) (norm string) + func ParseAddrPort(s string, defaultPort uint16) (ipp netip.AddrPort, err error) + type DialContextFunc = func(ctx context.Context, network, addr string) (conn net.Conn, err error) + type HostGenFunc func() (host string) + type Hosts map[netip.Addr][]*hostsfile.Record + type HostsContainer struct + func NewHostsContainer(fsys fs.FS, w aghos.FSWatcher, paths ...string) (hc *HostsContainer, err error) + func (hc *HostsContainer) Close() (err error) + func (hc *HostsContainer) MatchAddr(ip netip.Addr) (recs []*hostsfile.Record) + func (hc *HostsContainer) MatchName(name string) (recs []*hostsfile.Record) + func (hc *HostsContainer) Upd() (updates <-chan Hosts) + type IPMut struct + func NewIPMut(f IPMutFunc) (m *IPMut) + func (m *IPMut) Load() (f IPMutFunc) + func (m *IPMut) Store(f IPMutFunc) + type IPMutFunc func(ip net.IP) + type IPVersion = int + const IPVersion4 + const IPVersion6 + type IgnoreEngine struct + func NewIgnoreEngine(ignored []string) (e *IgnoreEngine, err error) + func (e *IgnoreEngine) Has(host string) (ignore bool) + func (e *IgnoreEngine) Values() (ignored []string) + type IpsetManager interface + Add func(host string, ip4s, ip6s []net.IP) (n int, err error) + Close func() (err error) + func NewIpsetManager(ipsetConf []string) (mgr IpsetManager, err error) + type NetIface interface + Addrs func() ([]net.Addr, error) + type NetInterface struct + Addresses []netip.Addr + Flags net.Flags + HardwareAddr net.HardwareAddr + MTU int + Name string + Subnets []netip.Prefix + func GetValidNetInterfacesForWeb() (nifaces []*NetInterface, err error) + func NetInterfaceFrom(iface *net.Interface) (niface *NetInterface, err error) + func (iface NetInterface) MarshalJSON() ([]byte, error) + type SystemResolvers interface + Get func() (rs []string) + func NewSystemResolvers(hostGenFunc HostGenFunc) (sr SystemResolvers, err error)