![]() |
AnyConnect Secure Mobility Client
4.10.06090
|
#include <CLIClientImpl.h>
Public Member Functions | |
void | printHostList () |
void | printDefaultHost () |
void | connect (std::string host, std::string user, std::string password, std::string group) |
void | disconnect () |
void | showGroups (std::string host) |
void | getStats () |
void | setUserData (ConnectPromptInfo &ConnectPrompt) |
void | printGroupList (ConnectPromptInfo &ConnectPrompt) |
std::wstring | convertMultiByteToWide (const std::string &sInputData) |
![]() | |
bool | attach (ClientType clientType=ClientType_GUI, bool requestFullCapabilities=true, bool suppressAutoConnect=true) |
void | detach () |
virtual void | ProcessEvents () |
bool | hasFullCapabilities () |
bool | isConnected () |
bool | isAvailable () |
bool | isVPNServiceAvailable () |
bool | isOperatingMode (OperatingMode opMode) |
std::list< tstring > | getHostNames () |
tstring | getDefaultHostName () |
bool | connect (tstring host) |
virtual bool | setNewTunnelGroup (const tstring &group) |
void | cancel () |
void | getState () |
void | getStats () |
void | resetStats () |
void | startStats () |
void | stopStats () |
void | exportStats (const tstring &tstrFilePath) |
void | setBannerResponse (bool bAccepted) |
void | setPreConnectReminderResponse () |
void | setCertBlockedResponse (bool bUnblock) |
void | setCertWarningResponse (bool bConnect, bool bImportCert) |
void | UserSubmit () |
PreferenceInfo & | getPreferences () |
bool | savePreferences () |
tstring | getConnectHost () |
void | setLastVpnError (VPNError vpnError) |
VPNError | getLastVpnError () |
Protected Member Functions | |
void | StatsCB (VPNStats &stats) |
void | StateCB (const VPNState state, const VPNSubState subState, const tstring stateString) |
void | BannerCB (const tstring &banner) |
void | PreConnectReminderCB (const tstring &rtstrPreConnectReminder) |
void | NoticeCB (const tstring ¬ice, const MessageType type, const bool bSensitive=false) |
void | ExitNoticeCB (const tstring ¬ice, const int returnCode) |
void | ServiceReadyCB () |
void | UserPromptCB (ConnectPromptInfo &ConnectPrompt) |
void | CertBlockedCB (const tstring &rtstrUntrustedServer) |
void | CertWarningCB (const tstring &rtstrUntrustedServer, const std::list< tstring > &rltstrCertErrors, bool bAllowImport) |
![]() | |
virtual void | WMHintCB (const WMHint hint, const WMHintReason reason) |
virtual void | deliverWebLaunchHostCB (const tstring &activeHost) |
virtual void | EventAvailable () |
![]() | |
AgentIfc & | getAgentIfc () |
virtual std::list< HostEntry > | getHostEntries () |
bool | connect (tstring host, unsigned int origin) |
VPNState | getCurrentState () |
VPNSubState | getCurrentSubState () |
VPNSubState | getPreviousSubState () |
tstring | getStateText () |
void | setNetworkStates (NETENV_STATE netEnvState, NETCTRL_STATE netCtrlState, NETWORK_TYPE netType, bool bACBrowserForCPRemediation, bool bUpdateUI) |
void | refreshOperatingModeForCurrentNetStates () |
NETENV_STATE | getCurrentNetEnvState () |
NETENV_STATE | getPreviousNetEnvState () |
NETCTRL_STATE | getCurrentNetCtrlState () |
NETWORK_TYPE | getCurrentNetType () |
bool | isACBrowserForCPRemediation () |
tstring | getNetworkStatusText (const VPNState state, const VPNSubState subState, const NETENV_STATE netEnvState, const NETCTRL_STATE netCtrlState) |
PreferenceInfo & | getPreferences () |
bool | savePreferences () |
void | setBanner (const tstring &banner) |
void | setBannerResponse (bool bResponse) |
void | setPreConnectReminder (const tstring &tstrPreConnectReminder) |
void | setPreConnectReminderResponse () |
bool | getUserResponse () |
bool | isUserResponseSet () |
void | setCertBlocked (const tstring &tstrUntrustedServer) |
void | setCertWarning (const tstring &rtstrUntrustedServer, const std::list< tstring > &rltstrCertErrors, bool bAllowImport) |
bool | getCertImportResponse () |
void | setUserPrompt (ConnectPromptInfo &ConnectPrompt) |
void | setCertBlockedResponse (bool bUnlock) |
void | setCertWarningResponse (bool bConnect, bool bImportCert) |
void | insertStateToConnectPrompt (ConnectPromptInfo &ConnectPrompt) |
void | ExitNotice (const tstring &tstrNotice, const int code=0) |
void | notice (const tstring &tstrNotice, const MessageType type=MsgType_Info, bool bClearLastMsg=false, bool bForce=false, bool bStateMsg=false, bool bSensitiveMsg=false) |
void | notice (MsgWithArg ¬ice, const MessageType type=MsgType_Info, bool bClearLastMsg=false, bool bForce=false, bool bStateMsg=false, bool bSensitiveMsg=false) |
void | getStats (void) |
void | setStats (VPNStats &stats) |
void | exportStats (const tstring &tstrFilePath) |
void | setState (VPNState state, VPNState previousState, VPNSubState subState=VPNSS_NORMAL, bool bUpdateStateMsg=true, bool bOnlyUpdateUI=false) |
void | setWMHint (WMHint hint, WMHintReason reason) |
bool | isLastConnectType (const ConnectPromptType connPromptType) |
bool | isOperatingMode (OperatingMode opMode) |
void | setOperatingMode (OperatingMode opMode) |
void | unsetOperatingMode (OperatingMode opMode) |
bool | CanRemediateCaptivePortal () |
bool | policyAllowsCaptivePortalRemediation () |
bool | isEventShutdown () |
bool | isUsingEventModel () |
time_t | getLastDisconnectTime () |
ConnectPromptInfo | getConnectPromptInfo () |
void | resetConnectPromptPasswordData () |
void | setStandaloneConnection (bool isStandalone) |
void | deliverActiveHost (const tstring &activeHost, ConnectProtocolType vpnProtocol=PROTOCOL_TYPE_UNKNOWN, bool bActiveHostFriendlyName=false) |
bool | isVPNServiceReady () |
void | resetLastDisconnectTime (time_t time=1) |
void | processMinimize () |
void | setEnrollClientCert (CertObj *pCert) |
void | linuxCertImportWarnUser () |
void | linuxCertImportWarnUserResponse (bool bAccept) |
void | setDefaultHost (tstring &host) |
void | setLastVpnError (VPNError vpnError) |
VPNError | getLastVpnError () |
bool | requestImportLocalization (const tstring tstrLocale, const std::vector< unsigned char > &MoFileData) |
void | startAHS (const unsigned int uiReason, const ProxyIfc &proxy) |
void | AHSSelectedHost (const unsigned int uiReason, const std::vector< tstring > &headendList, const long statusReturnCode, const tstring &extraInfo) |
std::vector< tstring > | getAHSHostList () |
unsigned int | getAHSState () |
bool | isAHSHasRun () |
bool | suppressConnectionErrorPopups () |
tstring | getCaptivePortalDetectedMsg () |
void | setProxyAuthPrompts (ProxyIfc *pProxy, const tstring &promptMsg) |
bool | handleIpcMessage (CIpcMessage *pIpcMessage) |
bool | IsCsdTokenVerified () const |
void | activateConnectMgrTunnelInitiationCompletionEvent () |
bool | isConnectRequestActive () |
bool | syncProfileChange (const tstring &profileName) |
tstring | getConnectHost () |
tstring | getMgmtTunnelHostname () |
VPN_TUNNEL_SCOPE | getVpnTunnelScope () |
bool | isStandaloneConnection () |
void | sendSSoLogoutPrompt (ConnectPromptInfo &cpi) |
void | setExternalSSOLogoutUrlFromAgent (const tstring &logoutUrl) |
Additional Inherited Members | |
![]() | |
static tstring | getNoticeTypeText (MessageType msgType) |
static tstring | getStateText (VPNState state, VPNSubState subState=VPNSS_NORMAL, NETENV_STATE netEnvState=NES_NETWORK_ACCESSIBLE, const tstring &tstrConnectedHost=tstring()) |
static tstring | getNetCtrlText (NETCTRL_STATE netCtrlState) |
static tstring | getNetEnvText (NETENV_STATE netEnvState, bool bSimple=false) |
static tstring | getNetTypeText (NETWORK_TYPE netType) |
static tstring | getQuarantinedStatusText () |
static tstring | getNetworkStatusSimpleText (const NETENV_STATE netEnvState, const NETCTRL_STATE netCtrlState) |
This is an example application demonstrating the implementation of the AnyConnect API
|
protectedvirtual |
If a banner needs to be acknowledged, this CB delivers the banner to the client.
NOTE: Connection establishment will block until the method setBannerResponse() is called.
In a GUI, a banner would typically be displayed in a modal dialog with an accept or decline button selection.
Implements ClientIfc.
|
protectedvirtual |
This method is called when the preference to block untrusted servers is enabled and the current VPN server being connected to is untrusted. Clients should present an error to the user notifying them that the current connection to rtstrUntrustedServer is being blocked. The client should also provide a way for the user to change the preference to block untrusted servers.
The user response must be indicated using setCertBlockedResponse
Implements ClientIfc.
|
protectedvirtual |
This method is called when connections to untrusted VPN servers is allowed by policies and the current VPN server being connected to is untrusted. Clients should present a warning to the user notifying them that the current connection to rtstrUntrustedServer is unsafe. The reason the VPN server is untrusted is provided in rltstrCertErrors. The client should provide a way for the user to connect once, connect and always trust or cancel the connection. If bAllowImport is set to false then the always trust option should not be presented to users.
The user response must be indicated using setCertWarningResponse
Implements ClientIfc.
|
virtual |
|
protectedvirtual |
This CB would likely occur only during a connection when it was detected that the software needed to be upgraded, or when Start Before Logon (SBL) is being used.
Unlike the other callback methods, this method provides a default implementation (calling the system's exit() function). If clients of the API wish to override this behavior, they are responsible for ensuring that the current running process exits with the return code specified by returnCode.
Caution: IF YOU OVERRIDE THIS METHOD AND DO NOT EXIT WITH THE PROPER CODE SOFTWARE UPDATE FUNCTIONALITY IN YOUR CLIENT WILL BREAK
Reimplemented from ClientIfc.
void CLIClientImpl::getStats | ( | void | ) |
This method demonstrates accessing the statistics data delivered via the ClientIfc::StatsCB method.
|
protectedvirtual |
Messages are delivered via the NoticeCB and can come from multiple sources. There are four message types (error, warning, info and status). See the MessageType enum in api.h for the list.
Clients using the API as an embedded application (not user visible) might want to further characterize messages. One option here is to use the AnyConnect message catalog and assign message codes as the translations for various messages. An application could then track messages based on its own error code scheme.
Implements ClientIfc.
|
protectedvirtual |
If a pre-connect reminder needs to be acknowledged, this CB delivers the pre-connect reminder to the client.
NOTE: Connection establishment will block until the method setPreConnectReminderResponse() is called.
In a GUI, a pre-connect reminder would typically be displayed in a modal dialog with an OK button selection.
Reimplemented from ClientIfc.
|
protectedvirtual |
Under normal operating conditions, this CB is called as soon as the attach method completes. In case the service (vpn agent) is not ready, this CB is not called until it is.
Any API calls made prior to this CB being called will result in a NoticeCB error message.
Implements ClientIfc.
void CLIClientImpl::setUserData | ( | ConnectPromptInfo & | ConnectPrompt | ) |
Method with example of parsing ConnectPromptInfo.
This method is triggered by an API call on the method UserPromptCB(ConnectPromptInfo &).
|
protectedvirtual |
|
protectedvirtual |
Callback used to deliver new statistics related to the VPN connection.
When a connection is active, a new set of statistics is delivered each second.
Implements ClientIfc.
|
protectedvirtual |
This method supports prompting for single or multiple values. All prompts are considered mandatory.
The ConnectPromptInfo object contains a list of PromptEntry instances. The labels and their default values (if any) can be found in these instances. After the data has been collected from the user it can be set into these same instances. When ready, the client application should call the method UserSubmit() to have the responses read by the API.
Implements ClientIfc.