25 #include <ibrcommon/data/BLOB.h>
26 #include <ibrcommon/data/File.h>
27 #include <ibrcommon/net/vinterface.h>
28 #include <ibrcommon/Logger.h>
29 #include <ibrcommon/link/LinkManager.h>
63 #ifdef HAVE_SYS_INOTIFY_H
78 #include <ibrcommon/ibrcommon.h>
79 #ifdef IBRCOMMON_SUPPORT_LOWPAN
104 #ifdef IBRDTN_SUPPORT_BSP
115 #ifdef WITH_DHT_NAMESERVICE
131 #define UNIT_MB * 1048576
145 const std::string NativeDaemon::TAG =
"NativeDaemon";
148 : _runlevel(
RUNLEVEL_ZERO), _statecb(statecb), _eventcb(eventcb), _event_loop(NULL)
159 std::vector<std::string> ret;
185 void NativeDaemon::bindEvents()
187 if (_eventcb != NULL) {
198 #ifdef IBRDTN_SUPPORT_BSP
204 void NativeDaemon::unbindEvents()
206 if (_eventcb != NULL) {
217 #ifdef IBRDTN_SUPPORT_BSP
223 void NativeDaemon::addEventData(
const dtn::data::Bundle &b, std::vector<std::string> &data)
const
243 void NativeDaemon::addEventData(
const dtn::data::MetaBundle &b, std::vector<std::string> &data)
const
250 data.push_back(
"Procflags: " + b.
procflags.toString());
263 void NativeDaemon::addEventData(
const dtn::data::BundleID &b, std::vector<std::string> &data)
const
274 std::stringstream fpll;
276 data.push_back(fpll.str());
282 const std::string
event = node.getName();
284 std::vector<std::string> data;
287 switch (node.getAction())
290 action =
"available";
293 action =
"unavailable";
296 action =
"data_added";
299 action =
"data_removed";
306 data.push_back(
"EID: " + node.getNode().getEID().getString());
309 _eventcb->eventRaised(event, action, data);
314 const std::string
event = global.getName();
316 std::vector<std::string> data;
319 switch (global.getAction())
337 action =
"low-energy";
340 action =
"internet available";
343 action =
"internet unavailable";
346 action =
"discovery start";
349 action =
"discovery stop";
356 _eventcb->eventRaised(event, action, data);
361 const std::string
event = received.getName();
363 std::vector<std::string> data;
368 data.push_back(
"Peer: " + received.peer.getString());
369 data.push_back(
"Local: " + (received.fromlocal ? std::string(
"true") : std::string(
"false")));
372 addEventData(received.bundle, data);
375 _eventcb->eventRaised(event, action, data);
380 const std::string
event = custody.getName();
382 std::vector<std::string> data;
385 switch (custody.getAction())
398 addEventData(custody.getBundle(), data);
401 _eventcb->eventRaised(event, action, data);
406 const std::string
event = aborted.getName();
408 std::vector<std::string> data;
413 data.push_back(
"Peer: " + aborted.getPeer().getString());
416 addEventData(aborted.getBundleID(), data);
419 _eventcb->eventRaised(event, action, data);
424 const std::string
event = completed.getName();
426 std::vector<std::string> data;
429 action =
"completed";
431 data.push_back(
"Peer: " + completed.getPeer().getString());
434 addEventData(completed.getBundle(), data);
437 _eventcb->eventRaised(event, action, data);
442 const std::string
event = connection.getName();
444 std::vector<std::string> data;
447 switch (connection.getState())
466 data.push_back(
"Peer: " + connection.getNode().getEID().getString());
469 _eventcb->eventRaised(event, action, data);
474 const std::string
event = queued.getName();
476 std::vector<std::string> data;
482 addEventData(queued.bundle, data);
485 _eventcb->eventRaised(event, action, data);
488 #ifdef IBRDTN_SUPPORT_BSP
491 const std::string
event = keyExchange.getName();
493 std::vector<std::string> data;
496 switch (keyExchange.getData().getAction()) {
501 action =
"PASSWORDREQUEST";
504 action =
"WRONGPASSWORD";
507 action =
"HASHCOMMIT";
508 data.push_back(
"data: " + keyExchange.getData().str());
511 data.push_back(
"data: " + keyExchange.getData().str());
521 std::stringstream sstm;
522 data.push_back(
"EID: " + keyExchange.getEID().getString());
524 sstm <<
"session: " << keyExchange.getData().getSessionId();
525 data.push_back(sstm.str());
528 sstm <<
"protocol: " << keyExchange.getData().getProtocol();
529 data.push_back(sstm.str());
532 _eventcb->eventRaised(event, action, data);
568 for (dtn::net::ConvergenceLayer::stats_data::const_iterator iter = data.begin(); iter != data.end(); ++iter) {
570 ret.
addData(pair.first, pair.second);
622 std::vector<std::string> ret;
626 for (std::set<dtn::core::Node>::const_iterator iter = nlist.begin(); iter != nlist.end(); ++iter)
642 if (protocol ==
"tcp")
644 std::string uri =
"ip=" + address +
";port=" + service +
";";
648 else if (protocol ==
"udp")
650 std::string uri =
"ip=" + address +
";port=" + service +
";";
654 else if (protocol ==
"file")
668 if (protocol ==
"tcp")
670 std::string uri =
"ip=" + address +
";port=" + service +
";";
674 else if (protocol ==
"udp")
676 std::string uri =
"ip=" + address +
";port=" + service +
";";
680 else if (protocol ==
"file")
695 }
catch (
const ibrcommon::Exception&) {
707 #ifdef IBRDTN_SUPPORT_BSP
711 if (!password.empty()) {
721 #ifdef IBRDTN_SUPPORT_BSP
736 #ifdef IBRDTN_SUPPORT_BSP
752 }
catch (ibrcommon::Exception &e) {
762 #ifdef IBRDTN_SUPPORT_BSP
770 }
catch (ibrcommon::Exception &e) {
785 unsigned char logsys = ibrcommon::Logger::LOGGER_EMERG | ibrcommon::Logger::LOGGER_ALERT | ibrcommon::Logger::LOGGER_CRIT | ibrcommon::Logger::LOGGER_ERR;
789 logsys |= ibrcommon::Logger::LOGGER_WARNING;
790 logsys |= ibrcommon::Logger::LOGGER_INFO;
795 logsys |= ibrcommon::Logger::LOGGER_NOTICE;
800 logsys |= ibrcommon::Logger::LOGGER_DEBUG;
804 ibrcommon::Logger::setDefaultTag(defaultTag);
807 ibrcommon::Logger::enableSyslog(
"ibrdtn-daemon", 0, 0, logsys);
812 _config_file = ibrcommon::File(path);
816 conf.
load(_config_file.getPath());
821 #ifdef IBRDTN_SUPPORT_BSP
833 unsigned char logopts = ibrcommon::Logger::LOG_DATETIME | ibrcommon::Logger::LOG_LEVEL | ibrcommon::Logger::LOG_TAG;
836 unsigned char logsys = ibrcommon::Logger::LOGGER_EMERG | ibrcommon::Logger::LOGGER_ALERT | ibrcommon::Logger::LOGGER_CRIT | ibrcommon::Logger::LOGGER_ERR;
845 logsys |= ibrcommon::Logger::LOGGER_WARNING;
846 logsys |= ibrcommon::Logger::LOGGER_INFO;
851 logsys |= ibrcommon::Logger::LOGGER_NOTICE;
856 logsys |= ibrcommon::Logger::LOGGER_DEBUG;
859 const ibrcommon::File lf(path);
860 ibrcommon::Logger::setLogfile(lf, logsys, logopts);
870 ibrcommon::MutexLock l(_runlevel_cond);
871 if (_runlevel < rl) {
872 for (; _runlevel < rl; _runlevel =
DaemonRunLevel(_runlevel + 1)) {
874 _runlevel_cond.signal(
true);
876 }
else if (_runlevel > rl) {
877 for (; _runlevel > rl; _runlevel =
DaemonRunLevel(_runlevel - 1)) {
878 init_down(_runlevel);
879 _runlevel_cond.signal(
true);
912 init_routing_extensions();
919 component_list &components = _components[rl];
920 for (component_list::iterator it = components.begin(); it != components.end(); ++it)
928 for (component_list::iterator it = components.begin(); it != components.end(); ++it)
933 if (_statecb != NULL) {
934 _statecb->levelChanged(rl);
937 IBRCOMMON_LOGGER_DEBUG_TAG(NativeDaemon::TAG, 5) <<
"runlevel " << rl <<
" reached" << IBRCOMMON_LOGGER_ENDL;
940 void NativeDaemon::init_down(
DaemonRunLevel rl)
throw (NativeDaemonException)
945 component_list &components = _components[rl];
946 for (component_list::iterator it = components.begin(); it != components.end(); ++it)
977 shutdown_routing_extensions();
984 for (component_list::iterator it = components.begin(); it != components.end(); ++it)
990 if (_statecb != NULL) {
994 IBRCOMMON_LOGGER_DEBUG_TAG(NativeDaemon::TAG, 5) <<
"runlevel " << (rl-1) <<
" reached" << IBRCOMMON_LOGGER_ENDL;
1000 ibrcommon::MutexLock l(_runlevel_cond);
1001 while (_runlevel != rl) _runlevel_cond.wait();
1002 }
catch (
const ibrcommon::Conditional::ConditionalAbortException&) {
1010 ibrcommon::LinkManager::initialize();
1018 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"IBR-DTN daemon " << conf.
version() << IBRCOMMON_LOGGER_ENDL;
1021 if (_config_file.exists()) {
1022 conf.
load(_config_file.getPath());
1029 ibrcommon::LinkManager::setLinkRequestInterval(interval);
1034 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"debug level set to " << conf.
getDebug().
level() << IBRCOMMON_LOGGER_ENDL;
1039 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"use logfile for output: " << lf.getPath() << IBRCOMMON_LOGGER_ENDL;
1044 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"Parallel event processing enabled using " << conf.
getDaemon().
getThreads() <<
" processes." << IBRCOMMON_LOGGER_ENDL;
1054 _event_loop =
new NativeEventLoop(*
this);
1057 _event_loop->start();
1064 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"TLS security enabled" << IBRCOMMON_LOGGER_ENDL;
1071 #ifdef IBRDTN_SUPPORT_BSP
1077 void NativeDaemon::shutdown_core() throw (NativeDaemonException)
1080 _event_loop->stop();
1081 _event_loop->join();
1095 #ifdef IBRDTN_SUPPORT_BSP
1104 void NativeDaemon::init_storage() throw (NativeDaemonException)
1116 ibrcommon::File path = conf.
getPath(
"storage");
1121 ibrcommon::File::createDirectory(path);
1124 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"using sqlite bundle storage in " << path.getPath() << IBRCOMMON_LOGGER_ENDL;
1131 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"using persistent bundle-sets" << IBRCOMMON_LOGGER_ENDL;
1141 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"storage for bundles" << IBRCOMMON_LOGGER_ENDL;
1142 throw NativeDaemonException(
"initialization of the bundle storage failed");
1154 ibrcommon::File path = conf.
getPath(
"storage");
1157 if (!path.exists()) ibrcommon::File::createDirectory(path);
1162 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"using persistent bundle-sets" << IBRCOMMON_LOGGER_ENDL;
1165 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"using simple bundle storage in " << path.getPath() << IBRCOMMON_LOGGER_ENDL;
1170 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"using bundle storage in memory-only mode" << IBRCOMMON_LOGGER_ENDL;
1177 if (storage == NULL)
1179 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"bundle storage module \"" << conf.
getStorage() <<
"\" do not exists!" << IBRCOMMON_LOGGER_ENDL;
1180 throw NativeDaemonException(
"bundle storage not available");
1193 storage->
attach(bundle_index);
1198 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"Enable extended bundle index for scheduling" << IBRCOMMON_LOGGER_ENDL;
1212 if (!blob_path.exists()) {
1214 ibrcommon::File::createDirectory(blob_path);
1217 if (blob_path.exists() && blob_path.isDirectory())
1219 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"using BLOB path: " << blob_path.getPath() << IBRCOMMON_LOGGER_ENDL;
1220 ibrcommon::BLOB::changeProvider(
new ibrcommon::FileBLOBProvider(blob_path),
true);
1224 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, warning) <<
"BLOB path exists, but is not a directory! Fallback to memory based mode." << IBRCOMMON_LOGGER_ENDL;
1225 ibrcommon::BLOB::changeProvider(
new ibrcommon::MemoryBLOBProvider(),
true);
1230 void NativeDaemon::shutdown_storage()
const throw (NativeDaemonException)
1233 ibrcommon::BLOB::changeProvider(
new ibrcommon::MemoryBLOBProvider(),
true);
1242 void NativeDaemon::init_routing() throw (NativeDaemonException)
1251 void NativeDaemon::shutdown_routing()
const throw (NativeDaemonException)
1255 void NativeDaemon::init_api() throw (NativeDaemonException)
1274 #ifdef IBRDTN_SUPPORT_BSP
1297 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"API initialized using unix domain socket: " << socket.getPath() << IBRCOMMON_LOGGER_ENDL;
1298 }
catch (
const ibrcommon::socket_exception&) {
1299 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"Unable to bind to unix domain socket " << socket.getPath() <<
". API not initialized!" << IBRCOMMON_LOGGER_ENDL;
1308 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"API initialized using tcp socket: " << apiconf.
iface.toString() <<
":" << apiconf.
port << IBRCOMMON_LOGGER_ENDL;
1309 }
catch (
const ibrcommon::socket_exception&) {
1310 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"Unable to bind to " << apiconf.
iface.toString() <<
":" << apiconf.
port <<
". API not initialized!" << IBRCOMMON_LOGGER_ENDL;
1317 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"API disabled" << IBRCOMMON_LOGGER_ENDL;
1322 void NativeDaemon::shutdown_api() throw (NativeDaemonException)
1324 for (app_list::iterator it = _apps.begin(); it != _apps.end(); ++it)
1331 void NativeDaemon::init_network() throw (NativeDaemonException)
1340 std::map<dtn::daemon::Configuration::NetConfig::NetType, dtn::net::ConvergenceLayer*> _cl_map;
1346 #ifdef HAVE_SYS_INOTIFY_H
1351 for (std::list<dtn::daemon::Configuration::NetConfig>::const_iterator iter = nets.begin(); iter != nets.end(); ++iter)
1367 #ifdef HAVE_SYS_INOTIFY_H
1368 if (net.
url.size() > 0)
1370 ibrcommon::File path(net.
url);
1379 ibrcommon::File path(net.
url);
1384 }
catch (
const ibrcommon::Exception &ex) {
1385 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"Failed to add FileConvergenceLayer: " << ex.what() << IBRCOMMON_LOGGER_ENDL;
1394 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"UDP ConvergenceLayer added on " << net.
iface.toString() <<
":" << net.
port << IBRCOMMON_LOGGER_ENDL;
1395 }
catch (
const ibrcommon::Exception &ex) {
1396 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"Failed to add UDP ConvergenceLayer on " << net.
iface.toString() <<
": " << ex.what() << IBRCOMMON_LOGGER_ENDL;
1405 std::map<dtn::daemon::Configuration::NetConfig::NetType, dtn::net::ConvergenceLayer*>::iterator it = _cl_map.find(net.
type);
1409 if (it == _cl_map.end()) {
1418 if (it == _cl_map.end()) {
1420 _cl_map[net.
type] = tcpcl;
1423 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"TCP ConvergenceLayer added on " << net.
iface.toString() <<
":" << net.
port << IBRCOMMON_LOGGER_ENDL;
1424 }
catch (
const ibrcommon::Exception &ex) {
1425 if (it == _cl_map.end()) {
1429 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"Failed to add TCP ConvergenceLayer on " << net.
iface.toString() <<
": " << ex.what() << IBRCOMMON_LOGGER_ENDL;
1440 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"HTTP ConvergenceLayer added, Server: " << net.
url << IBRCOMMON_LOGGER_ENDL;
1441 }
catch (
const ibrcommon::Exception &ex) {
1442 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"Failed to add HTTP ConvergenceLayer, Server: " << net.
url <<
": " << ex.what() << IBRCOMMON_LOGGER_ENDL;
1448 #ifdef IBRCOMMON_SUPPORT_LOWPAN
1453 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"LOWPAN ConvergenceLayer added on " << net.
iface.toString() <<
":" << net.
port << IBRCOMMON_LOGGER_ENDL;
1454 }
catch (
const ibrcommon::Exception &ex) {
1455 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"Failed to add LOWPAN ConvergenceLayer on " << net.
iface.toString() <<
": " << ex.what() << IBRCOMMON_LOGGER_ENDL;
1466 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"Datagram ConvergenceLayer (LowPAN) added on " << net.
iface.toString() <<
":" << net.
port << IBRCOMMON_LOGGER_ENDL;
1467 }
catch (
const ibrcommon::Exception &ex) {
1468 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"Failed to add Datagram ConvergenceLayer (LowPAN) on " << net.
iface.toString() <<
": " << ex.what() << IBRCOMMON_LOGGER_ENDL;
1479 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"Datagram ConvergenceLayer (UDP) added on " << net.
iface.toString() <<
":" << net.
port << IBRCOMMON_LOGGER_ENDL;
1480 }
catch (
const ibrcommon::Exception &ex) {
1481 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"Failed to add Datagram ConvergenceLayer (UDP) on " << net.
iface.toString() <<
": " << ex.what() << IBRCOMMON_LOGGER_ENDL;
1491 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"EMail Convergence Layer (MCL) added" << IBRCOMMON_LOGGER_ENDL;
1492 }
catch(
const ibrcommon::Exception &ex) {
1493 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"Failed to add EMail Convergence Layer (MCL): " << ex.what() << IBRCOMMON_LOGGER_ENDL;
1502 }
catch (
const std::exception &ex) {
1503 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"Error: " << ex.what() << IBRCOMMON_LOGGER_ENDL;
1511 #ifdef WITH_DHT_NAMESERVICE
1514 IBRCOMMON_LOGGER_DEBUG_TAG(NativeDaemon::TAG, 50) <<
"DHT: is enabled!" << IBRCOMMON_LOGGER_ENDL;
1542 for (std::set<ibrcommon::vaddress>::const_iterator iter = addr.begin(); iter != addr.end(); ++iter) {
1547 if (ibrcommon::basesocket::hasSupport(AF_INET6))
1548 ipnd->
add(ibrcommon::vaddress(
"ff02::142", disco_port, AF_INET6));
1550 if (ibrcommon::basesocket::hasSupport(AF_INET))
1551 ipnd->
add(ibrcommon::vaddress(
"224.0.0.142", disco_port, AF_INET));
1555 for (std::list<dtn::daemon::Configuration::NetConfig>::const_iterator iter = nets.begin(); iter != nets.end(); ++iter)
1558 if (!net.
iface.empty())
1566 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"Discovery disabled" << IBRCOMMON_LOGGER_ENDL;
1573 for (component_list::iterator it = clist.begin(); it != clist.end(); ++it)
1580 }
catch (
const std::bad_cast&) { }
1586 for (list<Node>::const_iterator iter = static_nodes.begin(); iter != static_nodes.end(); ++iter)
1592 void NativeDaemon::shutdown_network() throw (NativeDaemonException)
1600 for (list<Node>::const_iterator iter = static_nodes.begin(); iter != static_nodes.end(); ++iter)
1609 for (component_list::iterator it = clist.begin(); it != clist.end(); ++it)
1616 }
catch (
const std::bad_cast&) { }
1620 void NativeDaemon::init_routing_extensions() throw (NativeDaemonException)
1633 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"Using flooding routing extensions" << IBRCOMMON_LOGGER_ENDL;
1643 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"Using epidemic routing extensions" << IBRCOMMON_LOGGER_ENDL;
1656 if(strategy_name ==
"GRTR"){
1659 else if(strategy_name ==
"GTMX"){
1663 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, error) <<
"Prophet forwarding strategy " << strategy_name <<
" not found. Using GRTR as fallback." << IBRCOMMON_LOGGER_ENDL;
1666 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"Using prophet routing extensions with " << strategy_name <<
" as forwarding strategy." << IBRCOMMON_LOGGER_ENDL;
1679 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"Dynamic routing extensions disabled" << IBRCOMMON_LOGGER_ENDL;
1683 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"Using default routing extensions" << IBRCOMMON_LOGGER_ENDL;
1694 void NativeDaemon::shutdown_routing_extensions()
const throw (NativeDaemonException)
1711 ibrcommon::Logger::reload();
1723 ibrcommon::Logger::setVerbosity(level);
1724 IBRCOMMON_LOGGER_TAG(NativeDaemon::TAG, info) <<
"debug level set to " << level << IBRCOMMON_LOGGER_ENDL;
void add(RoutingExtension *extension)
void initiateConnection(std::string eid) const
static Configuration & getInstance(bool reset=false)
static SecurityKeyManager & getInstance()
static EventSwitch & getInstance()
virtual void __cancellation()
const std::set< dtn::core::Node > getNeighbors()
NativeEventLoop(NativeDaemon &daemon)
void onKeyExchangeBegin(std::string eid, int protocol, std::string password) const
const unsigned char logsys
void startDiscovery() const
const std::list< NetConfig > & getInterfaces() const
Bitset< FLAGS > procflags
void wait(DaemonRunLevel rl)
static dtn::data::EID local
const Configuration::Security & getSecurity() const
const Configuration::Discovery & getDiscovery() const
dtn::data::Size getThreads() const
static void add(EventReceiver< E > *receiver)
The GRTR forwarding strategy. Using this strategy, packets are forwarding, if the neighbor has a high...
dtn::data::Length size() const
This class is a manager to handle certificates.
void setLogging(const std::string &defaultTag, int logLevel) const
const Configuration::Logger & getLogger() const
void attach(dtn::storage::BundleIndex *index)
dtn::routing::BaseRouter & getRouter() const
std::vector< std::string > getVersion() const
void setConfigFile(const std::string &config_file)
void setSeeker(dtn::storage::BundleSeeker *seeker)
void setGloballyConnected(bool val)
std::pair< string, string > stats_pair
void remove(const dtn::core::Node &n)
dtn::data::Timestamp timestamp
virtual dtn::data::Size count()
void add(const ibrcommon::vaddress &address)
void removeConnection(std::string eid, std::string protocol, std::string address, std::string service, bool local=false) const
void stopDiscovery() const
Configuration::NetConfig getAPIInterface() const
ibrcommon::Timer::time_t time_unit
void addData(const std::string &tag, const std::string &data)
ibrcommon::Timer::time_t i_typ
void setSessionId(unsigned int sessionId)
void addConnection(std::string eid, std::string protocol, std::string address, std::string service, bool local=false) const
static void remove(const EventReceiver< E > *receiver)
void getStats(dtn::net::ConvergenceLayer::stats_data &data)
DaemonRunLevel getRunLevel() const
void removeKey(std::string eid) const
const std::string getCtrlPath() const
NativeNode getInfo(const std::string &neighbor_eid) const
virtual void raiseEvent(const dtn::core::NodeEvent &evt)
dtn::net::ConnectionManager & getConnectionManager()
size_t bundles_transmitted
const ibrcommon::File & getLogfile() const
NativeDaemon(NativeDaemonCallback *statecb=NULL, NativeEventCallback *eventcb=NULL)
virtual dtn::data::Length getPayloadLength() const
RoutingExtension getRoutingExtension() const
void watch(const ibrcommon::File &watch)
This class is a abstract base class for all prophet forwarding strategies.
const Configuration::P2P & getP2P() const
const Configuration::Network & getNetwork() const
dtn::data::Number sequencenumber
bool get(FLAGS flag) const
void add(const dtn::core::Node &n)
dtn::data::Size getLimit(const std::string &) const
const Configuration::DHT & getDHT() const
void load(bool quiet=false)
ibrcommon::File getPath(string name) const
virtual void initialize()
std::string getLocalUri() const
std::string toString() const
static void raise(const Action a)
virtual const std::string getData() const
const Configuration::Debug & getDebug() const
void setLogFile(const std::string &path, int logLevel) const
void onKeyExchangeResponse(std::string eid, int protocol, int session, int step, std::string data) const
void add(const ibrcommon::vinterface &net, int port)
static dtn::data::Timestamp getUptime()
static double toDouble(const timeval &val)
The GTMX forwarding strategy. Using this strategy, packets are forwarding, if the neighbor has a high...
std::map< string, string > stats_data
void setGloballyConnected(bool connected) const
void remove(const SecurityKey &key)
std::string version() const
static dtn::data::Timestamp getTime()
const std::list< Node > & getStaticNodes() const
virtual ~NativeEventCallback()=0
virtual ~NativeDaemonCallback()=0
void loop(size_t threads, bool profiling=false)
ProphetConfig getProphetConfig() const
dtn::security::SecurityKey get(const dtn::data::EID &ref, const dtn::security::SecurityKey::KeyType type=dtn::security::SecurityKey::KEY_UNSPEC) const
void setStorage(dtn::storage::BundleStorage *storage)
ibrcommon::File blob_path("/tmp")
static const struct timeval & getOffset()
ibrcommon::Timer::time_t next_exchange_timeout
dtn::data::SDNV< unsigned int > flags
std::string getStorage() const
virtual const std::string getFingerprint() const
virtual void onConfigurationChanged(const dtn::daemon::Configuration &conf)
size_t getLinkRequestInterval() const
static double getRating()
std::string getString() const
bool getUsePersistentBundleSets() const
ibrcommon::vinterface iface
const dtn::data::EID & getEID() const
dtn::storage::BundleStorage & getStorage()
void init(DaemonRunLevel rl)
const Configuration::Daemon & getDaemon() const
bool doFragmentation() const
ibrcommon::File getAPISocket() const
std::list< Node::URI > getAll() const
dtn::data::Number fragmentoffset
static void setPath(const ibrcommon::File &path)
std::string forwarding_strategy
Routing extension for PRoPHET routing.
virtual bool isFragment() const
const dtn::core::Node getNeighbor(const dtn::data::EID &eid)
void open(const dtn::core::Node &node)
bool doTLS() const
checks if TLS shall be activated
void setLeMode(bool low_energy) const
const std::set< ibrcommon::vaddress > address() const
std::vector< std::string > getNeighbors() const
void bind(const ibrcommon::vinterface &net)
NativeKeyInfo getKeyInfo(std::string eid) const
static BundleCore & getInstance()
virtual void onConfigurationChanged(const dtn::daemon::Configuration &conf)
static void raise(const dtn::data::EID &eid, const dtn::security::KeyExchangeData &data)
static size_t getCounter()
void clearStorage() const