1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-25 10:59:53 +03:00

remove unused functions (identified by cppcheck)

[src/Cedar/Hub.c:6663]: (style) The function 'CalcTrafficEntryDiff' is never used.
[src/Mayaqua/Cfg.c:539]: (style) The function 'CfgRead' is never used.
[src/Mayaqua/Cfg.c:1429]: (style) The function 'CfgStrToType' is never used.
[src/Mayaqua/Network.c:7782]: (style) The function 'CheckSubnetLength6' is never used.
[src/Mayaqua/Network.c:14614]: (style) The function 'CheckTCPPortThread' is never used.
[src/Cedar/WinUi.c:9257]: (style) The function 'CheckTextLen' is never used.
[src/Cedar/WinUi.c:9238]: (style) The function 'CheckTextSize' is never used.
[src/Mayaqua/Network.c:6827]: (style) The function 'CheckUnicastAddress' is never used.
[src/Mayaqua/Encrypt.c:2748]: (style) The function 'CheckX' is never used.
[src/Cedar/Client.c:10394]: (style) The function 'CiFreeInnerVPNServer' is never used.
[src/Cedar/Client.c:10785]: (style) The function 'CiGetNumActiveSessions' is never used.
[src/Cedar/Client.c:2042]: (style) The function 'CiHasAccountSensitiveInformationFile' is never used.
[src/Cedar/Client.c:10377]: (style) The function 'CiNewInnerVPNServer' is never used.
[src/Mayaqua/Secure.c:842]: (style) The function 'CkDateToUINT64' is never used.
[src/Mayaqua/Memory.c:2605]: (style) The function 'ClearFifo' is never used.
[src/Mayaqua/Memory.c:4267]: (style) The function 'CloneTail' is never used.
[src/Cedar/Command.c:9739]: (style) The function 'CmdEvalIpAndMask46' is never used.
[src/Cedar/Command.c:9826]: (style) The function 'CmdEvalNetworkAndSubnetMask46' is never used.
[src/Cedar/Command.c:22767]: (style) The function 'CmdPrintRow' is never used.
[src/Cedar/Client.c:1128]: (style) The function 'CncGetSessionId' is never used.
[src/Cedar/Client.c:767]: (style) The function 'CncPasswordDlgHaltThread' is never used.
[src/Cedar/Client.c:10589]: (style) The function 'CompareInternetSetting' is never used.
[src/Cedar/Protocol.c:907]: (style) The function 'CompareNodeInfo' is never used.
[src/Cedar/Session.c:1853]: (style) The function 'CompareSession' is never used.
[src/Mayaqua/Network.c:8171]: (style) The function 'CompareTcpTable' is never used.
[src/Mayaqua/Tracking.c:593]: (style) The function 'CompareTrackingObject' is never used.
[src/Mayaqua/FileIO.c:728]: (style) The function 'ConvertSafeFileNameW' is never used.
[src/Mayaqua/Str.c:2024]: (style) The function 'CopyBinToStr' is never used.
This commit is contained in:
Ilya Shipitsin 2018-02-08 07:26:03 +05:00
parent 79c06146a4
commit 2883bda17d
26 changed files with 0 additions and 678 deletions

View File

@ -763,29 +763,6 @@ void CndMsgDlgFree(SOCK *s)
ReleaseSock(s); ReleaseSock(s);
} }
// The thread to stop the password input dialog client forcibly
void CncPasswordDlgHaltThread(THREAD *thread, void *param)
{
CNC_CONNECT_ERROR_DLG_THREAD_PARAM *dp = (CNC_CONNECT_ERROR_DLG_THREAD_PARAM *)param;
// Validate arguments
if (thread == NULL || param == NULL)
{
return;
}
while (true)
{
if (dp->Session->Halt || dp->HaltThread)
{
break;
}
Wait(dp->Event, 100);
}
Disconnect(dp->Sock);
}
// Show the password input dialog // Show the password input dialog
bool CncPasswordDlg(SESSION *session, UI_PASSWORD_DLG *dlg) bool CncPasswordDlg(SESSION *session, UI_PASSWORD_DLG *dlg)
{ {
@ -1124,41 +1101,6 @@ void CncReleaseSocket()
ReleaseSock(s); ReleaseSock(s);
} }
// Get the Session ID of the client notification service
UINT CncGetSessionId()
{
SOCK *s = CncConnect();
PACK *p;
UINT ret;
if (s == NULL)
{
return INFINITE;
}
p = NewPack();
PackAddStr(p, "function", "get_session_id");
SendPack(s, p);
FreePack(p);
p = RecvPack(s);
if (p == NULL)
{
Disconnect(s);
ReleaseSock(s);
return INFINITE;
}
ret = PackGetInt(p, "session_id");
FreePack(p);
Disconnect(s);
ReleaseSock(s);
return ret;
}
// Terminate the process of the client notification service // Terminate the process of the client notification service
void CncExit() void CncExit()
{ {
@ -2039,28 +1981,6 @@ bool CiHasAccountSensitiveInformation(BUF *b)
return ret; return ret;
} }
bool CiHasAccountSensitiveInformationFile(wchar_t *name)
{
bool ret = false;
BUF *b;
// Validate arguments
if (name == NULL)
{
return false;
}
b = ReadDumpW(name);
if (b == NULL)
{
return false;
}
ret = CiHasAccountSensitiveInformation(b);
FreeBuf(b);
return ret;
}
// Delete the sensitive information in the account information // Delete the sensitive information in the account information
bool CiEraseSensitiveInAccount(BUF *b) bool CiEraseSensitiveInAccount(BUF *b)
@ -10373,35 +10293,6 @@ void CiWriteSettingToCfg(CLIENT *c, FOLDER *root)
} }
} }
// Create the inner VPN Server
SERVER *CiNewInnerVPNServer(CLIENT *c, bool relay_server)
{
SERVER *s = NULL;
// Validate arguments
if (c == NULL)
{
return NULL;
}
SetNatTLowPriority();
s = SiNewServerEx(false, true, relay_server);
return s;
}
// Stop the inner VPN Server
void CiFreeInnerVPNServer(CLIENT *c, SERVER *s)
{
// Validate arguments
if (c == NULL || s == NULL)
{
return;
}
SiReleaseServer(s);
}
// Apply settings of Inner VPN Server // Apply settings of Inner VPN Server
void CiApplyInnerVPNServerConfig(CLIENT *c) void CiApplyInnerVPNServerConfig(CLIENT *c)
{ {
@ -10585,48 +10476,6 @@ CLIENT *CiNewClient()
return c; return c;
} }
// Examine whether two proxy server settings equal
bool CompareInternetSetting(INTERNET_SETTING *s1, INTERNET_SETTING *s2)
{
// Validate arguments
if (s1 == NULL || s2 == NULL)
{
return false;
}
if (s1->ProxyType != s2->ProxyType)
{
return false;
}
if (s1->ProxyType == PROXY_DIRECT)
{
return true;
}
if (s1->ProxyPort != s2->ProxyPort)
{
return false;
}
if (StrCmp(s1->ProxyHostName, s2->ProxyHostName) != 0)
{
return false;
}
if (StrCmp(s1->ProxyUsername, s2->ProxyUsername) != 0)
{
return false;
}
if (StrCmp(s1->ProxyPassword, s2->ProxyPassword) != 0)
{
return false;
}
return true;
}
// Send a global pulse // Send a global pulse
void CiSendGlobalPulse(CLIENT *c) void CiSendGlobalPulse(CLIENT *c)
{ {
@ -10781,20 +10630,6 @@ void CiDecrementNumActiveSessions()
Unlock(ci_active_sessions_lock); Unlock(ci_active_sessions_lock);
} }
// Get the number of active sessions
UINT CiGetNumActiveSessions()
{
UINT ret;
Lock(ci_active_sessions_lock);
{
ret = ci_num_active_sessions;
}
Unlock(ci_active_sessions_lock);
return ret;
}
// Release the client // Release the client
void CtReleaseClient(CLIENT *c) void CtReleaseClient(CLIENT *c)
{ {

View File

@ -598,9 +598,6 @@ void CcSetServiceToForegroundProcess(REMOTE_CLIENT *r);
char *CiGetFirstVLan(CLIENT *c); char *CiGetFirstVLan(CLIENT *c);
void CiNormalizeAccountVLan(CLIENT *c); void CiNormalizeAccountVLan(CLIENT *c);
bool CompareInternetSetting(INTERNET_SETTING *s1, INTERNET_SETTING *s2);
void CnStart(); void CnStart();
void CnListenerProc(THREAD *thread, void *param); void CnListenerProc(THREAD *thread, void *param);
@ -642,7 +639,6 @@ SOCK *CncConnect();
SOCK *CncConnectEx(UINT timeout); SOCK *CncConnectEx(UINT timeout);
void CncReleaseSocket(); void CncReleaseSocket();
void CncExit(); void CncExit();
UINT CncGetSessionId();
bool CncExecDriverInstaller(char *arg); bool CncExecDriverInstaller(char *arg);
SOCK *CncStatusPrinterWindowStart(SESSION *s); SOCK *CncStatusPrinterWindowStart(SESSION *s);
void CncStatusPrinterWindowPrint(SOCK *s, wchar_t *str); void CncStatusPrinterWindowPrint(SOCK *s, wchar_t *str);
@ -651,7 +647,6 @@ void CncStatusPrinterWindowThreadProc(THREAD *thread, void *param);
bool CncConnectErrorDlg(SESSION *session, UI_CONNECTERROR_DLG *dlg); bool CncConnectErrorDlg(SESSION *session, UI_CONNECTERROR_DLG *dlg);
void CncConnectErrorDlgHaltThread(THREAD *thread, void *param); void CncConnectErrorDlgHaltThread(THREAD *thread, void *param);
bool CncPasswordDlg(SESSION *session, UI_PASSWORD_DLG *dlg); bool CncPasswordDlg(SESSION *session, UI_PASSWORD_DLG *dlg);
void CncPasswordDlgHaltThread(THREAD *thread, void *param);
void CncCheckCert(SESSION *session, UI_CHECKCERT *dlg); void CncCheckCert(SESSION *session, UI_CHECKCERT *dlg);
void CncCheckCertHaltThread(THREAD *thread, void *param); void CncCheckCertHaltThread(THREAD *thread, void *param);
bool CncSecureSignDlg(SECURE_SIGN *sign); bool CncSecureSignDlg(SECURE_SIGN *sign);
@ -793,13 +788,9 @@ bool CiTryToParseAccount(BUF *b);
bool CiTryToParseAccountFile(wchar_t *name); bool CiTryToParseAccountFile(wchar_t *name);
bool CiEraseSensitiveInAccount(BUF *b); bool CiEraseSensitiveInAccount(BUF *b);
bool CiHasAccountSensitiveInformation(BUF *b); bool CiHasAccountSensitiveInformation(BUF *b);
bool CiHasAccountSensitiveInformationFile(wchar_t *name);
void CiApplyInnerVPNServerConfig(CLIENT *c); void CiApplyInnerVPNServerConfig(CLIENT *c);
SERVER *CiNewInnerVPNServer(CLIENT *c, bool relay_server);
void CiFreeInnerVPNServer(CLIENT *c, SERVER *s);
void CiIncrementNumActiveSessions(); void CiIncrementNumActiveSessions();
void CiDecrementNumActiveSessions(); void CiDecrementNumActiveSessions();
UINT CiGetNumActiveSessions();
BUF *EncryptPassword(char *password); BUF *EncryptPassword(char *password);
BUF *EncryptPassword2(char *password); BUF *EncryptPassword2(char *password);

View File

@ -9736,39 +9736,6 @@ bool CmdEvalIpAndMask6(CONSOLE *c, wchar_t *str, void *param)
return true; return true;
} }
bool CmdEvalIpAndMask46(CONSOLE *c, wchar_t *str, void *param)
{
char tmp[MAX_SIZE];
TOKEN_LIST *t;
bool ret = false;
Zero(tmp, sizeof(tmp));
UniToStr(tmp, sizeof(tmp), str);
t = ParseToken(tmp, "/");
if (t == NULL)
{
return false;
}
if (t->NumTokens >= 1)
{
Trim(t->Token[0]);
if (IsIpStr4(t->Token[0]))
{
ret = CmdEvalIpAndMask4(c, str, param);
}
else
{
ret = CmdEvalIpAndMask6(c, str, param);
}
}
FreeToken(t);
return ret;
}
// Evaluate the network address and the subnet mask // Evaluate the network address and the subnet mask
bool CmdEvalNetworkAndSubnetMask4(CONSOLE *c, wchar_t *str, void *param) bool CmdEvalNetworkAndSubnetMask4(CONSOLE *c, wchar_t *str, void *param)
@ -9823,39 +9790,6 @@ bool CmdEvalNetworkAndSubnetMask6(CONSOLE *c, wchar_t *str, void *param)
return true; return true;
} }
bool CmdEvalNetworkAndSubnetMask46(CONSOLE *c, wchar_t *str, void *param)
{
char tmp[MAX_SIZE];
TOKEN_LIST *t;
bool ret = false;
Zero(tmp, sizeof(tmp));
UniToStr(tmp, sizeof(tmp), str);
t = ParseToken(tmp, "/");
if (t == NULL)
{
return false;
}
if (t->NumTokens >= 1)
{
Trim(t->Token[0]);
if (IsIpStr4(t->Token[0]))
{
ret = CmdEvalNetworkAndSubnetMask4(c, str, param);
}
else
{
ret = CmdEvalNetworkAndSubnetMask6(c, str, param);
}
}
FreeToken(t);
return ret;
}
// Evaluate the IP address and subnet mask // Evaluate the IP address and subnet mask
bool CmdEvalHostAndSubnetMask4(CONSOLE *c, wchar_t *str, void *param) bool CmdEvalHostAndSubnetMask4(CONSOLE *c, wchar_t *str, void *param)
@ -22763,28 +22697,6 @@ UINT PsListenerDelete(CONSOLE *c, char *cmd_name, wchar_t *str, void *param)
return 0; return 0;
} }
// Draw a row
void CmdPrintRow(CONSOLE *c, wchar_t *title, wchar_t *tag, ...)
{
wchar_t buf[MAX_SIZE * 2];
wchar_t buf2[MAX_SIZE * 2];
va_list args;
// Validate arguments
if (title == NULL || c == NULL || tag == NULL)
{
return;
}
va_start(args, tag);
UniFormatArgs(buf, sizeof(buf), tag, args);
UniFormat(buf2, sizeof(buf2), L"[%s] %s", title, buf);
va_end(args);
c->Write(c, buf2);
}
// ServerInfoGet command // ServerInfoGet command
UINT PsServerInfoGet(CONSOLE *c, char *cmd_name, wchar_t *str, void *param) UINT PsServerInfoGet(CONSOLE *c, char *cmd_name, wchar_t *str, void *param)
{ {

View File

@ -325,7 +325,6 @@ void InRpcTtResult(PACK *p, TT_RESULT *t);
void CmdPrintError(CONSOLE *c, UINT err); void CmdPrintError(CONSOLE *c, UINT err);
void CmdPrintAbout(CONSOLE *c); void CmdPrintAbout(CONSOLE *c);
void CmdPrintRow(CONSOLE *c, wchar_t *title, wchar_t *tag, ...);
wchar_t *CmdPromptPort(CONSOLE *c, void *param); wchar_t *CmdPromptPort(CONSOLE *c, void *param);
wchar_t *CmdPromptChoosePassword(CONSOLE *c, void *param); wchar_t *CmdPromptChoosePassword(CONSOLE *c, void *param);
bool CmdEvalPort(CONSOLE *c, wchar_t *str, void *param); bool CmdEvalPort(CONSOLE *c, wchar_t *str, void *param);
@ -346,10 +345,8 @@ wchar_t *GetConnectionTypeStr(UINT type);
bool CmdEvalHostAndSubnetMask4(CONSOLE *c, wchar_t *str, void *param); bool CmdEvalHostAndSubnetMask4(CONSOLE *c, wchar_t *str, void *param);
bool CmdEvalNetworkAndSubnetMask4(CONSOLE *c, wchar_t *str, void *param); bool CmdEvalNetworkAndSubnetMask4(CONSOLE *c, wchar_t *str, void *param);
bool CmdEvalNetworkAndSubnetMask6(CONSOLE *c, wchar_t *str, void *param); bool CmdEvalNetworkAndSubnetMask6(CONSOLE *c, wchar_t *str, void *param);
bool CmdEvalNetworkAndSubnetMask46(CONSOLE *c, wchar_t *str, void *param);
bool CmdEvalIpAndMask4(CONSOLE *c, wchar_t *str, void *param); bool CmdEvalIpAndMask4(CONSOLE *c, wchar_t *str, void *param);
bool CmdEvalIpAndMask6(CONSOLE *c, wchar_t *str, void *param); bool CmdEvalIpAndMask6(CONSOLE *c, wchar_t *str, void *param);
bool CmdEvalIpAndMask46(CONSOLE *c, wchar_t *str, void *param);
wchar_t *GetLogSwitchStr(UINT i); wchar_t *GetLogSwitchStr(UINT i);
wchar_t *GetPacketLogNameStr(UINT i); wchar_t *GetPacketLogNameStr(UINT i);
UINT StrToLogSwitchType(char *str); UINT StrToLogSwitchType(char *str);

View File

@ -6659,34 +6659,6 @@ void SetRadiusServerEx(HUB *hub, char *name, UINT port, char *secret, UINT inter
Unlock(hub->RadiusOptionLock); Unlock(hub->RadiusOptionLock);
} }
// Get the difference between the traffic data
void CalcTrafficEntryDiff(TRAFFIC_ENTRY *diff, TRAFFIC_ENTRY *old, TRAFFIC_ENTRY *current)
{
// Validate arguments
Zero(diff, sizeof(TRAFFIC_ENTRY));
if (old == NULL || current == NULL || diff == NULL)
{
return;
}
if (current->BroadcastCount >= old->BroadcastCount)
{
diff->BroadcastCount = current->BroadcastCount - old->BroadcastCount;
}
if (current->BroadcastBytes >= old->BroadcastBytes)
{
diff->BroadcastBytes = current->BroadcastBytes - old->BroadcastBytes;
}
if (current->UnicastCount >= old->UnicastCount)
{
diff->UnicastCount = current->UnicastCount - old->UnicastCount;
}
if (current->UnicastBytes >= old->UnicastBytes)
{
diff->UnicastBytes = current->UnicastBytes - old->UnicastBytes;
}
}
// Add the traffic information for Virtual HUB // Add the traffic information for Virtual HUB
void IncrementHubTraffic(HUB *h) void IncrementHubTraffic(HUB *h)
{ {

View File

@ -638,7 +638,6 @@ USERLIST *FindUserList(LIST *o, char *filename);
bool IsUserMatchInUserList(LIST *o, char *filename, UINT64 user_hash); bool IsUserMatchInUserList(LIST *o, char *filename, UINT64 user_hash);
bool IsUserMatchInUserListWithCacheExpires(LIST *o, char *filename, UINT64 user_hash, UINT64 lifetime); bool IsUserMatchInUserListWithCacheExpires(LIST *o, char *filename, UINT64 user_hash, UINT64 lifetime);
bool IsUserMatchInUserListWithCacheExpiresAcl(LIST *o, char *name_in_acl, UINT64 user_hash, UINT64 lifetime); bool IsUserMatchInUserListWithCacheExpiresAcl(LIST *o, char *name_in_acl, UINT64 user_hash, UINT64 lifetime);
void CalcTrafficEntryDiff(TRAFFIC_ENTRY *diff, TRAFFIC_ENTRY *old, TRAFFIC_ENTRY *current);
bool CheckMaxLoggedPacketsPerMinute(SESSION *s, UINT max_packets, UINT64 now); bool CheckMaxLoggedPacketsPerMinute(SESSION *s, UINT max_packets, UINT64 now);
void VgsSetUserAgentValue(char *str); void VgsSetUserAgentValue(char *str);
void VgsSetEmbTag(bool b); void VgsSetEmbTag(bool b);

View File

@ -903,95 +903,6 @@ void NodeInfoToStr(wchar_t *str, UINT size, NODE_INFO *info)
info->HubName, unique_id); info->HubName, unique_id);
} }
// Comparison of node information
bool CompareNodeInfo(NODE_INFO *a, NODE_INFO *b)
{
// Validate arguments
if (a == NULL || b == NULL)
{
return false;
}
if (StrCmp(a->ClientProductName, b->ClientProductName) != 0)
{
return false;
}
if (a->ClientProductVer != b->ClientProductVer)
{
return false;
}
if (a->ClientProductBuild != b->ClientProductBuild)
{
return false;
}
if (StrCmp(a->ServerProductName, b->ServerProductName) != 0)
{
return false;
}
if (a->ServerProductVer != b->ServerProductVer)
{
return false;
}
if (a->ServerProductBuild != b->ServerProductBuild)
{
return false;
}
if (StrCmp(a->ClientOsName, b->ClientOsName) != 0)
{
return false;
}
if (StrCmp(a->ClientOsVer, b->ClientOsVer) != 0)
{
return false;
}
if (StrCmp(a->ClientOsProductId, b->ClientOsProductId) != 0)
{
return false;
}
if (StrCmp(a->ClientHostname, b->ClientHostname) != 0)
{
return false;
}
if (a->ClientIpAddress != b->ClientIpAddress)
{
return false;
}
if (StrCmp(a->ServerHostname, b->ServerHostname) != 0)
{
return false;
}
if (a->ServerIpAddress != b->ServerIpAddress)
{
return false;
}
if (a->ServerPort != b->ServerPort)
{
return false;
}
if (StrCmp(a->ProxyHostname, b->ProxyHostname) != 0)
{
return false;
}
if (a->ProxyIpAddress != b->ProxyIpAddress)
{
return false;
}
if (a->ProxyPort != b->ProxyPort)
{
return false;
}
if (StrCmp(a->HubName, b->HubName) != 0)
{
return false;
}
if (Cmp(a->UniqueId, b->UniqueId, 16) != 0)
{
return false;
}
return true;
}
// Accept the password change // Accept the password change
UINT ChangePasswordAccept(CONNECTION *c, PACK *p) UINT ChangePasswordAccept(CONNECTION *c, PACK *p)
{ {

View File

@ -1849,23 +1849,6 @@ SKIP:
} }
} }
// Name comparison of sessions
int CompareSession(void *p1, void *p2)
{
SESSION *s1, *s2;
if (p1 == NULL || p2 == NULL)
{
return 0;
}
s1 = *(SESSION **)p1;
s2 = *(SESSION **)p2;
if (s1 == NULL || s2 == NULL)
{
return 0;
}
return StrCmpi(s1->Name, s2->Name);
}
// Create an RPC session // Create an RPC session
SESSION *NewRpcSession(CEDAR *cedar, CLIENT_OPTION *option) SESSION *NewRpcSession(CEDAR *cedar, CLIENT_OPTION *option)
{ {

View File

@ -413,7 +413,6 @@ void StopSession(SESSION *s);
void StopSessionEx(SESSION *s, bool no_wait); void StopSessionEx(SESSION *s, bool no_wait);
bool SessionConnect(SESSION *s); bool SessionConnect(SESSION *s);
bool ClientConnect(CONNECTION *c); bool ClientConnect(CONNECTION *c);
int CompareSession(void *p1, void *p2);
PACKET_ADAPTER *NewPacketAdapter(PA_INIT *init, PA_GETCANCEL *getcancel, PA_GETNEXTPACKET *getnext, PACKET_ADAPTER *NewPacketAdapter(PA_INIT *init, PA_GETCANCEL *getcancel, PA_GETNEXTPACKET *getnext,
PA_PUTPACKET *put, PA_FREE *free); PA_PUTPACKET *put, PA_FREE *free);
void FreePacketAdapter(PACKET_ADAPTER *pa); void FreePacketAdapter(PACKET_ADAPTER *pa);
@ -435,7 +434,6 @@ LIST *NewCancelList();
void ReleaseCancelList(LIST *o); void ReleaseCancelList(LIST *o);
void AddCancelList(LIST *o, CANCEL *c); void AddCancelList(LIST *o, CANCEL *c);
void CancelList(LIST *o); void CancelList(LIST *o);
bool CompareNodeInfo(NODE_INFO *a, NODE_INFO *b);
bool IsPriorityHighestPacketForQoS(void *data, UINT size); bool IsPriorityHighestPacketForQoS(void *data, UINT size);
UINT GetNextDelayedPacketTickDiff(SESSION *s); UINT GetNextDelayedPacketTickDiff(SESSION *s);

View File

@ -9234,44 +9234,6 @@ void Check(HWND hWnd, UINT id, bool b)
} }
} }
// Confirm that the character size of the text-box is less than or equal to specified size
bool CheckTextSize(HWND hWnd, UINT id, UINT size, bool unicode)
{
// Validate arguments
if (hWnd == NULL)
{
return false;
}
if (GetTextSize(hWnd, id, unicode) <= size)
{
return true;
}
else
{
return false;
}
}
// Confirm that a length of the string in the text-box is less than or equal to the specified size
bool CheckTextLen(HWND hWnd, UINT id, UINT len, bool unicode)
{
// Validate arguments
if (hWnd == NULL)
{
return false;
}
if (GetTextLen(hWnd, id, unicode) <= len)
{
return true;
}
else
{
return false;
}
}
// Limit the number of characters that can be entered into the text-box // Limit the number of characters that can be entered into the text-box
void LimitText(HWND hWnd, UINT id, UINT count) void LimitText(HWND hWnd, UINT id, UINT count)
{ {

View File

@ -661,8 +661,6 @@ bool GetFontSize(HFONT hFont, UINT *x, UINT *y);
void SetFont(HWND hWnd, UINT id, HFONT hFont); void SetFont(HWND hWnd, UINT id, HFONT hFont);
void SetFontEx(HWND hWnd, UINT id, HFONT hFont, bool no_adjust_font_size); void SetFontEx(HWND hWnd, UINT id, HFONT hFont, bool no_adjust_font_size);
void LimitText(HWND hWnd, UINT id, UINT count); void LimitText(HWND hWnd, UINT id, UINT count);
bool CheckTextLen(HWND hWnd, UINT id, UINT len, bool unicode);
bool CheckTextSize(HWND hWnd, UINT id, UINT size, bool unicode);
void Check(HWND hWnd, UINT id, bool b); void Check(HWND hWnd, UINT id, bool b);
bool IsChecked(HWND hWnd, UINT id); bool IsChecked(HWND hWnd, UINT id);
void SetIcon(HWND hWnd, UINT id, UINT icon_id); void SetIcon(HWND hWnd, UINT id, UINT icon_id);

View File

@ -536,15 +536,6 @@ bool CfgSaveExW3(CFG_RW *rw, FOLDER *f, wchar_t *name, UINT *written_size, bool
} }
// Read the settings from the file // Read the settings from the file
FOLDER *CfgRead(char *name)
{
wchar_t *name_w = CopyStrToUni(name);
FOLDER *ret = CfgReadW(name_w);
Free(name_w);
return ret;
}
FOLDER *CfgReadW(wchar_t *name) FOLDER *CfgReadW(wchar_t *name)
{ {
wchar_t tmp[MAX_SIZE]; wchar_t tmp[MAX_SIZE];
@ -1425,17 +1416,6 @@ void CfgAddData(BUF *b, UINT type, char *name, char *data, char *sub, UINT depth
Free(tmp); Free(tmp);
} }
// Convert the data type string to an integer value
UINT CfgStrToType(char *str)
{
if (!StrCmpi(str, TAG_INT)) return ITEM_TYPE_INT;
if (!StrCmpi(str, TAG_INT64)) return ITEM_TYPE_INT64;
if (!StrCmpi(str, TAG_BYTE)) return ITEM_TYPE_BYTE;
if (!StrCmpi(str, TAG_STRING)) return ITEM_TYPE_STRING;
if (!StrCmpi(str, TAG_BOOL)) return ITEM_TYPE_BOOL;
return 0;
}
// Convert the type of data to a string // Convert the type of data to a string
char *CfgTypeToStr(UINT type) char *CfgTypeToStr(UINT type)
{ {

View File

@ -226,7 +226,6 @@ void CfgAddLine(BUF *b, char *str, UINT depth);
void CfgAddDeclare(BUF *b, char *name, UINT depth); void CfgAddDeclare(BUF *b, char *name, UINT depth);
void CfgAddEnd(BUF *b, UINT depth); void CfgAddEnd(BUF *b, UINT depth);
void CfgAddData(BUF *b, UINT type, char *name, char *data, char *sub, UINT depth); void CfgAddData(BUF *b, UINT type, char *name, char *data, char *sub, UINT depth);
UINT CfgStrToType(char *str);
char *CfgTypeToStr(UINT type); char *CfgTypeToStr(UINT type);
void CfgAddItemText(BUF *b, ITEM *t, UINT depth); void CfgAddItemText(BUF *b, ITEM *t, UINT depth);
bool CfgEnumFolderProc(FOLDER *f, void *param); bool CfgEnumFolderProc(FOLDER *f, void *param);
@ -242,7 +241,6 @@ bool CfgSaveEx(CFG_RW *rw, FOLDER *f, char *name);
bool CfgSaveExW(CFG_RW *rw, FOLDER *f, wchar_t *name); bool CfgSaveExW(CFG_RW *rw, FOLDER *f, wchar_t *name);
bool CfgSaveExW2(CFG_RW *rw, FOLDER *f, wchar_t *name, UINT *written_size); bool CfgSaveExW2(CFG_RW *rw, FOLDER *f, wchar_t *name, UINT *written_size);
bool CfgSaveExW3(CFG_RW *rw, FOLDER *f, wchar_t *name, UINT *written_size, bool write_binary); bool CfgSaveExW3(CFG_RW *rw, FOLDER *f, wchar_t *name, UINT *written_size, bool write_binary);
FOLDER *CfgRead(char *name);
FOLDER *CfgReadW(wchar_t *name); FOLDER *CfgReadW(wchar_t *name);
FOLDER *CfgCreateRoot(); FOLDER *CfgCreateRoot();
void CfgTest(); void CfgTest();

View File

@ -2745,10 +2745,6 @@ bool RsaGen(K **priv, K **pub, UINT bit)
} }
// Confirm whether the certificate X is signed by the issuer of the certificate x_issuer // Confirm whether the certificate X is signed by the issuer of the certificate x_issuer
bool CheckX(X *x, X *x_issuer)
{
return CheckXEx(x, x_issuer, false, false);
}
bool CheckXEx(X *x, X *x_issuer, bool check_name, bool check_date) bool CheckXEx(X *x, X *x_issuer, bool check_name, bool check_date)
{ {
K *k; K *k;

View File

@ -427,7 +427,6 @@ bool CompareName(NAME *n1, NAME *n2);
K *GetKFromX(X *x); K *GetKFromX(X *x);
bool CheckSignature(X *x, K *k); bool CheckSignature(X *x, K *k);
X *X509ToX(X509 *x509); X *X509ToX(X509 *x509);
bool CheckX(X *x, X *x_issuer);
bool CheckXEx(X *x, X *x_issuer, bool check_name, bool check_date); bool CheckXEx(X *x, X *x_issuer, bool check_name, bool check_date);
bool Asn1TimeToSystem(SYSTEMTIME *s, void *asn1_time); bool Asn1TimeToSystem(SYSTEMTIME *s, void *asn1_time);
bool StrToSystem(SYSTEMTIME *s, char *str); bool StrToSystem(SYSTEMTIME *s, char *str);

View File

@ -725,24 +725,6 @@ void ConvertSafeFileName(char *dst, UINT size, char *src)
} }
} }
} }
void ConvertSafeFileNameW(wchar_t *dst, UINT size, wchar_t *src)
{
UINT i;
// Validate arguments
if (dst == NULL || src == NULL)
{
return;
}
UniStrCpy(dst, size, src);
for (i = 0;i < UniStrLen(dst);i++)
{
if (UniIsSafeChar(dst[i]) == false)
{
dst[i] = L'_';
}
}
}
// Get the free disk space // Get the free disk space
bool GetDiskFree(char *path, UINT64 *free_size, UINT64 *used_size, UINT64 *total_size) bool GetDiskFree(char *path, UINT64 *free_size, UINT64 *used_size, UINT64 *total_size)

View File

@ -370,7 +370,6 @@ int CompareDirListByName(void *p1, void *p2);
bool GetDiskFree(char *path, UINT64 *free_size, UINT64 *used_size, UINT64 *total_size); bool GetDiskFree(char *path, UINT64 *free_size, UINT64 *used_size, UINT64 *total_size);
bool GetDiskFreeW(wchar_t *path, UINT64 *free_size, UINT64 *used_size, UINT64 *total_size); bool GetDiskFreeW(wchar_t *path, UINT64 *free_size, UINT64 *used_size, UINT64 *total_size);
void ConvertSafeFileName(char *dst, UINT size, char *src); void ConvertSafeFileName(char *dst, UINT size, char *src);
void ConvertSafeFileNameW(wchar_t *dst, UINT size, wchar_t *src);
bool FileReplaceRename(char *old_name, char *new_name); bool FileReplaceRename(char *old_name, char *new_name);
bool FileReplaceRenameW(wchar_t *old_name, wchar_t *new_name); bool FileReplaceRenameW(wchar_t *old_name, wchar_t *new_name);
bool IsFile(char *name); bool IsFile(char *name);

View File

@ -2601,20 +2601,6 @@ void PadFifoFront(FIFO *f, UINT size)
f->p = ReAlloc(f->p, f->memsize); f->p = ReAlloc(f->p, f->memsize);
} }
// Clear the FIFO
void ClearFifo(FIFO *f)
{
// Validate arguments
if (f == NULL)
{
return;
}
f->size = f->pos = 0;
f->memsize = FIFO_INIT_MEM_SIZE;
f->p = ReAlloc(f->p, f->memsize);
}
// Get the current pointer of the FIFO // Get the current pointer of the FIFO
UCHAR *GetFifoPointer(FIFO *f) UCHAR *GetFifoPointer(FIFO *f)
{ {
@ -4263,25 +4249,6 @@ void *AddHead(void *src, UINT src_size, void *head, UINT head_size)
return ret; return ret;
} }
// Clone the memory area (only the tail)
void *CloneTail(void *src, UINT src_size, UINT dst_size)
{
// Validate arguments
if (src_size != 0 && src == NULL)
{
return NULL;
}
if (src_size >= dst_size)
{
return Clone(((UCHAR *)src) + (src_size - dst_size), dst_size);
}
else
{
return Clone(src, src_size);
}
}
// Clone the memory area // Clone the memory area
void *Clone(void *addr, UINT size) void *Clone(void *addr, UINT size)
{ {

View File

@ -290,7 +290,6 @@ int CmpCaseIgnore(void *p1, void *p2, UINT size);
void ZeroMem(void *addr, UINT size); void ZeroMem(void *addr, UINT size);
void Zero(void *addr, UINT size); void Zero(void *addr, UINT size);
void *Clone(void *addr, UINT size); void *Clone(void *addr, UINT size);
void *CloneTail(void *src, UINT src_size, UINT dst_size);
void *AddHead(void *src, UINT src_size, void *head, UINT head_size); void *AddHead(void *src, UINT src_size, void *head, UINT head_size);
char B64_CodeToChar(BYTE c); char B64_CodeToChar(BYTE c);
@ -360,7 +359,6 @@ UCHAR *FifoPtr(FIFO *f);
void WriteFifo(FIFO *f, void *p, UINT size); void WriteFifo(FIFO *f, void *p, UINT size);
void WriteFifoFront(FIFO *f, void *p, UINT size); void WriteFifoFront(FIFO *f, void *p, UINT size);
void PadFifoFront(FIFO *f, UINT size); void PadFifoFront(FIFO *f, UINT size);
void ClearFifo(FIFO *f);
UINT FifoSize(FIFO *f); UINT FifoSize(FIFO *f);
void LockFifo(FIFO *f); void LockFifo(FIFO *f);
void UnlockFifo(FIFO *f); void UnlockFifo(FIFO *f);

View File

@ -6823,23 +6823,6 @@ bool IsNetworkPrefixAddress6(IP *ip, IP *subnet)
return false; return false;
} }
// Check whether the unicast address is available
bool CheckUnicastAddress(IP *ip)
{
// Validate arguments
if (ip == NULL)
{
return false;
}
if ((GetIPAddrType6(ip) & IPV6_ADDR_UNICAST) == 0)
{
return false;
}
return true;
}
// Get the host address // Get the host address
void GetHostAddress6(IP *dst, IP *ip, IP *subnet) void GetHostAddress6(IP *dst, IP *ip, IP *subnet)
{ {
@ -7778,17 +7761,6 @@ void CopyIP(IP *dst, IP *src)
Copy(dst, src, sizeof(IP)); Copy(dst, src, sizeof(IP));
} }
// Check the length of the IPv6 subnet
bool CheckSubnetLength6(UINT i)
{
if (i >= 1 && i <= 127)
{
return true;
}
return false;
}
// Get the process ID of the corresponding TCP connection by the socket // Get the process ID of the corresponding TCP connection by the socket
UINT GetTcpProcessIdFromSocket(SOCK *s) UINT GetTcpProcessIdFromSocket(SOCK *s)
{ {
@ -8167,24 +8139,6 @@ void PrintTcpTableList(LIST *o)
Print("------\n\n"); Print("------\n\n");
} }
// Comparison of TCP table items
int CompareTcpTable(void *p1, void *p2)
{
TCPTABLE *t1, *t2;
if (p1 == NULL || p2 == NULL)
{
return 0;
}
t1 = *(TCPTABLE **)p1;
t2 = *(TCPTABLE **)p2;
if (t1 == NULL || t2 == NULL)
{
return 0;
}
return Cmp(t1, t2, sizeof(TCPTABLE));
}
// Get the TCP table list // Get the TCP table list
LIST *GetTcpTableList() LIST *GetTcpTableList()
{ {
@ -14610,39 +14564,6 @@ typedef struct TCP_PORT_CHECK
bool ok; bool ok;
} TCP_PORT_CHECK; } TCP_PORT_CHECK;
// The thread to check the TCP port
void CheckTCPPortThread(THREAD *thread, void *param)
{
TCP_PORT_CHECK *c;
SOCK *s;
// Validate arguments
if (thread == NULL || param == NULL)
{
return;
}
c = (TCP_PORT_CHECK *)param;
AddRef(c->ref);
NoticeThreadInit(thread);
AddWaitThread(thread);
s = Connect(c->hostname, c->port);
if (s != NULL)
{
c->ok = true;
Disconnect(s);
ReleaseSock(s);
}
if (Release(c->ref) == 0)
{
Free(c);
}
DelWaitThread(thread);
}
// Check whether the TCP port can be connected // Check whether the TCP port can be connected
bool CheckTCPPortEx(char *hostname, UINT port, UINT timeout) bool CheckTCPPortEx(char *hostname, UINT port, UINT timeout)
{ {

View File

@ -1354,7 +1354,6 @@ void SetTimeout(SOCK *sock, UINT timeout);
UINT GetTimeout(SOCK *sock); UINT GetTimeout(SOCK *sock);
bool CheckTCPPort(char *hostname, UINT port); bool CheckTCPPort(char *hostname, UINT port);
bool CheckTCPPortEx(char *hostname, UINT port, UINT timeout); bool CheckTCPPortEx(char *hostname, UINT port, UINT timeout);
void CheckTCPPortThread(THREAD *thread, void *param);
ROUTE_TABLE *GetRouteTable(); ROUTE_TABLE *GetRouteTable();
void FreeRouteTable(ROUTE_TABLE *t); void FreeRouteTable(ROUTE_TABLE *t);
bool AddRouteEntryEx(ROUTE_ENTRY *e, bool *already_exists); bool AddRouteEntryEx(ROUTE_ENTRY *e, bool *already_exists);
@ -1426,7 +1425,6 @@ UINT GetNumIpClient(IP *ip);
void SetLinuxArpFilter(); void SetLinuxArpFilter();
LIST *GetTcpTableList(); LIST *GetTcpTableList();
void FreeTcpTableList(LIST *o); void FreeTcpTableList(LIST *o);
int CompareTcpTable(void *p1, void *p2);
void PrintTcpTableList(LIST *o); void PrintTcpTableList(LIST *o);
TCPTABLE *GetTcpTableFromEndPoint(LIST *o, IP *local_ip, UINT local_port, IP *remote_ip, UINT remote_port); TCPTABLE *GetTcpTableFromEndPoint(LIST *o, IP *local_ip, UINT local_port, IP *remote_ip, UINT remote_port);
UINT GetTcpProcessIdFromSocket(SOCK *s); UINT GetTcpProcessIdFromSocket(SOCK *s);
@ -1455,7 +1453,6 @@ SOCKET_TIMEOUT_PARAM *NewSocketTimeout(SOCK *sock);
void FreeSocketTimeout(SOCKET_TIMEOUT_PARAM *ttp); void FreeSocketTimeout(SOCKET_TIMEOUT_PARAM *ttp);
void CopyIP(IP *dst, IP *src); void CopyIP(IP *dst, IP *src);
bool CheckSubnetLength6(UINT i);
bool IsIP6(IP *ip); bool IsIP6(IP *ip);
bool IsIP4(IP *ip); bool IsIP4(IP *ip);
bool IsSameIPVer(IP *ip1, IP *ip2); bool IsSameIPVer(IP *ip1, IP *ip2);
@ -1489,7 +1486,6 @@ UINT GetIPAddrType6(IP *ip);
UINT GetIPv6AddrType(IPV6_ADDR *addr); UINT GetIPv6AddrType(IPV6_ADDR *addr);
void GenerateMulticastMacAddress6(UCHAR *mac, IP *ip); void GenerateMulticastMacAddress6(UCHAR *mac, IP *ip);
void GetSoliciationMulticastAddr6(IP *dst, IP *src); void GetSoliciationMulticastAddr6(IP *dst, IP *src);
bool CheckUnicastAddress(IP *ip);
bool IsNetworkPrefixAddress6(IP *ip, IP *subnet); bool IsNetworkPrefixAddress6(IP *ip, IP *subnet);
bool IsNetworkAddress6(IP *ip, IP *subnet); bool IsNetworkAddress6(IP *ip, IP *subnet);
void GetHostAddress6(IP *dst, IP *ip, IP *subnet); void GetHostAddress6(IP *dst, IP *ip, IP *subnet);

View File

@ -838,32 +838,6 @@ bool DeleteSecCert(SECURE *sec, char *name)
return DeleteSecObjectByName(sec, name, SEC_X); return DeleteSecObjectByName(sec, name, SEC_X);
} }
// Convert the the CK_DATE to the 64 bit time
UINT64 CkDateToUINT64(struct CK_DATE *ck_date)
{
SYSTEMTIME st;
char year[32], month[32], day[32];
// Validate arguments
if (ck_date == NULL)
{
return 0;
}
Zero(year, sizeof(year));
Zero(month, sizeof(month));
Zero(day, sizeof(day));
Copy(year, ck_date->year, 4);
Copy(month, ck_date->month, 2);
Copy(day, ck_date->day, 2);
st.wYear = ToInt(year);
st.wMonth = ToInt(month);
st.wDay = ToInt(day);
return SystemToUINT64(&st);
}
// Convert the 64 bit time to the CK_DATE // Convert the 64 bit time to the CK_DATE
void UINT64ToCkDate(void *p_ck_date, UINT64 time64) void UINT64ToCkDate(void *p_ck_date, UINT64 time64)
{ {

View File

@ -2021,23 +2021,6 @@ char *CopyBinToStrEx(void *data, UINT data_size)
return ret; return ret;
} }
char *CopyBinToStr(void *data, UINT data_size)
{
char *ret;
UINT size;
// Validate arguments
if (data == NULL)
{
return NULL;
}
size = data_size * 2 + 1;
ret = ZeroMalloc(size);
BinToStr(ret, size, data, data_size);
return ret;
}
// Convert the binary data to a hexadecimal string // Convert the binary data to a hexadecimal string
void BinToStr(char *str, UINT str_size, void *data, UINT data_size) void BinToStr(char *str, UINT str_size, void *data, UINT data_size)

View File

@ -207,7 +207,6 @@ bool IsEmptyStr(char *str);
void BinToStrEx(char *str, UINT str_size, void *data, UINT data_size); void BinToStrEx(char *str, UINT str_size, void *data, UINT data_size);
void BinToStrEx2(char *str, UINT str_size, void *data, UINT data_size, char padding_char); void BinToStrEx2(char *str, UINT str_size, void *data, UINT data_size, char padding_char);
char *CopyBinToStrEx(void *data, UINT data_size); char *CopyBinToStrEx(void *data, UINT data_size);
char *CopyBinToStr(void *data, UINT data_size);
BUF *StrToBin(char *str); BUF *StrToBin(char *str);
void MacToStr(char *str, UINT size, UCHAR *mac_address); void MacToStr(char *str, UINT size, UCHAR *mac_address);
void ToStr3(char *str, UINT size, UINT64 v); void ToStr3(char *str, UINT size, UINT64 v);

View File

@ -589,33 +589,6 @@ void TrackChangeObjSize(UINT64 addr, UINT size, UINT64 new_addr)
UnlockTrackingList(); UnlockTrackingList();
} }
// Memory address comparison function
int CompareTrackingObject(const void *p1, const void *p2)
{
TRACKING_OBJECT *o1, *o2;
// Validate arguments
if (p1 == NULL || p2 == NULL)
{
return 0;
}
o1 = *(TRACKING_OBJECT **)p1;
o2 = *(TRACKING_OBJECT **)p2;
if (o1 == NULL || o2 == NULL)
{
return 0;
}
if (o1->Address > o2->Address)
{
return 1;
}
if (o1->Address == o2->Address)
{
return 0;
}
return -1;
}
// Search an object in the tracking list // Search an object in the tracking list
TRACKING_OBJECT *SearchTrackingList(UINT64 Address) TRACKING_OBJECT *SearchTrackingList(UINT64 Address)
{ {

View File

@ -166,7 +166,6 @@ void GetCallStackStr(char *str, UINT size, CALLSTACK_DATA *s);
void PrintCallStack(CALLSTACK_DATA *s); void PrintCallStack(CALLSTACK_DATA *s);
void InitTracking(); void InitTracking();
void FreeTracking(); void FreeTracking();
int CompareTrackingObject(const void *p1, const void *p2);
void LockTrackingList(); void LockTrackingList();
void UnlockTrackingList(); void UnlockTrackingList();
void InsertTrackingList(TRACKING_OBJECT *o); void InsertTrackingList(TRACKING_OBJECT *o);