Classified ads
|
not a real part datamodel. debugging aid. More...
#include <mockup_nodemodel.h>
Public Member Functions | |
MockUpNodeModel (MController *aMController) | |
~MockUpNodeModel () | |
virtual bool | nodeGreetingReceived (Node &aNode, bool aWasInitialGreeting=false) |
virtual Hash & | nodeFingerPrint () |
virtual int | listenPortOfThisNode () |
virtual const QSslCertificate & | nodeCert () const |
virtual const QSslKey & | nodeKey () const |
virtual QByteArray * | getNextItemToSend (Connection &aConnection) |
virtual Node * | nodeByHash (const Hash &aHash) |
virtual QList< Node * > * | getNodesBeforeHash (const Hash &aHash, int aMaxNodes) |
virtual void | closeOldestInactiveConnection () |
virtual QList< Node * > * | getNodesAfterHash (const Hash &aHash, int aMaxNodes, int aMaxInactivityMinutes=-1) |
virtual QList< QPair < QHostAddress, int > > | getHotAddresses () |
virtual bool | updateNodeLastConnectTimeInDb (Node &aNode) |
virtual QList< Node * > * | getHotNodes (int aMaxNodes) |
virtual void | addNodeFromBroadcast (const Hash &aNodeFingerPrint, const QHostAddress &aAddr, int aPort) |
virtual void | addNodeToConnectionWishList (Node *aNode) |
virtual bool | addNodeToConnectionWishList (const Hash &aNode) |
virtual Node * | nextConnectionWishListItem () |
virtual bool | isNodeAlreadyConnected (const Node &aNode) const |
virtual bool | isNodeAlreadyConnected (const Hash &aHash) const |
virtual Hash | bucketEndHash (const Hash &aFingerPrintOfNodeAsking) |
virtual bool | updateNodeLastMutualConnectTimeInDb (const Hash &aNodeFp, quint32 aTime) |
virtual void | setListenPortOfThisNode (int port) |
virtual QList< Node * > * | getNodesBeforeHash (const Hash &h, unsigned int i) |
virtual QList< Node * > * | getNodesAfterHash (const Hash &h, unsigned int u, int i) |
virtual void | setDnsName (QString aName) |
virtual QString | getDnsName () |
Public Member Functions inherited from MNodeModelProtocolInterface | |
virtual QList< Node * > * | getNodesBeforeHash (const Hash &aHash, unsigned aMaxNodes)=0 |
virtual QList< Node * > * | getNodesAfterHash (const Hash &aHash, unsigned aMaxNodes, int aMaxInactivityMinutes=-1)=0 |
Public Attributes | |
Node * | iLastNodeReceived |
Private Attributes | |
MController * | iController |
Hash * | iFingerPrintOfThisNode |
QString | iDnsName |
not a real part datamodel. debugging aid.
MockUpNodeModel::MockUpNodeModel | ( | MController * | aMController | ) |
constructor
MockUpNodeModel::~MockUpNodeModel | ( | ) |
Destructor
|
virtual |
method for adding node reference from broadcast. this needs difference in handling because in IPv4 network this typically contains private addr space addresses that we don't want to permanently store nor give to others as node-references.
For making connections inside LANs of organisations having NATs and firewalls and whatnot this might still be a handy feature.
Implements MNodeModelProtocolInterface.
|
virtual |
method for adding a node to connection-wishlist. network connector engine will then later pick them up. nodemodel will take ownership of the node and delete the object later.
Implements MNodeModelProtocolInterface.
|
virtual |
method for adding a node to connection-wishlist. network connector engine will then later pick them up.
Implements MNodeModelProtocolInterface.
Important method regarding churn here. This is called from Connection class and this method is used to determine what content belongs to same bucket with the node that is being served by that Connection. Content in the same bucket with the node is then sent over to node ; to keep the content alive in the network.
Intent here is find bucket size where we have approximately 20 live nodes in a bucket.
This is done so that we order the recently-seen nodes by hash value of the node, then start from the fingerprint of the node that is asking, and from that point we count to 20. The fingerprint of the node at position 20 is the end of the bucket. The fingerprint of the node that asks is the start.
aFingerPrintOfNodeAsking | fingerprint of node that wants to have its bucket filled |
Implements MNodeModelProtocolInterface.
|
virtual |
Implements MNodeModelProtocolInterface.
|
virtual |
called from settings dialog and own node construction
Implements MNodeModelProtocolInterface.
|
virtual |
Implements MNodeModelProtocolInterface.
|
virtual |
Implements MNodeModelProtocolInterface.
|
virtual |
Implements MNodeModelProtocolInterface.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
method for checking if a node is already connected
Implements MNodeModelProtocolInterface.
|
virtual |
Method for checking if a node is already connected. This version checks only hash, not addresses.
Implements MNodeModelProtocolInterface.
|
virtual |
TCP listen port number method
Implements MNodeModelProtocolInterface.
|
virtual |
method for getting one node from wishlist. caller is obliged to delete the node returned.
Implements MNodeModelProtocolInterface.
Implements MNodeModelProtocolInterface.
|
virtual |
Implements MNodeModelProtocolInterface.
|
virtual |
returns fingerprint of this node
Implements MNodeModelProtocolInterface.
|
virtual |
Implements MNodeModelProtocolInterface.
|
virtual |
getter for ssl certificate of SSL sock
Implements MNodeModelProtocolInterface.
|
virtual |
called from settings dialog
Implements MNodeModelProtocolInterface.
|
virtual |
for setting of tcp listen port
Implements MNodeModelProtocolInterface.
|
virtual |
Implements MNodeModelProtocolInterface.
|
virtual |
updates last mutual connect time, used for deciding what content to send automatically upon node connect
Implements MNodeModelProtocolInterface.
|
private |
|
private |
|
private |
set by method openOrCreateSSLCertificate
Node* MockUpNodeModel::iLastNodeReceived |