cli

package
v1.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2025 License: MIT Imports: 76 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackupDomainController  = 4
	PrimaryDomainController = 5
)

Domain controller role values from Win32_ComputerSystem https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-computersystem

View Source
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

func CheckDeactivationPin(pin int64, stopCh chan struct{}) int

CheckDeactivationPin checks if deactivation pin is valid

func ConfigureWindowsServiceFailureActions added in v1.4.0

func ConfigureWindowsServiceFailureActions(serviceName string) error

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 Main

func Main()

func RunCobraCommand added in v1.3.1

func RunCobraCommand(cmd *cobra.Command)

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 ValidateDefaultLocalIPsFromDelta added in v1.4.1

func ValidateDefaultLocalIPsFromDelta(newState *netmon.State)

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.

Types

type AppCallback added in v1.3.1

type AppCallback struct {
	HostName   func() string
	LanIp      func() string
	MacAddress func() string
	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
	HomeDir       string
	UpstreamProto string
	Verbose       int
	LogPath       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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL