mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-04-03 18:00:08 +03:00
regionunlock.patch
This commit is contained in:
parent
afa93c8b84
commit
11b5c523ab
@ -2049,10 +2049,10 @@ UINT StSetAcList(ADMIN *a, RPC_AC_LIST *t)
|
|||||||
return ERR_NOT_SUPPORTED;
|
return ERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetGlobalServerFlag(GSF_DISABLE_AC) != 0 && LIST_NUM(t->o) >= 1)
|
// if (GetGlobalServerFlag(GSF_DISABLE_AC) != 0 && LIST_NUM(t->o) >= 1)
|
||||||
{
|
// {
|
||||||
return ERR_NOT_SUPPORTED_FUNCTION_ON_OPENSOURCE;
|
// return ERR_NOT_SUPPORTED_FUNCTION_ON_OPENSOURCE;
|
||||||
}
|
// }
|
||||||
|
|
||||||
CHECK_RIGHT;
|
CHECK_RIGHT;
|
||||||
NO_SUPPORT_FOR_BRIDGE;
|
NO_SUPPORT_FOR_BRIDGE;
|
||||||
@ -3495,10 +3495,10 @@ UINT StSetSysLog(ADMIN *a, SYSLOG_SETTING *t)
|
|||||||
|
|
||||||
SERVER_ADMIN_ONLY;
|
SERVER_ADMIN_ONLY;
|
||||||
|
|
||||||
if (GetGlobalServerFlag(GSF_DISABLE_SYSLOG) != 0 && t->SaveType != SYSLOG_NONE)
|
// if (GetGlobalServerFlag(GSF_DISABLE_SYSLOG) != 0 && t->SaveType != SYSLOG_NONE)
|
||||||
{
|
// {
|
||||||
return ERR_NOT_SUPPORTED_FUNCTION_ON_OPENSOURCE;
|
// return ERR_NOT_SUPPORTED_FUNCTION_ON_OPENSOURCE;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (GetServerCapsBool(s, "b_support_syslog") == false)
|
if (GetServerCapsBool(s, "b_support_syslog") == false)
|
||||||
{
|
{
|
||||||
@ -4899,13 +4899,13 @@ UINT StSetUser(ADMIN *a, RPC_SET_USER *t)
|
|||||||
|
|
||||||
CHECK_RIGHT;
|
CHECK_RIGHT;
|
||||||
|
|
||||||
if (GetGlobalServerFlag(GSF_DISABLE_RADIUS_AUTH) != 0)
|
// if (GetGlobalServerFlag(GSF_DISABLE_RADIUS_AUTH) != 0)
|
||||||
{
|
// {
|
||||||
if (t->AuthType == AUTHTYPE_USERCERT || t->AuthType == AUTHTYPE_RADIUS || t->AuthType == AUTHTYPE_ROOTCERT || t->AuthType == AUTHTYPE_NT)
|
// if (t->AuthType == AUTHTYPE_USERCERT || t->AuthType == AUTHTYPE_RADIUS || t->AuthType == AUTHTYPE_ROOTCERT || t->AuthType == AUTHTYPE_NT)
|
||||||
{
|
// {
|
||||||
return ERR_NOT_SUPPORTED_AUTH_ON_OPENSOURCE;
|
// return ERR_NOT_SUPPORTED_AUTH_ON_OPENSOURCE;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (StrCmpi(t->Name, "*") == 0)
|
if (StrCmpi(t->Name, "*") == 0)
|
||||||
{
|
{
|
||||||
@ -7522,10 +7522,10 @@ UINT StSetHubRadius(ADMIN *a, RPC_RADIUS *t)
|
|||||||
return ERR_NOT_SUPPORTED;
|
return ERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetGlobalServerFlag(GSF_DISABLE_RADIUS_AUTH) != 0 && IsEmptyStr(t->RadiusServerName) == false)
|
// if (GetGlobalServerFlag(GSF_DISABLE_RADIUS_AUTH) != 0 && IsEmptyStr(t->RadiusServerName) == false)
|
||||||
{
|
// {
|
||||||
return ERR_NOT_SUPPORTED_FUNCTION_ON_OPENSOURCE;
|
// return ERR_NOT_SUPPORTED_FUNCTION_ON_OPENSOURCE;
|
||||||
}
|
// }
|
||||||
|
|
||||||
CHECK_RIGHT;
|
CHECK_RIGHT;
|
||||||
|
|
||||||
|
@ -1177,7 +1177,7 @@ void CleanupCedar(CEDAR *c)
|
|||||||
|
|
||||||
DeleteLock(c->OpenVPNPublicPortsLock);
|
DeleteLock(c->OpenVPNPublicPortsLock);
|
||||||
|
|
||||||
DeleteLock(c->CurrentRegionLock);
|
// DeleteLock(c->CurrentRegionLock);
|
||||||
|
|
||||||
DeleteLock(c->CurrentTcpQueueSizeLock);
|
DeleteLock(c->CurrentTcpQueueSizeLock);
|
||||||
DeleteLock(c->QueueBudgetLock);
|
DeleteLock(c->QueueBudgetLock);
|
||||||
@ -1437,7 +1437,7 @@ CEDAR *NewCedar(X *server_x, K *server_k)
|
|||||||
|
|
||||||
c->CedarSuperLock = NewLock();
|
c->CedarSuperLock = NewLock();
|
||||||
|
|
||||||
c->CurrentRegionLock = NewLock();
|
// c->CurrentRegionLock = NewLock();
|
||||||
|
|
||||||
StrCpy(c->OpenVPNDefaultClientOption, sizeof(c->OpenVPNDefaultClientOption), OVPN_DEF_CLIENT_OPTION_STRING);
|
StrCpy(c->OpenVPNDefaultClientOption, sizeof(c->OpenVPNDefaultClientOption), OVPN_DEF_CLIENT_OPTION_STRING);
|
||||||
|
|
||||||
|
@ -963,8 +963,8 @@ typedef struct CEDAR
|
|||||||
char CurrentDDnsFqdn[MAX_SIZE]; // FQDN of the current DDNS
|
char CurrentDDnsFqdn[MAX_SIZE]; // FQDN of the current DDNS
|
||||||
char OpenVPNPublicPorts[MAX_SIZE]; // OpenVPN public UDP port list
|
char OpenVPNPublicPorts[MAX_SIZE]; // OpenVPN public UDP port list
|
||||||
LOCK *OpenVPNPublicPortsLock; // Lock of OpenVPN public UDP port list
|
LOCK *OpenVPNPublicPortsLock; // Lock of OpenVPN public UDP port list
|
||||||
LOCK *CurrentRegionLock; // Current region lock
|
// LOCK *CurrentRegionLock; // Current region lock
|
||||||
char CurrentRegion[128]; // Current region
|
// char CurrentRegion[128]; // Current region
|
||||||
LOCK *CurrentTcpQueueSizeLock; // Current TCP send queue size lock
|
LOCK *CurrentTcpQueueSizeLock; // Current TCP send queue size lock
|
||||||
UINT CurrentTcpQueueSize; // Current TCP send queue size
|
UINT CurrentTcpQueueSize; // Current TCP send queue size
|
||||||
COUNTER *CurrentActiveLinks; // Current active cascade connections
|
COUNTER *CurrentActiveLinks; // Current active cascade connections
|
||||||
|
@ -597,11 +597,11 @@ UINT DCRegister(DDNS_CLIENT *c, bool ipv6, DDNS_REGISTER_PARAM *p, char *replace
|
|||||||
c->CurrentIPv4, c->CurrentIPv6,
|
c->CurrentIPv4, c->CurrentIPv6,
|
||||||
c->CurrentAzureIp, c->CurrentAzureTimestamp, c->CurrentAzureSignature, c->AzureCertHash);
|
c->CurrentAzureIp, c->CurrentAzureTimestamp, c->CurrentAzureSignature, c->AzureCertHash);
|
||||||
|
|
||||||
if (IsEmptyStr(current_region) == false)
|
// if (IsEmptyStr(current_region) == false)
|
||||||
{
|
// {
|
||||||
// Update the current region
|
// // Update the current region
|
||||||
SiUpdateCurrentRegion(c->Cedar, current_region, false);
|
// SiUpdateCurrentRegion(c->Cedar, current_region, false);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Unlock(c->Lock);
|
Unlock(c->Lock);
|
||||||
|
@ -818,10 +818,10 @@ bool IsIpDeniedByAcList(IP *ip, LIST *o)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetGlobalServerFlag(GSF_DISABLE_AC) != 0)
|
// if (GetGlobalServerFlag(GSF_DISABLE_AC) != 0)
|
||||||
{
|
// {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
for (i = 0;i < LIST_NUM(o);i++)
|
for (i = 0;i < LIST_NUM(o);i++)
|
||||||
{
|
{
|
||||||
@ -853,10 +853,10 @@ bool IsIpMaskedByAc(IP *ip, AC *ac)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetGlobalServerFlag(GSF_DISABLE_AC) != 0)
|
// if (GetGlobalServerFlag(GSF_DISABLE_AC) != 0)
|
||||||
{
|
// {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (IsIP4(ip))
|
if (IsIP4(ip))
|
||||||
{
|
{
|
||||||
|
@ -875,10 +875,10 @@ bool PacketLog(HUB *hub, SESSION *src_session, SESSION *dest_session, PKT *packe
|
|||||||
|
|
||||||
if (true)
|
if (true)
|
||||||
{
|
{
|
||||||
if (GetGlobalServerFlag(GSF_DISABLE_DEEP_LOGGING) != 0)
|
// if (GetGlobalServerFlag(GSF_DISABLE_DEEP_LOGGING) != 0)
|
||||||
{
|
// {
|
||||||
no_log = true;
|
// no_log = true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (hub->IsVgsHub)
|
if (hub->IsVgsHub)
|
||||||
{
|
{
|
||||||
|
@ -1382,8 +1382,8 @@ bool ServerAccept(CONNECTION *c)
|
|||||||
goto CLEANUP;
|
goto CLEANUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetGlobalServerFlag(GSF_DISABLE_AC) == 0)
|
// if (GetGlobalServerFlag(GSF_DISABLE_AC) == 0)
|
||||||
{
|
// {
|
||||||
if (hub->HubDb != NULL && c->FirstSock != NULL)
|
if (hub->HubDb != NULL && c->FirstSock != NULL)
|
||||||
{
|
{
|
||||||
IP ip;
|
IP ip;
|
||||||
@ -1403,7 +1403,7 @@ bool ServerAccept(CONNECTION *c)
|
|||||||
goto CLEANUP;
|
goto CLEANUP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|
||||||
Lock(hub->lock);
|
Lock(hub->lock);
|
||||||
{
|
{
|
||||||
@ -1803,10 +1803,10 @@ bool ServerAccept(CONNECTION *c)
|
|||||||
{
|
{
|
||||||
// Attempt external authentication registered users
|
// Attempt external authentication registered users
|
||||||
bool fail_ext_user_auth = false;
|
bool fail_ext_user_auth = false;
|
||||||
if (GetGlobalServerFlag(GSF_DISABLE_RADIUS_AUTH) != 0)
|
// if (GetGlobalServerFlag(GSF_DISABLE_RADIUS_AUTH) != 0)
|
||||||
{
|
// {
|
||||||
fail_ext_user_auth = true;
|
// fail_ext_user_auth = true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (fail_ext_user_auth == false)
|
if (fail_ext_user_auth == false)
|
||||||
{
|
{
|
||||||
@ -1866,8 +1866,8 @@ bool ServerAccept(CONNECTION *c)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CLIENT_AUTHTYPE_CERT:
|
case CLIENT_AUTHTYPE_CERT:
|
||||||
if (GetGlobalServerFlag(GSF_DISABLE_CERT_AUTH) == 0)
|
// if (GetGlobalServerFlag(GSF_DISABLE_CERT_AUTH) == 0)
|
||||||
{
|
// {
|
||||||
// Certificate authentication
|
// Certificate authentication
|
||||||
cert_size = PackGetDataSize(p, "cert");
|
cert_size = PackGetDataSize(p, "cert");
|
||||||
if (cert_size >= 1 && cert_size <= 100000)
|
if (cert_size >= 1 && cert_size <= 100000)
|
||||||
@ -1915,17 +1915,17 @@ bool ServerAccept(CONNECTION *c)
|
|||||||
}
|
}
|
||||||
Free(cert_buf);
|
Free(cert_buf);
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
// Certificate authentication is not supported in the open source version
|
// // Certificate authentication is not supported in the open source version
|
||||||
HLog(hub, "LH_AUTH_CERT_NOT_SUPPORT_ON_OPEN_SOURCE", c->Name, username);
|
// HLog(hub, "LH_AUTH_CERT_NOT_SUPPORT_ON_OPEN_SOURCE", c->Name, username);
|
||||||
Unlock(hub->lock);
|
// Unlock(hub->lock);
|
||||||
ReleaseHub(hub);
|
// ReleaseHub(hub);
|
||||||
FreePack(p);
|
// FreePack(p);
|
||||||
c->Err = ERR_AUTHTYPE_NOT_SUPPORTED;
|
// c->Err = ERR_AUTHTYPE_NOT_SUPPORTED;
|
||||||
goto CLEANUP;
|
// goto CLEANUP;
|
||||||
}
|
// }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AUTHTYPE_OPENVPN_CERT:
|
case AUTHTYPE_OPENVPN_CERT:
|
||||||
|
@ -654,10 +654,10 @@ bool SamAuthUserByCert(HUB *h, char *username, X *x)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetGlobalServerFlag(GSF_DISABLE_CERT_AUTH) != 0)
|
// if (GetGlobalServerFlag(GSF_DISABLE_CERT_AUTH) != 0)
|
||||||
{
|
// {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Check expiration date
|
// Check expiration date
|
||||||
if (CheckXDateNow(x) == false)
|
if (CheckXDateNow(x) == false)
|
||||||
|
@ -781,10 +781,10 @@ void SiWriteSysLog(SERVER *s, char *typestr, char *hubname, wchar_t *message)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetGlobalServerFlag(GSF_DISABLE_SYSLOG) != 0)
|
// if (GetGlobalServerFlag(GSF_DISABLE_SYSLOG) != 0)
|
||||||
{
|
// {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Host name
|
// Host name
|
||||||
GetMachineName(machinename, sizeof(machinename));
|
GetMachineName(machinename, sizeof(machinename));
|
||||||
@ -1214,25 +1214,25 @@ void GetServerCaps(SERVER *s, CAPSLIST *t)
|
|||||||
Unlock(s->CapsCacheLock);
|
Unlock(s->CapsCacheLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the global server flags
|
//// Update the global server flags
|
||||||
void UpdateGlobalServerFlags(SERVER *s, CAPSLIST *t)
|
//void UpdateGlobalServerFlags(SERVER *s, CAPSLIST *t)
|
||||||
{
|
//{
|
||||||
bool is_restricted = false;
|
// bool is_restricted = false;
|
||||||
// Validate arguments
|
// // Validate arguments
|
||||||
if (s == NULL || t == NULL)
|
// if (s == NULL || t == NULL)
|
||||||
{
|
// {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
is_restricted = SiIsEnterpriseFunctionsRestrictedOnOpenSource(s->Cedar);
|
// is_restricted = SiIsEnterpriseFunctionsRestrictedOnOpenSource(s->Cedar);
|
||||||
|
//
|
||||||
SetGlobalServerFlag(GSF_DISABLE_PUSH_ROUTE, is_restricted);
|
// SetGlobalServerFlag(GSF_DISABLE_PUSH_ROUTE, is_restricted);
|
||||||
SetGlobalServerFlag(GSF_DISABLE_RADIUS_AUTH, is_restricted);
|
// SetGlobalServerFlag(GSF_DISABLE_RADIUS_AUTH, is_restricted);
|
||||||
SetGlobalServerFlag(GSF_DISABLE_CERT_AUTH, is_restricted);
|
// SetGlobalServerFlag(GSF_DISABLE_CERT_AUTH, is_restricted);
|
||||||
SetGlobalServerFlag(GSF_DISABLE_DEEP_LOGGING, is_restricted);
|
// SetGlobalServerFlag(GSF_DISABLE_DEEP_LOGGING, is_restricted);
|
||||||
SetGlobalServerFlag(GSF_DISABLE_AC, is_restricted);
|
// SetGlobalServerFlag(GSF_DISABLE_AC, is_restricted);
|
||||||
SetGlobalServerFlag(GSF_DISABLE_SYSLOG, is_restricted);
|
// SetGlobalServerFlag(GSF_DISABLE_SYSLOG, is_restricted);
|
||||||
}
|
//}
|
||||||
|
|
||||||
// Set a global server flag
|
// Set a global server flag
|
||||||
void SetGlobalServerFlag(UINT index, UINT value)
|
void SetGlobalServerFlag(UINT index, UINT value)
|
||||||
@ -1261,7 +1261,7 @@ UINT GetGlobalServerFlag(UINT index)
|
|||||||
// Main of the acquisition of Caps of the server
|
// Main of the acquisition of Caps of the server
|
||||||
void GetServerCapsMain(SERVER *s, CAPSLIST *t)
|
void GetServerCapsMain(SERVER *s, CAPSLIST *t)
|
||||||
{
|
{
|
||||||
bool is_restricted = false;
|
// bool is_restricted = false;
|
||||||
|
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (s == NULL || t == NULL)
|
if (s == NULL || t == NULL)
|
||||||
@ -1269,7 +1269,7 @@ void GetServerCapsMain(SERVER *s, CAPSLIST *t)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
is_restricted = SiIsEnterpriseFunctionsRestrictedOnOpenSource(s->Cedar);
|
// is_restricted = SiIsEnterpriseFunctionsRestrictedOnOpenSource(s->Cedar);
|
||||||
|
|
||||||
// Initialize
|
// Initialize
|
||||||
InitCapsList(t);
|
InitCapsList(t);
|
||||||
@ -1415,7 +1415,8 @@ void GetServerCapsMain(SERVER *s, CAPSLIST *t)
|
|||||||
AddCapsBool(t, "b_support_securenat", true);
|
AddCapsBool(t, "b_support_securenat", true);
|
||||||
|
|
||||||
// Pushing routing table function of SecureNAT Virtual DHCP Server is available
|
// Pushing routing table function of SecureNAT Virtual DHCP Server is available
|
||||||
AddCapsBool(t, "b_suppport_push_route", !is_restricted);
|
// AddCapsBool(t, "b_suppport_push_route", !is_restricted);
|
||||||
|
AddCapsBool(t, "b_suppport_push_route", true);
|
||||||
AddCapsBool(t, "b_suppport_push_route_config", true);
|
AddCapsBool(t, "b_suppport_push_route_config", true);
|
||||||
|
|
||||||
if (s->ServerType != SERVER_TYPE_STANDALONE)
|
if (s->ServerType != SERVER_TYPE_STANDALONE)
|
||||||
@ -1657,7 +1658,7 @@ void GetServerCapsMain(SERVER *s, CAPSLIST *t)
|
|||||||
AddCapsBool(t, "b_vpn4", true);
|
AddCapsBool(t, "b_vpn4", true);
|
||||||
|
|
||||||
|
|
||||||
UpdateGlobalServerFlags(s, t);
|
// UpdateGlobalServerFlags(s, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SYSLOG_SETTING
|
// SYSLOG_SETTING
|
||||||
@ -3135,9 +3136,9 @@ FOLDER *SiWriteConfigurationToCfg(SERVER *s)
|
|||||||
|
|
||||||
root = CfgCreateFolder(NULL, TAG_ROOT);
|
root = CfgCreateFolder(NULL, TAG_ROOT);
|
||||||
|
|
||||||
SiGetCurrentRegion(s->Cedar, region, sizeof(region));
|
// SiGetCurrentRegion(s->Cedar, region, sizeof(region));
|
||||||
|
|
||||||
CfgAddStr(root, "Region", region);
|
// CfgAddStr(root, "Region", region);
|
||||||
|
|
||||||
CfgAddInt(root, "ConfigRevision", s->ConfigRevision);
|
CfgAddInt(root, "ConfigRevision", s->ConfigRevision);
|
||||||
|
|
||||||
@ -10503,34 +10504,34 @@ FARM_CONTROLLER *SiStartConnectToController(SERVER *s)
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the current version
|
//// Get the current version
|
||||||
void SiGetCurrentRegion(CEDAR *c, char *region, UINT region_size)
|
//void SiGetCurrentRegion(CEDAR *c, char *region, UINT region_size)
|
||||||
{
|
//{
|
||||||
ClearStr(region, region_size);
|
// ClearStr(region, region_size);
|
||||||
// Validate arguments
|
// // Validate arguments
|
||||||
if (c == NULL || region == NULL)
|
// if (c == NULL || region == NULL)
|
||||||
{
|
// {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
Lock(c->CurrentRegionLock);
|
// Lock(c->CurrentRegionLock);
|
||||||
{
|
// {
|
||||||
StrCpy(region, region_size, c->CurrentRegion);
|
// StrCpy(region, region_size, c->CurrentRegion);
|
||||||
}
|
// }
|
||||||
Unlock(c->CurrentRegionLock);
|
// Unlock(c->CurrentRegionLock);
|
||||||
|
//
|
||||||
if (IsEmptyStr(region))
|
// if (IsEmptyStr(region))
|
||||||
{
|
// {
|
||||||
if (GetCurrentLangId() == SE_LANG_JAPANESE)
|
// if (GetCurrentLangId() == SE_LANG_JAPANESE)
|
||||||
{
|
// {
|
||||||
StrCpy(region, region_size, "JP");
|
// StrCpy(region, region_size, "JP");
|
||||||
}
|
// }
|
||||||
else if (GetCurrentLangId() == SE_LANG_CHINESE_ZH)
|
// else if (GetCurrentLangId() == SE_LANG_CHINESE_ZH)
|
||||||
{
|
// {
|
||||||
StrCpy(region, region_size, "CN");
|
// StrCpy(region, region_size, "CN");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
// Check whether some enterprise functions are restricted
|
// Check whether some enterprise functions are restricted
|
||||||
//
|
//
|
||||||
@ -10564,60 +10565,60 @@ void SiGetCurrentRegion(CEDAR *c, char *region, UINT region_size)
|
|||||||
// Anyone, except Daiyuu Nobori, who understands and writes the C language
|
// Anyone, except Daiyuu Nobori, who understands and writes the C language
|
||||||
// program can remove this restriction at his own risk.
|
// program can remove this restriction at his own risk.
|
||||||
//
|
//
|
||||||
bool SiIsEnterpriseFunctionsRestrictedOnOpenSource(CEDAR *c)
|
//bool SiIsEnterpriseFunctionsRestrictedOnOpenSource(CEDAR *c)
|
||||||
{
|
//{
|
||||||
char region[128];
|
// char region[128];
|
||||||
bool ret = false;
|
// bool ret = false;
|
||||||
// Validate arguments
|
// // Validate arguments
|
||||||
if (c == NULL)
|
// if (c == NULL)
|
||||||
{
|
// {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
SiGetCurrentRegion(c, region, sizeof(region));
|
// SiGetCurrentRegion(c, region, sizeof(region));
|
||||||
|
//
|
||||||
if (StrCmpi(region, "JP") == 0 || StrCmpi(region, "CN") == 0)
|
// if (StrCmpi(region, "JP") == 0 || StrCmpi(region, "CN") == 0)
|
||||||
{
|
// {
|
||||||
ret = true;
|
// ret = true;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
return ret;
|
// return ret;
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
// Update the current region
|
//// Update the current region
|
||||||
void SiUpdateCurrentRegion(CEDAR *c, char *region, bool force_update)
|
//void SiUpdateCurrentRegion(CEDAR *c, char *region, bool force_update)
|
||||||
{
|
//{
|
||||||
bool changed = false;
|
// bool changed = false;
|
||||||
// Validate arguments
|
// // Validate arguments
|
||||||
if (c == NULL)
|
// if (c == NULL)
|
||||||
{
|
// {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (IsEmptyStr(region) == false)
|
// if (IsEmptyStr(region) == false)
|
||||||
{
|
// {
|
||||||
Lock(c->CurrentRegionLock);
|
// Lock(c->CurrentRegionLock);
|
||||||
{
|
// {
|
||||||
if (StrCmpi(c->CurrentRegion, region) != 0)
|
// if (StrCmpi(c->CurrentRegion, region) != 0)
|
||||||
{
|
// {
|
||||||
StrCpy(c->CurrentRegion, sizeof(c->CurrentRegion), region);
|
// StrCpy(c->CurrentRegion, sizeof(c->CurrentRegion), region);
|
||||||
changed = true;
|
// changed = true;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
Unlock(c->CurrentRegionLock);
|
// Unlock(c->CurrentRegionLock);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (force_update)
|
// if (force_update)
|
||||||
{
|
// {
|
||||||
changed = true;
|
// changed = true;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (changed)
|
// if (changed)
|
||||||
{
|
// {
|
||||||
FlushServerCaps(c->Server);
|
// FlushServerCaps(c->Server);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
// Create a server
|
// Create a server
|
||||||
SERVER *SiNewServer(bool bridge)
|
SERVER *SiNewServer(bool bridge)
|
||||||
@ -10774,7 +10775,7 @@ SERVER *SiNewServerEx(bool bridge, bool in_client_inner_server, bool relay_serve
|
|||||||
|
|
||||||
SiInitDeadLockCheck(s);
|
SiInitDeadLockCheck(s);
|
||||||
|
|
||||||
SiUpdateCurrentRegion(s->Cedar, "", true);
|
// SiUpdateCurrentRegion(s->Cedar, "", true);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
@ -324,12 +324,12 @@ struct LOG_FILE
|
|||||||
|
|
||||||
// Global server flags
|
// Global server flags
|
||||||
#define NUM_GLOBAL_SERVER_FLAGS 128
|
#define NUM_GLOBAL_SERVER_FLAGS 128
|
||||||
#define GSF_DISABLE_PUSH_ROUTE 1
|
//#define GSF_DISABLE_PUSH_ROUTE 1
|
||||||
#define GSF_DISABLE_RADIUS_AUTH 2
|
//#define GSF_DISABLE_RADIUS_AUTH 2
|
||||||
#define GSF_DISABLE_CERT_AUTH 3
|
//#define GSF_DISABLE_CERT_AUTH 3
|
||||||
#define GSF_DISABLE_DEEP_LOGGING 4
|
//#define GSF_DISABLE_DEEP_LOGGING 4
|
||||||
#define GSF_DISABLE_AC 5
|
//#define GSF_DISABLE_AC 5
|
||||||
#define GSF_DISABLE_SYSLOG 6
|
//#define GSF_DISABLE_SYSLOG 6
|
||||||
#define GSF_SHOW_OSS_MSG 7
|
#define GSF_SHOW_OSS_MSG 7
|
||||||
#define GSF_LOCALBRIDGE_NO_DISABLE_OFFLOAD 8
|
#define GSF_LOCALBRIDGE_NO_DISABLE_OFFLOAD 8
|
||||||
#define GSF_DISABLE_SESSION_RECONNECT 9
|
#define GSF_DISABLE_SESSION_RECONNECT 9
|
||||||
@ -603,7 +603,7 @@ void DestroyServerCapsCache(SERVER *s);
|
|||||||
|
|
||||||
void SetGlobalServerFlag(UINT index, UINT value);
|
void SetGlobalServerFlag(UINT index, UINT value);
|
||||||
UINT GetGlobalServerFlag(UINT index);
|
UINT GetGlobalServerFlag(UINT index);
|
||||||
void UpdateGlobalServerFlags(SERVER *s, CAPSLIST *t);
|
//void UpdateGlobalServerFlags(SERVER *s, CAPSLIST *t);
|
||||||
|
|
||||||
|
|
||||||
bool IsAdminPackSupportedServerProduct(char *name);
|
bool IsAdminPackSupportedServerProduct(char *name);
|
||||||
@ -629,9 +629,9 @@ bool SiIsAzureSupported(SERVER *s);
|
|||||||
void SiApplyAzureConfig(SERVER *s, DDNS_CLIENT_STATUS *ddns_status);
|
void SiApplyAzureConfig(SERVER *s, DDNS_CLIENT_STATUS *ddns_status);
|
||||||
void SiSetAzureEnable(SERVER *s, bool enabled);
|
void SiSetAzureEnable(SERVER *s, bool enabled);
|
||||||
|
|
||||||
void SiUpdateCurrentRegion(CEDAR *c, char *region, bool force_update);
|
//void SiUpdateCurrentRegion(CEDAR *c, char *region, bool force_update);
|
||||||
void SiGetCurrentRegion(CEDAR *c, char *region, UINT region_size);
|
//void SiGetCurrentRegion(CEDAR *c, char *region, UINT region_size);
|
||||||
bool SiIsEnterpriseFunctionsRestrictedOnOpenSource(CEDAR *c);
|
//bool SiIsEnterpriseFunctionsRestrictedOnOpenSource(CEDAR *c);
|
||||||
|
|
||||||
#endif // SERVER_H
|
#endif // SERVER_H
|
||||||
|
|
||||||
|
@ -9453,8 +9453,8 @@ void VirtualDhcpServer(VH *v, PKT *p)
|
|||||||
ret.DnsServer2 = v->DhcpDns2;
|
ret.DnsServer2 = v->DhcpDns2;
|
||||||
ret.Gateway = v->DhcpGateway;
|
ret.Gateway = v->DhcpGateway;
|
||||||
|
|
||||||
if (GetGlobalServerFlag(GSF_DISABLE_PUSH_ROUTE) == 0)
|
// if (GetGlobalServerFlag(GSF_DISABLE_PUSH_ROUTE) == 0)
|
||||||
{
|
// {
|
||||||
Copy(&ret.ClasslessRoute, &v->PushRoute, sizeof(DHCP_CLASSLESS_ROUTE_TABLE));
|
Copy(&ret.ClasslessRoute, &v->PushRoute, sizeof(DHCP_CLASSLESS_ROUTE_TABLE));
|
||||||
|
|
||||||
if (IsIpcMacAddress(p->MacAddressSrc))
|
if (IsIpcMacAddress(p->MacAddressSrc))
|
||||||
@ -9503,7 +9503,7 @@ void VirtualDhcpServer(VH *v, PKT *p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (opt->Opcode != DHCP_INFORM)
|
if (opt->Opcode != DHCP_INFORM)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user