2017-10-19 05:48:23 +03:00
|
|
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
2014-01-04 17:00:08 +04:00
|
|
|
// Cedar Communication Module
|
|
|
|
|
|
|
|
|
|
|
|
// Link.h
|
|
|
|
// Header of Link.c
|
|
|
|
|
|
|
|
#ifndef LINK_H
|
|
|
|
#define LINK_H
|
|
|
|
|
2021-04-05 05:48:25 +03:00
|
|
|
#include "CedarType.h"
|
|
|
|
|
|
|
|
#include "Mayaqua/MayaType.h"
|
|
|
|
|
2014-01-04 17:00:08 +04:00
|
|
|
struct LINK
|
|
|
|
{
|
|
|
|
bool Started; // Running flag
|
|
|
|
volatile bool Halting; // Halting flag
|
|
|
|
bool Offline; // Offline
|
2014-10-03 19:09:23 +04:00
|
|
|
bool NoOnline; // Do not set to online flag
|
2014-01-04 17:00:08 +04:00
|
|
|
REF *ref; // Reference counter
|
|
|
|
LOCK *lock; // Lock
|
|
|
|
CEDAR *Cedar; // Cedar
|
|
|
|
HUB *Hub; // HUB
|
|
|
|
SESSION *ClientSession; // Client session
|
|
|
|
SESSION *ServerSession; // Server session
|
|
|
|
CLIENT_OPTION *Option; // Client Option
|
|
|
|
CLIENT_AUTH *Auth; // Authentication data
|
|
|
|
POLICY *Policy; // Policy
|
|
|
|
QUEUE *SendPacketQueue; // Transmission packet queue
|
2014-10-03 19:09:23 +04:00
|
|
|
UINT CurrentSendPacketQueueSize; // Current send packet queue size
|
2014-01-04 17:00:08 +04:00
|
|
|
UINT LastError; // Last error
|
|
|
|
bool CheckServerCert; // To check the server certificate
|
2021-12-17 12:57:23 +03:00
|
|
|
bool AddDefaultCA; // Use default trust store
|
2014-01-04 17:00:08 +04:00
|
|
|
X *ServerCert; // Server certificate
|
2014-10-03 19:09:23 +04:00
|
|
|
bool LockFlag; // Lock flag
|
|
|
|
bool *StopAllLinkFlag; // Stop all link flag
|
|
|
|
UINT LastServerConnectionReceivedBlocksNum; // Last server connection recv queue num
|
|
|
|
UINT Flag1;
|
2014-01-04 17:00:08 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
PACKET_ADAPTER *LinkGetPacketAdapter();
|
|
|
|
bool LinkPaInit(SESSION *s);
|
|
|
|
CANCEL *LinkPaGetCancel(SESSION *s);
|
|
|
|
UINT LinkPaGetNextPacket(SESSION *s, void **data);
|
|
|
|
bool LinkPaPutPacket(SESSION *s, void *data, UINT size);
|
|
|
|
void LinkPaFree(SESSION *s);
|
|
|
|
|
|
|
|
void LinkServerSessionThread(THREAD *t, void *param);
|
|
|
|
LINK *NewLink(CEDAR *cedar, HUB *hub, CLIENT_OPTION *option, CLIENT_AUTH *auth, POLICY *policy);
|
|
|
|
void StartLink(LINK *k);
|
|
|
|
void StopLink(LINK *k);
|
|
|
|
void DelLink(HUB *hub, LINK *k);
|
|
|
|
void LockLink(LINK *k);
|
|
|
|
void UnlockLink(LINK *k);
|
|
|
|
void StopAllLink(HUB *h);
|
|
|
|
void StartAllLink(HUB *h);
|
|
|
|
void SetLinkOnline(LINK *k);
|
|
|
|
void SetLinkOffline(LINK *k);
|
|
|
|
void ReleaseLink(LINK *k);
|
|
|
|
void CleanupLink(LINK *k);
|
|
|
|
void ReleaseAllLink(HUB *h);
|
|
|
|
void NormalizeLinkPolicy(POLICY *p);
|
|
|
|
|
|
|
|
#endif // LINK_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|