Documentation ¶
Index ¶
- Constants
- Variables
- func AddMetrics(id *Id)
- func Clean(src *Id) dto.Identity
- func CleanUpZitiTUNAdapters(tunName string)
- func EnsurePermissions(group string) string
- func IpcPipeName() string
- func ResetFrequency(newFrequency int)
- func SubMain(ops chan string, changes chan<- svc.Status, winEvents <-chan WindowsEvents) error
- func UpdateRuntimeStateIpv4(ip string, ipv4Mask int, addDns string, apiPageSize int) error
- type Id
- type Pipes
- type RuntimeState
- func (t *RuntimeState) AddRoute(destination net.IPNet, nextHop net.IP, metric uint32) error
- func (t *RuntimeState) BroadcastEvent(event interface{})
- func (t *RuntimeState) Close()
- func (t *RuntimeState) CreateTun(ipv4 string, ipv4mask int, applyDns bool) (net.IP, *tun.Device, error)
- func (t *RuntimeState) Find(fingerprint string) *Id
- func (t *RuntimeState) InterceptDNS()
- func (t *RuntimeState) InterceptIP()
- func (t *RuntimeState) LoadConfig()
- func (t *RuntimeState) LoadIdentity(id *Id, refreshInterval int)
- func (t *RuntimeState) ReleaseDNS()
- func (t *RuntimeState) ReleaseIP()
- func (t *RuntimeState) RemoveByFingerprint(fingerprint string)
- func (t *RuntimeState) RemoveRoute(destination net.IPNet, nextHop net.IP) error
- func (t *RuntimeState) RemoveZitiTun()
- func (t *RuntimeState) SaveState()
- func (t *RuntimeState) SetNotified(fingerprint string, notified bool)
- func (t *RuntimeState) ToMetrics() dto.TunnelStatus
- func (t *RuntimeState) ToStatus(onlyInitialized bool) dto.TunnelStatus
- func (t *RuntimeState) UpdateControllerAddress(configFile string, newAddress string)
- func (t *RuntimeState) UpdateIpv4(ipv4 string)
- func (t *RuntimeState) UpdateIpv4Mask(ipv4mask int)
- func (t *RuntimeState) UpdateMfa(fingerprint string, mfaEnabled bool, mfaNeeded bool)
- func (t *RuntimeState) UpdateNotificationFrequency(notificationFreq int) error
- type WindowsEvents
Constants ¶
View Source
const ( API_VERSION = 1 SUCCESS = 0 COULD_NOT_WRITE_FILE = 1 COULD_NOT_ENROLL = 2 UNKNOWN_ERROR = 100 ERROR = 500 ERROR_DISCONNECTING_ID = 50 IDENTITY_NOT_FOUND = 1000 MFA_FAILED_TO_GENERATE_CODES = 200 MFA_FAILED_TO_RETURN_CODES = 201 MFA_FINGERPRINT_NOT_FOUND = 202 DEFAULT_REFRESH_INTERVAL = 10 InformationEvent = 0 //1 ContinueEvent = 0 //2 PauseEvent = 0 //3 InstallEvent = 0 //4 InterrogateEvent = 0 //5 StopEvent = 0 //6 ShutdownEvent = 0 //7 ErrorEvent = 0 //1000 // power events microsoft docs https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-powermanagementevent?redirectedfrom=MSDN PBT_APMSUSPEND = 4 // Entering Suspend PBT_APMRESUMESUSPEND = 7 // Resume from Suspend PBT_APMPOWERSTATUSCHANGE = 10 // Power Status Change PBT_APMRESUMEAUTOMATIC = 18 // Resume Automatic // windows session changes microsoft docs https://docs.microsoft.com/en-us/windows/win32/termserv/wm-wtssession-change WTS_SESSION_LOCK = 7 WTS_SESSION_UNLOCK = 8 // This is the name you will use for the NET START command SvcStartName = "ziti" // This is the name that will appear in the Services control panel SvcName = "Ziti Tunneler" // This is the longer description that will be shown in Services SvcNameLong = "Provides a client for accessing Ziti networks" // see: https://docs.microsoft.com/en-us/windows/win32/secauthz/sid-strings // breaks down to // "allow" - A (A;; // "full access" - FA (A;;FA // "well-known sid" - IU (A;;FA;;;IU) InteractivelyLoggedInUser = "(A;;GRGW;;;IU)" //generic read/write. We will want to tune this to a specific group but that is not working with Windows 10 home at the moment System = "(A;;FA;;;SY)" BuiltinAdmins = "(A;;FA;;;BA)" LocalService = "(A;;FA;;;LS)" NF_GROUP_NAME = "NetFoundry Tunneler Users" TunName = "ZitiTUN" STATUS_ENROLLED = "enrolled" ConfigFileName = "config.json" )
Variables ¶
View Source
var Debug bool
View Source
var TunStarted time.Time
View Source
var Version dto.ServiceVersion
Functions ¶
func AddMetrics ¶
func AddMetrics(id *Id)
func CleanUpZitiTUNAdapters ¶
func CleanUpZitiTUNAdapters(tunName string)
func EnsurePermissions ¶
func IpcPipeName ¶
func IpcPipeName() string
func ResetFrequency ¶
func ResetFrequency(newFrequency int)
Types ¶
type RuntimeState ¶
type RuntimeState struct {
// contains filtered or unexported fields
}
func (*RuntimeState) BroadcastEvent ¶
func (t *RuntimeState) BroadcastEvent(event interface{})
func (*RuntimeState) Close ¶
func (t *RuntimeState) Close()
func (*RuntimeState) Find ¶
func (t *RuntimeState) Find(fingerprint string) *Id
func (*RuntimeState) InterceptDNS ¶
func (t *RuntimeState) InterceptDNS()
func (*RuntimeState) InterceptIP ¶
func (t *RuntimeState) InterceptIP()
func (*RuntimeState) LoadConfig ¶
func (t *RuntimeState) LoadConfig()
func (*RuntimeState) LoadIdentity ¶
func (t *RuntimeState) LoadIdentity(id *Id, refreshInterval int)
func (*RuntimeState) ReleaseDNS ¶
func (t *RuntimeState) ReleaseDNS()
func (*RuntimeState) ReleaseIP ¶
func (t *RuntimeState) ReleaseIP()
func (*RuntimeState) RemoveByFingerprint ¶
func (t *RuntimeState) RemoveByFingerprint(fingerprint string)
func (*RuntimeState) RemoveRoute ¶
func (*RuntimeState) RemoveZitiTun ¶
func (t *RuntimeState) RemoveZitiTun()
func (*RuntimeState) SaveState ¶
func (t *RuntimeState) SaveState()
func (*RuntimeState) SetNotified ¶
func (t *RuntimeState) SetNotified(fingerprint string, notified bool)
func (*RuntimeState) ToMetrics ¶
func (t *RuntimeState) ToMetrics() dto.TunnelStatus
func (*RuntimeState) ToStatus ¶
func (t *RuntimeState) ToStatus(onlyInitialized bool) dto.TunnelStatus
func (*RuntimeState) UpdateControllerAddress ¶
func (t *RuntimeState) UpdateControllerAddress(configFile string, newAddress string)
func (*RuntimeState) UpdateIpv4 ¶
func (t *RuntimeState) UpdateIpv4(ipv4 string)
func (*RuntimeState) UpdateIpv4Mask ¶
func (t *RuntimeState) UpdateIpv4Mask(ipv4mask int)
func (*RuntimeState) UpdateMfa ¶
func (t *RuntimeState) UpdateMfa(fingerprint string, mfaEnabled bool, mfaNeeded bool)
func (*RuntimeState) UpdateNotificationFrequency ¶
func (t *RuntimeState) UpdateNotificationFrequency(notificationFreq int) error
type WindowsEvents ¶
Click to show internal directories.
Click to hide internal directories.