2017-10-19 05:48:23 +03:00
|
|
|
// SoftEther VPN Source Code - Developer Edition Master Branch
|
2014-01-04 17:00:08 +04:00
|
|
|
// SeLow: SoftEther Lightweight Network Protocol
|
|
|
|
|
|
|
|
|
|
|
|
// SeLowUser.h
|
|
|
|
// Header for SeLowUser.c
|
|
|
|
|
|
|
|
#ifndef SELOWUSER_H
|
|
|
|
#define SELOWUSER_H
|
|
|
|
|
2021-04-05 05:48:25 +03:00
|
|
|
#include "CedarType.h"
|
|
|
|
|
|
|
|
#include "Mayaqua/Mayaqua.h"
|
|
|
|
|
2014-01-04 17:00:08 +04:00
|
|
|
#include <SeLow/SeLowCommon.h>
|
|
|
|
|
|
|
|
//// Macro
|
|
|
|
#define SL_USER_INSTALL_LOCK_TIMEOUT 60000 // Lock acquisition timeout
|
|
|
|
#define SL_USER_AUTO_PUSH_TIMER 60000 // Timer to start the installation automatically
|
|
|
|
|
|
|
|
//// Type
|
|
|
|
|
|
|
|
// SU
|
|
|
|
struct SU
|
|
|
|
{
|
|
|
|
void *hFile; // File handle
|
|
|
|
SL_ADAPTER_INFO_LIST AdapterInfoList; // Adapter list cache
|
|
|
|
};
|
|
|
|
|
|
|
|
// Adapter
|
|
|
|
struct SU_ADAPTER
|
|
|
|
{
|
|
|
|
char AdapterId[MAX_PATH]; // Adapter ID
|
|
|
|
char DeviceName[MAX_PATH]; // Device name
|
|
|
|
void *hFile; // File handle
|
|
|
|
void *hEvent; // Event handle
|
|
|
|
bool Halt;
|
|
|
|
UINT CurrentPacketCount;
|
|
|
|
UCHAR GetBuffer[SL_EXCHANGE_BUFFER_SIZE]; // Read buffer
|
|
|
|
UCHAR PutBuffer[SL_EXCHANGE_BUFFER_SIZE]; // Write buffer
|
|
|
|
};
|
|
|
|
|
|
|
|
// Adapter list items
|
|
|
|
struct SU_ADAPTER_LIST
|
|
|
|
{
|
|
|
|
SL_ADAPTER_INFO Info; // Adapter information
|
|
|
|
char Guid[128]; // GUID
|
|
|
|
char Name[MAX_SIZE]; // Name
|
|
|
|
char SortKey[MAX_SIZE]; // Sort key
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//// Function prototype
|
|
|
|
SU *SuInit();
|
|
|
|
SU *SuInitEx(UINT wait_for_bind_complete_tick);
|
|
|
|
void SuFree(SU *u);
|
|
|
|
TOKEN_LIST *SuEnumAdapters(SU *u);
|
|
|
|
SU_ADAPTER *SuOpenAdapter(SU *u, char *adapter_id);
|
|
|
|
void SuCloseAdapter(SU_ADAPTER *a);
|
|
|
|
void SuCloseAdapterHandleInner(SU_ADAPTER *a);
|
|
|
|
bool SuGetPacketsFromDriver(SU_ADAPTER *a);
|
|
|
|
bool SuGetNextPacket(SU_ADAPTER *a, void **buf, UINT *size);
|
|
|
|
bool SuPutPacketsToDriver(SU_ADAPTER *a);
|
|
|
|
bool SuPutPacket(SU_ADAPTER *a, void *buf, UINT size);
|
|
|
|
|
|
|
|
SU_ADAPTER_LIST *SuAdapterInfoToAdapterList(SL_ADAPTER_INFO *info);
|
|
|
|
LIST *SuGetAdapterList(SU *u);
|
|
|
|
void SuFreeAdapterList(LIST *o);
|
2018-05-17 00:47:10 +03:00
|
|
|
int SuCmpAdapterList(void *p1, void *p2);
|
2014-01-04 17:00:08 +04:00
|
|
|
|
|
|
|
bool SuInstallDriver(bool force);
|
|
|
|
bool SuInstallDriverInner(bool force);
|
2014-10-03 19:09:23 +04:00
|
|
|
bool SuIsSupportedOs(bool on_install);
|
2015-10-19 15:30:51 +03:00
|
|
|
bool SuCopySysFile(wchar_t *src, wchar_t *dst);
|
2014-01-04 17:00:08 +04:00
|
|
|
|
2015-07-16 18:31:57 +03:00
|
|
|
void SuDeleteGarbageInfs();
|
|
|
|
void SuDeleteGarbageInfsInner();
|
2015-10-19 15:30:51 +03:00
|
|
|
bool SuLoadDriversHive();
|
|
|
|
bool SuUnloadDriversHive();
|
2015-07-16 18:31:57 +03:00
|
|
|
|
2014-01-04 17:00:08 +04:00
|
|
|
#endif // SELOWUSER_H
|
|
|
|
|
|
|
|
|
|
|
|
|