Classified ads
|
Node is a peer in network. More...
#include <node.h>
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 Hash & | nodeFingerPrint (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 Node * | fromQVariant (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 |
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.
Node::Node | ( | const Hash & | aNodeFingerPrint, |
const int | aListenPort | ||
) |
constructor
aNodeFingerPrint | is certificate fingerprint of the node that this class re-presents |
aListenPort | is the network port where the node is supposed to listen |
Node::~Node | ( | ) |
Destructor
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 |
reverse of asQVariant()
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
aAddress | is the address to try |
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
|
private |
true if node has been successfully contacted from outside
|
private |
dns-name as text
|
private |
32 bits of IPv4 addr, 0 if no IPv4 addr present
|
private |
ipv6-addr
|
private |
time when node was last seen connecting
|
private |
time when node was last connected to this node
|
private |
TCP port number where node is supposed to listen
|
private |
SHA1 fingerprint of node certificate
|
private |
time when node says has last received good node listing
|
private |
time when node was last successfully contacted
|
private |
address within tor-network as text