Files
amnezia-client/ipc/ipcserver.h
T

45 lines
1.3 KiB
C++
Raw Normal View History

2021-02-02 01:47:40 +03:00
#ifndef IPCSERVER_H
#define IPCSERVER_H
2021-02-03 15:42:36 +03:00
#include <QLocalServer>
2021-02-02 01:47:40 +03:00
#include <QObject>
2021-06-01 18:18:09 +03:00
#include <QRemoteObjectNode>
2021-02-02 01:47:40 +03:00
#include "ipc.h"
#include "ipcserverprocess.h"
#include "rep_ipcinterface_source.h"
class IpcServer : public IpcInterfaceSource
{
public:
explicit IpcServer(QObject *parent = nullptr);
virtual int createPrivilegedProcess() override;
2021-02-18 15:00:41 +03:00
virtual int routeAddList(const QString &gw, const QStringList &ips) override;
virtual bool clearSavedRoutes() override;
2021-06-01 18:18:09 +03:00
virtual bool routeDeleteList(const QString &gw, const QStringList &ips) override;
2021-02-18 15:00:41 +03:00
virtual void flushDns() override;
virtual bool checkAndInstallDriver() override;
virtual QStringList getTapList() override;
2021-02-02 01:47:40 +03:00
private:
int m_localpid = 0;
struct ProcessDescriptor {
ProcessDescriptor (QObject *parent = nullptr) {
serverNode = QSharedPointer<QRemoteObjectHost>(new QRemoteObjectHost(parent));
ipcProcess = QSharedPointer<IpcServerProcess>(new IpcServerProcess(parent));
2021-02-03 15:42:36 +03:00
localServer = QSharedPointer<QLocalServer>(new QLocalServer(parent));
2021-02-02 01:47:40 +03:00
}
2021-06-01 18:18:09 +03:00
2021-02-02 01:47:40 +03:00
QSharedPointer<IpcServerProcess> ipcProcess;
QSharedPointer<QRemoteObjectHost> serverNode;
2021-02-03 15:42:36 +03:00
QSharedPointer<QLocalServer> localServer;
2021-02-02 01:47:40 +03:00
};
QMap<int, ProcessDescriptor> m_processes;
};
#endif // IPCSERVER_H