IBR-DTNSuite
0.12
|
#include <Configuration.h>
Classes | |
class | Daemon |
class | Debug |
class | DHT |
class | Discovery |
class | |
class | Extension |
class | Logger |
class | NetConfig |
class | Network |
class | OnChangeListener |
class | P2P |
class | ParameterNotFoundException |
class | ParameterNotSetException |
class | Security |
class | TimeSync |
Public Types | |
enum | RoutingExtension { DEFAULT_ROUTING = 0, EPIDEMIC_ROUTING = 1, FLOOD_ROUTING = 2, PROPHET_ROUTING = 3, NO_ROUTING = 4 } |
Public Member Functions | |
void | load (bool quiet=false) |
void | load (const std::string &filename, bool quiet=false) |
void | params (int argc, char *argv[]) |
std::string | getNodename () const |
ibrcommon::File | getPath (string name) const |
bool | doAPI () const |
Configuration::NetConfig | getAPIInterface () const |
ibrcommon::File | getAPISocket () const |
std::string | version () const |
std::string | getStorage () const |
bool | getUsePersistentBundleSets () const |
dtn::data::Size | getLimit (const std::string &) const |
const Configuration::Discovery & | getDiscovery () const |
const Configuration::Debug & | getDebug () const |
const Configuration::Logger & | getLogger () const |
const Configuration::Network & | getNetwork () const |
const Configuration::Security & | getSecurity () const |
const Configuration::Daemon & | getDaemon () const |
const Configuration::TimeSync & | getTimeSync () const |
const Configuration::DHT & | getDHT () const |
const Configuration::P2P & | getP2P () const |
const Configuration::EMail & | getEMail () const |
Static Public Member Functions | |
static Configuration & | getInstance (bool reset=false) |
This class contains the hole configuration for the daemon.
Definition at line 45 of file Configuration.h.
Enumerator | |
---|---|
DEFAULT_ROUTING | |
EPIDEMIC_ROUTING | |
FLOOD_ROUTING | |
PROPHET_ROUTING | |
NO_ROUTING |
Definition at line 143 of file Configuration.h.
bool dtn::daemon::Configuration::doAPI | ( | ) | const |
Enable/Disable the API interface.
Definition at line 966 of file Configuration.cpp.
Configuration::NetConfig dtn::daemon::Configuration::getAPIInterface | ( | ) | const |
Definition at line 622 of file Configuration.cpp.
References dtn::daemon::Configuration::NetConfig::iface, ibrcommon::vinterface::LOOPBACK, dtn::daemon::Configuration::NetConfig::NETWORK_TCP, dtn::daemon::Configuration::NetConfig::port, and ibrcommon::ConfigFile::read().
ibrcommon::File dtn::daemon::Configuration::getAPISocket | ( | ) | const |
Definition at line 642 of file Configuration.cpp.
References ibrcommon::ConfigFile::read().
const Configuration::Daemon & dtn::daemon::Configuration::getDaemon | ( | ) | const |
Definition at line 161 of file Configuration.cpp.
Referenced by __daemon_run(), main(), and dtn::daemon::NativeEventLoop::run().
const Configuration::Debug & dtn::daemon::Configuration::getDebug | ( | ) | const |
Definition at line 141 of file Configuration.cpp.
Referenced by __daemon_run().
const Configuration::DHT & dtn::daemon::Configuration::getDHT | ( | ) | const |
Definition at line 171 of file Configuration.cpp.
const Configuration::Discovery & dtn::daemon::Configuration::getDiscovery | ( | ) | const |
Definition at line 136 of file Configuration.cpp.
Referenced by dtn::net::UDPConvergenceLayer::onUpdateBeacon(), and dtn::net::TCPConvergenceLayer::onUpdateBeacon().
const Configuration::EMail & dtn::daemon::Configuration::getEMail | ( | ) | const |
Definition at line 181 of file Configuration.cpp.
Referenced by dtn::dht::DHTNameService::componentRun(), and dtn::net::DiscoveryAgent::onBeaconReceived().
|
static |
Definition at line 186 of file Configuration.cpp.
Referenced by __daemon_run(), dtn::daemon::Configuration::Discovery::address(), dtn::daemon::Configuration::Discovery::announce(), dtn::net::EMailSmtpService::Task::checkForReturningMail(), dtn::api::ApiServer::componentRun(), dtn::dht::DHTNameService::componentRun(), dtn::security::SecurityCertificateManager::componentUp(), dtn::net::ConnectionManager::componentUp(), dtn::dht::DHTNameService::componentUp(), dtn::core::BundleCore::componentUp(), dtn_dht_handle_lookup_result(), dtn::daemon::DTNTPWorker::DTNTPWorker(), dtn::net::TCPConnection::eventConnectionUp(), dtn::core::BundleCore::eventNotify(), dtn::security::SecurityManager::fastverify(), dtn::security::SecurityKeyManager::get(), dtn::net::TCPConnection::initiateExtendedHandshake(), main(), dtn::net::DiscoveryAgent::onBeaconReceived(), dtn::net::UDPConvergenceLayer::onUpdateBeacon(), dtn::net::TCPConvergenceLayer::onUpdateBeacon(), dtn::daemon::Configuration::Discovery::port(), dtn::api::Registration::processIncomingBundle(), dtn::net::UDPConvergenceLayer::queue(), dtn::routing::FloodRoutingExtension::run(), dtn::routing::StaticRoutingExtension::run(), dtn::routing::EpidemicRoutingExtension::run(), dtn::daemon::NativeEventLoop::run(), dtn::daemon::NativeDaemon::setConfigFile(), dtn::net::TCPConnection::setup(), dtn::daemon::Configuration::Discovery::shortbeacon(), dtn::api::Registration::underflow(), and dtn::daemon::Configuration::Discovery::version().
dtn::data::Size dtn::daemon::Configuration::getLimit | ( | const std::string & | suffix) | const |
Returns a limit defined in the configuration file. The given string specify with limit is to return. If the string is "block", then the value of "limit_block" is returned.
Definition at line 1036 of file Configuration.cpp.
References ibrcommon::ConfigFile::read().
Referenced by dtn::api::Registration::processIncomingBundle().
const Configuration::Logger & dtn::daemon::Configuration::getLogger | ( | ) | const |
Definition at line 146 of file Configuration.cpp.
Referenced by __daemon_run().
const Configuration::Network & dtn::daemon::Configuration::getNetwork | ( | ) | const |
Definition at line 151 of file Configuration.cpp.
Referenced by dtn::dht::DHTNameService::componentRun(), dtn::net::ConnectionManager::componentUp(), dtn::dht::DHTNameService::componentUp(), dtn::net::TCPConnection::eventConnectionUp(), dtn::core::BundleCore::eventNotify(), dtn::routing::FloodRoutingExtension::run(), dtn::routing::StaticRoutingExtension::run(), dtn::routing::EpidemicRoutingExtension::run(), and dtn::api::Registration::underflow().
std::string dtn::daemon::Configuration::getNodename | ( | ) | const |
Returns the name of the node
Definition at line 532 of file Configuration.cpp.
References ibrcommon::ConfigFile::read().
const Configuration::P2P & dtn::daemon::Configuration::getP2P | ( | ) | const |
Definition at line 176 of file Configuration.cpp.
ibrcommon::File dtn::daemon::Configuration::getPath | ( | string | name) | const |
Generic command to get a specific path. If "name" is set to "foo" then the parameter "foo_path" is returned.
name | The prefix of the path to get. |
Definition at line 933 of file Configuration.cpp.
References ibrcommon::ConfigFile::read().
const Configuration::Security & dtn::daemon::Configuration::getSecurity | ( | ) | const |
Definition at line 156 of file Configuration.cpp.
Referenced by dtn::security::SecurityManager::fastverify(), dtn::security::SecurityKeyManager::get(), and dtn::net::TCPConnection::initiateExtendedHandshake().
std::string dtn::daemon::Configuration::getStorage | ( | ) | const |
Get the type of bundle storage to use.
Definition at line 653 of file Configuration.cpp.
References ibrcommon::ConfigFile::read().
const Configuration::TimeSync & dtn::daemon::Configuration::getTimeSync | ( | ) | const |
Definition at line 166 of file Configuration.cpp.
Referenced by dtn::daemon::DTNTPWorker::DTNTPWorker().
bool dtn::daemon::Configuration::getUsePersistentBundleSets | ( | ) | const |
returns, whether Persistent BundleSets are used (stored in SQL database)
Definition at line 658 of file Configuration.cpp.
References ibrcommon::ConfigFile::read().
void dtn::daemon::Configuration::load | ( | bool | quiet = false ) |
load the configuration from a file
Definition at line 371 of file Configuration.cpp.
Referenced by __daemon_run(), and dtn::daemon::NativeDaemon::setConfigFile().
void dtn::daemon::Configuration::load | ( | const std::string & | filename, |
bool | quiet = false |
||
) |
Definition at line 376 of file Configuration.cpp.
References _debug, ibrcommon::ConfigFile::add(), IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::LogLevel::info, dtn::daemon::Configuration::Discovery::load(), dtn::daemon::Configuration::Logger::load(), dtn::daemon::Configuration::Network::load(), dtn::daemon::Configuration::Security::load(), dtn::daemon::Configuration::TimeSync::load(), dtn::daemon::Configuration::DHT::load(), dtn::daemon::Configuration::P2P::load(), and dtn::daemon::Configuration::EMail::load().
void dtn::daemon::Configuration::params | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 196 of file Configuration.cpp.
References _debug, dtn::daemon::Configuration::Network::_default_net, dtn::daemon::Configuration::Discovery::_enabled, dtn::daemon::Configuration::Logger::_timestamps, dtn::daemon::Configuration::Network::_use_default_net, dtn::daemon::Configuration::Logger::_verbose, ibrcommon::LinkManager::getInstance(), ibrcommon::Win32LinkManager::getInterfaces(), ibrcommon::Thread::getNumberOfProcessors(), ibrcommon::vinterface::toString(), and version().
Referenced by main().
std::string dtn::daemon::Configuration::version | ( | ) | const |
Get the version of this daemon.
Definition at line 66 of file Configuration.cpp.
References BUILD_NUMBER, and PACKAGE_VERSION.
Referenced by dtn::api::ApiServer::componentRun(), and params().