1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-11-20 18:31:51 +03:00

Cedar: various improvements to Proto

The PROTO structure is now used to identify the system as a whole, rather than a single protocol. It's stored and initialized in Server.

ProtoCompare(), ProtoAdd() and ProtoDetected() are renamed to make the difference between PROTO and PROTO_IMPL more clear.

ProtoGet() and ProtoNum() are removed because the related list can now be accessed directly by Server.
This commit is contained in:
Davide Beatrici
2020-05-01 07:14:38 +02:00
parent 039cd8edf0
commit 942051d3a8
6 changed files with 77 additions and 102 deletions

View File

@ -2623,15 +2623,13 @@ void SiInitConfiguration(SERVER *s)
s->AutoSaveConfigSpan = SERVER_FILE_SAVE_INTERVAL_DEFAULT;
s->BackupConfigOnlyWhenModified = true;
// IPsec server
if (s->Cedar->Bridge == false)
{
// Protocols handler
s->Proto = ProtoNew(s->Cedar);
// IPsec server
s->IPsecServer = NewIPsecServer(s->Cedar);
}
// OpenVPN server (UDP)
if (s->Cedar->Bridge == false)
{
// OpenVPN server (UDP)
s->OpenVpnServerUdp = NewOpenVpnServerUdp(s->Cedar);
}
@ -6538,6 +6536,11 @@ void SiFreeConfiguration(SERVER *s)
s->SaveHaltEvent = NULL;
s->SaveThread = NULL;
// Stop the protocols handler
if (s->Proto != NULL)
{
ProtoDelete(s->Proto);
}
// Stop the IPsec server
if (s->IPsecServer != NULL)