1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-23 09:59:52 +03:00
SoftEtherVPN/src/Cedar/SeLowUser.h

81 lines
2.1 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
// SeLow: SoftEther Lightweight Network Protocol
// SeLowUser.h
// Header for SeLowUser.c
#ifndef SELOWUSER_H
#define SELOWUSER_H
#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);
Correct Spelling (#458) * spelling: accepts * spelling: account * spelling: accept * spelling: accumulate * spelling: adapter * spelling: address * spelling: additional * spelling: aggressive * spelling: adhered * spelling: allowed * spelling: ambiguous * spelling: amount * spelling: anonymous * spelling: acquisition * spelling: assemble * spelling: associated * spelling: assigns * spelling: attach * spelling: attempt * spelling: attribute * spelling: authenticate * spelling: authentication * spelling: available * spelling: bridging * spelling: cascade * spelling: cancel * spelling: check * spelling: challenge * spelling: changing * spelling: characters * spelling: cloud * spelling: compare * spelling: communication * spelling: compatible * spelling: compatibility * spelling: completion * spelling: complete * spelling: computers * spelling: configure * spelling: configuration * spelling: conformant * spelling: connection * spelling: contains * spelling: continuously * spelling: continue * spelling: convert * spelling: counters * spelling: create * spelling: created * spelling: cumulate * spelling: currently * spelling: debugging * spelling: decryption * spelling: description * spelling: default * spelling: driver * spelling: delete * spelling: destination * spelling: disabled * spelling: different * spelling: dynamically * spelling: directory * spelling: disappeared * spelling: disable * spelling: doesn't * spelling: download * spelling: dropped * spelling: enable * spelling: established * spelling: ether * spelling: except * spelling: expired * spelling: field * spelling: following * spelling: forever * spelling: firewall * spelling: first * spelling: fragment * spelling: function * spelling: gateway * spelling: identifier * spelling: identify * spelling: incoming * spelling: information * spelling: initialize * spelling: injection * spelling: inner * spelling: instead * spelling: installation * spelling: inserted * spelling: integer * spelling: interrupt * spelling: intuitive * spelling: interval * spelling: january * spelling: keybytes * spelling: know * spelling: language * spelling: length * spelling: library * spelling: listener * spelling: maintain * spelling: modified * spelling: necessary * spelling: number * spelling: obsoleted * spelling: occurred * spelling: occurring * spelling: occur * spelling: original * spelling: omittable * spelling: omit * spelling: opening * spelling: operation * spelling: packet * spelling: parameters * spelling: pointed * spelling: popupmenuopen * spelling: privilege * spelling: product * spelling: protection * spelling: promiscuous * spelling: prompt * spelling: query * spelling: random * spelling: reconnection * spelling: revocation * spelling: received * spelling: red hat * spelling: registry * spelling: release * spelling: retrieve
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