summaryrefslogtreecommitdiffstats
path: root/src/fbgui/networkdiscovery.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/fbgui/networkdiscovery.h')
-rw-r--r--src/fbgui/networkdiscovery.h164
1 files changed, 82 insertions, 82 deletions
diff --git a/src/fbgui/networkdiscovery.h b/src/fbgui/networkdiscovery.h
index c422b18..d63ad0b 100644
--- a/src/fbgui/networkdiscovery.h
+++ b/src/fbgui/networkdiscovery.h
@@ -27,7 +27,6 @@
#include <syslog.h>
#include <sysfs/libsysfs.h>
-#include "loggerengine.h"
#include "interfaceconfiguration.h"
#include "networkmanager.h"
@@ -40,98 +39,99 @@
#define DEFAULT_PATHTODHCPCDEXE "/bin/cdhcpcd"
-class NetworkDiscovery: public QObject {
-Q_OBJECT
+class NetworkDiscovery: public QObject
+{
+ Q_OBJECT
public:
- NetworkDiscovery(QObject *parent=0);
- ~NetworkDiscovery();
-
- void initAndRun(QString serverIp, bool userChoice,
- bool autoUp,
- QString pathToLogFile,
- QString serverPath = DEFAULT_QTSOCKETADDRESS,
- QString pathToExe = DEFAULT_PATHTODHCPCDEXE,
- QStringList* args = NULL);
- int ip4_replaceDefaultRoute(QString ifName, QString gateway, int mss);
- QString getGatewayForInterface(QString ifName);
-
- int ip4_setManualConfiguration(QVariantMap result);
- QString readLogFile();
- void tryAgain();
- void prepareTryAgain();
- bool checkConnectivity(QString ifName);
- bool checkConnectivityViaTcp();
- QVariantMap getInterfaceConfig(QString ifName);
- QString GetErrorStr();
+ NetworkDiscovery(QObject *parent = 0);
+ ~NetworkDiscovery();
+
+ void initAndRun(QString serverIp, bool userChoice,
+ bool autoUp,
+ QString pathToLogFile,
+ QString serverPath = DEFAULT_QTSOCKETADDRESS,
+ QString pathToExe = DEFAULT_PATHTODHCPCDEXE,
+ QStringList* args = NULL);
+ int ip4_replaceDefaultRoute(QString ifName, QString gateway, int mss);
+ QString getGatewayForInterface(QString ifName);
+
+ int ip4_setManualConfiguration(QVariantMap result);
+ QString readLogFile();
+ void tryAgain();
+ void prepareTryAgain();
+ bool checkConnectivity(QString ifName);
+ bool checkConnectivityViaTcp();
+ QVariantMap getInterfaceConfig(QString ifName);
+ QString GetErrorStr();
public slots:
- void handleNewConnection();
- void handleNewInput();
- void handleNewInputLine(QLocalSocket * client, QString data);
- void handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
- void handleProcessStarted();
- void handleClientDisconnect();
+ void handleNewConnection();
+ void handleNewInput();
+ void handleNewInputLine(QLocalSocket * client, QString data);
+ void handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
+ void handleProcessStarted();
+ void handleClientDisconnect();
- void slotReadyForRun();
+ void slotReadyForRun();
- void checkForIsRunning();
+ void checkForIsRunning();
signals:
- void addInterface(const QString &ifName);
- void changeProgressBarValue(const QString & ifName, const int $newValue);
- void connectionEstablished(QString ifName);
- void abortBoot(QString msg);
- void updateIfStatus(QString ifName, QString status);
- void updateStatus(QString status);
- void allProcessesFinished();
- void continueBoot(QString ifName);
- void continueBootWithoutCheck(QString ifName);
- void setManualConfInterfaces(QString jsonArr);
-
- void readyForRun();
+ void addInterface(const QString &ifName);
+ void changeProgressBarValue(const QString & ifName, const int $newValue);
+ void connectionEstablished(QString ifName);
+ void abortBoot(QString msg);
+ void updateIfStatus(QString ifName, QString status);
+ void updateStatus(QString status);
+ void allProcessesFinished();
+ void continueBoot(QString ifName);
+ void continueBootWithoutCheck(QString ifName);
+ void setManualConfInterfaces(QString jsonArr);
+
+ void readyForRun();
private:
- QString _tag;
- QLocalServer *_server;
- QMap<QLocalSocket*,QLocalSocket*> _clients;
- QLocalSocket *_client;
- QMap<QString,QLocalSocket*> _ifNameToClient;
- QMap<QProcess*,QString> _clientProcessToIfNameMap;
- QString _serverPath;
- QString _pathToDhcpcdExe;
- QStringList _dhcpcdArguments;
- int _numberOfProcesses;
- NetworkManager* _networkManager;
- bool _userChoice;
- bool _blocked;
- bool _autoUp;
- QString _serverIp;
- QString _pathToLogFile;
- QList<QString> _ifUpList;
- QList<QString> _ifDownList;
- int _ifUpCountdown;
- QTimer*_timer;
- QList<Q_PID> _pidsList;
- QString _errorStr;
- QMap<QString,interfaceconfiguration*> _ifcMap;
- void mainWork();
-
- void killDHCPCD();
-
- void handleNewInput(QLocalSocket * client);
-
- void runDHCPCD(QList<QString> &interfaces);
- void runDHCPCD(QString interface);
-
- bool checkCarrierState(QString interface);
- bool checkConnectivityViaTcp(QString server);
-
- bool checkBlackList(QString i);
-
- void getListOfNetworkInterfaces();
- void getListOfNetworkInterfacesWithAutoUp();
+ QString _tag;
+ QLocalServer *_server;
+ QMap<QLocalSocket*, QLocalSocket*> _clients;
+ QLocalSocket *_client;
+ QMap<QString, QLocalSocket*> _ifNameToClient;
+ QMap<QProcess*, QString> _clientProcessToIfNameMap;
+ QString _serverPath;
+ QString _pathToDhcpcdExe;
+ QStringList _dhcpcdArguments;
+ int _numberOfProcesses;
+ NetworkManager* _networkManager;
+ bool _userChoice;
+ bool _blocked;
+ bool _autoUp;
+ QString _serverIp;
+ QString _pathToLogFile;
+ QList<QString> _ifUpList;
+ QList<QString> _ifDownList;
+ int _ifUpCountdown;
+ QTimer*_timer;
+ QList<Q_PID> _pidsList;
+ QString _errorStr;
+ QMap<QString, interfaceconfiguration*> _ifcMap;
+ void mainWork();
+
+ void killDHCPCD();
+
+ void handleNewInput(QLocalSocket * client);
+
+ void runDHCPCD(QList<QString> &interfaces);
+ void runDHCPCD(QString interface);
+
+ bool checkCarrierState(QString interface);
+ bool checkConnectivityViaTcp(QString server);
+
+ bool checkBlackList(QString i);
+
+ void getListOfNetworkInterfaces();
+ void getListOfNetworkInterfacesWithAutoUp();
};