21 #ifndef CLASSIFIED_NODEMODEL_H 22 #define CLASSIFIED_NODEMODEL_H 23 #include <QSqlDatabase> 25 #include "../mcontroller.h" 27 #include "../net/connection.h" 28 #include <QHostAddress> 35 class QSslCertificate ;
58 virtual const QSslCertificate&
nodeCert()
const ;
60 virtual const QSslKey&
nodeKey()
const ;
123 bool aWasInitialGreeting =
false ) ;
140 int aMaxInactivityMinutes = -1 ) ;
162 unsigned aMaxNodes) ;
189 const QHostAddress& aAddr,
277 quint32 aLessSignificant,
278 quint32 aMoreSignificant,
279 quint32 aMostSignificant )
const ;
283 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:40
bool saveSslCertToDb(const QByteArray &aCert)
virtual Node * nextConnectionWishListItem()
bool saveSslKeyToDb(const QByteArray &aKey)
virtual const QSslKey & nodeKey() const
virtual Hash bucketEndHash(const Hash &aFingerPrintOfNodeAsking)
QList< HostConnectQueueItem > iHotAddresses
Definition: nodemodel.h:289
const Model & iModel
Definition: nodemodel.h:290
virtual void setDnsName(QString aName)
virtual Node * nodeByHash(const Hash &aHash)
virtual bool updateNodeLastMutualConnectTimeInDb(const Hash &aNodeFp, quint32 aTime)
QString iDataDir
Definition: nodemodel.h:291
virtual int listenPortOfThisNode()
QSslCertificate * iThisNodeCert
Definition: nodemodel.h:287
virtual QByteArray * getNextItemToSend(Connection &aConnection)
QList< Node * > iConnectionWishList
Definition: nodemodel.h:292
virtual void closeOldestInactiveConnection()
Hash is class that carries 160-bit digest.
Definition: hash.h:38
CAErrorSituation
Definition: mcontroller.h:52
virtual QString getDnsName()
virtual bool nodeGreetingReceived(Node &aNode, bool aWasInitialGreeting=false)
void timerEvent(QTimerEvent *event)
virtual void addNodeFromBroadcast(const Hash &aNodeFingerPrint, const QHostAddress &aAddr, int aPort)
virtual QList< HostConnectQueueItem > getHotAddresses()
Pure-virtual interface class for controller. This is spammed across parties needing access to applica...
Definition: mcontroller.h:43
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:39
M of the MVC pattern. Handles permanent storage.
Definition: model.h:48
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:46
Hash * iFingerPrintOfThisNode
Definition: nodemodel.h:286
virtual Hash & nodeFingerPrint()
QList< Node * > * getHotNodes(int aMaxNodes)
virtual bool isNodeAlreadyConnected(const Node &aNode) const
void removeNodeFromRecentlyFailedList(const Hash &aConnectedHostFingerPrint)
void deleteOldestConnectedNode()
int iTimerId
Definition: nodemodel.h:299
QList< QPair< Hash, unsigned > > iRecentlyFailedNodes
Definition: nodemodel.h:298
Pure-virtual interface of nodemodel.
Definition: mnodemodelprotocolinterface.h:39
bool updateNodeInDb(Node &aNode)
Class that represents a network connection.
Definition: connection.h:43
MController * iController
Definition: nodemodel.h:285
QSslKey * iThisNodeKey
Definition: nodemodel.h:288
virtual void offerNodeToRecentlyFailedList(const Hash &aFailedNodeHash)
void retrieveListOfHotConnections()
virtual bool addNodeToConnectionWishList(Node *aNode)
bool updateNodeLastConnectTimeInDb(Node &aNode)