Ring Daemon 16.0.0
|
#include <routing_table.h>
Public Member Functions | |
bool | addConnectingNode (const NodeId &nodeId) |
Add connecting node to routing table. | |
bool | addKnownNode (const NodeId &nodeId) |
Add known node to routing table. | |
bool | addMobileNode (const NodeId &nodeId) |
Add mobile node to routing table. | |
bool | addNode (const std::shared_ptr< dhtnet::ChannelSocketInterface > &channel, std::list< Bucket >::iterator &bucket) |
Add socket to specific bucket. | |
bool | addNode (const std::shared_ptr< dhtnet::ChannelSocketInterface > &socket) |
Add socket to bucket. | |
std::vector< NodeId > | closestNodes (const NodeId &nodeId, unsigned count) |
Returns the count closest nodes to a specific nodeId. | |
bool | contains (const std::list< Bucket >::iterator &it, const NodeId &nodeId) const |
Test if connected nodeId is in specific bucket. | |
void | deleteNode (const NodeId &nodeId) |
Delete node from every table in bucket. | |
std::list< Bucket >::iterator | findBucket (const NodeId &nodeId) |
Returns bucket iterator containing nodeId. | |
const std::list< Bucket >::const_iterator | findBucket (const NodeId &nodeId) const |
Returns bucket iterator containing nodeId. | |
std::vector< NodeId > | getAllNodes () const |
Return every node from each bucket. | |
std::vector< NodeId > | getBucketMobileNodes () const |
Returns mobile nodes corresponding to the swarm's id. | |
std::list< Bucket > & | getBuckets () |
Returns buckets in routing table. | |
std::vector< NodeId > | getConnectingNodes () const |
Returns all routing table's connecting nodes. | |
NodeId | getId () const |
Returns id for routing table. | |
std::vector< NodeId > | getKnownNodes () const |
Returns all routing table's known nodes. | |
std::vector< NodeId > | getMobileNodes () const |
Returns all routing table's mobile nodes. | |
std::vector< NodeId > | getNodes () const |
Returns all routing table's connected nodes. | |
unsigned | getRoutingTableNodeCount () const |
Returns number of total nodes in routing table. | |
unsigned | getRoutingTableSize () const |
Returns number of buckets in routing table. | |
bool | hasConnectingNode (const NodeId &nodeId) const |
Check if Connecting node exists in routing table. | |
bool | hasKnownNode (const NodeId &nodeId) const |
Checks if known node exists in routing table. | |
bool | hasMobileNode (const NodeId &nodeId) |
Check if mobile node exists in routing table. | |
bool | hasNode (const NodeId &nodeId) |
Check if connected node exsits in routing table. | |
void | printRoutingTable () const |
Prints routing table. | |
void | removeConnectingNode (const NodeId &nodeId) |
Remove connecting connecting node to routing table. | |
void | removeMobileNode (const NodeId &nodeId) |
Remove mobile node to routing table. | |
bool | removeNode (const NodeId &nodeId) |
Removes node from routing table Adds it to known_nodes or mobile_nodes depending on mobility. | |
RoutingTable () | |
void | setId (const NodeId &node) |
Sets id for routing table. | |
void | shutdownAllNodes () |
Shutdowns all nodes in routing table and add them to known_nodes or mobile_nodes. | |
void | shutdownNode (const NodeId &nodeId) |
Shutdowns a node. | |
Definition at line 307 of file routing_table.h.
jami::RoutingTable::RoutingTable | ( | ) |
Definition at line 247 of file routing_table.cpp.
Add connecting node to routing table.
nodeId |
Definition at line 334 of file routing_table.cpp.
References jami::emitSignal(), and findBucket().
Referenced by jami::SwarmManager::maintainBuckets().
Add known node to routing table.
nodeId |
Definition at line 294 of file routing_table.cpp.
References jami::emitSignal(), and findBucket().
Add mobile node to routing table.
nodeId |
Definition at line 307 of file routing_table.cpp.
References jami::emitSignal(), and findBucket().
bool jami::RoutingTable::addNode | ( | const std::shared_ptr< dhtnet::ChannelSocketInterface > & | channel, |
std::list< Bucket >::iterator & | bucket | ||
) |
Add socket to specific bucket.
channel | |
bucket |
Definition at line 260 of file routing_table.cpp.
References contains(), jami::emitSignal(), and findBucket().
bool jami::RoutingTable::addNode | ( | const std::shared_ptr< dhtnet::ChannelSocketInterface > & | socket | ) |
Add socket to bucket.
socket |
Definition at line 253 of file routing_table.cpp.
References addNode(), jami::emitSignal(), and findBucket().
Referenced by jami::SwarmManager::addChannel(), and addNode().
Returns the count closest nodes to a specific nodeId.
nodeId | |
count |
Definition at line 373 of file routing_table.cpp.
References closestNodes(), jami::emitSignal(), and findBucket().
Referenced by closestNodes().
bool jami::RoutingTable::contains | ( | const std::list< Bucket >::iterator & | it, |
const NodeId & | nodeId | ||
) | const |
Test if connected nodeId is in specific bucket.
it | |
nodeId |
Definition at line 487 of file routing_table.cpp.
References jami::emitSignal().
Referenced by addNode(), and jami::SwarmManager::maintainBuckets().
Delete node from every table in bucket.
Definition at line 513 of file routing_table.cpp.
References jami::emitSignal(), and findBucket().
Referenced by jami::SwarmManager::deleteNode().
std::list< Bucket >::iterator jami::RoutingTable::findBucket | ( | const NodeId & | nodeId | ) |
Returns bucket iterator containing nodeId.
nodeId |
Definition at line 355 of file routing_table.cpp.
References jami::emitSignal().
Referenced by jami::SwarmManager::addChannel(), addConnectingNode(), addKnownNode(), addMobileNode(), addNode(), addNode(), jami::SwarmManager::changeMobility(), closestNodes(), deleteNode(), findBucket(), getBucketMobileNodes(), hasConnectingNode(), hasKnownNode(), hasMobileNode(), hasNode(), removeConnectingNode(), removeMobileNode(), removeNode(), and shutdownNode().
|
inline |
Returns bucket iterator containing nodeId.
nodeId |
Definition at line 419 of file routing_table.h.
References findBucket().
std::vector< NodeId > jami::RoutingTable::getAllNodes | ( | ) | const |
Return every node from each bucket.
Definition at line 495 of file routing_table.cpp.
References jami::emitSignal().
Referenced by jami::SwarmManager::getAllNodes().
std::vector< NodeId > jami::RoutingTable::getBucketMobileNodes | ( | ) | const |
Returns mobile nodes corresponding to the swarm's id.
Definition at line 476 of file routing_table.cpp.
References jami::emitSignal(), and findBucket().
|
inline |
Returns buckets in routing table.
Definition at line 487 of file routing_table.h.
Referenced by jami::SwarmManager::display(), jami::SwarmManager::getBuckets(), and jami::SwarmManager::maintainBuckets().
std::vector< NodeId > jami::RoutingTable::getConnectingNodes | ( | ) | const |
Returns all routing table's connecting nodes.
Definition at line 465 of file routing_table.cpp.
References jami::emitSignal().
|
inline |
std::vector< NodeId > jami::RoutingTable::getKnownNodes | ( | ) | const |
Returns all routing table's known nodes.
Definition at line 443 of file routing_table.cpp.
References jami::emitSignal().
std::vector< NodeId > jami::RoutingTable::getMobileNodes | ( | ) | const |
Returns all routing table's mobile nodes.
Definition at line 454 of file routing_table.cpp.
References jami::emitSignal().
std::vector< NodeId > jami::RoutingTable::getNodes | ( | ) | const |
Returns all routing table's connected nodes.
Definition at line 431 of file routing_table.cpp.
References jami::emitSignal().
|
inline |
Returns number of total nodes in routing table.
Definition at line 443 of file routing_table.h.
References jami::emitSignal().
Referenced by jami::SwarmManager::display().
|
inline |
Returns number of buckets in routing table.
Definition at line 437 of file routing_table.h.
Check if Connecting node exists in routing table.
nodeId |
Definition at line 401 of file routing_table.h.
References jami::emitSignal(), and findBucket().
Checks if known node exists in routing table.
nodeId |
Definition at line 355 of file routing_table.h.
References jami::emitSignal(), and findBucket().
Check if mobile node exists in routing table.
nodeId |
Definition at line 328 of file routing_table.cpp.
References findBucket().
Check if connected node exsits in routing table.
nodeId |
Definition at line 288 of file routing_table.cpp.
References findBucket().
Referenced by jami::SwarmManager::isConnectedWith().
void jami::RoutingTable::printRoutingTable | ( | ) | const |
Prints routing table.
Definition at line 413 of file routing_table.cpp.
References jami::emitSignal(), and JAMI_DEBUG.
Remove connecting connecting node to routing table.
nodeId |
Definition at line 349 of file routing_table.cpp.
References findBucket().
Remove mobile node to routing table.
nodeId |
Definition at line 322 of file routing_table.cpp.
References findBucket().
Removes node from routing table Adds it to known_nodes or mobile_nodes depending on mobility.
socket |
Definition at line 282 of file routing_table.cpp.
References findBucket().
Sets id for routing table.
node |
Definition at line 475 of file routing_table.h.
Referenced by jami::SwarmManager::SwarmManager().
|
inline |
Shutdowns all nodes in routing table and add them to known_nodes or mobile_nodes.
Definition at line 465 of file routing_table.h.
References jami::emitSignal().
Referenced by jami::SwarmManager::shutdown().
Shutdowns a node.
nodeId |
Definition at line 425 of file routing_table.cpp.
References findBucket().