Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiyuu Nobori <da.git@softether.co.jp>2014-02-05 20:35:26 +0400
committerDaiyuu Nobori <da.git@softether.co.jp>2014-02-05 20:35:26 +0400
commitcdd4540baaae47865402cf208566324c39945446 (patch)
treee96677efe306ac3768565dcdd3f49ace9cffd2d8 /src/Cedar/Client.c
parent001fd910fedfd0ef1690a9d3c50c1a28d1680d1d (diff)
parent8779e59295b857c38f5f453080a5e87be07c1fc3 (diff)
Merge pull request #10 from nattoheaven/tuntaposx
Supporting VLAN for Mac OS X using TunTapOSX
Diffstat (limited to 'src/Cedar/Client.c')
-rw-r--r--src/Cedar/Client.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/Cedar/Client.c b/src/Cedar/Client.c
index 104e8990..e2a02f7b 100644
--- a/src/Cedar/Client.c
+++ b/src/Cedar/Client.c
@@ -7455,12 +7455,14 @@ bool CtDisableVLan(CLIENT *c, RPC_CLIENT_CREATE_VLAN *vlan)
#ifndef OS_WIN32
+#ifdef NO_VLAN
if (GetOsInfo()->OsType == OSTYPE_MACOS_X)
{
// Can not be added or removed the virtual LAN card in MacOS X
CiSetError(c, ERR_NOT_SUPPORTED);
return false;
}
+#endif
// Check whether the virtual LAN card with the specified name is not
// being used by one or more accounts
@@ -7606,12 +7608,14 @@ bool CtEnableVLan(CLIENT *c, RPC_CLIENT_CREATE_VLAN *vlan)
#ifndef OS_WIN32
+#ifdef NO_VLAN
if (GetOsInfo()->OsType == OSTYPE_MACOS_X)
{
// Can not be added or removed the virtual LAN card in MacOS X
CiSetError(c, ERR_NOT_SUPPORTED);
return false;
}
+#endif
// Search the virtual LAN card
LockList(c->UnixVLanList);
@@ -7702,12 +7706,14 @@ bool CtDeleteVLan(CLIENT *c, RPC_CLIENT_CREATE_VLAN *d)
#ifndef OS_WIN32
+#ifdef NO_VLAN
if (GetOsInfo()->OsType == OSTYPE_MACOS_X)
{
// Can not be added or removed the virtual LAN card in MacOS X
CiSetError(c, ERR_NOT_SUPPORTED);
return false;
}
+#endif
// Check whether the virtual LAN card with the specified name is not
// being used by one or more accounts
@@ -8274,12 +8280,14 @@ bool CtCreateVLan(CLIENT *c, RPC_CLIENT_CREATE_VLAN *create)
#ifndef OS_WIN32
// Non-Win32
+#ifdef NO_VLAN
if (GetOsInfo()->OsType == OSTYPE_MACOS_X)
{
// A virtual LAN card can not be added or removed in MacOS X
CiSetError(c, ERR_NOT_SUPPORTED);
return false;
}
+#endif
// Check whether the specified name is valid or not
if (IsSafeStr(create->DeviceName) == false)
@@ -9801,7 +9809,11 @@ bool CiReadSettingFromCfg(CLIENT *c, FOLDER *root)
// Eraser
c->Eraser = NewEraser(c->Logger, CfgGetInt64(config, "AutoDeleteCheckDiskFreeSpaceMin"));
- if (OS_IS_UNIX(GetOsInfo()->OsType) && GetOsInfo()->OsType != OSTYPE_MACOS_X)
+ if (OS_IS_UNIX(GetOsInfo()->OsType)
+#ifdef NO_VLAN
+ && GetOsInfo()->OsType != OSTYPE_MACOS_X
+#endif
+ )
{
// Read the UNIX version virtual LAN card list (except MacOS)
vlan = CfgGetFolder(root, "UnixVLan");
@@ -9811,6 +9823,7 @@ bool CiReadSettingFromCfg(CLIENT *c, FOLDER *root)
}
}
+#ifdef NO_VLAN
if (GetOsInfo()->OsType == OSTYPE_MACOS_X)
{
#ifdef OS_UNIX
@@ -9831,6 +9844,7 @@ bool CiReadSettingFromCfg(CLIENT *c, FOLDER *root)
Add(c->UnixVLanList, uv);
#endif // OS_UNIX
}
+#endif
CiLoadAccountDatabase(c, db);
@@ -10337,7 +10351,11 @@ void CiWriteSettingToCfg(CLIENT *c, FOLDER *root)
CiWriteCAList(c, ca);
// VLAN
- if (OS_IS_UNIX(GetOsInfo()->OsType) && GetOsInfo()->OsType != OSTYPE_MACOS_X)
+ if (OS_IS_UNIX(GetOsInfo()->OsType)
+#ifdef NO_VLAN
+ && GetOsInfo()->OsType != OSTYPE_MACOS_X
+#endif
+ )
{
vlan = CfgCreateFolder(root, "UnixVLan");
CiWriteVLanList(c, vlan);