IBR-DTNSuite
0.8
|
#include <Node.h>
Classes | |
class | Attribute |
class | URI |
Public Types | |
enum | Protocol { CONN_UNSUPPORTED = -1, CONN_UNDEFINED = 0, CONN_TCPIP = 1, CONN_UDPIP = 2, CONN_LOWPAN = 3, CONN_BLUETOOTH = 4, CONN_HTTP = 5, CONN_FILE = 6, CONN_DGRAM_UDP = 7, CONN_DGRAM_LOWPAN = 8, CONN_DGRAM_ETHERNET = 9 } |
enum | Type { NODE_UNAVAILABLE = 0, NODE_CONNECTED = 1, NODE_DISCOVERED = 2, NODE_STATIC = 3, NODE_DHT_DISCOVERED = 4 } |
Public Member Functions | |
Node (const dtn::data::EID &id) | |
Node () | |
virtual | ~Node () |
bool | has (Node::Protocol proto) const |
bool | has (const std::string &name) const |
void | add (const URI &u) |
void | add (const Attribute &attr) |
void | remove (const URI &u) |
void | remove (const Attribute &attr) |
void | clear () |
std::list< URI > | get (Node::Protocol proto) const |
std::list< URI > | get (Node::Type type, Node::Protocol proto) const |
std::set< Node::Type > | getTypes () const |
std::list< Attribute > | get (const std::string &name) const |
const dtn::data::EID & | getEID () const |
bool | expire () |
bool | operator== (const Node &other) const |
bool | operator< (const Node &other) const |
bool | operator== (const dtn::data::EID &other) const |
const Node & | operator+= (const Node &other) |
const Node & | operator-= (const Node &other) |
std::string | toString () const |
bool | doConnectImmediately () const |
void | setConnectImmediately (bool val) |
bool | isAvailable () const |
Static Public Member Functions | |
static std::string | toString (Node::Type type) |
static std::string | toString (Node::Protocol proto) |
Friends | |
std::ostream & | operator<< (std::ostream &, const Node &) |
Specify a node type. FLOATING is a node, if it's not statically reachable. STATIC is used for static nodes with are permanently reachable. DHT_DISCOVERED is used for a node, learned by a dht lookup
dtn::core::Node::Node | ( | const dtn::data::EID & | id | ) |
dtn::core::Node::~Node | ( | ) | [virtual] |
void dtn::core::Node::add | ( | const URI & | u | ) |
Add a URI to this node.
u |
Definition at line 212 of file Node.cpp.
Referenced by dtn::net::DatagramConvergenceLayer::componentRun(), dtn::net::TCPConnection::connect(), dtn_dht_handle_lookup_result(), dtn::daemon::Configuration::Network::load(), and operator+=().
void dtn::core::Node::add | ( | const Attribute & | attr | ) |
void dtn::core::Node::clear | ( | ) |
Clear all URIs & Attributes contained in this node.
Definition at line 234 of file Node.cpp.
Referenced by dtn::net::TCPConnection::connect().
bool dtn::core::Node::doConnectImmediately | ( | ) | const |
Definition at line 409 of file Node.cpp.
Referenced by dtn::net::ConnectionManager::raiseEvent().
bool dtn::core::Node::expire | ( | ) |
remove expired service descriptors
Definition at line 308 of file Node.cpp.
References dtn::core::Node::URI::expire, dtn::core::Node::Attribute::expire, and dtn::utils::Clock::getTime().
std::list< Node::URI > dtn::core::Node::get | ( | Node::Protocol | proto | ) | const |
Returns a list of URIs matching the given protocol
proto |
Definition at line 252 of file Node.cpp.
References dtn::core::compare_uri_priority().
Referenced by dtn::net::TCPConnection::connect(), dtn::net::LOWPANConvergenceLayer::queue(), dtn::net::UDPConvergenceLayer::queue(), dtn::net::DatagramConvergenceLayer::queue(), and dtn::daemon::DTNTPWorker::raiseEvent().
std::list< Node::URI > dtn::core::Node::get | ( | Node::Type | type, |
Node::Protocol | proto | ||
) | const |
Definition at line 267 of file Node.cpp.
References dtn::core::compare_uri_priority().
std::list< Node::Attribute > dtn::core::Node::get | ( | const std::string & | name | ) | const |
get a list of attributes match the given name
name |
Definition at line 288 of file Node.cpp.
References dtn::core::compare_attr_priority().
const dtn::data::EID & dtn::core::Node::getEID | ( | ) | const |
Return the EID of this node.
Definition at line 299 of file Node.cpp.
Referenced by dtn::net::ConnectionManager::addConnection(), dtn::net::ConnectionManager::discovered(), dtn_dht_handle_lookup_result(), dtn::net::TCPConnection::eventBundleForwarded(), dtn::net::TCPConnection::eventBundleRefused(), dtn::net::ConnectionManager::getNeighbor(), dtn::daemon::Configuration::Network::load(), dtn::routing::StaticRoutingExtension::notify(), dtn::routing::NodeHandshakeExtension::notify(), dtn::routing::NeighborRoutingExtension::notify(), dtn::routing::FloodRoutingExtension::notify(), dtn::routing::EpidemicRoutingExtension::notify(), dtn::routing::ProphetRoutingExtension::notify(), dtn::net::operator<<(), dtn::net::UDPConvergenceLayer::queue(), dtn::net::HTTPConvergenceLayer::queue(), dtn::net::TCPConvergenceLayer::queue(), dtn::daemon::DTNTPWorker::raiseEvent(), dtn::api::EventConnection::raiseEvent(), dtn::dht::DHTNameService::raiseEvent(), dtn::net::ConnectionManager::removeConnection(), dtn::routing::NeighborRoutingExtension::run(), and toString().
std::set< Node::Type > dtn::core::Node::getTypes | ( | ) | const |
bool dtn::core::Node::has | ( | Node::Protocol | proto | ) | const |
Check if the protocol is available for this node.
proto |
Definition at line 194 of file Node.cpp.
Referenced by dtn::net::ConnectionManager::open(), dtn::daemon::DTNTPWorker::raiseEvent(), and dtn::net::FileConvergenceLayer::raiseEvent().
bool dtn::core::Node::has | ( | const std::string & | name | ) | const |
bool dtn::core::Node::isAvailable | ( | ) | const |
returns true, if at least one connection is available
Definition at line 419 of file Node.cpp.
Referenced by dtn::net::ConnectionManager::getNeighbor(), dtn::net::ConnectionManager::getNeighbors(), and dtn::net::ConnectionManager::isNeighbor().
bool dtn::core::Node::operator< | ( | const Node & | other | ) | const |
bool dtn::core::Node::operator== | ( | const Node & | other | ) | const |
bool dtn::core::Node::operator== | ( | const dtn::data::EID & | other | ) | const |
void dtn::core::Node::remove | ( | const URI & | u | ) |
void dtn::core::Node::remove | ( | const Attribute & | attr | ) |
void dtn::core::Node::setConnectImmediately | ( | bool | val | ) |
Definition at line 414 of file Node.cpp.
Referenced by dtn::daemon::Configuration::Network::load().
std::string dtn::core::Node::toString | ( | Node::Type | type | ) | [static] |
Definition at line 130 of file Node.cpp.
References NODE_CONNECTED, NODE_DHT_DISCOVERED, NODE_DISCOVERED, NODE_STATIC, and NODE_UNAVAILABLE.
Referenced by dtn::net::TCPConnection::connect(), dtn::net::TCPConvergenceLayer::queue(), dtn::core::EventDebugger::raiseEvent(), and dtn::daemon::Notifier::raiseEvent().
std::string dtn::core::Node::toString | ( | Node::Protocol | proto | ) | [static] |
Definition at line 153 of file Node.cpp.
References CONN_BLUETOOTH, CONN_DGRAM_ETHERNET, CONN_DGRAM_LOWPAN, CONN_DGRAM_UDP, CONN_FILE, CONN_HTTP, CONN_LOWPAN, CONN_TCPIP, CONN_UDPIP, CONN_UNDEFINED, and CONN_UNSUPPORTED.
std::string dtn::core::Node::toString | ( | ) | const |
Definition at line 403 of file Node.cpp.
References getEID(), and dtn::data::EID::getString().
Referenced by dtn::core::operator<<().
std::ostream& operator<< | ( | std::ostream & | stream, |
const Node & | node | ||
) | [friend] |