mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-20 02:00:55 +07:00
37 lines
663 B
C++
37 lines
663 B
C++
#ifndef XRAY_H
|
|
#define XRAY_H
|
|
|
|
#include <QString>
|
|
|
|
class Xray
|
|
{
|
|
public:
|
|
static Xray& getInstance()
|
|
{
|
|
static Xray instance;
|
|
return instance;
|
|
}
|
|
|
|
bool startXray(const QString& cfg);
|
|
bool stopXray();
|
|
|
|
private:
|
|
static void ctxSockCallback(uintptr_t fd, void* ctx) {
|
|
reinterpret_cast<Xray*>(ctx)->sockCallback(fd);
|
|
}
|
|
static void ctxLogHandler(char* str, void* ctx) {
|
|
reinterpret_cast<Xray*>(ctx)->logHandler(str);
|
|
}
|
|
|
|
void sockCallback(uintptr_t fd);
|
|
void logHandler(char* str);
|
|
|
|
#ifdef Q_OS_LINUX
|
|
QByteArray m_defaultIfaceName;
|
|
#else
|
|
int m_defaultIfaceIdx;
|
|
#endif
|
|
};
|
|
|
|
#endif // XRAY_H
|