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
|
|
|
|
|
|
|
class TorControlDialog: public QDialog, public Ui::TorControlDialog
|
|
|
|
{
|
|
|
|
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 {
|
|
|
|
HIDDEN_SERVICE_STATUS_UNKNOWN = 0x00,
|
|
|
|
HIDDEN_SERVICE_STATUS_OK = 0x01,
|
|
|
|
HIDDEN_SERVICE_STATUS_FAIL = 0x02
|
|
|
|
};
|
|
|
|
|
|
|
|
// Should be called multiple times in a loop until it returns something else than *_UNKNOWN
|
|
|
|
|
|
|
|
TorStatus checkForTor() ;
|
|
|
|
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 checkForHiddenService();
|
|
|
|
void onIncomingConnection();
|
2017-12-21 09:32:42 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
void setupHiddenService();
|
|
|
|
|
|
|
|
Tor::TorManager *mTorManager ;
|
2017-12-21 12:16:32 -05:00
|
|
|
Tor::HiddenService *mHiddenService ;
|
|
|
|
|
|
|
|
QTcpServer *mIncomingServer ;
|
2017-12-21 09:32:42 -05:00
|
|
|
};
|