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::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::~Node ( )

Destructor

Member Function Documentation

◆ asQVariant()

QVariant Node::asQVariant ( ) const

Method for getting node reference as JSon / QVariant

◆ canReceiveIncoming()

bool Node::canReceiveIncoming ( void  ) const

gets bool if can receive incoming connections

◆ DNSAddr()

QString Node::DNSAddr ( void  ) const

gets dns-name of node

◆ fromQVariant()

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

reverse of asQVariant()

Returns
node or NULL if

◆ goodNodeListTime()

time_t Node::goodNodeListTime ( void  ) const

gets time of good node list

◆ ipv4Addr()

quint32 Node::ipv4Addr ( void  ) const

gets ipv4 addr of node

◆ ipv6Addr()

Q_IPV6ADDR Node::ipv6Addr ( void  ) const

gets ipv6 addr of node

◆ lastConnectTime()

time_t Node::lastConnectTime ( void  ) const

gets last time of connect

◆ lastMutualConnectTime()

time_t Node::lastMutualConnectTime ( void  ) const

gets last time of connect to this node.

◆ nodeFingerPrint()

const Hash& Node::nodeFingerPrint ( void  ) const

gets hash of node

◆ port()

int Node::port ( void  ) const

gets listen port of node

◆ setCanReceiveIncoming()

void Node::setCanReceiveIncoming ( const bool  aYesItCan)

sets bool if can receive incoming connections

◆ setDNSAddr()

void Node::setDNSAddr ( const QString &  aAddr)

sets dns-name of node

◆ setGoodNodeListTime()

void Node::setGoodNodeListTime ( const time_t  aTime)

sets time of good node list

◆ setIpAddrWithChecks()

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

◆ setIpv4Addr()

void Node::setIpv4Addr ( const quint32  aAddr)

sets ipv4 addr of node

◆ setIpv6Addr()

void Node::setIpv6Addr ( const Q_IPV6ADDR &  aAddr)

sets ipv6 addr of node

◆ setLastConnectTime()

void Node::setLastConnectTime ( const time_t  aTime)

sets last time of connect

◆ setLastMutualConnectTime()

void Node::setLastMutualConnectTime ( const time_t  aTime)

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

◆ setPort()

void Node::setPort ( const int  aPort)

sets listen port of node

◆ setTORAddr()

void Node::setTORAddr ( const QString &  aAddr)

sets tor-name of node

◆ TORAddr()

QString Node::TORAddr ( void  ) const

gets tor-name of node

Member Data Documentation

◆ iCanReceiveIncoming

bool Node::iCanReceiveIncoming
private

true if node has been successfully contacted from outside

◆ iDnsName

QString* Node::iDnsName
private

dns-name as text

◆ iIPv4Addr

quint32 Node::iIPv4Addr
private

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

◆ iIPv6Addr

Q_IPV6ADDR Node::iIPv6Addr
private

ipv6-addr

◆ iLastConnectTime

time_t Node::iLastConnectTime
private

time when node was last seen connecting

◆ iLastMutualConnectTime

time_t Node::iLastMutualConnectTime
private

time when node was last connected to this node

◆ iListenPort

int Node::iListenPort
private

TCP port number where node is supposed to listen

◆ iNodeFingerPrint

const Hash Node::iNodeFingerPrint
private

SHA1 fingerprint of node certificate

◆ iTimeOfGoodNodeList

time_t Node::iTimeOfGoodNodeList
private

time when node says has last received good node listing

◆ iTimeOfLastContact

time_t Node::iTimeOfLastContact
private

time when node was last successfully contacted

◆ iTorAddr

QString* Node::iTorAddr
private

address within tor-network as text


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