Client.h 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874
  1. // SoftEther VPN Source Code - Stable Edition Repository
  2. // Cedar Communication Module
  3. //
  4. // SoftEther VPN Server, Client and Bridge are free software under the Apache License, Version 2.0.
  5. //
  6. // Copyright (c) Daiyuu Nobori.
  7. // Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
  8. // Copyright (c) SoftEther Corporation.
  9. // Copyright (c) all contributors on SoftEther VPN project in GitHub.
  10. //
  11. // All Rights Reserved.
  12. //
  13. // http://www.softether.org/
  14. //
  15. // This stable branch is officially managed by Daiyuu Nobori, the owner of SoftEther VPN Project.
  16. // Pull requests should be sent to the Developer Edition Master Repository on https://github.com/SoftEtherVPN/SoftEtherVPN
  17. //
  18. // License: The Apache License, Version 2.0
  19. // https://www.apache.org/licenses/LICENSE-2.0
  20. //
  21. // DISCLAIMER
  22. // ==========
  23. //
  24. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  25. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  26. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  27. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  28. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  29. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  30. // SOFTWARE.
  31. //
  32. // THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN, UNDER
  33. // JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY, MERGE, PUBLISH,
  34. // DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS SOFTWARE, THAT ANY
  35. // JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS SOFTWARE OR ITS CONTENTS,
  36. // AGAINST US (SOFTETHER PROJECT, SOFTETHER CORPORATION, DAIYUU NOBORI OR OTHER
  37. // SUPPLIERS), OR ANY JURIDICAL DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND
  38. // OF USING, COPYING, MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING,
  39. // AND/OR SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
  40. // CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO EXCLUSIVE
  41. // JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO, JAPAN. YOU MUST WAIVE
  42. // ALL DEFENSES OF LACK OF PERSONAL JURISDICTION AND FORUM NON CONVENIENS.
  43. // PROCESS MAY BE SERVED ON EITHER PARTY IN THE MANNER AUTHORIZED BY APPLICABLE
  44. // LAW OR COURT RULE.
  45. //
  46. // USE ONLY IN JAPAN. DO NOT USE THIS SOFTWARE IN ANOTHER COUNTRY UNLESS YOU HAVE
  47. // A CONFIRMATION THAT THIS SOFTWARE DOES NOT VIOLATE ANY CRIMINAL LAWS OR CIVIL
  48. // RIGHTS IN THAT PARTICULAR COUNTRY. USING THIS SOFTWARE IN OTHER COUNTRIES IS
  49. // COMPLETELY AT YOUR OWN RISK. THE SOFTETHER VPN PROJECT HAS DEVELOPED AND
  50. // DISTRIBUTED THIS SOFTWARE TO COMPLY ONLY WITH THE JAPANESE LAWS AND EXISTING
  51. // CIVIL RIGHTS INCLUDING PATENTS WHICH ARE SUBJECTS APPLY IN JAPAN. OTHER
  52. // COUNTRIES' LAWS OR CIVIL RIGHTS ARE NONE OF OUR CONCERNS NOR RESPONSIBILITIES.
  53. // WE HAVE NEVER INVESTIGATED ANY CRIMINAL REGULATIONS, CIVIL LAWS OR
  54. // INTELLECTUAL PROPERTY RIGHTS INCLUDING PATENTS IN ANY OF OTHER 200+ COUNTRIES
  55. // AND TERRITORIES. BY NATURE, THERE ARE 200+ REGIONS IN THE WORLD, WITH
  56. // DIFFERENT LAWS. IT IS IMPOSSIBLE TO VERIFY EVERY COUNTRIES' LAWS, REGULATIONS
  57. // AND CIVIL RIGHTS TO MAKE THE SOFTWARE COMPLY WITH ALL COUNTRIES' LAWS BY THE
  58. // PROJECT. EVEN IF YOU WILL BE SUED BY A PRIVATE ENTITY OR BE DAMAGED BY A
  59. // PUBLIC SERVANT IN YOUR COUNTRY, THE DEVELOPERS OF THIS SOFTWARE WILL NEVER BE
  60. // LIABLE TO RECOVER OR COMPENSATE SUCH DAMAGES, CRIMINAL OR CIVIL
  61. // RESPONSIBILITIES. NOTE THAT THIS LINE IS NOT LICENSE RESTRICTION BUT JUST A
  62. // STATEMENT FOR WARNING AND DISCLAIMER.
  63. //
  64. // READ AND UNDERSTAND THE 'WARNING.TXT' FILE BEFORE USING THIS SOFTWARE.
  65. // SOME SOFTWARE PROGRAMS FROM THIRD PARTIES ARE INCLUDED ON THIS SOFTWARE WITH
  66. // LICENSE CONDITIONS WHICH ARE DESCRIBED ON THE 'THIRD_PARTY.TXT' FILE.
  67. //
  68. //
  69. // SOURCE CODE CONTRIBUTION
  70. // ------------------------
  71. //
  72. // Your contribution to SoftEther VPN Project is much appreciated.
  73. // Please send patches to us through GitHub.
  74. // Read the SoftEther VPN Patch Acceptance Policy in advance:
  75. // http://www.softether.org/5-download/src/9.patch
  76. //
  77. //
  78. // DEAR SECURITY EXPERTS
  79. // ---------------------
  80. //
  81. // If you find a bug or a security vulnerability please kindly inform us
  82. // about the problem immediately so that we can fix the security problem
  83. // to protect a lot of users around the world as soon as possible.
  84. //
  85. // Our e-mail address for security reports is:
  86. // softether-vpn-security [at] softether.org
  87. //
  88. // Please note that the above e-mail address is not a technical support
  89. // inquiry address. If you need technical assistance, please visit
  90. // http://www.softether.org/ and ask your question on the users forum.
  91. //
  92. // Thank you for your cooperation.
  93. //
  94. //
  95. // NO MEMORY OR RESOURCE LEAKS
  96. // ---------------------------
  97. //
  98. // The memory-leaks and resource-leaks verification under the stress
  99. // test has been passed before release this source code.
  100. // Client.h
  101. // Header of Client.c
  102. #ifndef CLIENT_H
  103. #define CLIENT_H
  104. #define CLIENT_CONFIG_PORT GC_CLIENT_CONFIG_PORT // Client port number
  105. #define CLIENT_NOTIFY_PORT GC_CLIENT_NOTIFY_PORT // Client notification port number
  106. #define CLIENT_WAIT_CN_READY_TIMEOUT (10 * 1000) // Standby time to start the client notification service
  107. // Check whether the client can run on the specified OS_TYPE
  108. #define IS_CLIENT_SUPPORTED_OS(t) \
  109. ((OS_IS_WINDOWS_NT(t) && GET_KETA(t, 100) >= 2) || (OS_IS_WINDOWS_9X(t)))
  110. // Constants
  111. #define CLIENT_CONFIG_FILE_NAME "@vpn_client.config"
  112. #define CLIENT_DEFAULT_KEEPALIVE_HOST "keepalive.softether.org"
  113. #define CLIENT_DEFAULT_KEEPALIVE_PORT 80
  114. #define CLIENT_DEFAULT_KEEPALIVE_INTERVAL KEEP_INTERVAL_DEFAULT
  115. #define CLIENT_RPC_MODE_NOTIFY 0
  116. #define CLIENT_RPC_MODE_MANAGEMENT 1
  117. #define CLIENT_RPC_MODE_SHORTCUT 2
  118. #define CLIENT_RPC_MODE_SHORTCUT_DISCONNECT 3
  119. #define CLIENT_MACOS_TAP_NAME "tap0"
  120. #define CLIENT_SAVER_INTERVAL (30 * 1000)
  121. #define CLIENT_NOTIFY_SERVICE_INSTANCENAME GC_SW_SOFTETHER_PREFIX "vpnclient_uihelper"
  122. #define CLIENT_WIN32_EXE_FILENAME "vpnclient.exe"
  123. #define CLIENT_WIN32_EXE_FILENAME_X64 "vpnclient_x64.exe"
  124. #define CLIENT_WIN32_EXE_FILENAME_IA64 "vpnclient_ia64.exe"
  125. #define CLIENT_CUSTOM_INI_FILENAME "@custom.ini"
  126. #define CLIENT_GLOBAL_PULSE_NAME "clientglobalpulse"
  127. #define CLIENT_WIN32_REGKEYNAME "Software\\" GC_REG_COMPANY_NAME "\\" CEDAR_PRODUCT_STR " VPN\\Client"
  128. #define CLIENT_WIN32_REGVALUE_PORT "RpcPort"
  129. #define CLIENT_WIN32_REGVALUE_PID "RpcPid"
  130. // List of virtual LAN cards in UNIX
  131. struct UNIX_VLAN
  132. {
  133. bool Enabled; // Enable flag
  134. char Name[MAX_SIZE]; // Name
  135. UCHAR MacAddress[6]; // MAC address
  136. UCHAR Padding[2];
  137. };
  138. // Account
  139. struct ACCOUNT
  140. {
  141. // Static data
  142. CLIENT_OPTION *ClientOption; // Client Option
  143. CLIENT_AUTH *ClientAuth; // Client authentication data
  144. bool CheckServerCert; // Check the server certificate
  145. X *ServerCert; // Server certificate
  146. bool StartupAccount; // Start-up account
  147. UCHAR ShortcutKey[SHA1_SIZE]; // Key
  148. UINT64 CreateDateTime; // Creation date and time
  149. UINT64 UpdateDateTime; // Updating date
  150. UINT64 LastConnectDateTime; // Last connection date and time
  151. // Dynamic data
  152. LOCK *lock; // Lock
  153. SESSION *ClientSession; // Client session
  154. CLIENT_STATUS_PRINTER *StatusPrinter; // Status indicator
  155. SOCK *StatusWindow; // Status window
  156. };
  157. // Client Settings
  158. struct CLIENT_CONFIG
  159. {
  160. bool AllowRemoteConfig; // Allow the remote configuration
  161. bool UseKeepConnect; // Keep connected to the Internet
  162. char KeepConnectHost[MAX_HOST_NAME_LEN + 1]; // Host name
  163. UINT KeepConnectPort; // Port number
  164. UINT KeepConnectProtocol; // Protocol
  165. UINT KeepConnectInterval; // Interval
  166. bool NoChangeWcmNetworkSettingOnWindows8; // Don't change the WCM network settings on Windows 8
  167. bool DisableRpcDynamicPortListener;
  168. bool EnableTunnelCrackProtect;
  169. };
  170. // Version acquisition
  171. struct RPC_CLIENT_VERSION
  172. {
  173. char ClientProductName[128]; // Client product name
  174. char ClientVersionString[128]; // Client version string
  175. char ClientBuildInfoString[128]; // Build client information string
  176. UINT ClientVerInt; // Client version integer value
  177. UINT ClientBuildInt; // Client build number integer value
  178. UINT ProcessId; // Process ID
  179. UINT OsType; // OS type
  180. bool IsVLanNameRegulated; // Whether a virtual LAN card name must be "VLAN" + number
  181. bool IsVgcSupported; // Whether the VPN Gate Client is supported
  182. bool ShowVgcLink; // Display a VPN Gate Client link
  183. char ClientId[128]; // Client OD
  184. };
  185. // Password Setting
  186. struct RPC_CLIENT_PASSWORD
  187. {
  188. char Password[MAX_PASSWORD_LEN + 1]; // Password
  189. bool PasswordRemoteOnly; // The password is required only remote access
  190. };
  191. // Get the password setting
  192. struct RPC_CLIENT_PASSWORD_SETTING
  193. {
  194. bool IsPasswordPresented; // Password exists
  195. bool PasswordRemoteOnly; // The password is required only remote access
  196. };
  197. // Certificate enumeration item
  198. struct RPC_CLIENT_ENUM_CA_ITEM
  199. {
  200. UINT Key; // Certificate key
  201. wchar_t SubjectName[MAX_SIZE]; // Issued to
  202. wchar_t IssuerName[MAX_SIZE]; // Issuer
  203. UINT64 Expires; // Expiration date
  204. };
  205. // Certificate enumeration
  206. struct RPC_CLIENT_ENUM_CA
  207. {
  208. UINT NumItem; // Number of items
  209. RPC_CLIENT_ENUM_CA_ITEM **Items; // Item
  210. };
  211. // Certificate item
  212. struct RPC_CERT
  213. {
  214. X *x; // Certificate
  215. };
  216. // Delete the certificate
  217. struct RPC_CLIENT_DELETE_CA
  218. {
  219. UINT Key; // Certificate key
  220. };
  221. // Get the certificate
  222. struct RPC_GET_CA
  223. {
  224. UINT Key; // Certificate key
  225. X *x; // Certificate
  226. };
  227. // Get the issuer
  228. struct RPC_GET_ISSUER
  229. {
  230. X *x; // Certificate
  231. X *issuer_x; // Issuer
  232. };
  233. // Secure device enumeration item
  234. struct RPC_CLIENT_ENUM_SECURE_ITEM
  235. {
  236. UINT DeviceId; // Device ID
  237. UINT Type; // Type
  238. char DeviceName[MAX_SIZE]; // Device name
  239. char Manufacturer[MAX_SIZE]; // Manufacturer
  240. };
  241. // Enumeration of secure devices
  242. struct RPC_CLIENT_ENUM_SECURE
  243. {
  244. UINT NumItem; // Number of items
  245. RPC_CLIENT_ENUM_SECURE_ITEM **Items; // Item
  246. };
  247. // Specify a secure device
  248. struct RPC_USE_SECURE
  249. {
  250. UINT DeviceId; // Device ID
  251. };
  252. // Enumerate objects in the secure device
  253. struct RPC_ENUM_OBJECT_IN_SECURE
  254. {
  255. UINT hWnd; // Window handle
  256. UINT NumItem; // Number of items
  257. char **ItemName; // Item name
  258. bool *ItemType; // Type (true = secret key, false = public key)
  259. };
  260. // Create a virtual LAN
  261. struct RPC_CLIENT_CREATE_VLAN
  262. {
  263. char DeviceName[MAX_SIZE]; // Device name
  264. };
  265. // Get a Virtual LAN information
  266. struct RPC_CLIENT_GET_VLAN
  267. {
  268. char DeviceName[MAX_SIZE]; // Device name
  269. bool Enabled; // Flag of whether it works or not
  270. char MacAddress[MAX_SIZE]; // MAC address
  271. char Version[MAX_SIZE]; // Version
  272. char FileName[MAX_SIZE]; // Driver file name
  273. char Guid[MAX_SIZE]; // GUID
  274. };
  275. // Set the virtual LAN information
  276. struct RPC_CLIENT_SET_VLAN
  277. {
  278. char DeviceName[MAX_SIZE]; // Device name
  279. char MacAddress[MAX_SIZE]; // MAC address
  280. };
  281. // Virtual LAN enumeration item
  282. struct RPC_CLIENT_ENUM_VLAN_ITEM
  283. {
  284. char DeviceName[MAX_SIZE]; // Device name
  285. bool Enabled; // Operation flag
  286. char MacAddress[MAX_SIZE]; // MAC address
  287. char Version[MAX_SIZE]; // Version
  288. };
  289. // Enumerate the virtual LANs
  290. struct RPC_CLIENT_ENUM_VLAN
  291. {
  292. UINT NumItem; // Item count
  293. RPC_CLIENT_ENUM_VLAN_ITEM **Items; // Item
  294. };
  295. // Create an account
  296. struct RPC_CLIENT_CREATE_ACCOUNT
  297. {
  298. CLIENT_OPTION *ClientOption; // Client Option
  299. CLIENT_AUTH *ClientAuth; // Client authentication data
  300. bool StartupAccount; // Startup account
  301. bool CheckServerCert; // Checking of the server certificate
  302. X *ServerCert; // Server certificate
  303. UCHAR ShortcutKey[SHA1_SIZE]; // Shortcut Key
  304. };
  305. // Enumeration item of account
  306. struct RPC_CLIENT_ENUM_ACCOUNT_ITEM
  307. {
  308. wchar_t AccountName[MAX_ACCOUNT_NAME_LEN + 1]; // Account name
  309. char UserName[MAX_USERNAME_LEN + 1]; // User name
  310. char ServerName[MAX_HOST_NAME_LEN + 1]; // Server name
  311. char DeviceName[MAX_DEVICE_NAME_LEN + 1]; // Device name
  312. UINT ProxyType; // Type of proxy connection
  313. char ProxyName[MAX_HOST_NAME_LEN + 1]; // Host name
  314. bool Active; // Operation flag
  315. bool Connected; // Connection completion flag
  316. bool StartupAccount; // Startup account
  317. UINT Port; // Port number (Ver 3.0 or later)
  318. char HubName[MAX_HUBNAME_LEN + 1]; // Virtual HUB name (Ver 3.0 or later)
  319. UINT64 CreateDateTime; // Creation date and time (Ver 3.0 or later)
  320. UINT64 UpdateDateTime; // Modified date (Ver 3.0 or later)
  321. UINT64 LastConnectDateTime; // Last connection date and time (Ver 3.0 or later)
  322. UINT tmp1; // Temporary data
  323. };
  324. // Enumeration of accounts
  325. struct RPC_CLIENT_ENUM_ACCOUNT
  326. {
  327. UINT NumItem; // Item count
  328. RPC_CLIENT_ENUM_ACCOUNT_ITEM **Items; // Items
  329. };
  330. // Delete the Account
  331. struct RPC_CLIENT_DELETE_ACCOUNT
  332. {
  333. wchar_t AccountName[MAX_ACCOUNT_NAME_LEN + 1]; // Account name
  334. };
  335. // Change the account name
  336. struct RPC_RENAME_ACCOUNT
  337. {
  338. wchar_t OldName[MAX_ACCOUNT_NAME_LEN + 1]; // Old name
  339. wchar_t NewName[MAX_ACCOUNT_NAME_LEN + 1]; // New Name
  340. };
  341. // Get the account
  342. struct RPC_CLIENT_GET_ACCOUNT
  343. {
  344. wchar_t AccountName[MAX_ACCOUNT_NAME_LEN + 1]; // Account name
  345. CLIENT_OPTION *ClientOption; // Client Option
  346. CLIENT_AUTH *ClientAuth; // Client authentication data
  347. bool StartupAccount; // Startup account
  348. bool CheckServerCert; // Check the server certificate
  349. X *ServerCert; // Server certificate
  350. UCHAR ShortcutKey[SHA1_SIZE]; // Shortcut Key
  351. UINT64 CreateDateTime; // Creation date and time (Ver 3.0 or later)
  352. UINT64 UpdateDateTime; // Modified date (Ver 3.0 or later)
  353. UINT64 LastConnectDateTime; // Last connection date and time (Ver 3.0 or later)
  354. };
  355. // Connection
  356. struct RPC_CLIENT_CONNECT
  357. {
  358. wchar_t AccountName[MAX_ACCOUNT_NAME_LEN + 1]; // Account name
  359. };
  360. // Get the Connection status
  361. struct RPC_CLIENT_GET_CONNECTION_STATUS
  362. {
  363. wchar_t AccountName[MAX_ACCOUNT_NAME_LEN + 1]; // Account name
  364. bool Active; // Operation flag
  365. bool Connected; // Connected flag
  366. UINT SessionStatus; // Session status
  367. char ServerName[MAX_HOST_NAME_LEN + 1]; // Server name
  368. UINT ServerPort; // Port number of the server
  369. char ServerProductName[MAX_SIZE]; // Server product name
  370. UINT ServerProductVer; // Server product version
  371. UINT ServerProductBuild; // Server product build number
  372. X *ServerX; // Server certificate
  373. X *ClientX; // Client certificate
  374. UINT64 StartTime; // Connection start time
  375. UINT64 FirstConnectionEstablisiedTime; // Connection completion time of the first connection
  376. UINT64 CurrentConnectionEstablishTime; // Connection completion time of this connection
  377. UINT NumConnectionsEatablished; // Number of connections have been established so far
  378. bool HalfConnection; // Half-connection
  379. bool QoS; // VoIP / QoS
  380. UINT MaxTcpConnections; // Maximum number of the TCP connections
  381. UINT NumTcpConnections; // Number of current TCP connections
  382. UINT NumTcpConnectionsUpload; // Number of inbound connections
  383. UINT NumTcpConnectionsDownload; // Number of outbound connections
  384. bool UseEncrypt; // Use of encryption
  385. char CipherName[32]; // Cipher algorithm name
  386. char ProtocolName[64]; // Protocol name
  387. bool UseCompress; // Use of compression
  388. bool IsRUDPSession; // R-UDP session
  389. char UnderlayProtocol[64]; // Physical communication protocol
  390. char ProtocolDetails[256]; // Protocol Details
  391. bool IsUdpAccelerationEnabled; // The UDP acceleration is enabled
  392. bool IsUsingUdpAcceleration; // Using the UDP acceleration function
  393. char SessionName[MAX_SESSION_NAME_LEN + 1]; // Session name
  394. char ConnectionName[MAX_CONNECTION_NAME_LEN + 1]; // Connection name
  395. UCHAR SessionKey[SHA1_SIZE]; // Session key
  396. POLICY Policy; // Policy
  397. UINT64 TotalSendSize; // Total transmitted data size
  398. UINT64 TotalRecvSize; // Total received data size
  399. UINT64 TotalSendSizeReal; // Total transmitted data size (no compression)
  400. UINT64 TotalRecvSizeReal; // Total received data size (no compression)
  401. TRAFFIC Traffic; // Traffic data
  402. bool IsBridgeMode; // Bridge Mode
  403. bool IsMonitorMode; // Monitor mode
  404. UINT VLanId; // VLAN ID
  405. };
  406. // RPC connection
  407. struct CLIENT_RPC_CONNECTION
  408. {
  409. struct CLIENT *Client; // Client
  410. bool RpcMode; // True: RPC mode, false: notification mode
  411. THREAD *Thread; // Processing thread
  412. SOCK *Sock; // Socket
  413. };
  414. // Client object
  415. struct CLIENT
  416. {
  417. LOCK *lock; // Lock
  418. LOCK *lockForConnect; // Lock to be used in the CtConnect
  419. REF *ref; // Reference counter
  420. CEDAR *Cedar; // Cedar
  421. volatile bool Halt; // Halting flag
  422. UINT Err; // Error code
  423. CFG_RW *CfgRw; // Configuration file R/W
  424. LIST *AccountList; // Account list
  425. UCHAR EncryptedPassword[SHA1_SIZE]; // Password
  426. bool PasswordRemoteOnly; // Password is required only remote access
  427. UINT UseSecureDeviceId; // Secure device ID to be used
  428. CLIENT_CONFIG Config; // Client Settings
  429. LIST *RpcConnectionList; // RPC connection list
  430. SOCK *RpcListener; // RPC listener
  431. THREAD *RpcThread; // RPC thread
  432. LOCK *HelperLock; // Auxiliary lock
  433. THREAD *SaverThread; // Saver thread
  434. EVENT *SaverHalter; // The event to stop the Saver thread
  435. LIST *NotifyCancelList; // Notification event list
  436. KEEP *Keep; // Keep Connection
  437. LIST *UnixVLanList; // List of virtual LAN cards in UNIX
  438. LOG *Logger; // Logger
  439. bool DontSavePassword; // Flag for not to save the password
  440. ERASER *Eraser; // Eraser
  441. SOCKLIST *SockList; // Socket list
  442. CM_SETTING *CmSetting; // CM configuration
  443. void *GlobalPulse; // Global pulse
  444. THREAD *PulseRecvThread; // Pulse reception thread
  445. volatile bool HaltPulseThread; // Stop flag for the pulse reception thread
  446. bool NoSaveLog; // Do not save the log
  447. bool NoSaveConfig; // Do not save the settings
  448. INTERNET_SETTING CommonProxySetting; // Common proxy settings
  449. void *MsSuspendHandler; // MS suspend handler
  450. };
  451. // Notification to the remote client
  452. struct RPC_CLIENT_NOTIFY
  453. {
  454. UINT NotifyCode; // Code
  455. };
  456. // Type of notification
  457. #define CLIENT_NOTIFY_ACCOUNT_CHANGED 1 // Account change notification
  458. #define CLIENT_NOTIFY_VLAN_CHANGED 2 // Virtual LAN card change notification
  459. // Remote client
  460. struct REMOTE_CLIENT
  461. {
  462. RPC *Rpc;
  463. UINT OsType;
  464. bool Unix;
  465. bool Win9x;
  466. UINT ProcessId;
  467. UINT ClientBuildInt;
  468. bool IsVgcSupported;
  469. bool ShowVgcLink;
  470. char ClientId[128];
  471. };
  472. // Notification client
  473. struct NOTIFY_CLIENT
  474. {
  475. SOCK *Sock;
  476. };
  477. // CM configuration
  478. struct CM_SETTING
  479. {
  480. bool EasyMode; // Simple mode
  481. bool LockMode; // Setting lock mode
  482. UCHAR HashedPassword[SHA1_SIZE]; // Password
  483. };
  484. // Function prototype
  485. REMOTE_CLIENT *CcConnectRpc(char *server_name, char *password, bool *bad_pass, bool *no_remote, UINT wait_retry);
  486. REMOTE_CLIENT *CcConnectRpcEx(char *server_name, char *password, bool *bad_pass, bool *no_remote, UCHAR *key, UINT *key_error_code, bool shortcut_disconnect, UINT wait_retry);
  487. UINT CcShortcut(UCHAR *key);
  488. UINT CcShortcutDisconnect(UCHAR *key);
  489. void CcDisconnectRpc(REMOTE_CLIENT *rc);
  490. NOTIFY_CLIENT *CcConnectNotify(REMOTE_CLIENT *rc);
  491. void CcDisconnectNotify(NOTIFY_CLIENT *n);
  492. void CcStopNotify(NOTIFY_CLIENT *n);
  493. bool CcWaitNotify(NOTIFY_CLIENT *n);
  494. UINT CcGetClientVersion(REMOTE_CLIENT *r, RPC_CLIENT_VERSION *a);
  495. UINT CcSetCmSetting(REMOTE_CLIENT *r, CM_SETTING *a);
  496. UINT CcGetCmSetting(REMOTE_CLIENT *r, CM_SETTING *a);
  497. UINT CcSetPassword(REMOTE_CLIENT *r, RPC_CLIENT_PASSWORD *pass);
  498. UINT CcGetPasswordSetting(REMOTE_CLIENT *r, RPC_CLIENT_PASSWORD_SETTING *a);
  499. UINT CcEnumCa(REMOTE_CLIENT *r, RPC_CLIENT_ENUM_CA *e);
  500. UINT CcAddCa(REMOTE_CLIENT *r, RPC_CERT *cert);
  501. UINT CcDeleteCa(REMOTE_CLIENT *r, RPC_CLIENT_DELETE_CA *p);
  502. UINT CcGetCa(REMOTE_CLIENT *r, RPC_GET_CA *get);
  503. UINT CcEnumSecure(REMOTE_CLIENT *r, RPC_CLIENT_ENUM_SECURE *e);
  504. UINT CcUseSecure(REMOTE_CLIENT *r, RPC_USE_SECURE *sec);
  505. UINT CcGetUseSecure(REMOTE_CLIENT *r, RPC_USE_SECURE *sec);
  506. UINT CcEnumObjectInSecure(REMOTE_CLIENT *r, RPC_ENUM_OBJECT_IN_SECURE *e);
  507. UINT CcCreateVLan(REMOTE_CLIENT *r, RPC_CLIENT_CREATE_VLAN *create);
  508. UINT CcUpgradeVLan(REMOTE_CLIENT *r, RPC_CLIENT_CREATE_VLAN *create);
  509. UINT CcGetVLan(REMOTE_CLIENT *r, RPC_CLIENT_GET_VLAN *get);
  510. UINT CcSetVLan(REMOTE_CLIENT *r, RPC_CLIENT_SET_VLAN *set);
  511. UINT CcEnumVLan(REMOTE_CLIENT *r, RPC_CLIENT_ENUM_VLAN *e);
  512. UINT CcDeleteVLan(REMOTE_CLIENT *r, RPC_CLIENT_CREATE_VLAN *d);
  513. UINT CcEnableVLan(REMOTE_CLIENT *r, RPC_CLIENT_CREATE_VLAN *vlan);
  514. UINT CcDisableVLan(REMOTE_CLIENT *r, RPC_CLIENT_CREATE_VLAN *vlan);
  515. UINT CcCreateAccount(REMOTE_CLIENT *r, RPC_CLIENT_CREATE_ACCOUNT *a);
  516. UINT CcEnumAccount(REMOTE_CLIENT *r, RPC_CLIENT_ENUM_ACCOUNT *e);
  517. UINT CcDeleteAccount(REMOTE_CLIENT *r, RPC_CLIENT_DELETE_ACCOUNT *a);
  518. UINT CcSetAccount(REMOTE_CLIENT *r, RPC_CLIENT_CREATE_ACCOUNT *a);
  519. UINT CcGetAccount(REMOTE_CLIENT *r, RPC_CLIENT_GET_ACCOUNT *a);
  520. UINT CcRenameAccount(REMOTE_CLIENT *r, RPC_RENAME_ACCOUNT *rename);
  521. UINT CcSetClientConfig(REMOTE_CLIENT *r, CLIENT_CONFIG *o);
  522. UINT CcGetClientConfig(REMOTE_CLIENT *r, CLIENT_CONFIG *o);
  523. UINT CcConnect(REMOTE_CLIENT *r, RPC_CLIENT_CONNECT *connect);
  524. UINT CcDisconnect(REMOTE_CLIENT *r, RPC_CLIENT_CONNECT *connect);
  525. UINT CcGetAccountStatus(REMOTE_CLIENT *r, RPC_CLIENT_GET_CONNECTION_STATUS *st);
  526. UINT CcSetStartupAccount(REMOTE_CLIENT *r, RPC_CLIENT_DELETE_ACCOUNT *a);
  527. UINT CcRemoveStartupAccount(REMOTE_CLIENT *r, RPC_CLIENT_DELETE_ACCOUNT *a);
  528. UINT CcGetIssuer(REMOTE_CLIENT *r, RPC_GET_ISSUER *a);
  529. UINT CcGetCommonProxySetting(REMOTE_CLIENT *r, INTERNET_SETTING *a);
  530. UINT CcSetCommonProxySetting(REMOTE_CLIENT *r, INTERNET_SETTING *a);
  531. void CcSetServiceToForegroundProcess(REMOTE_CLIENT *r);
  532. char *CiGetFirstVLan(CLIENT *c);
  533. void CiNormalizeAccountVLan(CLIENT *c);
  534. bool CompareInternetSetting(INTERNET_SETTING *s1, INTERNET_SETTING *s2);
  535. void CnStart();
  536. void CnListenerProc(THREAD *thread, void *param);
  537. void CnReleaseSocket(SOCK *s, PACK *p);
  538. void CnStatusPrinter(SOCK *s, PACK *p);
  539. void Win32CnStatusPrinter(SOCK *s, PACK *p);
  540. void CnConnectErrorDlg(SOCK *s, PACK *p);
  541. void Win32CnConnectErrorDlg(SOCK *s, PACK *p);
  542. void Win32CnConnectErrorDlgThreadProc(THREAD *thread, void *param);
  543. void CnPasswordDlg(SOCK *s, PACK *p);
  544. void Win32CnPasswordDlg(SOCK *s, PACK *p);
  545. void Win32CnPasswordDlgThreadProc(THREAD *thread, void *param);
  546. void CnMsgDlg(SOCK *s, PACK *p);
  547. void Win32CnMsgDlg(SOCK *s, PACK *p);
  548. void Win32CnMsgDlgThreadProc(THREAD *thread, void *param);
  549. void CnNicInfo(SOCK *s, PACK *p);
  550. void Win32CnNicInfo(SOCK *s, PACK *p);
  551. void Win32CnNicInfoThreadProc(THREAD *thread, void *param);
  552. void CnCheckCert(SOCK *s, PACK *p);
  553. void Win32CnCheckCert(SOCK *s, PACK *p);
  554. void Win32CnCheckCertThreadProc(THREAD *thread, void *param);
  555. void CnExecDriverInstaller(SOCK *s, PACK *p);
  556. void Win32CnExecDriverInstaller(SOCK *s, PACK *p);
  557. bool CnCheckAlreadyExists(bool lock);
  558. bool CnIsCnServiceReady();
  559. void CnWaitForCnServiceReady();
  560. void CnSecureSign(SOCK *s, PACK *p);
  561. SOCK *CncConnect();
  562. SOCK *CncConnectEx(UINT timeout);
  563. void CncReleaseSocket();
  564. void CncExit();
  565. UINT CncGetSessionId();
  566. bool CncExecDriverInstaller(char *arg);
  567. SOCK *CncStatusPrinterWindowStart(SESSION *s);
  568. void CncStatusPrinterWindowPrint(SOCK *s, wchar_t *str);
  569. void CncStatusPrinterWindowStop(SOCK *s);
  570. void CncStatusPrinterWindowThreadProc(THREAD *thread, void *param);
  571. bool CncConnectErrorDlg(SESSION *session, UI_CONNECTERROR_DLG *dlg);
  572. void CncConnectErrorDlgHaltThread(THREAD *thread, void *param);
  573. bool CncPasswordDlg(SESSION *session, UI_PASSWORD_DLG *dlg);
  574. void CncPasswordDlgHaltThread(THREAD *thread, void *param);
  575. void CncCheckCert(SESSION *session, UI_CHECKCERT *dlg);
  576. void CncCheckCertHaltThread(THREAD *thread, void *param);
  577. bool CncSecureSignDlg(SECURE_SIGN *sign);
  578. SOCK *CncMsgDlg(UI_MSG_DLG *dlg);
  579. void CndMsgDlgFree(SOCK *s);
  580. SOCK *CncNicInfo(UI_NICINFO *info);
  581. void CncNicInfoFree(SOCK *s);
  582. void CtStartClient();
  583. void CtStopClient();
  584. CLIENT *CtGetClient();
  585. void CtReleaseClient(CLIENT *c);
  586. bool CtGetClientVersion(CLIENT *c, RPC_CLIENT_VERSION *ver);
  587. bool CtGetCmSetting(CLIENT *c, CM_SETTING *s);
  588. bool CtSetCmSetting(CLIENT *c, CM_SETTING *s);
  589. bool CtSetPassword(CLIENT *c, RPC_CLIENT_PASSWORD *pass);
  590. bool CtGetPasswordSetting(CLIENT *c, RPC_CLIENT_PASSWORD_SETTING *a);
  591. bool CtEnumCa(CLIENT *c, RPC_CLIENT_ENUM_CA *e);
  592. bool CtAddCa(CLIENT *c, RPC_CERT *cert);
  593. bool CtDeleteCa(CLIENT *c, RPC_CLIENT_DELETE_CA *p);
  594. bool CtGetCa(CLIENT *c, RPC_GET_CA *get);
  595. bool CtEnumSecure(CLIENT *c, RPC_CLIENT_ENUM_SECURE *e);
  596. bool CtUseSecure(CLIENT *c, RPC_USE_SECURE *sec);
  597. bool CtGetUseSecure(CLIENT *c, RPC_USE_SECURE *sec);
  598. bool CtEnumObjectInSecure(CLIENT *c, RPC_ENUM_OBJECT_IN_SECURE *e);
  599. bool CtCreateVLan(CLIENT *c, RPC_CLIENT_CREATE_VLAN *create);
  600. bool CtUpgradeVLan(CLIENT *c, RPC_CLIENT_CREATE_VLAN *create);
  601. bool CtGetVLan(CLIENT *c, RPC_CLIENT_GET_VLAN *get);
  602. bool CtSetVLan(CLIENT *c, RPC_CLIENT_SET_VLAN *set);
  603. bool CtEnumVLan(CLIENT *c, RPC_CLIENT_ENUM_VLAN *e);
  604. bool CtDeleteVLan(CLIENT *c, RPC_CLIENT_CREATE_VLAN *d);
  605. bool CtEnableVLan(CLIENT *c, RPC_CLIENT_CREATE_VLAN *vlan);
  606. bool CtDisableVLan(CLIENT *c, RPC_CLIENT_CREATE_VLAN *vlan);
  607. bool CtCreateAccount(CLIENT *c, RPC_CLIENT_CREATE_ACCOUNT *a, bool inner);
  608. bool CtEnumAccount(CLIENT *c, RPC_CLIENT_ENUM_ACCOUNT *e);
  609. bool CtDeleteAccount(CLIENT *c, RPC_CLIENT_DELETE_ACCOUNT *a, bool inner);
  610. bool CtSetAccount(CLIENT *c, RPC_CLIENT_CREATE_ACCOUNT *a, bool inner);
  611. bool CtGetAccount(CLIENT *c, RPC_CLIENT_GET_ACCOUNT *a);
  612. bool CtRenameAccount(CLIENT *c, RPC_RENAME_ACCOUNT *rename, bool inner);
  613. bool CtSetClientConfig(CLIENT *c, CLIENT_CONFIG *o);
  614. bool CtGetClientConfig(CLIENT *c, CLIENT_CONFIG *o);
  615. bool CtConnect(CLIENT *c, RPC_CLIENT_CONNECT *connect);
  616. bool CtDisconnect(CLIENT *c, RPC_CLIENT_CONNECT *connect, bool inner);
  617. bool CtGetAccountStatus(CLIENT *c, RPC_CLIENT_GET_CONNECTION_STATUS *st);
  618. bool CtSetStartupAccount(CLIENT *c, RPC_CLIENT_DELETE_ACCOUNT *a, bool inner);
  619. bool CtRemoveStartupAccount(CLIENT *c, RPC_CLIENT_DELETE_ACCOUNT *a);
  620. bool CtGetIssuer(CLIENT *c, RPC_GET_ISSUER *a);
  621. bool CtGetCommonProxySetting(CLIENT *c, INTERNET_SETTING *a);
  622. bool CtSetCommonProxySetting(CLIENT *c, INTERNET_SETTING *a);
  623. // Internal function prototype
  624. void CiSendGlobalPulse(CLIENT *c);
  625. void CiPulseRecvThread(THREAD *thread, void *param);
  626. char *CiGetVpnClientExeFileName();
  627. void CiServerThread(THREAD *t, void *param);
  628. void CiInitSaver(CLIENT *c);
  629. void CiFreeSaver(CLIENT *c);
  630. void CiGetSessionStatus(RPC_CLIENT_GET_CONNECTION_STATUS *st, SESSION *s);
  631. PACK *CiRpcDispatch(RPC *rpc, char *name, PACK *p);
  632. void CiRpcAccepted(CLIENT *c, SOCK *s);
  633. void CiNotifyMain(CLIENT *c, SOCK *s);
  634. void CiRpcAcceptThread(THREAD *thread, void *param);
  635. void CiRpcServerThread(THREAD *thread, void *param);
  636. void CiStartRpcServer(CLIENT *c);
  637. void CiStopRpcServer(CLIENT *c);
  638. CLIENT_OPTION *CiLoadClientOption(FOLDER *f);
  639. CLIENT_AUTH *CiLoadClientAuth(FOLDER *f);
  640. ACCOUNT *CiLoadClientAccount(FOLDER *f);
  641. void CiLoadClientConfig(CLIENT_CONFIG *c, FOLDER *f);
  642. void CiLoadAccountDatabase(CLIENT *c, FOLDER *f);
  643. void CiLoadCAList(CLIENT *c, FOLDER *f);
  644. void CiLoadCACert(CLIENT *c, FOLDER *f);
  645. void CiLoadVLanList(CLIENT *c, FOLDER *f);
  646. void CiLoadVLan(CLIENT *c, FOLDER *f);
  647. bool CiReadSettingFromCfg(CLIENT *c, FOLDER *root);
  648. void CiWriteAccountDatabase(CLIENT *c, FOLDER *f);
  649. void CiWriteAccountData(FOLDER *f, ACCOUNT *a);
  650. void CiWriteClientOption(FOLDER *f, CLIENT_OPTION *o);
  651. void CiWriteClientAuth(FOLDER *f, CLIENT_AUTH *a);
  652. void CiWriteClientConfig(FOLDER *cc, CLIENT_CONFIG *config);
  653. void CiWriteSettingToCfg(CLIENT *c, FOLDER *root);
  654. void CiWriteCAList(CLIENT *c, FOLDER *f);
  655. void CiWriteCACert(CLIENT *c, FOLDER *f, X *x);
  656. void CiWriteVLanList(CLIENT *c, FOLDER *f);
  657. void CiWriteVLan(CLIENT *c, FOLDER *f, UNIX_VLAN *v);
  658. void CiFreeClientGetConnectionStatus(RPC_CLIENT_GET_CONNECTION_STATUS *st);
  659. bool CiCheckCertProc(SESSION *s, CONNECTION *c, X *server_x, bool *expired);
  660. bool CiSecureSignProc(SESSION *s, CONNECTION *c, SECURE_SIGN *sign);
  661. bool Win32CiSecureSign(SECURE_SIGN *sign);
  662. void CiFreeClientAuth(CLIENT_AUTH *auth);
  663. void CiFreeClientCreateAccount(RPC_CLIENT_CREATE_ACCOUNT *a);
  664. void CiFreeClientGetAccount(RPC_CLIENT_GET_ACCOUNT *a);
  665. void CiFreeClientEnumVLan(RPC_CLIENT_ENUM_VLAN *e);
  666. void CiFreeClientEnumSecure(RPC_CLIENT_ENUM_SECURE *e);
  667. void CiFreeClientEnumCa(RPC_CLIENT_ENUM_CA *e);
  668. void CiFreeEnumObjectInSecure(RPC_ENUM_OBJECT_IN_SECURE *a);
  669. void CiFreeGetCa(RPC_GET_CA *a);
  670. void CiFreeGetIssuer(RPC_GET_ISSUER *a);
  671. void CiFreeClientEnumAccount(RPC_CLIENT_ENUM_ACCOUNT *a);
  672. void CiSetError(CLIENT *c, UINT err);
  673. void CiCheckOs();
  674. CLIENT *CiNewClient();
  675. void CiCleanupClient(CLIENT *c);
  676. bool CiLoadConfigurationFile(CLIENT *c);
  677. void CiSaveConfigurationFile(CLIENT *c);
  678. void CiInitConfiguration(CLIENT *c);
  679. void CiSetVLanToDefault(CLIENT *c);
  680. bool CiIsVLan(CLIENT *c, char *name);
  681. void CiFreeConfiguration(CLIENT *c);
  682. int CiCompareAccount(void *p1, void *p2);
  683. void CiFreeAccount(ACCOUNT *a);
  684. void CiNotify(CLIENT *c);
  685. void CiNotifyInternal(CLIENT *c);
  686. void CiClientStatusPrinter(SESSION *s, wchar_t *status);
  687. void CiInitKeep(CLIENT *c);
  688. void CiFreeKeep(CLIENT *c);
  689. int CiCompareUnixVLan(void *p1, void *p2);
  690. BUF *CiAccountToCfg(RPC_CLIENT_CREATE_ACCOUNT *t);
  691. RPC_CLIENT_CREATE_ACCOUNT *CiCfgToAccount(BUF *b);
  692. void CiChangeAllVLanMacAddressIfCleared(CLIENT *c);
  693. void CiChangeAllVLanMacAddress(CLIENT *c);
  694. void CiChangeAllVLanMacAddressIfMachineChanged(CLIENT *c);
  695. bool CiReadLastMachineHash(void *data);
  696. bool CiWriteLastMachineHash(void *data);
  697. void CiGetCurrentMachineHash(void *data);
  698. void CiGetCurrentMachineHashOld(void *data);
  699. void CiGetCurrentMachineHashNew(void *data);
  700. LIST *CiLoadIni();
  701. void CiFreeIni(LIST *o);
  702. void CiLoadIniSettings(CLIENT *c);
  703. bool CiLoadConfigFilePathFromIni(char *path, UINT size);
  704. int CiCompareClientAccountEnumItemByLastConnectDateTime(void *p1, void *p2);
  705. bool CiIsValidVLanRegulatedName(char *name);
  706. void CiGenerateVLanRegulatedName(char *name, UINT size, UINT i);
  707. bool CiGetNextRecommendedVLanName(REMOTE_CLIENT *r, char *name, UINT size);
  708. void CiDisableWcmNetworkMinimize(CLIENT *c);
  709. bool CiTryToParseAccount(BUF *b);
  710. bool CiTryToParseAccountFile(wchar_t *name);
  711. bool CiEraseSensitiveInAccount(BUF *b);
  712. bool CiHasAccountSensitiveInformation(BUF *b);
  713. bool CiHasAccountSensitiveInformationFile(wchar_t *name);
  714. void CiApplyInnerVPNServerConfig(CLIENT *c);
  715. SERVER *CiNewInnerVPNServer(CLIENT *c, bool relay_server);
  716. void CiFreeInnerVPNServer(CLIENT *c, SERVER *s);
  717. void CiIncrementNumActiveSessions();
  718. void CiDecrementNumActiveSessions();
  719. UINT CiGetNumActiveSessions();
  720. BUF *EncryptPassword(char *password);
  721. BUF *EncryptPassword2(char *password);
  722. char *DecryptPassword(BUF *b);
  723. char *DecryptPassword2(BUF *b);
  724. void InRpcGetIssuer(RPC_GET_ISSUER *c, PACK *p);
  725. void OutRpcGetIssuer(PACK *p, RPC_GET_ISSUER *c);
  726. void InRpcClientVersion(RPC_CLIENT_VERSION *ver, PACK *p);
  727. void OutRpcClientVersion(PACK *p, RPC_CLIENT_VERSION *ver);
  728. void InRpcClientPassword(RPC_CLIENT_PASSWORD *pw, PACK *p);
  729. void OutRpcClientPassword(PACK *p, RPC_CLIENT_PASSWORD *pw);
  730. void InRpcClientEnumCa(RPC_CLIENT_ENUM_CA *e, PACK *p);
  731. void OutRpcClientEnumCa(PACK *p, RPC_CLIENT_ENUM_CA *e);
  732. void InRpcCert(RPC_CERT *c, PACK *p);
  733. void OutRpcCert(PACK *p, RPC_CERT *c);
  734. void InRpcClientDeleteCa(RPC_CLIENT_DELETE_CA *c, PACK *p);
  735. void OutRpcClientDeleteCa(PACK *p, RPC_CLIENT_DELETE_CA *c);
  736. void InRpcGetCa(RPC_GET_CA *c, PACK *p);
  737. void OutRpcGetCa(PACK *p, RPC_GET_CA *c);
  738. void InRpcClientEnumSecure(RPC_CLIENT_ENUM_SECURE *e, PACK *p);
  739. void OutRpcClientEnumSecure(PACK *p, RPC_CLIENT_ENUM_SECURE *e);
  740. void InRpcUseSecure(RPC_USE_SECURE *u, PACK *p);
  741. void OutRpcUseSecure(PACK *p, RPC_USE_SECURE *u);
  742. void InRpcEnumObjectInSecure(RPC_ENUM_OBJECT_IN_SECURE *e, PACK *p);
  743. void OutRpcEnumObjectInSecure(PACK *p, RPC_ENUM_OBJECT_IN_SECURE *e);
  744. void InRpcCreateVLan(RPC_CLIENT_CREATE_VLAN *v, PACK *p);
  745. void OutRpcCreateVLan(PACK *p, RPC_CLIENT_CREATE_VLAN *v);
  746. void InRpcClientGetVLan(RPC_CLIENT_GET_VLAN *v, PACK *p);
  747. void OutRpcClientGetVLan(PACK *p, RPC_CLIENT_GET_VLAN *v);
  748. void InRpcClientSetVLan(RPC_CLIENT_SET_VLAN *v, PACK *p);
  749. void OutRpcClientSetVLan(PACK *p, RPC_CLIENT_SET_VLAN *v);
  750. void InRpcClientEnumVLan(RPC_CLIENT_ENUM_VLAN *v, PACK *p);
  751. void OutRpcClientEnumVLan(PACK *p, RPC_CLIENT_ENUM_VLAN *v);
  752. void InRpcClientOption(CLIENT_OPTION *c, PACK *p);
  753. void OutRpcClientOption(PACK *p, CLIENT_OPTION *c);
  754. void InRpcClientAuth(CLIENT_AUTH *c, PACK *p);
  755. void OutRpcClientAuth(PACK *p, CLIENT_AUTH *c);
  756. void InRpcClientCreateAccount(RPC_CLIENT_CREATE_ACCOUNT *c, PACK *p);
  757. void OutRpcClientCreateAccount(PACK *p, RPC_CLIENT_CREATE_ACCOUNT *c);
  758. void InRpcClientEnumAccount(RPC_CLIENT_ENUM_ACCOUNT *e, PACK *p);
  759. void OutRpcClientEnumAccount(PACK *p, RPC_CLIENT_ENUM_ACCOUNT *e);
  760. void InRpcClientDeleteAccount(RPC_CLIENT_DELETE_ACCOUNT *a, PACK *p);
  761. void OutRpcClientDeleteAccount(PACK *p, RPC_CLIENT_DELETE_ACCOUNT *a);
  762. void InRpcRenameAccount(RPC_RENAME_ACCOUNT *a, PACK *p);
  763. void OutRpcRenameAccount(PACK *p, RPC_RENAME_ACCOUNT *a);
  764. void InRpcClientGetAccount(RPC_CLIENT_GET_ACCOUNT *c, PACK *p);
  765. void OutRpcClientGetAccount(PACK *p, RPC_CLIENT_GET_ACCOUNT *c);
  766. void InRpcClientConnect(RPC_CLIENT_CONNECT *c, PACK *p);
  767. void OutRpcClientConnect(PACK *p, RPC_CLIENT_CONNECT *c);
  768. void InRpcPolicy(POLICY *o, PACK *p);
  769. void OutRpcPolicy(PACK *p, POLICY *o);
  770. void InRpcClientGetConnectionStatus(RPC_CLIENT_GET_CONNECTION_STATUS *s, PACK *p);
  771. void OutRpcClientGetConnectionStatus(PACK *p, RPC_CLIENT_GET_CONNECTION_STATUS *c);
  772. void InRpcClientNotify(RPC_CLIENT_NOTIFY *n, PACK *p);
  773. void OutRpcClientNotify(PACK *p, RPC_CLIENT_NOTIFY *n);
  774. void InRpcClientConfig(CLIENT_CONFIG *c, PACK *p);
  775. void OutRpcClientConfig(PACK *p, CLIENT_CONFIG *c);
  776. void InRpcClientPasswordSetting(RPC_CLIENT_PASSWORD_SETTING *a, PACK *p);
  777. void OutRpcClientPasswordSetting(PACK *p, RPC_CLIENT_PASSWORD_SETTING *a);
  778. void InRpcTraffic(TRAFFIC *t, PACK *p);
  779. void OutRpcTraffic(PACK *p, TRAFFIC *t);
  780. void InRpcTrafficEx(TRAFFIC *t, PACK *p, UINT i);
  781. void OutRpcTrafficEx(TRAFFIC *t, PACK *p, UINT i, UINT num);
  782. void OutRpcCmSetting(PACK *p, CM_SETTING *c);
  783. void InRpcCmSetting(CM_SETTING *c, PACK *p);
  784. #ifdef OS_WIN32
  785. void CiInitDriverVerStruct(MS_DRIVER_VER *ver);
  786. #endif // OS_EIN32
  787. #endif // CLIENT_H