123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688 |
- // SoftEther VPN Source Code
- // Cedar Communication Module
- //
- // SoftEther VPN Server, Client and Bridge are free software under GPLv2.
- //
- // Copyright (c) 2012-2014 Daiyuu Nobori.
- // Copyright (c) 2012-2014 SoftEther VPN Project, University of Tsukuba, Japan.
- // Copyright (c) 2012-2014 SoftEther Corporation.
- //
- // All Rights Reserved.
- //
- // http://www.softether.org/
- //
- // Author: Daiyuu Nobori
- // Comments: Tetsuo Sugiyama, Ph.D.
- //
- // This program is free software; you can redistribute it and/or
- // modify it under the terms of the GNU General Public License
- // version 2 as published by the Free Software Foundation.
- //
- // This program is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- // GNU General Public License for more details.
- //
- // You should have received a copy of the GNU General Public License version 2
- // along with this program; if not, write to the Free Software
- // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- //
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- //
- // THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
- // AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
- //
- //
- // THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
- // UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
- // MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
- // SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
- // SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
- // CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
- // DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
- // MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
- // SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
- // CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
- // EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
- // JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
- // AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
- // THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
- //
- // USE ONLY IN JAPAN. DO NOT USE THIS SOFTWARE IN ANOTHER COUNTRY UNLESS
- // YOU HAVE A CONFIRMATION THAT THIS SOFTWARE DOES NOT VIOLATE ANY
- // CRIMINAL LAWS OR CIVIL RIGHTS IN THAT PARTICULAR COUNTRY. USING THIS
- // SOFTWARE IN OTHER COUNTRIES IS COMPLETELY AT YOUR OWN RISK. THE
- // SOFTETHER VPN PROJECT HAS DEVELOPED AND DISTRIBUTED THIS SOFTWARE TO
- // COMPLY ONLY WITH THE JAPANESE LAWS AND EXISTING CIVIL RIGHTS INCLUDING
- // PATENTS WHICH ARE SUBJECTS APPLY IN JAPAN. OTHER COUNTRIES' LAWS OR
- // CIVIL RIGHTS ARE NONE OF OUR CONCERNS NOR RESPONSIBILITIES. WE HAVE
- // NEVER INVESTIGATED ANY CRIMINAL REGULATIONS, CIVIL LAWS OR
- // INTELLECTUAL PROPERTY RIGHTS INCLUDING PATENTS IN ANY OF OTHER 200+
- // COUNTRIES AND TERRITORIES. BY NATURE, THERE ARE 200+ REGIONS IN THE
- // WORLD, WITH DIFFERENT LAWS. IT IS IMPOSSIBLE TO VERIFY EVERY
- // COUNTRIES' LAWS, REGULATIONS AND CIVIL RIGHTS TO MAKE THE SOFTWARE
- // COMPLY WITH ALL COUNTRIES' LAWS BY THE PROJECT. EVEN IF YOU WILL BE
- // SUED BY A PRIVATE ENTITY OR BE DAMAGED BY A PUBLIC SERVANT IN YOUR
- // COUNTRY, THE DEVELOPERS OF THIS SOFTWARE WILL NEVER BE LIABLE TO
- // RECOVER OR COMPENSATE SUCH DAMAGES, CRIMINAL OR CIVIL
- // RESPONSIBILITIES. NOTE THAT THIS LINE IS NOT LICENSE RESTRICTION BUT
- // JUST A STATEMENT FOR WARNING AND DISCLAIMER.
- //
- //
- // SOURCE CODE CONTRIBUTION
- // ------------------------
- //
- // Your contribution to SoftEther VPN Project is much appreciated.
- // Please send patches to us through GitHub.
- // Read the SoftEther VPN Patch Acceptance Policy in advance:
- // http://www.softether.org/5-download/src/9.patch
- //
- //
- // DEAR SECURITY EXPERTS
- // ---------------------
- //
- // If you find a bug or a security vulnerability please kindly inform us
- // about the problem immediately so that we can fix the security problem
- // to protect a lot of users around the world as soon as possible.
- //
- // Our e-mail address for security reports is:
- // softether-vpn-security [at] softether.org
- //
- // Please note that the above e-mail address is not a technical support
- // inquiry address. If you need technical assistance, please visit
- // http://www.softether.org/ and ask your question on the users forum.
- //
- // Thank you for your cooperation.
- //
- //
- // NO MEMORY OR RESOURCE LEAKS
- // ---------------------------
- //
- // The memory-leaks and resource-leaks verification under the stress
- // test has been passed before release this source code.
- // AzureClient.c
- // VPN Azure Client
- #include "CedarPch.h"
- // Wait for connection request
- void AcWaitForRequest(AZURE_CLIENT *ac, SOCK *s, AZURE_PARAM *param)
- {
- // Validate arguments
- if (ac == NULL || s == NULL || param == NULL)
- {
- return;
- }
- while (ac->Halt == false)
- {
- UCHAR uc;
- // Receive 1 byte
- if (RecvAll(s, &uc, 1, false) == 0)
- {
- break;
- }
- if (uc != 0)
- {
- // Receive a Pack
- PACK *p = RecvPackWithHash(s);
- if (p == NULL)
- {
- break;
- }
- else
- {
- // Verify contents of Pack
- char opcode[MAX_SIZE];
- char cipher_name[MAX_SIZE];
- char hostname[MAX_SIZE];
- PackGetStr(p, "opcode", opcode, sizeof(opcode));
- PackGetStr(p, "cipher_name", cipher_name, sizeof(cipher_name));
- PackGetStr(p, "hostname", hostname, sizeof(hostname));
- if (StrCmpi(opcode, "relay") == 0)
- {
- IP client_ip, server_ip;
- UINT client_port;
- UINT server_port;
- UCHAR session_id[SHA1_SIZE];
- if (PackGetIp(p, "client_ip", &client_ip) &&
- PackGetIp(p, "server_ip", &server_ip) &&
- PackGetData2(p, "session_id", session_id, sizeof(session_id)))
- {
- client_port = PackGetInt(p, "client_port");
- server_port = PackGetInt(p, "server_port");
- if (client_port != 0 && server_port != 0)
- {
- SOCK *ns;
- Debug("Connect Request from %r:%u\n", &client_ip, client_port);
- // Create new socket and connect VPN Azure Server
- if (ac->DDnsStatusCopy.InternetSetting.ProxyType == PROXY_DIRECT)
- {
- ns = ConnectEx2(ac->DDnsStatusCopy.CurrentAzureIp, AZURE_SERVER_PORT,
- 0, (bool *)&ac->Halt);
- }
- else
- {
- ns = WpcSockConnect2(ac->DDnsStatusCopy.CurrentAzureIp, AZURE_SERVER_PORT,
- &ac->DDnsStatusCopy.InternetSetting, NULL, AZURE_VIA_PROXY_TIMEOUT);
- }
- if (ns == NULL)
- {
- Debug("Connect Error.\n");
- }
- else
- {
- Debug("Connected to the relay server.\n");
- SetTimeout(ns, param->DataTimeout);
- if (StartSSLEx(ns, NULL, NULL, true, 0, NULL))
- {
- // Check certification
- char server_cert_hash_str[MAX_SIZE];
- UCHAR server_cert_hash[SHA1_SIZE];
- Zero(server_cert_hash, sizeof(server_cert_hash));
- GetXDigest(ns->RemoteX, server_cert_hash, true);
- BinToStr(server_cert_hash_str, sizeof(server_cert_hash_str),
- server_cert_hash, SHA1_SIZE);
- if (IsEmptyStr(ac->DDnsStatusCopy.AzureCertHash) || StrCmpi(server_cert_hash_str, ac->DDnsStatusCopy.AzureCertHash) == 0)
- {
- if (SendAll(ns, AZURE_PROTOCOL_DATA_SIANGTURE, 24, true))
- {
- PACK *p2 = NewPack();
- PackAddStr(p2, "hostname", hostname);
- PackAddData(p2, "session_id", session_id, sizeof(session_id));
- if (SendPackWithHash(ns, p2))
- {
- UCHAR uc;
- if (RecvAll(ns, &uc, 1, true) != false)
- {
- if (uc != 0)
- {
- SOCK *accept_sock = GetReverseListeningSock(ac->Cedar);
- if (accept_sock != NULL)
- {
- AddRef(ns->ref);
- SetTimeout(ns, INFINITE);
- Copy(&ns->Reverse_MyServerGlobalIp, &server_ip, sizeof(IP));
- ns->Reverse_MyServerPort = server_port;
- InjectNewReverseSocketToAccept(accept_sock, ns,
- &client_ip, client_port);
- ReleaseSock(accept_sock);
- }
- }
- }
- }
- FreePack(p2);
- }
- }
- }
- ReleaseSock(ns);
- }
- }
- }
- }
- FreePack(p);
- }
- }
- // Send 1 byte
- uc = 0;
- if (SendAll(s, &uc, 1, false) == 0)
- {
- break;
- }
- }
- }
- // VPN Azure client main thread
- void AcMainThread(THREAD *thread, void *param)
- {
- AZURE_CLIENT *ac = (AZURE_CLIENT *)param;
- UINT last_ip_revision = INFINITE;
- UINT64 last_reconnect_tick = 0;
- UINT64 next_reconnect_interval = AZURE_CONNECT_INITIAL_RETRY_INTERVAL;
- UINT num_reconnect_retry = 0;
- UINT64 next_ddns_retry_tick = 0;
- bool last_connect_ok = false;
- // Validate arguments
- if (ac == NULL || thread == NULL)
- {
- return;
- }
- while (ac->Halt == false)
- {
- UINT64 now = Tick64();
- bool connect_was_ok = false;
- // Wait for enabling VPN Azure function
- if (ac->IsEnabled)
- {
- // VPN Azure is enabled
- DDNS_CLIENT_STATUS st;
- bool connect_now = false;
- bool azure_ip_changed = false;
- Lock(ac->Lock);
- {
- Copy(&st, &ac->DDnsStatus, sizeof(DDNS_CLIENT_STATUS));
- if (StrCmpi(st.CurrentAzureIp, ac->DDnsStatusCopy.CurrentAzureIp) != 0)
- {
- if (IsEmptyStr(st.CurrentAzureIp) == false)
- {
- // Destination IP address is changed
- connect_now = true;
- num_reconnect_retry = 0;
- }
- }
- if (StrCmpi(st.CurrentHostName, ac->DDnsStatusCopy.CurrentHostName) != 0)
- {
- // DDNS host name is changed
- connect_now = true;
- num_reconnect_retry = 0;
- }
- Copy(&ac->DDnsStatusCopy, &st, sizeof(DDNS_CLIENT_STATUS));
- }
- Unlock(ac->Lock);
- if (last_ip_revision != ac->IpStatusRevision)
- {
- last_ip_revision = ac->IpStatusRevision;
- connect_now = true;
- num_reconnect_retry = 0;
- }
- if (last_reconnect_tick == 0 || (now >= (last_reconnect_tick + next_reconnect_interval)))
- {
- UINT r;
- last_reconnect_tick = now;
- num_reconnect_retry++;
- next_reconnect_interval = (UINT64)num_reconnect_retry * AZURE_CONNECT_INITIAL_RETRY_INTERVAL;
- next_reconnect_interval = MIN(next_reconnect_interval, AZURE_CONNECT_MAX_RETRY_INTERVAL);
- r = (UINT)next_reconnect_interval;
- r = GenRandInterval(r / 2, r);
- next_reconnect_interval = r;
- connect_now = true;
- }
- if (IsEmptyStr(st.CurrentAzureIp) == false && IsEmptyStr(st.CurrentHostName) == false)
- {
- if (connect_now)
- {
- SOCK *s;
- char *host = NULL;
- UINT port = AZURE_SERVER_PORT;
- Debug("VPN Azure: Connecting to %s...\n", st.CurrentAzureIp);
- if (ParseHostPort(st.CurrentAzureIp, &host, &port, AZURE_SERVER_PORT))
- {
- if (st.InternetSetting.ProxyType == PROXY_DIRECT)
- {
- s = ConnectEx2(host, port, 0, (bool *)&ac->Halt);
- }
- else
- {
- s = WpcSockConnect2(host, port, &st.InternetSetting, NULL, AZURE_VIA_PROXY_TIMEOUT);
- }
- if (s != NULL)
- {
- PACK *p;
- UINT64 established_tick = 0;
- Debug("VPN Azure: Connected.\n");
- SetTimeout(s, AZURE_PROTOCOL_CONTROL_TIMEOUT_DEFAULT);
- Lock(ac->Lock);
- {
- ac->CurrentSock = s;
- ac->IsConnected = true;
- StrCpy(ac->ConnectingAzureIp, sizeof(ac->ConnectingAzureIp), st.CurrentAzureIp);
- }
- Unlock(ac->Lock);
- SendAll(s, AZURE_PROTOCOL_CONTROL_SIGNATURE, StrLen(AZURE_PROTOCOL_CONTROL_SIGNATURE), false);
- // Receive parameter
- p = RecvPackWithHash(s);
- if (p != NULL)
- {
- UCHAR c;
- AZURE_PARAM param;
- bool hostname_changed = false;
- Zero(¶m, sizeof(param));
- param.ControlKeepAlive = PackGetInt(p, "ControlKeepAlive");
- param.ControlTimeout = PackGetInt(p, "ControlTimeout");
- param.DataTimeout = PackGetInt(p, "DataTimeout");
- param.SslTimeout = PackGetInt(p, "SslTimeout");
- FreePack(p);
- param.ControlKeepAlive = MAKESURE(param.ControlKeepAlive, 1000, AZURE_SERVER_MAX_KEEPALIVE);
- param.ControlTimeout = MAKESURE(param.ControlTimeout, 1000, AZURE_SERVER_MAX_TIMEOUT);
- param.DataTimeout = MAKESURE(param.DataTimeout, 1000, AZURE_SERVER_MAX_TIMEOUT);
- param.SslTimeout = MAKESURE(param.SslTimeout, 1000, AZURE_SERVER_MAX_TIMEOUT);
- Lock(ac->Lock);
- {
- Copy(&ac->AzureParam, ¶m, sizeof(AZURE_PARAM));
- }
- Unlock(ac->Lock);
- SetTimeout(s, param.ControlTimeout);
- // Send parameter
- p = NewPack();
- PackAddStr(p, "CurrentHostName", st.CurrentHostName);
- PackAddStr(p, "CurrentAzureIp", st.CurrentAzureIp);
- PackAddInt64(p, "CurrentAzureTimestamp", st.CurrentAzureTimestamp);
- PackAddStr(p, "CurrentAzureSignature", st.CurrentAzureSignature);
- Lock(ac->Lock);
- {
- if (StrCmpi(st.CurrentHostName, ac->DDnsStatus.CurrentHostName) != 0)
- {
- hostname_changed = true;
- }
- }
- Unlock(ac->Lock);
- if (hostname_changed == false)
- {
- if (SendPackWithHash(s, p))
- {
- // Receive result
- if (RecvAll(s, &c, 1, false))
- {
- if (c && ac->Halt == false)
- {
- connect_was_ok = true;
- established_tick = Tick64();
- AcWaitForRequest(ac, s, ¶m);
- }
- }
- }
- }
- FreePack(p);
- }
- else
- {
- WHERE;
- }
- Debug("VPN Azure: Disconnected.\n");
- Lock(ac->Lock);
- {
- ac->IsConnected = false;
- ac->CurrentSock = NULL;
- ClearStr(ac->ConnectingAzureIp, sizeof(ac->ConnectingAzureIp));
- }
- Unlock(ac->Lock);
- if (established_tick != 0)
- {
- if ((established_tick + (UINT64)AZURE_CONNECT_MAX_RETRY_INTERVAL) <= Tick64())
- {
- // If the connected time exceeds the AZURE_CONNECT_MAX_RETRY_INTERVAL, reset the retry counter.
- last_reconnect_tick = 0;
- num_reconnect_retry = 0;
- next_reconnect_interval = AZURE_CONNECT_INITIAL_RETRY_INTERVAL;
- }
- }
- Disconnect(s);
- ReleaseSock(s);
- }
- else
- {
- Debug("VPN Azure: Error: Connect Failed.\n");
- }
- Free(host);
- }
- }
- }
- }
- else
- {
- last_reconnect_tick = 0;
- num_reconnect_retry = 0;
- next_reconnect_interval = AZURE_CONNECT_INITIAL_RETRY_INTERVAL;
- }
- if (ac->Halt)
- {
- break;
- }
- if (connect_was_ok)
- {
- // If connection goes out after connected, increment connection success count to urge DDNS client query
- next_ddns_retry_tick = Tick64() + MIN((UINT64)DDNS_VPN_AZURE_CONNECT_ERROR_DDNS_RETRY_TIME_DIFF * (UINT64)(num_reconnect_retry + 1), (UINT64)DDNS_VPN_AZURE_CONNECT_ERROR_DDNS_RETRY_TIME_DIFF_MAX);
- }
- if ((next_ddns_retry_tick != 0) && (Tick64() >= next_ddns_retry_tick))
- {
- next_ddns_retry_tick = 0;
- ac->DDnsTriggerInt++;
- }
- Wait(ac->Event, rand() % 1000);
- }
- }
- // Get enabled or disabled VPN Azure client
- bool AcGetEnable(AZURE_CLIENT *ac)
- {
- // Validate arguments
- if (ac == NULL)
- {
- return false;
- }
- return ac->IsEnabled;
- }
- // Enable or disable VPN Azure client
- void AcSetEnable(AZURE_CLIENT *ac, bool enabled)
- {
- bool old_status;
- // Validate arguments
- if (ac == NULL)
- {
- return;
- }
- old_status = ac->IsEnabled;
- ac->IsEnabled = enabled;
- if (ac->IsEnabled && (ac->IsEnabled != old_status))
- {
- ac->DDnsTriggerInt++;
- }
- AcApplyCurrentConfig(ac, NULL);
- }
- // Set current configuration to VPN Azure client
- void AcApplyCurrentConfig(AZURE_CLIENT *ac, DDNS_CLIENT_STATUS *ddns_status)
- {
- bool disconnect_now = false;
- SOCK *disconnect_sock = NULL;
- // Validate arguments
- if (ac == NULL)
- {
- return;
- }
- // Get current DDNS configuration
- Lock(ac->Lock);
- {
- if (ddns_status != NULL)
- {
- if (StrCmpi(ac->DDnsStatus.CurrentHostName, ddns_status->CurrentHostName) != 0)
- {
- // If host name is changed, disconnect current data connection
- disconnect_now = true;
- }
- if (Cmp(&ac->DDnsStatus.InternetSetting, &ddns_status->InternetSetting, sizeof(INTERNET_SETTING)) != 0)
- {
- // If proxy setting is changed, disconnect current data connection
- disconnect_now = true;
- }
- Copy(&ac->DDnsStatus, ddns_status, sizeof(DDNS_CLIENT_STATUS));
- }
- if (ac->IsEnabled == false)
- {
- // If VPN Azure client is disabled, disconnect current data connection
- disconnect_now = true;
- }
- if (disconnect_now)
- {
- if (ac->CurrentSock != NULL)
- {
- disconnect_sock = ac->CurrentSock;
- AddRef(disconnect_sock->ref);
- }
- }
- }
- Unlock(ac->Lock);
- if (disconnect_sock != NULL)
- {
- Disconnect(disconnect_sock);
- ReleaseSock(disconnect_sock);
- }
- Set(ac->Event);
- }
- // Free VPN Azure client
- void FreeAzureClient(AZURE_CLIENT *ac)
- {
- SOCK *disconnect_sock = NULL;
- // Validate arguments
- if (ac == NULL)
- {
- return;
- }
- ac->Halt = true;
- Lock(ac->Lock);
- {
- if (ac->CurrentSock != NULL)
- {
- disconnect_sock = ac->CurrentSock;
- AddRef(disconnect_sock->ref);
- }
- }
- Unlock(ac->Lock);
- if (disconnect_sock != NULL)
- {
- Disconnect(disconnect_sock);
- ReleaseSock(disconnect_sock);
- }
- Set(ac->Event);
- // Stop main thread
- WaitThread(ac->MainThread, INFINITE);
- ReleaseThread(ac->MainThread);
- ReleaseEvent(ac->Event);
- DeleteLock(ac->Lock);
- Free(ac);
- }
- // Create new VPN Azure client
- AZURE_CLIENT *NewAzureClient(CEDAR *cedar, SERVER *server)
- {
- AZURE_CLIENT *ac;
- // Validate arguments
- if (cedar == NULL || server == NULL)
- {
- return NULL;
- }
- ac = ZeroMalloc(sizeof(AZURE_CLIENT));
- ac->Cedar = cedar;
- ac->Server = server;
- ac->Lock = NewLock();
- ac->IsEnabled = false;
- ac->Event = NewEvent();
- // Start main thread
- ac->MainThread = NewThread(AcMainThread, ac);
- return ac;
- }
- // Developed by SoftEther VPN Project at University of Tsukuba in Japan.
- // Department of Computer Science has dozens of overly-enthusiastic geeks.
- // Join us: http://www.tsukuba.ac.jp/english/admission/
|