Documentation
¶
Index ¶
- Constants
- func CheckDeactivationPin(pin int64, stopCh chan struct{}) int
- func ConfigureWindowsServiceFailureActions(serviceName string) error
- func ControlSocketName() string
- func FlushDNSCache() error
- func Main()
- func RunCobraCommand(cmd *cobra.Command)
- func RunMobile(appConfig *AppConfig, appCallback *AppCallback, stopCh chan struct{})
- func SetMobileNameservers(csv string)
- func ValidateDefaultLocalIPsFromDelta(newState *netmon.State)
- type AppCallback
- type AppConfig
- type RecoveryReason
Constants ¶
const ( BackupDomainController = 4 PrimaryDomainController = 5 )
Domain controller role values from Win32_ComputerSystem https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-computersystem
const ( // EDNS0_OPTION_MAC is dnsmasq EDNS0 code for adding mac option. // https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=src/dns-protocol.h;h=76ac66a8c28317e9c121a74ab5fd0e20f6237dc8;hb=HEAD#l81 // This is also dns.EDNS0LOCALSTART, but define our own constant here for clarification. EDNS0_OPTION_MAC = 0xFDE9 )
Variables ¶
This section is empty.
Functions ¶
func CheckDeactivationPin ¶ added in v1.3.5
CheckDeactivationPin checks if deactivation pin is valid
func ConfigureWindowsServiceFailureActions ¶ added in v1.4.0
func ControlSocketName ¶ added in v1.3.6
func ControlSocketName() string
ControlSocketName returns name for control unix socket.
func FlushDNSCache ¶ added in v1.4.0
func FlushDNSCache() error
FlushDNSCache flushes the DNS cache on macOS.
func RunCobraCommand ¶ added in v1.3.1
RunCobraCommand runs ctrld cli.
func RunMobile ¶ added in v1.3.1
func RunMobile(appConfig *AppConfig, appCallback *AppCallback, stopCh chan struct{})
RunMobile runs the ctrld cli on mobile platforms.
func SetMobileNameservers ¶ added in v1.5.11
func SetMobileNameservers(csv string)
SetMobileNameservers makes the comma-separated list csv the OS resolvers, and builds the OS resolver again from them. The app calls it when the network of the device changes. It is safe to call while ctrld runs. A list with no IP address keeps the current OS resolver, because a device without a network reports no nameservers. The next start replaces the list with the nameservers of its AppConfig.
func ValidateDefaultLocalIPsFromDelta ¶ added in v1.4.1
ValidateDefaultLocalIPsFromDelta checks if the default local IPv4 and IPv6 stored are still present in the new network state (provided by delta.New). If a stored default IP is no longer active, it resets that default (sets it to nil) so that it won't be used in subsequent custom dialer contexts. Deprecated: retained for callers of the existing exported cli API. The network monitor uses transition-aware validation instead.
Types ¶
type AppCallback ¶ added in v1.3.1
type AppCallback struct {
HostName func() string
LanIp func() string
MacAddress func() string
// Exit gets a failure line of the run. ctrld calls it before the run
// ends, and the run does not end until Exit returns. So Exit must not
// wait for the run to end: a wait with a timeout stalls the stop until
// the timeout, and a wait with no timeout never ends.
Exit func(error string)
}
AppCallback provides hooks for injecting certain functionalities from mobile platforms to main ctrld cli.
type AppConfig ¶ added in v1.3.1
type AppConfig struct {
CdUID string
ProvisionID string
CustomHostname string
HomeDir string
UpstreamProto string
Verbose int
LogPath string
// Dev makes ctrld use the dev API, like the --dev flag.
Dev bool
// MemoryLimitMiB, if more than 0, is the Go memory limit of the process.
MemoryLimitMiB int
// Nameservers is a comma-separated list of the OS resolvers that the app
// reports. If it is empty, ctrld finds the OS resolvers itself. Each start
// replaces the list that SetMobileNameservers set before it.
Nameservers string
}
AppConfig allows overwriting ctrld cli flags from mobile platforms.
type RecoveryReason ¶ added in v1.4.0
type RecoveryReason int
RecoveryReason provides context for why we are waiting for recovery. recovery involves removing the listener IP from the interface and waiting for the upstreams to work before returning
const ( RecoveryReasonNetworkChange RecoveryReason = iota RecoveryReasonRegularFailure RecoveryReasonOSFailure )
Source Files
¶
- ad_others.go
- api_maintenance.go
- awake_clock_others.go
- cgo.go
- change_logger.go
- cli.go
- commands.go
- commands_diag.go
- config_file_owner_unix.go
- config_file_write.go
- conn.go
- control_client.go
- control_server.go
- ctrld_group.go
- ctrld_group_others.go
- dns.go
- dns64.go
- dns_config.go
- dns_config_others.go
- dns_forwarders_others.go
- dns_intercept_others.go
- dns_intercept_settle.go
- dns_proxy.go
- dns_target.go
- dns_target_diagnostic.go
- dns_target_native.go
- dns_target_service.go
- dns_target_stub.go
- fresh_connection.go
- host_context.go
- hostname.go
- intercept_mode.go
- intercept_probe.go
- intercept_target.go
- internal_domains.go
- lan_name_fallback.go
- lan_name_fallback_others.go
- library.go
- log_budget.go
- log_file.go
- log_header.go
- log_journal.go
- log_path.go
- log_reader.go
- log_redact.go
- log_send.go
- log_send_linux.go
- log_send_other.go
- log_send_transport_unix.go
- log_send_unix.go
- log_tail_follow.go
- log_writer.go
- loop.go
- main.go
- metrics.go
- net_linux.go
- network_delta.go
- network_events.go
- network_manager_linux.go
- network_service_order.go
- network_snapshot.go
- network_snapshot_prog.go
- network_transition.go
- nextdns.go
- nrpt_external_gp.go
- os_linux.go
- os_resolver_stale.go
- pf_diagnostic.go
- pf_diagnostic_log.go
- pf_probe.go
- pf_ruleset.go
- pf_state.go
- prog.go
- prog_linux.go
- prometheus.go
- provision_result.go
- query_error_sampler.go
- query_health.go
- recovery_exemptions.go
- recovery_state.go
- reload_others.go
- resolvconf.go
- resolvconf_not_darwin_unix.go
- route_others.go
- search_domains_unix.go
- self_delete_others.go
- self_kill_unix.go
- self_upgrade_others.go
- selfloop.go
- selfloop_others.go
- sema.go
- service.go
- service_args_others.go
- service_image_path.go
- service_image_path_others.go
- service_others.go
- service_status.go
- suspend_detector.go
- tailscale_localapi.go
- tailscale_localapi_others.go
- tailscale_routes.go
- tunnel_owner.go
- upgrade_rollback.go
- upgrade_version.go
- upstream_monitor.go
- vpn_dns.go