IBR-DTNSuite 0.6

dtn::daemon::Configuration Class Reference

#include <Configuration.h>

Collaboration diagram for dtn::daemon::Configuration:

List of all members.

Classes

class  Daemon
class  Debug
class  Discovery
class  Extension
class  Logger
class  NetConfig
class  Network
class  ParameterNotFoundException
class  ParameterNotSetException
class  Security
class  Statistic

Public Types

enum  RoutingExtension { DEFAULT_ROUTING = 0, EPIDEMIC_ROUTING = 1, FLOOD_ROUTING = 2 }

Public Member Functions

void load ()
void load (string filename)
void params (int argc, char *argv[])
string getNodename ()
int getTimezone ()
ibrcommon::File getPath (string name)
unsigned int getUID () const
unsigned int getGID () const
const std::string getUser () const
bool doAPI ()
Configuration::NetConfig getAPIInterface ()
ibrcommon::File getAPISocket ()
std::string version ()
std::string getNotifyCommand ()
std::string getStorage () const
size_t getLimit (std::string)
const Configuration::DiscoverygetDiscovery () const
const Configuration::StatisticgetStatistic () const
const Configuration::DebuggetDebug () const
const Configuration::LoggergetLogger () const
const Configuration::NetworkgetNetwork () const
const Configuration::SecuritygetSecurity () const
const Configuration::DaemongetDaemon () const

Static Public Member Functions

static ConfigurationgetInstance ()

Detailed Description

This class contains the hole configuration for the daemon.

Definition at line 22 of file Configuration.h.


Member Enumeration Documentation

Enumerator:
DEFAULT_ROUTING 
EPIDEMIC_ROUTING 
FLOOD_ROUTING 

Definition at line 147 of file Configuration.h.


Member Function Documentation

bool dtn::daemon::Configuration::doAPI ( )

Enable/Disable the API interface.

Returns:
True, if the API interface should be enabled.

Definition at line 668 of file Configuration.cpp.

Referenced by __daemon_run().

Configuration::NetConfig dtn::daemon::Configuration::getAPIInterface ( )

Definition at line 393 of file Configuration.cpp.

References dtn::daemon::Configuration::NetConfig::NETWORK_TCP, and ibrcommon::ConfigFile::read().

Referenced by __daemon_run().

Here is the call graph for this function:

ibrcommon::File dtn::daemon::Configuration::getAPISocket ( )

Definition at line 414 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by __daemon_run().

Here is the call graph for this function:

const Configuration::Daemon & dtn::daemon::Configuration::getDaemon ( ) const

Definition at line 130 of file Configuration.cpp.

Referenced by __daemon_run(), and main().

const Configuration::Debug & dtn::daemon::Configuration::getDebug ( ) const

Definition at line 110 of file Configuration.cpp.

Referenced by __daemon_run().

const Configuration::Discovery & dtn::daemon::Configuration::getDiscovery ( ) const

Definition at line 100 of file Configuration.cpp.

Referenced by __daemon_run().

unsigned int dtn::daemon::Configuration::getGID ( ) const

The "gid" keyword in the configuration can define a group to work as. If this daemon is started as root the daemon will switch to the defined group on startup.

Returns:
The GID of the group.

Definition at line 638 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by switchUser().

Here is the call graph for this function:

size_t dtn::daemon::Configuration::getLimit ( std::string  suffix)

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.

Returns:
A limit in bytes.

Definition at line 744 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by createBundleStorage(), and setGlobalVars().

Here is the call graph for this function:

const Configuration::Logger & dtn::daemon::Configuration::getLogger ( ) const

Definition at line 115 of file Configuration.cpp.

Referenced by __daemon_run().

const Configuration::Network & dtn::daemon::Configuration::getNetwork ( ) const

Definition at line 120 of file Configuration.cpp.

Referenced by __daemon_run(), and createConvergenceLayers().

string dtn::daemon::Configuration::getNodename ( )

Returns the name of the node

Definition at line 344 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by setGlobalVars().

Here is the call graph for this function:

string dtn::daemon::Configuration::getNotifyCommand ( )

The keyword "notify_cmd" can define an external application which is called by some events. This could be used to notify the user of some events of interest.

Returns:
A path to the notify command.

Definition at line 673 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by __daemon_run().

Here is the call graph for this function:

ibrcommon::File dtn::daemon::Configuration::getPath ( string  name)

Generic command to get a specific path. If "name" is set to "foo" then the parameter "foo_path" is returned.

Parameters:
nameThe prefix of the path to get.
Returns:
The path as file object.

Definition at line 607 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by createBundleStorage(), and setGlobalVars().

Here is the call graph for this function:

const Configuration::Security & dtn::daemon::Configuration::getSecurity ( ) const

Definition at line 125 of file Configuration.cpp.

Referenced by __daemon_run().

const Configuration::Statistic & dtn::daemon::Configuration::getStatistic ( ) const

Definition at line 105 of file Configuration.cpp.

Referenced by __daemon_run().

std::string dtn::daemon::Configuration::getStorage ( ) const

Get the type of bundle storage to use.

Returns:

Definition at line 423 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by createBundleStorage().

Here is the call graph for this function:

int dtn::daemon::Configuration::getTimezone ( )

Returns the manual timezone difference in hours.

Returns:
A positive or negative number containing the timezone offset in hours.

Definition at line 602 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by setGlobalVars().

Here is the call graph for this function:

unsigned int dtn::daemon::Configuration::getUID ( ) const

The "uid" keyword in the configuration can define a user to work as. If this daemon is started as root the daemon will switch to the defined user on startup.

Returns:
The UID of the user.

Definition at line 629 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by switchUser().

Here is the call graph for this function:

const std::string dtn::daemon::Configuration::getUser ( ) const

The "user" keyword in the configuration can define a user to work as. If this daemon is started as root the daemon will switch to the defined user on startup.

Returns:
The name of the user.

Definition at line 620 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by switchUser().

Here is the call graph for this function:

void dtn::daemon::Configuration::load ( )

load the configuration from a file

Definition at line 274 of file Configuration.cpp.

Referenced by __daemon_run().

void dtn::daemon::Configuration::params ( int  argc,
char *  argv[] 
)
std::string dtn::daemon::Configuration::version ( )

Get the version of this daemon.

Returns:
The version string.

Definition at line 52 of file Configuration.cpp.

Referenced by __daemon_run(), and params().


The documentation for this class was generated from the following files: