mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-13 11:14:59 +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:
@ -10,6 +10,12 @@
|
||||
#define PROTO_MODE_TCP 1
|
||||
#define PROTO_MODE_UDP 2
|
||||
|
||||
typedef struct PROTO
|
||||
{
|
||||
CEDAR *Cedar;
|
||||
LIST *Impls;
|
||||
} PROTO;
|
||||
|
||||
typedef struct PROTO_IMPL
|
||||
{
|
||||
bool (*Init)(void **param, CEDAR *cedar, INTERRUPT_MANAGER *im, SOCK_EVENT *se);
|
||||
@ -23,22 +29,14 @@ typedef struct PROTO_IMPL
|
||||
UINT (*EstablishedSessions)(void *param);
|
||||
} PROTO_IMPL;
|
||||
|
||||
typedef struct PROTO
|
||||
{
|
||||
PROTO_IMPL *impl;
|
||||
} PROTO;
|
||||
int ProtoImplCompare(void *p1, void *p2);
|
||||
|
||||
int ProtoCompare(void *p1, void *p2);
|
||||
PROTO *ProtoNew(CEDAR *cedar);
|
||||
void ProtoDelete(PROTO *proto);
|
||||
|
||||
void ProtoInit();
|
||||
void ProtoFree();
|
||||
bool ProtoImplAdd(PROTO *proto, PROTO_IMPL *impl);
|
||||
PROTO_IMPL *ProtoImplDetect(PROTO *proto, SOCK *sock);
|
||||
|
||||
bool ProtoAdd(PROTO_IMPL *impl);
|
||||
|
||||
UINT ProtoNum();
|
||||
PROTO *ProtoGet(const UINT index);
|
||||
PROTO *ProtoDetect(SOCK *sock);
|
||||
|
||||
bool ProtoHandleConnection(CEDAR *cedar, SOCK *sock);
|
||||
bool ProtoHandleConnection(PROTO *proto, SOCK *sock);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user