1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-26 19:39:53 +03:00
SoftEtherVPN/src/Cedar/Link.h

66 lines
1.9 KiB
C
Raw Normal View History

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
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
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