14 #ifndef _CLIENTIFCBASE_ 15 #define _CLIENTIFCBASE_ 21 #include "ClientIfcCommon.h" 24 #if defined(ANYCONNECT_USE_SNAK) 25 #include "SNAK_CertPlugin.h" 28 #if defined(HOST_DATA_SUPPORTED) 40 class ClientIfcInternal;
42 #if defined(VPNAPI_TRANSMIGRATION_SUPPORTED) 43 class CSharedAccessLock;
46 #if defined(VPNAPI_EVENT_NOTIFICATION_SUPPORTED) 47 class CEventNotificationTlv;
50 #if defined(CREDENTIAL_PREFILL_SUPPORTED) 51 class CredentialPrefill;
54 #if (defined(ANYCONNECT_USE_SNAK) || defined(PLATFORM_APPLE_SSLVPN)) && !defined(PLATFORM_WIN_APP) 55 class ManagedCertificate;
58 #if defined(PROGRAM_DATA_IMPORT_SUPPORTED) 59 class IACImporterAsync;
60 class IACImporterAsyncCB;
65 friend class EventMgr;
66 friend class ClientIfcInternal;
83 virtual void StatsCB(
VPNStats &stats) = 0;
92 virtual void StateCB(
const VPNState state,
109 virtual void BannerCB(
const tstring &banner) = 0;
124 virtual void PreConnectReminderCB(
const tstring &rtstrPreConnectReminder);
138 virtual void NoticeCB(
const tstring ¬ice,
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;
166 virtual void ExitNoticeCB(
const tstring &tstrNotice,
167 const int returnCode);
178 virtual void ServiceReadyCB() = 0;
208 virtual void WMHintCB(
const WMHint hint,
223 virtual void deliverWebLaunchHostCB(
const tstring &activeHost);
235 virtual void CertBlockedCB(
const tstring &rtstrUntrustedServer) = 0;
250 virtual void CertWarningCB(
const tstring &rtstrUntrustedServer,
251 const std::list<tstring> &rltstrCertErrors,
252 bool bAllowImport) = 0;
254 #if defined(PLATFORM_WIN_APP) 258 virtual void CertWarningCB(
const tstring &rtstrUntrustedServer,
259 const std::list<tstring> &rltstrCertErrors,
260 const std::vector<uint8_t> &rvServerCertDER,
261 bool bAllowImport) = 0;
277 virtual void EventAvailable();
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) 292 virtual void EventNotificationInternalCB(
293 const std::shared_ptr<CEventNotificationTlv>& spEventNtfctnTlv) = 0;
301 void ResetQuarantinedReconnect();
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);
359 STATE getCurrentState();
366 NETENV_STATE netEnvState = NES_NETWORK_ACCESSIBLE,
369 void setNetworkStates(NETENV_STATE netEnvState,
370 NETCTRL_STATE netCtrlState,
371 NETWORK_TYPE netType,
372 bool bACBrowserForCPRemediation,
374 void refreshOperatingModeForCurrentNetStates();
375 NETENV_STATE getCurrentNetEnvState();
376 NETENV_STATE getPreviousNetEnvState();
377 NETCTRL_STATE getCurrentNetCtrlState();
378 NETWORK_TYPE getCurrentNetType();
379 bool isACBrowserForCPRemediation();
381 static tstring getNetCtrlText(NETCTRL_STATE netCtrlState);
382 static tstring getNetEnvText(NETENV_STATE netEnvState,
383 bool bSimple =
false);
384 static tstring getNetTypeText(NETWORK_TYPE netType);
385 static tstring getQuarantinedStatusText();
386 static tstring getNetworkStatusSimpleText(
const NETENV_STATE netEnvState,
387 const NETCTRL_STATE netCtrlState);
392 const NETENV_STATE netEnvState,
393 const NETCTRL_STATE netCtrlState);
397 bool savePreferences();
405 void setBanner(
const tstring &banner);
406 void setBannerResponse(
bool bResponse);
408 void setPreConnectReminder(
const tstring &tstrPreConnectReminder);
409 void setPreConnectReminderResponse();
411 bool getUserResponse();
412 bool isUserResponseSet();
414 void setCertBlocked(
const tstring &tstrUntrustedServer);
415 void setCertWarning(
const tstring &rtstrUntrustedServer,
416 const std::list<tstring> &rltstrCertErrors,
418 #if defined(PLATFORM_WIN_APP) 419 void setCertWarning(
const tstring &rtstrUntrustedServer,
420 const std::list<tstring> &rltstrCertErrors,
421 const std::vector<uint8_t>& rvServerCertDER,
424 bool getCertImportResponse();
426 #if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK) 427 void setCertBanner(
tstring tstrCertBannerSummary,
428 uint32_t nCertBannerCertLen,
429 const uint8_t *pCertBannerCertDer,
430 const std::list<tstring> &confirmReasons,
431 const std::list<CertConfirmReason> &confirmReasonEnums,
432 bool bImportAllowed);
434 void setCertBannerResponse(
bool bResponse,
bool bImportCert);
435 void importServerCert(std::vector<uint8_t> certData);
436 bool setFipsMode(
bool bEnableFips);
437 #if defined(PLATFORM_ANDROID) 438 bool setStrictMode(
bool bEnableStrictMode);
439 bool setRevocationEnabled(
bool bRevocationEnabled);
440 bool IsRevocationEnabled();
441 #endif // currently supported only for android 446 #if defined(PLATFORM_ANDROID) 447 void setClientCertResponse(std::vector< std::pair<uint32_t, uint8_t*> > &derList);
448 void setAgentDetached();
449 bool getClientCertificates();
452 #if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID) 453 void setSCEPEnrollInProgress(
bool bInProgress);
454 bool isSCEPEnrollInProgress();
457 #if defined(MANUAL_PKCS12_IMPORT_SUPPORTED) 458 void setImportPKCS12Result(
const std::vector<uint8_t> &certHash,
const tstring &tstrError);
459 bool requestImportPKCS12(
const std::vector<uint8_t> &data);
460 std::vector<uint8_t> importPKCS12WithPassword(
const std::vector<uint8_t> &data,
const tstring &password);
463 void setCertBlockedResponse(
bool bUnlock);
464 void setCertWarningResponse(
bool bConnect,
bool bImportCert);
468 void ExitNotice(
const tstring &tstrNotice,
const int code = 0);
470 void notice(
const tstring &tstrNotice,
472 bool bClearLastMsg =
false,
474 bool bStateMsg =
false,
475 bool bSensitiveMsg =
false);
477 void notice(MsgWithArg ¬ice,
479 bool bClearLastMsg =
false,
481 bool bStateMsg =
false,
482 bool bSensitiveMsg =
false);
488 void exportStats(
const tstring &tstrFilePath);
497 bool bUpdateStateMsg =
true,
498 bool bOnlyUpdateUI =
false);
500 #if defined(PROGRAM_DATA_IMPORT_SUPPORTED) 501 IACImporterAsync *createACImporter(IACImporterAsyncCB *pCallback);
504 void setWMHint(
WMHint hint,
513 bool CanRemediateCaptivePortal();
514 bool policyAllowsCaptivePortalRemediation();
516 bool isEventShutdown();
518 bool isUsingEventModel();
520 time_t getLastDisconnectTime();
523 void resetConnectPromptPasswordData();
525 void setStandaloneConnection(
bool isStandalone);
527 void deliverActiveHost(
const tstring &activeHost,
528 ConnectProtocolType vpnProtocol = PROTOCOL_TYPE_UNKNOWN,
529 bool bActiveHostFriendlyName =
false);
531 bool isVPNServiceReady();
535 void resetLastDisconnectTime(time_t time = 1);
537 void processMinimize();
540 void setEnrollClientCert(CertObj* pCert);
544 void linuxCertImportWarnUser();
548 void linuxCertImportWarnUserResponse(
bool bAccept);
550 void setDefaultHost(
tstring &host);
552 #if defined(HOST_DATA_SUPPORTED) 553 void setDefaultHostProfile(
const IHostData &hostProfile);
554 IHostData* getDefaultHostData();
557 void setLastVpnError(
VPNError vpnError);
560 #if defined(PLATFORM_ANDROID) 561 bool requestClientCertificates();
564 bool requestImportLocalization(
const tstring tstrLocale,
565 const std::vector<unsigned char> &MoFileData);
568 void startAHS(
const unsigned int uiReason,
569 const ProxyIfc& proxy);
573 void AHSSelectedHost(
const unsigned int uiReason,
574 const std::vector<tstring> &headendList,
575 const long statusReturnCode,
577 std::vector<tstring> getAHSHostList();
578 unsigned int getAHSState();
580 bool IsAHSCachingRestricted();
582 bool suppressConnectionErrorPopups();
584 tstring getCaptivePortalDetectedMsg();
586 void setProxyAuthPrompts(ProxyIfc* pProxy,
589 #if defined(INTERPROCESS_COMMUNICATION_SUPPORTED) 590 bool handleIpcMessage(CIpcMessage *pIpcMessage);
591 #if defined(VPNAPI_EVENT_NOTIFICATION_SUPPORTED) 592 void signalDisconnectedToEventNtfctnThread();
595 bool IsCsdTokenVerified()
const;
597 #if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID) 598 virtual void SCEPEnrollStartCB();
599 virtual void SCEPEnrollExitCB();
602 void activateConnectMgrTunnelInitiationCompletionEvent();
603 bool isConnectRequestActive();
604 bool isConnectRequestCleanup();
605 #if defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK) 606 bool deleteProfileByName(
const tstring &profileName);
608 bool importProfile(
const tstring &profileName,
const tstring &profileContents);
611 bool syncProfileChange(
const tstring &profileName);
613 #if defined(CREDENTIAL_PREFILL_SUPPORTED) 614 bool hasPrefilledCredentials();
616 void setPrefilledCredentials(CredentialPrefill *prefill);
619 #if defined(PLATFORM_ANDROID) || defined(PLATFORM_APPLE_SSLVPN) 620 std::list<ManagedCertificate *> enumerateCertificates(CertificateType certType);
621 bool deleteCertificates(CertificateType certType,
const std::list<std::string> &idList);
622 bool deleteServerCertificates(
const std::list<std::string> &idList);
625 #if defined(ANYCONNECT_USE_SNAK) && !defined(PLATFORM_WIN_APP) 626 std::list<ManagedCertificate *> enumerateSNAKCertificates(SNAK_CertType certType);
627 SNAK_CertType getSNAKCertType(CertificateType certType);
628 bool deleteClientCertificates(
const std::list<std::string> &idList);
631 #if defined(PLATFORM_APPLE_SSLVPN) 632 bool canUseBackupServers();
637 tstring getMgmtTunnelHostname();
639 VPN_TUNNEL_SCOPE getVpnTunnelScope();
641 bool isStandaloneConnection();
645 void setExternalSSOLogoutUrlFromAgent(
const tstring& logoutUrl);
653 #if defined(VPNAPI_TRANSMIGRATION_SUPPORTED) 654 std::shared_ptr<CSharedAccessLock> m_spClientIfcInternalPtrSharedAccessLock;
656 std::unique_ptr<ClientIfcInternal> m_upClientIfcInternal;
669 #endif // _CLIENTIFCBASE_
ConnectPromptType
Definition: api.h:244
Definition: PreferenceInfo.h:26
WMHintReason
Definition: api.h:220
VPNDisconnectReason
Definition: api.h:188
VPNState
Definition: api.h:146
Definition: ClientIfcBase.h:63
#define tstring
Definition: api.h:35
WMHint
Definition: api.h:201
Definition: ConnectPromptInfo.h:37
MessageType
Definition: api.h:108
OperatingMode
Definition: api.h:545
VPNSubState
Definition: api.h:170
VPNError
Definition: api.h:597
Definition: VPNStats.h:35