20 #ifndef CLASSIFIED_NODEMODEL_H
21 #define CLASSIFIED_NODEMODEL_H
22 #include <QSqlDatabase>
24 #include "../mcontroller.h"
26 #include "../net/connection.h"
27 #include <QHostAddress>
34 class QSslCertificate ;
57 virtual const QSslCertificate&
nodeCert()
const ;
59 virtual const QSslKey&
nodeKey()
const ;
122 bool aWasInitialGreeting =
false ) ;
139 int aMaxInactivityMinutes = -1 ) ;
161 unsigned aMaxNodes) ;
188 const QHostAddress& aAddr,
267 quint32 aLessSignificant,
268 quint32 aMoreSignificant,
269 quint32 aMostSignificant )
const ;
272 const QString& aExplanation) ;
NodeModel(MController *aController, const Model &aModel)
virtual const QSslCertificate & nodeCert() const
bool insertNodeToDb(Node &aNode)
bool openOrCreateSSLCertificate()
Node is a peer in network.
Definition: node.h:39
bool saveSslCertToDb(const QByteArray &aCert)
virtual Node * nextConnectionWishListItem()
bool saveSslKeyToDb(const QByteArray &aKey)
virtual const QSslKey & nodeKey() const
virtual Hash bucketEndHash(const Hash &aFingerPrintOfNodeAsking)
const Model & iModel
Definition: nodemodel.h:279
virtual void setDnsName(QString aName)
virtual Node * nodeByHash(const Hash &aHash)
virtual bool updateNodeLastMutualConnectTimeInDb(const Hash &aNodeFp, quint32 aTime)
QString iDataDir
Definition: nodemodel.h:280
virtual int listenPortOfThisNode()
QSslCertificate * iThisNodeCert
Definition: nodemodel.h:276
virtual QByteArray * getNextItemToSend(Connection &aConnection)
QList< Node * > iConnectionWishList
Definition: nodemodel.h:281
virtual void closeOldestInactiveConnection()
Hash is class that carries 160-bit digest.
Definition: hash.h:37
CAErrorSituation
Definition: mcontroller.h:48
virtual QString getDnsName()
virtual void addNodeToConnectionWishList(Node *aNode)
virtual bool nodeGreetingReceived(Node &aNode, bool aWasInitialGreeting=false)
QList< QPair< QHostAddress, int > > iHotAddresses
Definition: nodemodel.h:278
virtual void addNodeFromBroadcast(const Hash &aNodeFingerPrint, const QHostAddress &aAddr, int aPort)
Pure-virtual interface class for controller. This is spammed across parties needing access to applica...
Definition: mcontroller.h:39
virtual QList< Node * > * getNodesAfterHash(const Hash &aHash, unsigned aMaxNodes, int aMaxInactivityMinutes=-1)
datamodel-parts common part. this is inherited and contains common funcs
Definition: datamodelbase.h:38
M of the MVC pattern. Handles permanent storage.
Definition: model.h:47
virtual QList< Node * > * getNodesBeforeHash(const Hash &aHash, unsigned aMaxNodes)
virtual void setListenPortOfThisNode(int port)
void error(MController::CAErrorSituation aError, const QString &aExplanation)
Q_IPV6ADDR ipv6AddrFromUints(quint32 aLeastSignificant, quint32 aLessSignificant, quint32 aMoreSignificant, quint32 aMostSignificant) const
This is node-specific part of the datamodel.
Definition: nodemodel.h:45
Hash * iFingerPrintOfThisNode
Definition: nodemodel.h:275
virtual QList< QPair< QHostAddress, int > > getHotAddresses()
virtual Hash & nodeFingerPrint()
QList< Node * > * getHotNodes(int aMaxNodes)
virtual bool isNodeAlreadyConnected(const Node &aNode) const
void deleteOldestConnectedNode()
Pure-virtual interface of nodemodel.
Definition: mnodemodelprotocolinterface.h:38
bool updateNodeInDb(Node &aNode)
Class that represents a network connection.
Definition: connection.h:41
MController * iController
Definition: nodemodel.h:274
QSslKey * iThisNodeKey
Definition: nodemodel.h:277
void retrieveListOfHotConnections()
bool updateNodeLastConnectTimeInDb(Node &aNode)