1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-12 02:34:59 +03:00

Cedar: improve constness of PROTO_IMPL functions, move Name() at the top

This commit is contained in:
Davide Beatrici
2020-07-17 02:55:47 +02:00
parent b57a4b051b
commit cd850c07ae
5 changed files with 21 additions and 22 deletions

View File

@ -14,13 +14,13 @@ static UCHAR ping_signature[] =
0x07, 0xed, 0x2d, 0x0a, 0x98, 0x1f, 0xc7, 0x48
};
PROTO_IMPL *OvsGetProtoImpl()
const PROTO_IMPL *OvsGetProtoImpl()
{
static PROTO_IMPL impl =
static const PROTO_IMPL impl =
{
OvsName,
OvsInit,
OvsFree,
OvsName,
OvsIsPacketForMe,
OvsProcessData,
OvsProcessDatagrams
@ -29,6 +29,11 @@ PROTO_IMPL *OvsGetProtoImpl()
return &impl;
}
const char *OvsName()
{
return "OpenVPN";
}
bool OvsInit(void **param, CEDAR *cedar, INTERRUPT_MANAGER *im, SOCK_EVENT *se, const char *cipher, const char *hostname)
{
if (param == NULL || cedar == NULL || im == NULL || se == NULL)
@ -48,12 +53,6 @@ void OvsFree(void *param)
FreeOpenVpnServer(param);
}
// Return the protocol name
char *OvsName()
{
return "OpenVPN";
}
// Check whether it's an OpenVPN packet
bool OvsIsPacketForMe(const PROTO_MODE mode, const UCHAR *data, const UINT size)
{