Classified ads
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Node Class Reference

Node is a peer in network. More...

#include <node.h>

Collaboration diagram for Node:
Collaboration graph
[legend]

Public Member Functions

 Node (const Hash &aNodeFingerPrint, const int aListenPort)
 
 ~Node ()
 
void setIpv4Addr (const quint32 aAddr)
 
void setIpv6Addr (const Q_IPV6ADDR &aAddr)
 
quint32 ipv4Addr (void) const
 
Q_IPV6ADDR ipv6Addr (void) const
 
QString DNSAddr (void) const
 
void setDNSAddr (const QString &aAddr)
 
QString TORAddr (void) const
 
void setTORAddr (const QString &aAddr)
 
void setPort (const int aPort)
 
int port (void) const
 
void setGoodNodeListTime (const time_t aTime)
 
time_t goodNodeListTime (void) const
 
const HashnodeFingerPrint (void) const
 
void setLastConnectTime (const time_t aTime)
 
time_t lastConnectTime (void) const
 
void setLastMutualConnectTime (const time_t aTime)
 
time_t lastMutualConnectTime (void) const
 
void setCanReceiveIncoming (const bool aYesItCan)
 
bool canReceiveIncoming (void) const
 
bool setIpAddrWithChecks (const QHostAddress &aAddress)
 
QVariant asQVariant () const
 

Static Public Member Functions

static NodefromQVariant (const QVariantMap &aJSonAsQVariant, const bool aIsInitialGreeting)
 

Private Attributes

const Hash iNodeFingerPrint
 
int iListenPort
 
time_t iTimeOfLastContact
 
quint32 iIPv4Addr
 
Q_IPV6ADDR iIPv6Addr
 
QString * iDnsName
 
QString * iTorAddr
 
bool iCanReceiveIncoming
 
time_t iTimeOfGoodNodeList
 
time_t iLastConnectTime
 
time_t iLastMutualConnectTime
 

Detailed Description

Node is a peer in network.

Class that represents a node in network ; typically a physical computer. Nothing prevents having multiuser computer, each user running separate nodes ; but usually only one node per physical computer.

Constructor & Destructor Documentation

Node::Node ( const Hash aNodeFingerPrint,
const int  aListenPort 
)

constructor

Parameters
aNodeFingerPrintis certificate fingerprint of the node that this class re-presents
aListenPortis the network port where the node is supposed to listen
Node::~Node ( )

Destructor

Member Function Documentation

QVariant Node::asQVariant ( ) const

Method for getting node reference as JSon / QVariant

bool Node::canReceiveIncoming ( void  ) const

gets bool if can receive incoming connections

QString Node::DNSAddr ( void  ) const

gets dns-name of node

static Node* Node::fromQVariant ( const QVariantMap &  aJSonAsQVariant,
const bool  aIsInitialGreeting 
)
static

reverse of asQVariant()

Returns
node or NULL if
time_t Node::goodNodeListTime ( void  ) const

gets time of good node list

quint32 Node::ipv4Addr ( void  ) const

gets ipv4 addr of node

Q_IPV6ADDR Node::ipv6Addr ( void  ) const

gets ipv6 addr of node

time_t Node::lastConnectTime ( void  ) const

gets last time of connect

time_t Node::lastMutualConnectTime ( void  ) const

gets last time of connect to this node.

const Hash& Node::nodeFingerPrint ( void  ) const

gets hash of node

int Node::port ( void  ) const

gets listen port of node

void Node::setCanReceiveIncoming ( const bool  aYesItCan)

sets bool if can receive incoming connections

void Node::setDNSAddr ( const QString &  aAddr)

sets dns-name of node

void Node::setGoodNodeListTime ( const time_t  aTime)

sets time of good node list

bool Node::setIpAddrWithChecks ( const QHostAddress &  aAddress)

method intended for setting local address ; this will either set or not set an addr, based on checks inside

Parameters
aAddressis the address to try
Returns
true if aAddress was decided to be valid for future advertisement
void Node::setIpv4Addr ( const quint32  aAddr)

sets ipv4 addr of node

void Node::setIpv6Addr ( const Q_IPV6ADDR &  aAddr)

sets ipv6 addr of node

void Node::setLastConnectTime ( const time_t  aTime)

sets last time of connect

void Node::setLastMutualConnectTime ( const time_t  aTime)

sets last time of connect to this particular node here running this code

void Node::setPort ( const int  aPort)

sets listen port of node

void Node::setTORAddr ( const QString &  aAddr)

sets tor-name of node

QString Node::TORAddr ( void  ) const

gets tor-name of node

Member Data Documentation

bool Node::iCanReceiveIncoming
private

true if node has been successfully contacted from outside

QString* Node::iDnsName
private

dns-name as text

quint32 Node::iIPv4Addr
private

32 bits of IPv4 addr, 0 if no IPv4 addr present

Q_IPV6ADDR Node::iIPv6Addr
private

ipv6-addr

time_t Node::iLastConnectTime
private

time when node was last seen connecting

time_t Node::iLastMutualConnectTime
private

time when node was last connected to this node

int Node::iListenPort
private

TCP port number where node is supposed to listen

const Hash Node::iNodeFingerPrint
private

SHA1 fingerprint of node certificate

time_t Node::iTimeOfGoodNodeList
private

time when node says has last received good node listing

time_t Node::iTimeOfLastContact
private

time when node was last successfully contacted

QString* Node::iTorAddr
private

address within tor-network as text


The documentation for this class was generated from the following file: