63class VPN_VPNAPI ClientIfcBase
65 friend class EventMgr;
66 friend class ClientIfcInternal;
71 virtual ~ClientIfcBase();
140 const bool bSensitive =
false) = 0;
142#if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK)
143 virtual void CertBannerCB(
const tstring &certBannerSummary,
144 const uint32_t nCertBannerCertLen,
145 const uint8_t *pCertBannerCertDer,
146 const std::list<tstring> &confirmReasons,
147 const std::list<CertConfirmReason> &confirmReasonEnums,
148 bool bImportAllowed =
true) = 0;
167 const int returnCode);
251 const std::list<tstring> &rltstrCertErrors,
252 bool bAllowImport) = 0;
254#if defined(PLATFORM_WIN_APP)
259 const std::list<tstring> &rltstrCertErrors,
260 const std::vector<uint8_t> &rvServerCertDER,
261 bool bAllowImport) = 0;
279#if defined(MANUAL_PKCS12_IMPORT_SUPPORTED)
280 virtual void ImportPKCS12ResultCB(
const std::vector<uint8_t> &certHash,
283#if defined(PLATFORM_ANDROID)
284 virtual void ClientCertificateCB(std::vector< std::pair<uint32_t, uint8_t*> > certList) = 0;
285 virtual void AgentDetachedCB();
288#if defined(VPNAPI_EVENT_NOTIFICATION_SUPPORTED)
293 const std::shared_ptr<CEventNotificationTlv>& spEventNtfctnTlv) = 0;
303 void ClientIfcTransmigration();
307 bool attach(
const ClientType clientType = ClientType_GUI,
308 const bool requestFullCapabilities =
true,
309 const bool suppressAutoConnect =
true,
310 const bool bSuppressEventAvailableCB =
false);
314 void ProcessEvents();
316 bool hasFullCapabilities();
318 bool isConnected(
bool bSilent =
false);
322 std::list<tstring> getHostNames();
324 std::list<HostEntry> getHostEntries();
329#
if defined(HOST_DATA_SUPPORTED)
330 const IHostData& host);
336#
if defined(HOST_DATA_SUPPORTED)
337 const IHostData& host,
341 unsigned int origin);
343 bool setNewTunnelGroup(
const tstring & group);
357 STATE getCurrentState();
364 NETENV_STATE netEnvState = NES_NETWORK_ACCESSIBLE,
367 void setNetworkStates(NETENV_STATE netEnvState,
368 NETCTRL_STATE netCtrlState,
369 NETWORK_TYPE netType,
370 bool bACBrowserForCPRemediation,
372 void refreshOperatingModeForCurrentNetStates();
373 NETENV_STATE getCurrentNetEnvState();
374 NETENV_STATE getPreviousNetEnvState();
375 NETCTRL_STATE getCurrentNetCtrlState();
376 NETWORK_TYPE getCurrentNetType();
377 bool isACBrowserForCPRemediation();
379 static tstring getNetCtrlText(NETCTRL_STATE netCtrlState);
380 static tstring getNetEnvText(NETENV_STATE netEnvState,
381 bool bSimple =
false);
382 static tstring getNetTypeText(NETWORK_TYPE netType);
383 static tstring getQuarantinedStatusText();
384 static tstring getNetworkStatusSimpleText(
const NETENV_STATE netEnvState,
385 const NETCTRL_STATE netCtrlState);
390 const NETENV_STATE netEnvState,
391 const NETCTRL_STATE netCtrlState);
395 bool savePreferences();
403 void setBanner(
const tstring &banner);
404 void setBannerResponse(
bool bResponse);
406 void setPreConnectReminder(
const tstring &tstrPreConnectReminder);
407 void setPreConnectReminderResponse();
409 bool getUserResponse();
410 bool isUserResponseSet();
412 void setCertBlocked(
const tstring &tstrUntrustedServer);
413 void setCertWarning(
const tstring &rtstrUntrustedServer,
414 const std::list<tstring> &rltstrCertErrors,
416#if defined(PLATFORM_WIN_APP)
417 void setCertWarning(
const tstring &rtstrUntrustedServer,
418 const std::list<tstring> &rltstrCertErrors,
419 const std::vector<uint8_t>& rvServerCertDER,
422 bool getCertImportResponse();
424#if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK)
425 void setCertBanner(
tstring tstrCertBannerSummary,
426 uint32_t nCertBannerCertLen,
427 const uint8_t *pCertBannerCertDer,
428 const std::list<tstring> &confirmReasons,
429 const std::list<CertConfirmReason> &confirmReasonEnums,
430 bool bImportAllowed);
432 void setCertBannerResponse(
bool bResponse,
bool bImportCert);
433 void importServerCert(std::vector<uint8_t> certData);
434 bool setFipsMode(
bool bEnableFips);
435#if defined(PLATFORM_ANDROID)
436 bool setStrictMode(
bool bEnableStrictMode);
437 bool setRevocationEnabled(
bool bRevocationEnabled);
438 bool IsRevocationEnabled();
444#if defined(PLATFORM_ANDROID)
445 void setClientCertResponse(std::vector< std::pair<uint32_t, uint8_t*> > &derList);
446 void setAgentDetached();
447 bool getClientCertificates();
450#if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID)
451 void setSCEPEnrollInProgress(
bool bInProgress);
452 bool isSCEPEnrollInProgress();
455#if defined(MANUAL_PKCS12_IMPORT_SUPPORTED)
456 void setImportPKCS12Result(
const std::vector<uint8_t> &certHash,
const tstring &tstrError);
457 bool requestImportPKCS12(
const std::vector<uint8_t> &data);
458 std::vector<uint8_t> importPKCS12WithPassword(
const std::vector<uint8_t> &data,
const tstring &password);
461 void setCertBlockedResponse(
bool bUnlock);
462 void setCertWarningResponse(
bool bConnect,
bool bImportCert);
466 void ExitNotice(
const tstring &tstrNotice,
const int code = 0);
468 void notice(
const tstring &tstrNotice,
470 bool bClearLastMsg =
false,
472 bool bStateMsg =
false,
473 bool bSensitiveMsg =
false);
475 void notice(MsgWithArg ¬ice,
477 bool bClearLastMsg =
false,
479 bool bStateMsg =
false,
480 bool bSensitiveMsg =
false);
486 void exportStats(
const tstring &tstrFilePath);
495 bool bUpdateStateMsg =
true,
496 bool bOnlyUpdateUI =
false);
498#if defined(PROGRAM_DATA_IMPORT_SUPPORTED)
499 IACImporterAsync *createACImporter(IACImporterAsyncCB *pCallback);
502 void setWMHint(
WMHint hint,
511 bool CanRemediateCaptivePortal();
512 bool policyAllowsCaptivePortalRemediation();
514 bool isEventShutdown();
516 bool isUsingEventModel();
518 time_t getLastDisconnectTime();
521 void resetConnectPromptPasswordData();
523 void setStandaloneConnection(
bool isStandalone);
525 void deliverActiveHost(
const tstring &activeHost,
526 ConnectProtocolType vpnProtocol = PROTOCOL_TYPE_UNKNOWN,
527 bool bActiveHostFriendlyName =
false);
529 bool isVPNServiceReady();
533 void resetLastDisconnectTime(time_t time = 1);
535 void processMinimize();
538 void setEnrollClientCert(CertObj* pCert);
542 void linuxCertImportWarnUser();
546 void linuxCertImportWarnUserResponse(
bool bAccept);
548 void setDefaultHost(
tstring &host);
550#if defined(HOST_DATA_SUPPORTED)
551 void setDefaultHostProfile(
const IHostData &hostProfile);
552 IHostData* getDefaultHostData();
555 void setLastVpnError(
VPNError vpnError);
558#if defined(PLATFORM_ANDROID)
559 bool requestClientCertificates();
562 bool requestImportLocalization(
const tstring tstrLocale,
563 const std::vector<unsigned char> &MoFileData);
566 void startAHS(
const unsigned int uiReason,
567 const ProxyIfc& proxy);
571 void AHSSelectedHost(
const unsigned int uiReason,
572 const std::vector<tstring> &headendList,
573 const long statusReturnCode,
575 std::vector<tstring> getAHSHostList();
576 unsigned int getAHSState();
578 bool IsAHSCachingRestricted();
580 bool suppressConnectionErrorPopups();
582 tstring getCaptivePortalDetectedMsg();
584 void setProxyAuthPrompts(ProxyIfc* pProxy,
587#if defined(INTERPROCESS_COMMUNICATION_SUPPORTED)
588 bool handleIpcMessage(CIpcMessage *pIpcMessage);
589#if defined(VPNAPI_EVENT_NOTIFICATION_SUPPORTED)
590 void signalDisconnectedToEventNtfctnThread();
593 bool IsCsdTokenVerified()
const;
595#if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID)
596 virtual void SCEPEnrollStartCB();
597 virtual void SCEPEnrollExitCB();
600 void activateConnectMgrTunnelInitiationCompletionEvent();
601 bool isConnectRequestActive();
602 bool isConnectRequestCleanup();
603#if defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK)
604 bool deleteProfileByName(
const tstring &profileName);
606 bool importProfile(
const tstring &profileName,
const tstring &profileContents);
609 bool syncProfileChange(
const tstring &profileName);
611#if defined(CREDENTIAL_PREFILL_SUPPORTED)
612 bool hasPrefilledCredentials();
614 void setPrefilledCredentials(CredentialPrefill *prefill);
617#if defined(PLATFORM_ANDROID) || defined(PLATFORM_APPLE_SSLVPN)
618 std::list<ManagedCertificate *> enumerateCertificates(CertificateType certType);
619 bool deleteCertificates(CertificateType certType,
const std::list<std::string> &idList);
620 bool deleteServerCertificates(
const std::list<std::string> &idList);
623#if defined(ANYCONNECT_USE_SNAK) && !defined(PLATFORM_WIN_APP)
624 std::list<ManagedCertificate *> enumerateSNAKCertificates(SNAK_CertType certType);
625 SNAK_CertType getSNAKCertType(CertificateType certType);
626 bool deleteClientCertificates(
const std::list<std::string> &idList);
629#if defined(PLATFORM_APPLE_SSLVPN)
630 bool canUseBackupServers();
635 tstring getMgmtTunnelHostname();
637 VPN_TUNNEL_SCOPE getVpnTunnelScope();
639 bool isStandaloneConnection();
643 void setExternalSSOLogoutUrlFromAgent(
const tstring& logoutUrl);
651#if defined(VPNAPI_TRANSMIGRATION_SUPPORTED)
652 std::shared_ptr<CSharedAccessLock> m_spClientIfcInternalPtrSharedAccessLock;
654 std::unique_ptr<ClientIfcInternal> m_upClientIfcInternal;
663 ClientIfcBase(
const ClientIfcBase& other);
664 ClientIfcBase& operator=(
const ClientIfcBase& other);