summaryrefslogtreecommitdiffstats
path: root/qdbd/networkconfigurationexecutor.h
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2017-03-02 12:34:52 +0200
committerKari Oikarinen <kari.oikarinen@qt.io>2017-05-02 11:47:27 +0000
commitd96efc1a528f38c1da6830eadd9d096a49495d08 (patch)
tree387c352de97ebba767edd926559ec78e713d1355 /qdbd/networkconfigurationexecutor.h
parente1e7ff8f1fd0558559321066cedd62e729621175 (diff)
Configure DHCP server on device before handshake
Change the procedure for a newly detected device: First configure the network and then do the handshake for the device information. The configuring the network part is new and incorporates a new service NetworkConfigurationService. On the device it relies on a script b2qt-gadget-network.sh (or as specified in a command line parameter) which does the actual configuring of the USB network interface. The network configuration to apply is selected from a list of hardcoded candidates from the private use IPv4 ranges available. They are checked against the existing networks on the host and an unused one is picked. On the device the USB interface is configured to use this network and to act as a DHCP server for it. Host will then pick up an IP from this DHCP server automatically. Previous configuration of the host network is thus not necessary and is removed. Task-number: QTBUG-58614 Change-Id: I6a4ed34ef7d5cba9e55e6fa4f07725bb3c00d795 Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Diffstat (limited to 'qdbd/networkconfigurationexecutor.h')
-rw-r--r--qdbd/networkconfigurationexecutor.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/qdbd/networkconfigurationexecutor.h b/qdbd/networkconfigurationexecutor.h
new file mode 100644
index 0000000..f3c1c1a
--- /dev/null
+++ b/qdbd/networkconfigurationexecutor.h
@@ -0,0 +1,42 @@
+/******************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Debug Bridge.
+**
+** $QT_BEGIN_LICENSE:COMM$
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** $QT_END_LICENSE$
+**
+******************************************************************************/
+#ifndef NETWORKCONFIGURATIONEXECUTOR_H
+#define NETWORKCONFIGURATIONEXECUTOR_H
+
+#include "executor.h"
+class Stream;
+
+class NetworkConfigurationExecutor : public Executor
+{
+ Q_OBJECT
+public:
+ explicit NetworkConfigurationExecutor(Stream *stream);
+
+public slots:
+ void receive(StreamPacket packet) override;
+
+private:
+ void failedResponse();
+
+ Stream *m_stream;
+};
+
+#endif // NETWORKCONFIGURATIONEXECUTOR_H