Documentation ¶
Index ¶
- Variables
- func CheckUncleanShutdown(wgIface string) error
- type DefaultServer
- func NewDefaultServer(ctx context.Context, wgInterface WGIface, customAddress string, ...) (*DefaultServer, error)
- func NewDefaultServerIos(ctx context.Context, wgInterface WGIface, iosDnsManager IosDnsManager, ...) *DefaultServer
- func NewDefaultServerPermanentUpstream(ctx context.Context, wgInterface WGIface, hostsDnsList []string, ...) *DefaultServer
- func (s *DefaultServer) DnsIP() string
- func (s *DefaultServer) Initialize() (err error)
- func (s *DefaultServer) OnUpdatedHostDNSServer(hostsDnsList []string)
- func (s *DefaultServer) ProbeAvailability()
- func (s *DefaultServer) SearchDomains() []string
- func (s *DefaultServer) Stop()
- func (s *DefaultServer) UpdateDNSServer(serial uint64, update nbdns.Config) error
- type DomainConfig
- type HostDNSConfig
- type IosDnsManager
- type MockServer
- func (m *MockServer) DnsIP() string
- func (m *MockServer) Initialize() error
- func (m *MockServer) OnUpdatedHostDNSServer(strings []string)
- func (m *MockServer) ProbeAvailability()
- func (m *MockServer) SearchDomains() []string
- func (m *MockServer) Stop()
- func (m *MockServer) UpdateDNSServer(serial uint64, update nbdns.Config) error
- type ReadyListener
- type Server
- type UpstreamResolver
- type WGIface
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownOsManagerType = errors.New("unknown os manager type")
Functions ¶
func CheckUncleanShutdown ¶ added in v0.25.6
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, statusRecorder *peer.Status, ) (*DefaultServer, error)
NewDefaultServer returns a new dns server
func NewDefaultServerIos ¶ added in v0.25.0
func NewDefaultServerIos( ctx context.Context, wgInterface WGIface, iosDnsManager IosDnsManager, statusRecorder *peer.Status, ) *DefaultServer
NewDefaultServerIos returns a new dns server. It optimized for ios
func NewDefaultServerPermanentUpstream ¶ added in v0.21.9
func NewDefaultServerPermanentUpstream( ctx context.Context, wgInterface WGIface, hostsDnsList []string, config nbdns.Config, listener listener.NetworkChangeListener, statusRecorder *peer.Status, ) *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) ProbeAvailability ¶ added in v0.25.5
func (s *DefaultServer) ProbeAvailability()
ProbeAvailability tests each upstream group's servers for availability and deactivates the group if no server responds
func (*DefaultServer) SearchDomains ¶ added in v0.24.3
func (s *DefaultServer) SearchDomains() []string
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 DomainConfig ¶ added in v0.25.0
type HostDNSConfig ¶ added in v0.25.0
type HostDNSConfig struct { Domains []DomainConfig `json:"domains"` RouteAll bool `json:"routeAll"` ServerIP string `json:"serverIP"` ServerPort int `json:"serverPort"` }
type IosDnsManager ¶ added in v0.25.0
type IosDnsManager interface {
ApplyDns(string)
}
IosDnsManager is a dns manager interface for iOS
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) ProbeAvailability ¶ added in v0.25.5
func (m *MockServer) ProbeAvailability()
ProbeAvailability mocks implementation of ProbeAvailability from the Server interface
func (*MockServer) SearchDomains ¶ added in v0.24.3
func (m *MockServer) SearchDomains() []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) SearchDomains() []string ProbeAvailability() }
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 UpstreamResolver ¶ added in v0.25.0
type UpstreamResolver interface {
// contains filtered or unexported methods
}
Source Files ¶
- dbus_linux.go
- file_linux.go
- file_parser_linux.go
- file_repair_linux.go
- host.go
- host_linux.go
- hosts_dns_holder.go
- local.go
- mock_server.go
- network_manager_linux.go
- notifier.go
- resolvconf_linux.go
- response_writer.go
- server.go
- server_export.go
- server_linux.go
- service.go
- service_listener.go
- service_memory.go
- systemd_linux.go
- unclean_shutdown_linux.go
- upstream.go
- upstream_general.go
- wgiface.go