forked from Drifter321/admintool
-
Notifications
You must be signed in to change notification settings - Fork 1
/
loghandler.h
56 lines (48 loc) · 1.21 KB
/
loghandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef LOGHANDLER_H
#define LOGHANDLER_H
#include "serverinfo.h"
#include <QUdpSocket>
#include <QThread>
#include <QNetworkAccessManager>
class Worker;
class LogHandler: public QObject
{
Q_OBJECT
public:
LogHandler(MainWindow *);
~LogHandler();
void createBind(quint16);
void removeServer(ServerInfo *);
void addServer(ServerInfo *);
bool isPrivateIP(QHostAddress address);
QHostAddress *getAddressToLogTo(QHostAddress serverAddress);
QString szPort;
bool isBound;
void setExternalIP(QString szAddress);
void setInternalIP(QString szAddress);
private:
void findLocalAddress();
void createSocket();
signals:
void setupUPnP(LogHandler *);
private slots:
void socketReadyRead();
void socketDisconnected();
void apiFinished(QNetworkReply *);
public slots:
void UPnPReady();
private:
quint16 logPort;
QUdpSocket *logsocket;
QList<ServerInfo *> logList;
MainWindow *pMain;
QThread workerThread;
Worker *worker;
QNetworkAccessManager *manager;
// Grabbed for UPnP
QHostAddress *pExternalIP;
QHostAddress *pInternalIP;
//Grabbed from network interfaces
QHostAddress *pLocalAddress;
};
#endif // LOGHANDLER_H