summaryrefslogtreecommitdiffstats
path: root/NetworkDiscovery/networkdiscovery.h
diff options
context:
space:
mode:
authorNiklas2011-10-19 17:00:58 +0200
committerNiklas2011-10-19 17:00:58 +0200
commit54e31640362a7a995dd49f100eee9550d745e58f (patch)
tree04fbf5a34cf1d98c53a4a766da023e9f6843dcd6 /NetworkDiscovery/networkdiscovery.h
parentsmall changes in the networkmanager. added some ipv6 methods for adding a rou... (diff)
downloadfbgui-54e31640362a7a995dd49f100eee9550d745e58f.tar.gz
fbgui-54e31640362a7a995dd49f100eee9550d745e58f.tar.xz
fbgui-54e31640362a7a995dd49f100eee9550d745e58f.zip
put the NetworkDiscovery code into the src folder of the fbgui. made some test, building a usb stick iso and running it on a maschine. did some bug fixes
Diffstat (limited to 'NetworkDiscovery/networkdiscovery.h')
-rw-r--r--NetworkDiscovery/networkdiscovery.h88
1 files changed, 41 insertions, 47 deletions
diff --git a/NetworkDiscovery/networkdiscovery.h b/NetworkDiscovery/networkdiscovery.h
index b4c4ef7..2291a7c 100644
--- a/NetworkDiscovery/networkdiscovery.h
+++ b/NetworkDiscovery/networkdiscovery.h
@@ -27,36 +27,31 @@ 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();
+ 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();
+ bool checkConnectivityViaTcp();
+ bool checkConnectivityViaTcp(QString server);
+ QVariantMap getInterfaceConfig(QString ifName);
private slots:
- void handleNewConnection();
- void handleNewInput();
- void handleNewInputLine(QLocalSocket * client, QString data);
- void handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
- void handleProcessStarted();
- void handleClientDisconnect();
-
- void slotReadyForRun();
-
- void checkForIsRunning();
+ void handleNewConnection();
+ void handleNewInput();
+ void handleNewInputLine(QLocalSocket *client, QString data);
+ void handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
+ void handleProcessStarted();
+ void handleClientDisconnect();
+ void slotReadyForRun();
+ void checkForIsRunning();
signals:
- void addInterface(const QString &ifName);
+ void addInterface(const QString & ifName);
void changeProgressBarValue(const QString & ifName, const int $newValue);
void connectionEstablished(QString ifName);
void abortBoot(QString msg);
@@ -64,31 +59,31 @@ signals:
void allProcessesFinished();
void continueBoot(QString ifName, int userChoice);
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 _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;
-
- QMap<QString, interfaceconfiguration*> _ifcMap;
+ QLocalServer *_server;
+ QMap<QLocalSocket*,QLocalSocket*> _clients;
+ QLocalSocket *_client;
+ QMap<QString,QLocalSocket*> _ifNameToClient;
+ QMap<QProcess*,QString> _clientProcessToIfNameMap;
+ 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;
+ QMap<QString,interfaceconfiguration*> _ifcMap;
+ void mainWork();
void handleNewInput(QLocalSocket * client);
@@ -97,7 +92,6 @@ private:
bool checkCarrierState(QString interface);
bool checkConnectivity(QString ifName);
- bool checkConnectivityViaTcp(QString server);
bool checkBlackList(QString i);
void getListOfNetworkInterfaces();