1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-12-25 17:49:52 +03:00

Merge PR #857: remove unused functions

This commit is contained in:
Davide Beatrici 2019-01-06 20:31:36 +01:00 committed by GitHub
commit 3b85a116ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 11 additions and 92 deletions

View File

@ -493,20 +493,6 @@ void DCThread(THREAD *thread, void *param)
FreeInterruptManager(interrupt);
}
// Command to update immediately
void DCUpdateNow(DDNS_CLIENT *c)
{
// Validate arguments
if (c == NULL)
{
return;
}
c->NextRegisterTick_IPv4 = c->NextRegisterTick_IPv6 = 0;
Set(c->Event);
}
// Execution of registration
UINT DCRegister(DDNS_CLIENT *c, bool ipv6, DDNS_REGISTER_PARAM *p, char *replace_v6)
{
@ -526,9 +512,6 @@ UINT DCRegister(DDNS_CLIENT *c, bool ipv6, DDNS_REGISTER_PARAM *p, char *replace
char current_azure_ip[MAX_SIZE];
INTERNET_SETTING t;
UINT build = 0;
bool use_https = false;
bool use_vgs = false;
bool no_cert_verify = false;
char add_header_name[64];
char add_header_value[64];
// Validate arguments
@ -652,33 +635,20 @@ UINT DCRegister(DDNS_CLIENT *c, bool ipv6, DDNS_REGISTER_PARAM *p, char *replace
Format(url2, sizeof(url2), "%s?v=%I64u", url, Rand64());
Format(url3, sizeof(url3), url2, key_hash_str[2], key_hash_str[3]);
if (use_https == false)
{
ReplaceStr(url3, sizeof(url3), url3, "https://", "http://");
}
ReplaceStr(url3, sizeof(url3), url3, "https://", "http://");
ReplaceStr(url3, sizeof(url3), url3, ".servers", ".open.servers");
cert_hash = StrToBin(DDNS_CERT_HASH);
if (no_cert_verify == false)
{
cert_hash = StrToBin(DDNS_CERT_HASH);
}
ret = NULL;
if (ret == NULL)
{
Debug("WpcCall: %s\n", url3);
ret = WpcCallEx2(url3, &t, DDNS_CONNECT_TIMEOUT, DDNS_COMM_TIMEOUT, "register", req,
NULL, NULL, ((cert_hash != NULL && ((cert_hash->Size % SHA1_SIZE) == 0)) ? cert_hash->Buf : NULL),
(cert_hash != NULL ? cert_hash->Size / SHA1_SIZE : 0),
NULL, DDNS_RPC_MAX_RECV_SIZE,
add_header_name, add_header_value,
DDNS_SNI_VER_STRING);
Debug("WpcCall Ret: %u\n", ret);
}
Debug("WpcCall: %s\n", url3);
ret = WpcCallEx2(url3, &t, DDNS_CONNECT_TIMEOUT, DDNS_COMM_TIMEOUT, "register", req,
NULL, NULL, ((cert_hash != NULL && ((cert_hash->Size % SHA1_SIZE) == 0)) ? cert_hash->Buf : NULL),
(cert_hash != NULL ? cert_hash->Size / SHA1_SIZE : 0),
NULL, DDNS_RPC_MAX_RECV_SIZE,
add_header_name, add_header_value,
DDNS_SNI_VER_STRING);
Debug("WpcCall Ret: %u\n", ret);
FreeBuf(cert_hash);
@ -828,7 +798,6 @@ UINT DCGetMyIpMain(DDNS_CLIENT *c, bool ipv6, char *dst, UINT dst_size, bool use
URL_DATA data;
BUF *recv;
BUF *cert_hash = NULL;
bool no_cert_verify = false;
// Validate arguments
if (dst == NULL || c == NULL)
{
@ -872,11 +841,7 @@ UINT DCGetMyIpMain(DDNS_CLIENT *c, bool ipv6, char *dst, UINT dst_size, bool use
return ERR_INTERNAL_ERROR;
}
if (no_cert_verify == false)
{
cert_hash = StrToBin(DDNS_CERT_HASH);
}
cert_hash = StrToBin(DDNS_CERT_HASH);
StrCpy(data.SniString, sizeof(data.SniString), DDNS_SNI_VER_STRING);

View File

@ -237,7 +237,6 @@ void DCThread(THREAD *thread, void *param);
UINT DCRegister(DDNS_CLIENT *c, bool ipv6, DDNS_REGISTER_PARAM *p, char *replace_v6);
UINT DCGetMyIpMain(DDNS_CLIENT *c, bool ipv6, char *dst, UINT dst_size, bool use_ssl, char *replace_v6);
UINT DCGetMyIp(DDNS_CLIENT *c, bool ipv6, char *dst, UINT dst_size, char *replace_v6);
void DCUpdateNow(DDNS_CLIENT *c);
void DCGetStatus(DDNS_CLIENT *c, DDNS_CLIENT_STATUS *st);
UINT DCChangeHostName(DDNS_CLIENT *c, char *hostname);
void DCSetInternetSetting(DDNS_CLIENT *c, INTERNET_SETTING *t);

View File

@ -116,13 +116,6 @@
static bool ipsec_disable = false;
// Disabling whole IPsec
void IPSecSetDisable(bool b)
{
ipsec_disable = b;
}
// Monitor the IPsec service of the OS, and stop it if it will conflict
void IPsecOsServiceCheckThread(THREAD *t, void *p)
{

View File

@ -198,7 +198,6 @@ void AddEtherIPId(IPSEC_SERVER *s, ETHERIP_ID *id);
bool DeleteEtherIPId(IPSEC_SERVER *s, char *id_str);
void IPsecOsServiceCheckThread(THREAD *t, void *p);
bool IPsecCheckOsService(IPSEC_SERVER *s);
void IPSecSetDisable(bool b);
#endif // PROTO_IPSEC_H

View File

@ -122,12 +122,6 @@ bool GetNoSstp()
return g_no_sstp;
}
// Set the SSTP disabling flag
void SetNoSstp(bool b)
{
g_no_sstp = b;
}
// Process the SSTP control packet reception
void SstpProcessControlPacket(SSTP_SERVER *s, SSTP_PACKET *p)
{

View File

@ -257,6 +257,5 @@ SSTP_PACKET *SstpNewControlPacket(USHORT message_type);
SSTP_PACKET *SstpNewControlPacketWithAnAttribute(USHORT message_type, SSTP_ATTRIBUTE *a);
void SstpSendPacket(SSTP_SERVER *s, SSTP_PACKET *p);
bool GetNoSstp();
void SetNoSstp(bool b);
#endif // PROTO_SSTP_H

View File

@ -6640,15 +6640,6 @@ failure:
}
// Connect through a proxy
SOCK *ProxyConnectEx(CONNECTION *c, char *proxy_host_name, UINT proxy_port,
char *server_host_name, UINT server_port,
char *username, char *password, bool additional_connect,
bool *cancel_flag, void *hWnd)
{
return ProxyConnectEx2(c, proxy_host_name, proxy_port,
server_host_name, server_port, username, password, additional_connect,
cancel_flag, hWnd, 0);
}
SOCK *ProxyConnectEx2(CONNECTION *c, char *proxy_host_name, UINT proxy_port,
char *server_host_name, UINT server_port,
char *username, char *password, bool additional_connect,

View File

@ -257,10 +257,6 @@ SOCK *ClientAdditionalConnectToServer(CONNECTION *c);
bool ClientUploadAuth2(CONNECTION *c, SOCK *s);
bool GetSessionKeyFromPack(PACK *p, UCHAR *session_key, UINT *session_key_32);
SOCK *ProxyConnectEx(CONNECTION *c, char *proxy_host_name, UINT proxy_port,
char *server_host_name, UINT server_port,
char *username, char *password, bool additional_connect,
bool *cancel_flag, void *hWnd);
SOCK *ProxyConnectEx2(CONNECTION *c, char *proxy_host_name, UINT proxy_port,
char *server_host_name, UINT server_port,
char *username, char *password, bool additional_connect,

View File

@ -406,10 +406,6 @@ UINT UtSpeedMeterDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void
}
// Speedometer
void UtSpeedMeter()
{
UtSpeedMeterEx(NULL);
}
void UtSpeedMeterEx(void *hWnd)
{
Dialog((HWND)hWnd, D_SPEEDMETER, UtSpeedMeterDlgProc, NULL);

View File

@ -131,7 +131,6 @@ void UtSpeedMeterDlgRefreshStatus(HWND hWnd);
#endif // UT_C
// Function prototype
void UtSpeedMeter();
void UtSpeedMeterEx(void *hWnd);
#endif // UT_H

View File

@ -2079,17 +2079,6 @@ void NormalizePath(char *dst, UINT size, char *src)
}
// Rename the file
bool FileRename(char *old_name, char *new_name)
{
wchar_t *old_name_w = CopyStrToUni(old_name);
wchar_t *new_name_w = CopyStrToUni(new_name);
bool ret = FileRenameW(old_name_w, new_name_w);
Free(old_name_w);
Free(new_name_w);
return ret;
}
bool FileRenameW(wchar_t *old_name, wchar_t *new_name)
{
wchar_t tmp1[MAX_SIZE];

View File

@ -307,7 +307,6 @@ IO *FileOpenEx(char *name, bool write_mode, bool read_lock);
IO *FileOpenExW(wchar_t *name, bool write_mode, bool read_lock);
void ConvertPathW(wchar_t *path);
bool FileRenameInnerW(wchar_t *old_name, wchar_t *new_name);
bool FileRename(char *old_name, char *new_name);
bool FileRenameW(wchar_t *old_name, wchar_t *new_name);
void NormalizePath(char *dst, UINT size, char *src);
void NormalizePathW(wchar_t *dst, UINT size, wchar_t *src);