66class VPN_VPNAPI ClientIfcBase
68 friend class EventMgr;
69 friend class ClientIfcInternal;
74 virtual ~ClientIfcBase();
143 const bool bSensitive =
false) = 0;
145#if defined(PLATFORM_DARWIN)
152#if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK)
153 virtual void CertBannerCB(
const tstring &certBannerSummary,
154 const uint32_t nCertBannerCertLen,
155 const uint8_t *pCertBannerCertDer,
156 const std::list<tstring> &confirmReasons,
157 const std::list<CertConfirmReason> &confirmReasonEnums,
158 bool bImportAllowed =
true) = 0;
177 const int returnCode);
261 const std::list<tstring> &rltstrCertErrors,
262 bool bAllowImport) = 0;
264#if defined(PLATFORM_WIN_APP)
269 const std::list<tstring> &rltstrCertErrors,
270 const std::vector<uint8_t> &rvServerCertDER,
271 bool bAllowImport) = 0;
289#if defined(MANUAL_PKCS12_IMPORT_SUPPORTED)
290 virtual void ImportPKCS12ResultCB(
const std::vector<uint8_t> &certHash,
293#if defined(PLATFORM_ANDROID)
294 virtual void ClientCertificateCB(std::vector< std::pair<uint32_t, uint8_t*> > certList) = 0;
295 virtual void AgentDetachedCB();
298#if defined(VPNAPI_EVENT_NOTIFICATION_SUPPORTED)
302 virtual void EventNotificationInternalCB(
303 const std::shared_ptr<CEventNotificationTlv>& spEventNtfctnTlv) = 0;
313 void ClientIfcTransmigration();
317 bool attach(
const ClientType clientType = ClientType_GUI,
318 const bool requestFullCapabilities =
true,
319 const bool suppressAutoConnect =
true,
320 const bool bSuppressEventAvailableCB =
false);
324 void ProcessEvents();
326 bool hasFullCapabilities();
328 bool isConnected(
bool bSilent =
false);
332 std::list<tstring> getHostNames();
334 std::list<HostEntry> getHostEntries();
339#
if defined(HOST_DATA_SUPPORTED)
340 const IHostData& host);
346#
if defined(HOST_DATA_SUPPORTED)
347 const IHostData& host,
351 unsigned int origin);
353 bool setNewTunnelGroup(
const tstring & group);
369 STATE getCurrentState();
376 NETENV_STATE netEnvState = NES_NETWORK_ACCESSIBLE,
379 void setNetworkStates(NETENV_STATE netEnvState,
380 NETCTRL_STATE netCtrlState,
381 NETWORK_TYPE netType,
382 bool bACBrowserForCPRemediation,
384 void refreshOperatingModeForCurrentNetStates();
385 NETENV_STATE getCurrentNetEnvState();
386 NETENV_STATE getPreviousNetEnvState();
387 NETCTRL_STATE getCurrentNetCtrlState();
388 NETWORK_TYPE getCurrentNetType();
389 bool isACBrowserForCPRemediation();
391 static tstring getNetCtrlText(NETCTRL_STATE netCtrlState);
392 static tstring getNetEnvText(NETENV_STATE netEnvState,
393 bool bSimple =
false);
394 static tstring getNetTypeText(NETWORK_TYPE netType);
395 static tstring getQuarantinedStatusText();
396 static tstring getNetworkStatusSimpleText(
const NETENV_STATE netEnvState,
397 const NETCTRL_STATE netCtrlState);
402 const NETENV_STATE netEnvState,
403 const NETCTRL_STATE netCtrlState);
407 bool savePreferences();
415 void setBanner(
const tstring &banner);
416 void setBannerResponse(
bool bResponse);
418 void setPreConnectReminder(
const tstring &tstrPreConnectReminder);
419 void setPreConnectReminderResponse();
421 bool getUserResponse();
422 bool isUserResponseSet();
424 void setCertBlocked(
const tstring &tstrUntrustedServer);
425 void setCertWarning(
const tstring &rtstrUntrustedServer,
426 const std::list<tstring> &rltstrCertErrors,
428#if defined(PLATFORM_WIN_APP)
429 void setCertWarning(
const tstring &rtstrUntrustedServer,
430 const std::list<tstring> &rltstrCertErrors,
431 const std::vector<uint8_t>& rvServerCertDER,
434 bool getCertImportResponse();
436#if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK)
437 void setCertBanner(
tstring tstrCertBannerSummary,
438 uint32_t nCertBannerCertLen,
439 const uint8_t *pCertBannerCertDer,
440 const std::list<tstring> &confirmReasons,
441 const std::list<CertConfirmReason> &confirmReasonEnums,
442 bool bImportAllowed);
444 void setCertBannerResponse(
bool bResponse,
bool bImportCert);
445 void importServerCert(std::vector<uint8_t> certData);
446 bool setFipsMode(
bool bEnableFips);
447#if defined(PLATFORM_ANDROID)
448 bool setStrictMode(
bool bEnableStrictMode);
449 bool setRevocationEnabled(
bool bRevocationEnabled);
450 bool IsRevocationEnabled();
456#if defined(PLATFORM_ANDROID)
457 void setClientCertResponse(std::vector< std::pair<uint32_t, uint8_t*> > &derList);
458 void setAgentDetached();
459 bool getClientCertificates();
462#if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID)
463 void setSCEPEnrollInProgress(
bool bInProgress);
464 bool isSCEPEnrollInProgress();
467#if defined(MANUAL_PKCS12_IMPORT_SUPPORTED)
468 void setImportPKCS12Result(
const std::vector<uint8_t> &certHash,
const tstring &tstrError);
469 bool requestImportPKCS12(
const std::vector<uint8_t> &data);
470 std::vector<uint8_t> importPKCS12WithPassword(
const std::vector<uint8_t> &data,
const tstring &password);
473 void setCertBlockedResponse(
bool bUnlock);
474 void setCertWarningResponse(
bool bConnect,
bool bImportCert);
478 void ExitNotice(
const tstring &tstrNotice,
const int code = 0);
480 void notice(
const tstring &tstrNotice,
482 bool bClearLastMsg =
false,
484 bool bStateMsg =
false,
485 bool bSensitiveMsg =
false);
487 void notice(MsgWithArg ¬ice,
489 bool bClearLastMsg =
false,
491 bool bStateMsg =
false,
492 bool bSensitiveMsg =
false);
498 void exportStats(
const tstring &tstrFilePath);
507 bool bUpdateStateMsg =
true,
508 bool bOnlyUpdateUI =
false);
510#if defined(PLATFORM_DARWIN)
514#if defined(PROGRAM_DATA_IMPORT_SUPPORTED)
515 IACImporterAsync *createACImporter(IACImporterAsyncCB *pCallback);
518 void setWMHint(
WMHint hint,
527 bool CanRemediateCaptivePortal();
528 bool policyAllowsCaptivePortalRemediation();
530 bool isEventShutdown();
532 bool isUsingEventModel();
534 time_t getLastDisconnectTime();
537 void resetConnectPromptPasswordData();
539 void setStandaloneConnection(
bool isStandalone);
541 void deliverActiveHost(
const tstring &activeHost,
542 ConnectProtocolType vpnProtocol = PROTOCOL_TYPE_UNKNOWN,
543 bool bActiveHostFriendlyName =
false);
545 bool isVPNServiceReady();
549 void resetLastDisconnectTime(time_t time = 1);
551 void processMinimize();
554 void setEnrollClientCert(CertObj* pCert);
558 void linuxCertImportWarnUser();
562 void linuxCertImportWarnUserResponse(
bool bAccept);
564 void setDefaultHost(
tstring &host);
566#if defined(HOST_DATA_SUPPORTED)
567 void setDefaultHostProfile(
const IHostData &hostProfile);
568 IHostData* getDefaultHostData();
571 void setLastVpnError(
VPNError vpnError);
574#if defined(PLATFORM_ANDROID)
575 bool requestClientCertificates();
578 bool requestImportLocalization(
const tstring tstrLocale,
579 const std::vector<unsigned char> &MoFileData);
582 void startAHS(
const unsigned int uiReason,
583 const ProxyIfc& proxy);
587 void AHSSelectedHost(
const unsigned int uiReason,
588 const std::vector<tstring> &headendList,
589 const long statusReturnCode,
591 std::vector<tstring> getAHSHostList();
592 unsigned int getAHSState();
594 bool IsAHSCachingRestricted();
596 bool suppressConnectionErrorPopups();
598 tstring getCaptivePortalDetectedMsg();
600 void setProxyAuthPrompts(ProxyIfc* pProxy,
603#if defined(INTERPROCESS_COMMUNICATION_SUPPORTED)
604 bool handleIpcMessage(CIpcMessage *pIpcMessage);
605#if defined(VPNAPI_EVENT_NOTIFICATION_SUPPORTED)
606 void signalDisconnectedToEventNtfctnThread();
609 bool IsCsdTokenVerified()
const;
611#if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID)
612 virtual void SCEPEnrollStartCB();
613 virtual void SCEPEnrollExitCB();
616 void activateConnectMgrTunnelInitiationCompletionEvent();
617 bool isConnectRequestActive();
618 bool isConnectRequestCleanup();
619#if defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK)
620 bool deleteProfileByName(
const tstring &profileName);
622 bool importProfile(
const tstring &profileName,
const tstring &profileContents);
625 bool syncProfileChange(
const tstring &profileName);
627#if defined(CREDENTIAL_PREFILL_SUPPORTED)
628 bool hasPrefilledCredentials();
630 void setPrefilledCredentials(CredentialPrefill *prefill);
633#if defined(PLATFORM_ANDROID) || defined(PLATFORM_APPLE_SSLVPN)
634 std::list<ManagedCertificate *> enumerateCertificates(CertificateType certType);
635 bool deleteCertificates(CertificateType certType,
const std::list<std::string> &idList);
636 bool deleteServerCertificates(
const std::list<std::string> &idList);
639#if defined(ANYCONNECT_USE_SNAK) && !defined(PLATFORM_WIN_APP)
640 std::list<ManagedCertificate *> enumerateSNAKCertificates(SNAK_CertType certType);
641 SNAK_CertType getSNAKCertType(CertificateType certType);
642 bool deleteClientCertificates(
const std::list<std::string> &idList);
645#if defined(PLATFORM_APPLE_SSLVPN)
646 bool canUseBackupServers();
651 tstring getMgmtTunnelHostname();
653 VPN_TUNNEL_SCOPE getVpnTunnelScope();
655 bool isStandaloneConnection();
659 void setExternalSSOLogoutUrlFromAgent(
const tstring& logoutUrl);
667#if defined(VPNAPI_TRANSMIGRATION_SUPPORTED)
668 std::shared_ptr<CSharedAccessLock> m_spClientIfcInternalPtrSharedAccessLock;
670 std::unique_ptr<ClientIfcInternal> m_upClientIfcInternal;
679 ClientIfcBase(
const ClientIfcBase& other);
680 ClientIfcBase& operator=(
const ClientIfcBase& other);