Documentation ¶
Index ¶
- type Protocol
- func (p *Protocol) OnAccountStatus(sessionToken string, accountInfo preferences.AccountStatus)
- func (p *Protocol) OnDNSChanged(dns net.IP)
- func (p *Protocol) OnKillSwitchStateChanged()
- func (p *Protocol) OnPingStatus(retMap map[string]int)
- func (p *Protocol) OnServiceSessionChanged()
- func (p *Protocol) OnWiFiChanged(ssid string, isInsecureNetwork bool)
- func (p *Protocol) Start(secret uint64, startedOnPort chan<- int, service Service) error
- func (p *Protocol) Stop()
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Protocol ¶
type Protocol struct {
// contains filtered or unexported fields
}
Protocol - TCP interface to communicate with IVPN application
func CreateProtocol ¶
CreateProtocol - Create new protocol object
func (*Protocol) OnAccountStatus ¶
func (p *Protocol) OnAccountStatus(sessionToken string, accountInfo preferences.AccountStatus)
OnAccountStatus - handler of account status info. Notifying clients.
func (*Protocol) OnDNSChanged ¶
OnDNSChanged - DNS changed handler
func (*Protocol) OnKillSwitchStateChanged ¶
func (p *Protocol) OnKillSwitchStateChanged()
OnKillSwitchStateChanged - Firewall change handler
func (*Protocol) OnPingStatus ¶
OnPingStatus - servers ping status
func (*Protocol) OnServiceSessionChanged ¶
func (p *Protocol) OnServiceSessionChanged()
OnServiceSessionChanged - SessionChanged handler
func (*Protocol) OnWiFiChanged ¶
OnWiFiChanged - handler of WiFi status change. Notifying clients.
type Service ¶
type Service interface { // OnControlConnectionClosed - Perform reqired operations when protocol (controll channel with UI application) was closed // (for example, we must disable firewall (if it not persistant)) // Must be called by protocol object // Return parameters: // - isServiceMustBeClosed: true informing that service have to be closed ("Stop IVPN Agent when application is not running" feature) // - err: error OnControlConnectionClosed() (isServiceMustBeClosed bool, err error) // GetDisabledFunctions returns info about functions which are disabled // Some functionality can be not accessible // It can happen, for example, if some external binaries not installed // (e.g. obfsproxy or WireGuard on Linux) GetDisabledFunctions() (wgErr, ovpnErr, obfspErr error) ServersList() (*apitypes.ServersInfoResponse, error) PingServers(retryCount int, timeoutMs int) (map[string]int, error) ServersUpdateNotifierChannel() chan struct{} APIRequest(apiAlias string) (responseData []byte, err error) KillSwitchState() (isEnabled, isPersistant, isAllowLAN, isAllowLanMulticast bool, err error) SetKillSwitchState(bool) error SetKillSwitchIsPersistent(isPersistant bool) error SetKillSwitchAllowLANMulticast(isAllowLanMulticast bool) error SetKillSwitchAllowLAN(isAllowLan bool) error Preferences() preferences.Preferences SetPreference(key string, val string) error SetManualDNS(dns net.IP) error ResetManualDNS() error ConnectOpenVPN(connectionParams openvpn.ConnectionParams, manualDNS net.IP, firewallOn bool, firewallDuringConnection bool, stateChan chan<- vpn.StateInfo) error ConnectWireGuard(connectionParams wireguard.ConnectionParams, manualDNS net.IP, firewallOn bool, firewallDuringConnection bool, stateChan chan<- vpn.StateInfo) error Disconnect() error Connected() bool Pause() error Resume() error IsPaused() bool SessionNew(accountID string, forceLogin bool, captchaID string, captcha string, confirmation2FA string) ( apiCode int, apiErrorMsg string, accountInfo preferences.AccountStatus, rawResponse string, err error) SessionDelete() error RequestSessionStatus() ( apiCode int, apiErrorMsg string, sessionToken string, accountInfo preferences.AccountStatus, err error) WireGuardGenerateKeys(updateIfNecessary bool) error WireGuardSetKeysRotationInterval(interval int64) GetWiFiCurrentState() (ssid string, isInsecureNetwork bool) GetWiFiAvailableNetworks() []string }
Service - service interface
Click to show internal directories.
Click to hide internal directories.