Versions in this module Expand all Collapse all v1 v1.2.1 Apr 10, 2025 v1.2.0 Apr 9, 2025 v1.1.1 Apr 3, 2025 v1.1.0 Apr 2, 2025 Changes in this version + const ErrClosed + func ValidateClientID(id string) (err error) + type AddressProcessor interface + Close func() (err error) + Process func(ctx context.Context, ip netip.Addr) + type AddressUpdater interface + UpdateAddress func(ctx context.Context, ip netip.Addr, host string, info *whois.Info) + type DHCP interface + HostByIP func(ip netip.Addr) (host string) + Leases func() (leases []*dhcpsvc.Lease) + MACByIP func(ip netip.Addr) (mac net.HardwareAddr) + type DefaultAddrProc struct + func NewDefaultAddrProc(c *DefaultAddrProcConfig) (p *DefaultAddrProc) + func (p *DefaultAddrProc) Close() (err error) + func (p *DefaultAddrProc) Process(ctx context.Context, ip netip.Addr) + type DefaultAddrProcConfig struct + AddressUpdater AddressUpdater + BaseLogger *slog.Logger + CatchPanics bool + DialContext aghnet.DialContextFunc + Exchanger rdns.Exchanger + InitialAddresses []netip.Addr + PrivateSubnets netutil.SubnetSet + UsePrivateRDNS bool + UseRDNS bool + UseWHOIS bool + type EmptyAddrProc struct + func (EmptyAddrProc) Close() (_ error) + func (EmptyAddrProc) Process(_ context.Context, _ netip.Addr) + type EmptyDHCP struct + func (EmptyDHCP) HostByIP(_ netip.Addr) (host string) + func (EmptyDHCP) Leases() (leases []*dhcpsvc.Lease) + func (EmptyDHCP) MACByIP(_ netip.Addr) (mac net.HardwareAddr) + type HostsContainer interface + Upd func() (updates <-chan *hostsfile.DefaultStorage) + type Persistent struct + BlockedServices *filtering.BlockedServices + ClientIDs []string + FilteringEnabled bool + IPs []netip.Addr + IgnoreQueryLog bool + IgnoreStatistics bool + MACs []net.HardwareAddr + Name string + ParentalEnabled bool + SafeBrowsingEnabled bool + SafeSearch filtering.SafeSearch + SafeSearchConf filtering.SafeSearchConfig + Subnets []netip.Prefix + Tags []string + UID UID + UpstreamConfig *proxy.CustomUpstreamConfig + Upstreams []string + UpstreamsCacheEnabled bool + UpstreamsCacheSize uint32 + UseOwnBlockedServices bool + UseOwnSettings bool + func (c *Persistent) CloseUpstreams() (err error) + func (c *Persistent) EqualIDs(prev *Persistent) (equal bool) + func (c *Persistent) IDs() (ids []string) + func (c *Persistent) IDsLen() (n int) + func (c *Persistent) SetIDs(ids []string) (err error) + func (c *Persistent) ShallowClone() (clone *Persistent) + type Runtime struct + func NewRuntime(ip netip.Addr) (r *Runtime) + func (r *Runtime) Addr() (ip netip.Addr) + func (r *Runtime) Info() (cs Source, host string) + func (r *Runtime) WHOIS() (info *whois.Info) + type Source uint8 + const SourceARP + const SourceDHCP + const SourceHostsFile + const SourcePersistent + const SourceRDNS + const SourceWHOIS + func (cs Source) MarshalText() (text []byte, err error) + func (cs Source) String() (s string) + type Storage struct + func NewStorage(ctx context.Context, conf *StorageConfig) (s *Storage, err error) + func (s *Storage) Add(ctx context.Context, p *Persistent) (err error) + func (s *Storage) AllowedTags() (tags []string) + func (s *Storage) ClientRuntime(ip netip.Addr) (rc *Runtime) + func (s *Storage) Find(id string) (p *Persistent, ok bool) + func (s *Storage) FindByMAC(mac net.HardwareAddr) (p *Persistent, ok bool) + func (s *Storage) FindByName(name string) (p *Persistent, ok bool) + func (s *Storage) FindLoose(ip netip.Addr, id string) (p *Persistent, ok bool) + func (s *Storage) RangeByName(f func(c *Persistent) (cont bool)) + func (s *Storage) RangeRuntime(f func(rc *Runtime) (cont bool)) + func (s *Storage) ReloadARP(ctx context.Context) + func (s *Storage) RemoveByName(ctx context.Context, name string) (ok bool) + func (s *Storage) Shutdown(_ context.Context) (err error) + func (s *Storage) Size() (n int) + func (s *Storage) Start(ctx context.Context) (err error) + func (s *Storage) Update(ctx context.Context, name string, p *Persistent) (err error) + func (s *Storage) UpdateAddress(ctx context.Context, ip netip.Addr, host string, info *whois.Info) + func (s *Storage) UpdateDHCP(ctx context.Context) + type StorageConfig struct + ARPClientsUpdatePeriod time.Duration + ARPDB arpdb.Interface + DHCP DHCP + EtcHosts HostsContainer + InitialClients []*Persistent + Logger *slog.Logger + RuntimeSourceDHCP bool + type UID uuid.UUID + func MustNewUID() (uid UID) + func NewUID() (uid UID, err error) + func (uid *UID) UnmarshalText(data []byte) error + func (uid UID) MarshalText() ([]byte, error)