1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-13 03:04:58 +03:00

Add interface for easy protocol implementation

This commit adds a protocol interface to the server, its purpose is to manage TCP connections and the various third-party protocols.

More specifically, ProtoHandleConnection() takes care of exchanging the packets between the local and remote endpoint; the protocol implementation only has to parse them and act accordingly.

The interface knows which protocol is the connection for by calling IsPacketForMe(), a function implemented for each protocol.
This commit is contained in:
Davide Beatrici
2019-07-26 08:36:54 +02:00
parent 3f9b610c80
commit 7d58e6bf60
10 changed files with 392 additions and 69 deletions

View File

@ -305,8 +305,7 @@
#define CONNECTION_TYPE_ADMIN_RPC 5 // RPC for Management
#define CONNECTION_TYPE_ENUM_HUB 6 // HUB enumeration
#define CONNECTION_TYPE_PASSWORD 7 // Password change
#define CONNECTION_TYPE_SSTP 8 // SSTP
#define CONNECTION_TYPE_OPENVPN 9 // OpenVPN
#define CONNECTION_TYPE_OTHER 0xffffffff // E.g. Third-party protocol
// Protocol
#define CONNECTION_TCP 0 // TCP protocol
@ -1031,6 +1030,7 @@ typedef struct CEDAR
// Layer-2/Layer-3 converter
#include <Cedar/IPC.h>
// Third party protocols
#include <Cedar/Proto.h>
#include <Cedar/Proto_IPsec.h>
#include <Cedar/Proto_EtherIP.h>
#include <Cedar/Proto_IkePacket.h>