2017-12-21 09:32:42 -05:00
|
|
|
#include "ui_TorControlWindow.h"
|
2017-12-21 12:16:32 -05:00
|
|
|
|
|
|
|
class QTcpServer ;
|
|
|
|
|
|
|
|
namespace Tor {
|
|
|
|
class HiddenService ;
|
|
|
|
class TorManager ;
|
|
|
|
}
|
2017-12-21 09:32:42 -05:00
|
|
|
|
2017-12-26 14:42:25 -05:00
|
|
|
class TorControlDialog: public QWidget, public Ui::TorControlDialog
|
2017-12-21 09:32:42 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
TorControlDialog(Tor::TorManager *tm,QWidget *parent =NULL);
|
|
|
|
|
2017-12-21 12:16:32 -05:00
|
|
|
enum TorStatus {
|
|
|
|
TOR_STATUS_UNKNOWN = 0x00,
|
|
|
|
TOR_STATUS_OK = 0x01,
|
|
|
|
TOR_STATUS_FAIL = 0x02
|
|
|
|
};
|
|
|
|
|
|
|
|
enum HiddenServiceStatus {
|
2017-12-25 16:59:42 -05:00
|
|
|
HIDDEN_SERVICE_STATUS_UNKNOWN = 0x00, // no information known.
|
|
|
|
HIDDEN_SERVICE_STATUS_FAIL = 0x01, // some error occurred
|
|
|
|
HIDDEN_SERVICE_STATUS_REQUESTED = 0x02, // one service at least has been requested. Still being tested.
|
|
|
|
HIDDEN_SERVICE_STATUS_OK = 0x03 // one service responds and has been tested
|
2017-12-21 12:16:32 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
// Should be called multiple times in a loop until it returns something else than *_UNKNOWN
|
|
|
|
|
2018-02-08 09:26:21 -05:00
|
|
|
TorStatus checkForTor(QString& error_msg) ;
|
2017-12-21 12:16:32 -05:00
|
|
|
HiddenServiceStatus checkForHiddenService() ;
|
|
|
|
|
2017-12-21 09:32:42 -05:00
|
|
|
protected slots:
|
|
|
|
void showLog();
|
|
|
|
void statusChanged();
|
2017-12-21 12:16:32 -05:00
|
|
|
void onIncomingConnection();
|
2017-12-21 09:32:42 -05:00
|
|
|
|
|
|
|
private:
|
2018-02-08 09:26:21 -05:00
|
|
|
QString mErrorMsg ;
|
2017-12-25 16:59:42 -05:00
|
|
|
HiddenServiceStatus mHiddenServiceStatus ;
|
2017-12-21 09:32:42 -05:00
|
|
|
|
|
|
|
Tor::TorManager *mTorManager ;
|
2017-12-21 12:16:32 -05:00
|
|
|
Tor::HiddenService *mHiddenService ;
|
|
|
|
|
|
|
|
QTcpServer *mIncomingServer ;
|
2017-12-21 09:32:42 -05:00
|
|
|
};
|