66class VPN_VPNAPI ClientIfcBase
68 friend class EventMgr;
69 friend class ClientIfcInternal;
74 virtual ~ClientIfcBase();
142 const bool bSensitive =
false) = 0;
144#if defined(PLATFORM_DARWIN)
151#if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK)
152 virtual void CertBannerCB(
const tstring &certBannerSummary,
153 const uint32_t nCertBannerCertLen,
154 const uint8_t *pCertBannerCertDer,
155 const std::list<tstring> &confirmReasons,
156 const std::list<CertConfirmReason> &confirmReasonEnums,
157 bool bImportAllowed =
true) = 0;
176 const int returnCode);
260 const std::list<tstring> &rltstrCertErrors,
261 bool bAllowImport) = 0;
263#if defined(PLATFORM_WIN_APP)
268 const std::list<tstring> &rltstrCertErrors,
269 const std::vector<uint8_t> &rvServerCertDER,
270 bool bAllowImport) = 0;
288#if defined(MANUAL_PKCS12_IMPORT_SUPPORTED)
289 virtual void ImportPKCS12ResultCB(
const std::vector<uint8_t> &certHash,
292#if defined(PLATFORM_ANDROID)
293 virtual void ClientCertificateCB(std::vector< std::pair<uint32_t, uint8_t*> > certList) = 0;
294 virtual void AgentDetachedCB();
297#if defined(VPNAPI_EVENT_NOTIFICATION_SUPPORTED)
301 virtual void EventNotificationInternalCB(
302 const std::shared_ptr<CEventNotificationTlv>& spEventNtfctnTlv) = 0;
311 void ClientIfcTransmigration();
315 bool attach(
const ClientType clientType = ClientType_GUI,
316 const bool requestFullCapabilities =
true,
317 const bool suppressAutoConnect =
true,
318 const bool bSuppressEventAvailableCB =
false);
322 void ProcessEvents();
324 bool hasFullCapabilities();
326 bool isConnected(
bool bSilent =
false);
330 std::list<tstring> getHostNames();
332 std::list<HostEntry> getHostEntries();
337#
if defined(HOST_DATA_SUPPORTED)
338 const IHostData& host);
344#
if defined(HOST_DATA_SUPPORTED)
345 const IHostData& host,
349 unsigned int origin);
351 bool setNewTunnelGroup(
const tstring & group);
367 STATE getCurrentState();
374 NETENV_STATE netEnvState = NES_NETWORK_ACCESSIBLE,
377 void setNetworkStates(NETENV_STATE netEnvState,
378 NETCTRL_STATE netCtrlState,
379 NETWORK_TYPE netType,
380 bool bACBrowserForCPRemediation,
382 void refreshOperatingModeForCurrentNetStates();
383 NETENV_STATE getCurrentNetEnvState();
384 NETENV_STATE getPreviousNetEnvState();
385 NETCTRL_STATE getCurrentNetCtrlState();
386 NETWORK_TYPE getCurrentNetType();
387 bool isACBrowserForCPRemediation();
389 static tstring getNetCtrlText(NETCTRL_STATE netCtrlState);
390 static tstring getNetEnvText(NETENV_STATE netEnvState,
391 bool bSimple =
false);
392 static tstring getNetTypeText(NETWORK_TYPE netType);
393 static tstring getQuarantinedStatusText();
394 static tstring getNetworkStatusSimpleText(
const NETENV_STATE netEnvState,
395 const NETCTRL_STATE netCtrlState);
400 const NETENV_STATE netEnvState,
401 const NETCTRL_STATE netCtrlState);
405 bool savePreferences();
413 void setBanner(
const tstring &banner);
414 void setBannerResponse(
bool bResponse);
416 void setPreConnectReminder(
const tstring &tstrPreConnectReminder);
417 void setPreConnectReminderResponse();
419 bool getUserResponse();
420 bool isUserResponseSet();
422 void setCertBlocked(
const tstring &tstrUntrustedServer);
423 void setCertWarning(
const tstring &rtstrUntrustedServer,
424 const std::list<tstring> &rltstrCertErrors,
426#if defined(PLATFORM_WIN_APP)
427 void setCertWarning(
const tstring &rtstrUntrustedServer,
428 const std::list<tstring> &rltstrCertErrors,
429 const std::vector<uint8_t>& rvServerCertDER,
432 bool getCertImportResponse();
434#if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK)
435 void setCertBanner(
tstring tstrCertBannerSummary,
436 uint32_t nCertBannerCertLen,
437 const uint8_t *pCertBannerCertDer,
438 const std::list<tstring> &confirmReasons,
439 const std::list<CertConfirmReason> &confirmReasonEnums,
440 bool bImportAllowed);
442 void setCertBannerResponse(
bool bResponse,
bool bImportCert);
443 void importServerCert(std::vector<uint8_t> certData);
444 bool setFipsMode(
bool bEnableFips);
445#if defined(PLATFORM_ANDROID)
446 bool setStrictMode(
bool bEnableStrictMode);
447 bool setRevocationEnabled(
bool bRevocationEnabled);
448 bool IsRevocationEnabled();
454#if defined(PLATFORM_ANDROID)
455 void setClientCertResponse(std::vector< std::pair<uint32_t, uint8_t*> > &derList);
456 void setAgentDetached();
457 bool getClientCertificates();
460#if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID)
461 void setSCEPEnrollInProgress(
bool bInProgress);
462 bool isSCEPEnrollInProgress();
465#if defined(MANUAL_PKCS12_IMPORT_SUPPORTED)
466 void setImportPKCS12Result(
const std::vector<uint8_t> &certHash,
const tstring &tstrError);
467 bool requestImportPKCS12(
const std::vector<uint8_t> &data);
468 std::vector<uint8_t> importPKCS12WithPassword(
const std::vector<uint8_t> &data,
const tstring &password);
471 void setCertBlockedResponse(
bool bUnlock);
472 void setCertWarningResponse(
bool bConnect,
bool bImportCert);
476 void ExitNotice(
const tstring &tstrNotice,
const int code = 0);
478 void notice(
const tstring &tstrNotice,
480 bool bClearLastMsg =
false,
482 bool bStateMsg =
false,
483 bool bSensitiveMsg =
false);
485 void notice(MsgWithArg ¬ice,
487 bool bClearLastMsg =
false,
489 bool bStateMsg =
false,
490 bool bSensitiveMsg =
false);
496 void exportStats(
const tstring &tstrFilePath);
505 bool bUpdateStateMsg =
true,
506 bool bOnlyUpdateUI =
false);
508#if defined(PLATFORM_DARWIN)
512#if defined(PROGRAM_DATA_IMPORT_SUPPORTED)
513 IACImporterAsync *createACImporter(IACImporterAsyncCB *pCallback);
516 void setWMHint(
WMHint hint,
525 bool CanRemediateCaptivePortal();
526 bool policyAllowsCaptivePortalRemediation();
528 bool isEventShutdown();
530 bool isUsingEventModel();
532 time_t getLastDisconnectTime();
535 void resetConnectPromptPasswordData();
537 void setStandaloneConnection(
bool isStandalone);
539 void deliverActiveHost(
const tstring &activeHost,
540 ConnectProtocolType vpnProtocol = PROTOCOL_TYPE_UNKNOWN,
541 bool bActiveHostFriendlyName =
false);
543 bool isVPNServiceReady();
547 void resetLastDisconnectTime(time_t time = 1);
549 void processMinimize();
552 void setEnrollClientCert(CertObj* pCert);
556 void linuxCertImportWarnUser();
560 void linuxCertImportWarnUserResponse(
bool bAccept);
562 void setDefaultHost(
tstring &host);
564#if defined(HOST_DATA_SUPPORTED)
565 void setDefaultHostProfile(
const IHostData &hostProfile);
566 IHostData* getDefaultHostData();
569 void setLastVpnError(
VPNError vpnError);
572#if defined(PLATFORM_ANDROID)
573 bool requestClientCertificates();
576 bool requestImportLocalization(
const tstring tstrLocale,
577 const std::vector<unsigned char> &MoFileData);
580 void startAHS(
const unsigned int uiReason,
581 const ProxyIfc& proxy);
585 void AHSSelectedHost(
const unsigned int uiReason,
586 const std::vector<tstring> &headendList,
587 const long statusReturnCode,
589 std::vector<tstring> getAHSHostList();
590 unsigned int getAHSState();
592 bool IsAHSCachingRestricted();
594 bool suppressConnectionErrorPopups();
596 tstring getCaptivePortalDetectedMsg();
598 void setProxyAuthPrompts(ProxyIfc* pProxy,
601#if defined(INTERPROCESS_COMMUNICATION_SUPPORTED)
602 bool handleIpcMessage(CIpcMessage *pIpcMessage);
603#if defined(VPNAPI_EVENT_NOTIFICATION_SUPPORTED)
604 void eventNotification(
const int &eventCode);
605 void signalDisconnectedToEventNtfctnThread();
608 bool IsCsdTokenVerified()
const;
610#if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID)
611 virtual void SCEPEnrollStartCB();
612 virtual void SCEPEnrollExitCB();
615 void activateConnectMgrTunnelInitiationCompletionEvent();
616 bool isConnectRequestActive();
617 bool isConnectRequestCleanup();
618#if defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK)
619 bool deleteProfileByName(
const tstring &profileName);
621 bool importProfile(
const tstring &profileName,
const tstring &profileContents);
624 bool syncProfileChange(
const tstring &profileName);
626#if defined(CREDENTIAL_PREFILL_SUPPORTED)
627 bool hasPrefilledCredentials();
629 void setPrefilledCredentials(CredentialPrefill *prefill);
632#if defined(PLATFORM_ANDROID) || defined(PLATFORM_APPLE_SSLVPN)
633 std::list<ManagedCertificate *> enumerateCertificates(CertificateType certType);
634 bool deleteCertificates(CertificateType certType,
const std::list<std::string> &idList);
635 bool deleteServerCertificates(
const std::list<std::string> &idList);
638#if defined(ANYCONNECT_USE_SNAK) && !defined(PLATFORM_WIN_APP)
639 std::list<ManagedCertificate *> enumerateSNAKCertificates(SNAK_CertType certType);
640 SNAK_CertType getSNAKCertType(CertificateType certType);
641 bool deleteClientCertificates(
const std::list<std::string> &idList);
644#if defined(PLATFORM_APPLE_SSLVPN)
645 bool canUseBackupServers();
650 tstring getMgmtTunnelHostname();
652 VPN_TUNNEL_SCOPE getVpnTunnelScope();
654 bool isStandaloneConnection();
658 void setExternalSSOLogoutUrlFromAgent(
const tstring& logoutUrl);
666#if defined(VPNAPI_TRANSMIGRATION_SUPPORTED)
667 std::shared_ptr<CSharedAccessLock> m_spClientIfcInternalPtrSharedAccessLock;
669 std::unique_ptr<ClientIfcInternal> m_upClientIfcInternal;
678 ClientIfcBase(
const ClientIfcBase& other);
679 ClientIfcBase& operator=(
const ClientIfcBase& other);