From 4e1b9faba7503f99ee2fbcd7458f66ade42fa309 Mon Sep 17 00:00:00 2001 From: Niklas Date: Thu, 1 Sep 2011 09:31:39 +0200 Subject: tried to clean the git. deleted old unused files and folders. moved customdhcpcd and LogReceiver to the fbgui folder --- LogReceiver/logreceiver.h | 74 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 LogReceiver/logreceiver.h (limited to 'LogReceiver/logreceiver.h') diff --git a/LogReceiver/logreceiver.h b/LogReceiver/logreceiver.h new file mode 100644 index 0000000..ce6d070 --- /dev/null +++ b/LogReceiver/logreceiver.h @@ -0,0 +1,74 @@ +#ifndef LOGRECEIVER_H +#define LOGRECEIVER_H + +#include +#include +#include +#include +#include +#include +#include + +class QLocalServer; +class QLocalSocket; + +class LogReceiver: public QObject { +Q_OBJECT + +#define DEFAULT_QTSOCKETADDRESS "/var/tmp/qt_c_socket_default" +#define DEFAULT_PATHTODHCPCDEXE "/home/niklas/fbgui/workspace/customdhcpcd/src/customdhcpcd" + +public: + LogReceiver(); + ~LogReceiver(); + + void initAndRun(QString serverPath = DEFAULT_QTSOCKETADDRESS, + QString pathToExe = DEFAULT_PATHTODHCPCDEXE, + QStringList* args = NULL); + +private slots: + void handleNewConnection(); + void handleNewInput(); + void handleNewInputLine(QLocalSocket * client, QString data); + void handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus); + void handleProcessStarted(); + void handleClientDisconnect(); + +signals: + void addNewInterface(QString ifName); + void changeProgressBarValue(QString ifName, int newValue); + void connectionEstablished(QString ifName); + void abortBoot(QString msg); + void updateStatusLabel(QString ifName, QString status); + void allProcessesFinished(); + +private: + QLocalServer *server; + quint16 blockSize; + //QMap interfacesMap; + //QMap indexToIfaceNameMap; + QMap clients; + QLocalSocket * client; + QMap ifNameToClient; + QMap clientProcessToIfNameMap; + QString pathToDhcpcdExe; + QStringList dhcpcdArguments; + QNetworkConfigurationManager configurationManager; + QNetworkAccessManager *accessManager; + int numberOfProcesses; + + void handleNewInput(QLocalSocket * client); + + void runDHCPCD(QList &interfaces); + void runDHCPCD(QString interface); + QListcheckCarrierState(QList &interfaces); + bool checkCarrierState(QString interface); + void checkInternetConnection(QString ifName); + void checkInternetConnection(QList &interfaces); + void checkInternetConnectionViaTCP(QString ifName); + QList getListOfNetworkInterfaces(); + bool checkBlackList(QString i); + +}; + +#endif // LOGRECEIVER_H -- cgit v1.2.3-55-g7522