Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultServer ¶ added in v0.10.7
type DefaultServer struct {
// contains filtered or unexported fields
}
DefaultServer dns server object
func NewDefaultServer ¶ added in v0.10.7
func NewDefaultServer(ctx context.Context, wgInterface WGIface, customAddress string) (*DefaultServer, error)
NewDefaultServer returns a new dns server
func NewDefaultServerPermanentUpstream ¶ added in v0.21.9
func NewDefaultServerPermanentUpstream(ctx context.Context, wgInterface WGIface, hostsDnsList []string) *DefaultServer
NewDefaultServerPermanentUpstream returns a new dns server. It optimized for mobile systems
func (*DefaultServer) DnsIP ¶ added in v0.21.2
func (s *DefaultServer) DnsIP() string
DnsIP returns the DNS resolver server IP address
When kernel space interface used it return real DNS server listener IP address For bind interface, fake DNS resolver address returned (second last IP address from Nebird network)
func (*DefaultServer) Initialize ¶ added in v0.21.4
func (s *DefaultServer) Initialize() (err error)
Initialize instantiate host manager and the dns service
func (*DefaultServer) OnUpdatedHostDNSServer ¶ added in v0.21.9
func (s *DefaultServer) OnUpdatedHostDNSServer(hostsDnsList []string)
OnUpdatedHostDNSServer update the DNS servers addresses for root zones It will be applied if the mgm server do not enforce DNS settings for root zone
func (*DefaultServer) UpdateDNSServer ¶ added in v0.10.7
func (s *DefaultServer) UpdateDNSServer(serial uint64, update nbdns.Config) error
UpdateDNSServer processes an update received from the management service
type MockServer ¶ added in v0.10.7
type MockServer struct { InitializeFunc func() error StopFunc func() UpdateDNSServerFunc func(serial uint64, update nbdns.Config) error }
MockServer is the mock instance of a dns server
func (*MockServer) DnsIP ¶ added in v0.21.2
func (m *MockServer) DnsIP() string
func (*MockServer) Initialize ¶ added in v0.21.4
func (m *MockServer) Initialize() error
Initialize mock implementation of Initialize from Server interface
func (*MockServer) OnUpdatedHostDNSServer ¶ added in v0.21.9
func (m *MockServer) OnUpdatedHostDNSServer(strings []string)
func (*MockServer) Stop ¶ added in v0.10.7
func (m *MockServer) Stop()
Stop mock implementation of Stop from Server interface
func (*MockServer) UpdateDNSServer ¶ added in v0.10.7
func (m *MockServer) UpdateDNSServer(serial uint64, update nbdns.Config) error
UpdateDNSServer mock implementation of UpdateDNSServer from Server interface
type ReadyListener ¶ added in v0.21.9
type ReadyListener interface {
OnReady()
}
ReadyListener is a notification mechanism what indicate the server is ready to handle host dns address changes
type Server ¶
type Server interface { Initialize() error Stop() DnsIP() string UpdateDNSServer(serial uint64, update nbdns.Config) error OnUpdatedHostDNSServer(strings []string) }
Server is a dns server interface
func GetServerDns ¶ added in v0.21.9
GetServerDns export the DNS server instance in static way. It used by the Mobile client
type WGIface ¶ added in v0.21.9
type WGIface interface { Name() string Address() iface.WGAddress IsUserspaceBind() bool GetFilter() iface.PacketFilter GetDevice() *iface.DeviceWrapper }
WGIface defines subset methods of interface required for manager