![]() |
AnyConnect Secure Mobility Client 4.7.03052
|
00001 /******************************************************************************\ 00002 * This sample is supplied as is with no implied warranty. 00003 * It is designed to assist you in using the Cisco AnyConnect VPN API. 00004 * It is assumed that you will build a production application and 00005 * refer to this sample as a reference only. 00006 \*****************************************************************************/ 00007 00008 #ifndef _GUICLIENTIMPL_ 00009 #define _GUICLIENTIMPL_ 00010 00011 #include "ClientIfc.h" 00012 00013 enum RequestType { REQ_CONNECT, REQ_GROUPLIST, REQ_END }; 00014 00015 class MainDialog; 00016 00017 /** 00018 * This is an example application demonstrating the implementation of the 00019 * AnyConnect API 00020 */ 00021 00022 class GUIClientImpl : public ClientIfc 00023 { 00024 public: 00025 00026 GUIClientImpl( MainDialog *parent ); 00027 virtual ~GUIClientImpl(); 00028 00029 bool connect(tstring host); 00030 00031 tstring ms_user, 00032 ms_pswd, 00033 ms_group; 00034 00035 void setUserData(ConnectPromptInfo &ConnectPrompt); 00036 00037 protected: 00038 00039 ConnectPromptInfo *m_pConnectPrompt; 00040 MainDialog *parentWindow; 00041 00042 void StatsCB(IN VPNStats &stats); 00043 00044 void StateCB(IN const VPNState state, 00045 IN const VPNSubState subState, 00046 IN const tstring stateString); 00047 00048 void BannerCB(IN const tstring &banner); 00049 00050 void NoticeCB(IN const tstring notice, 00051 IN const MessageType type); 00052 00053 void ExitNoticeCB(IN const tstring ¬ice, const int returnCode); 00054 00055 void ServiceReadyCB(); 00056 00057 void UserPromptCB(IN ConnectPromptInfo &ConnectPrompt); 00058 00059 void CertBlockedCB(IN const tstring &rtstrUntrustedServer); 00060 void CertWarningCB(IN const tstring &rtstrUntrustedServer, 00061 IN const std::list<tstring> &rltstrCertErrors, 00062 IN bool bAllowImport); 00063 00064 /** 00065 * The implementation of this method and subsequent call on 00066 * MainDialog::HandleEventAvailable demonstrates the posting of 00067 * an event. 00068 */ 00069 void EventAvailable(); 00070 00071 00072 private: 00073 00074 RequestType me_RequestType; 00075 00076 }; 00077 00078 00079 #endif // _GUICLIENTIMPL_