From ce3329047d378a14006ce74ec273ac59e3375303 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 12 May 2010 19:42:27 +0200 Subject: initial import of latest svn version --- src/net/pvsDiscoveredServer.h | 63 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/net/pvsDiscoveredServer.h (limited to 'src/net/pvsDiscoveredServer.h') 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 +#include +#include + +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 & errors ); + void sock_dataArrival(); + void sock_connected(); + +Q_SIGNALS: + void validated(PVSDiscoveredServer*); +}; + +#endif /* PVSDISCOVEREDSERVER_H_ */ -- cgit v1.2.3-55-g7522