summaryrefslogtreecommitdiffstats
path: root/src/net/pvsDiscoveredServer.h
diff options
context:
space:
mode:
authorSebastian2010-05-12 19:42:27 +0200
committerSebastian2010-05-12 19:42:27 +0200
commitce3329047d378a14006ce74ec273ac59e3375303 (patch)
tree782430f270b4c7aca1b35d5b7813518e3797c555 /src/net/pvsDiscoveredServer.h
downloadpvs-ce3329047d378a14006ce74ec273ac59e3375303.tar.gz
pvs-ce3329047d378a14006ce74ec273ac59e3375303.tar.xz
pvs-ce3329047d378a14006ce74ec273ac59e3375303.zip
initial import of latest svn version
Diffstat (limited to 'src/net/pvsDiscoveredServer.h')
-rw-r--r--src/net/pvsDiscoveredServer.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/net/pvsDiscoveredServer.h b/src/net/pvsDiscoveredServer.h
new file mode 100644
index 0000000..d9f0c01
--- /dev/null
+++ b/src/net/pvsDiscoveredServer.h
@@ -0,0 +1,63 @@
+/*
+# Copyright (c) 2009 - OpenSLX Project, Computer Center University of Freiburg
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# src/net/pvsDiscoveredServer.h
+# - represents an entry in the list of available servers
+# - handles some extra things like validating the identity of the remote host
+# -----------------------------------------------------------------------------
+*/
+
+#ifndef PVSDISCOVEREDSERVER_H_
+#define PVSDISCOVEREDSERVER_H_
+
+#include <QtNetwork/QSslSocket>
+#include <QtNetwork/QHostAddress>
+#include <QtCore/QDateTime>
+
+class PVSDiscoveredServer;
+
+class PVSDiscoveredServer : public QObject {
+ Q_OBJECT
+
+private:
+ QHostAddress _host;
+ int _port;
+ QByteArray _fingerprint;
+ bool _validated;
+ QSslSocket *_socket;
+ QDateTime _lastCheck;
+ QDateTime _lastUpdate;
+ QString _name;
+
+public:
+ PVSDiscoveredServer(QObject* parent, QHostAddress host, int port, QByteArray fingerprint, QString name);
+ virtual ~PVSDiscoveredServer();
+ bool isValid() { return _validated; }
+ bool hasFingerprint(QByteArray &fingerprint);
+ bool hasHost(QHostAddress &host);
+ void update(int port);
+ int getAge();
+ QString getName();
+ QHostAddress getHost() { return _host; }
+ QByteArray getFingerprint() { return _fingerprint; }
+ int getPort() { return _port; }
+ void validateCertificate();
+
+private Q_SLOTS:
+ void ssl_Error( const QList<QSslError> & errors );
+ void sock_dataArrival();
+ void sock_connected();
+
+Q_SIGNALS:
+ void validated(PVSDiscoveredServer*);
+};
+
+#endif /* PVSDISCOVEREDSERVER_H_ */