IBR-DTNSuite  0.8
dtn::daemon::Configuration Class Reference

#include <Configuration.h>

List of all members.

Classes

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

Public Types

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

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
const Configuration::TimeSyncgetTimeSync () const
const Configuration::DHTgetDHT () const

Static Public Member Functions

static ConfigurationgetInstance ()

Detailed Description

This class contains the hole configuration for the daemon.

Definition at line 24 of file Configuration.h.


Member Enumeration Documentation

Enumerator:
DEFAULT_ROUTING 
EPIDEMIC_ROUTING 
FLOOD_ROUTING 
PROPHET_ROUTING 

Definition at line 154 of file Configuration.h.


Member Function Documentation

Enable/Disable the API interface.

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

Definition at line 814 of file Configuration.cpp.

Referenced by __daemon_run().

Definition at line 493 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by __daemon_run().

Here is the call graph for this function:

Definition at line 144 of file Configuration.cpp.

Referenced by __daemon_run(), and main().

Definition at line 124 of file Configuration.cpp.

Referenced by __daemon_run().

Definition at line 154 of file Configuration.cpp.

Referenced by __daemon_run().

Definition at line 114 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 784 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 912 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by createBundleStorage(), and setGlobalVars().

Here is the call graph for this function:

Definition at line 129 of file Configuration.cpp.

Referenced by __daemon_run().

Returns the name of the node

Definition at line 423 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by setGlobalVars().

Here is the call graph for this function:

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 819 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by __daemon_run().

Here is the call graph for this function:

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 753 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by createBundleStorage(), and initialize_blobs().

Here is the call graph for this function:

Definition at line 119 of file Configuration.cpp.

Referenced by __daemon_run().

Get the type of bundle storage to use.

Returns:

Definition at line 504 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by createBundleStorage().

Here is the call graph for this function:

Returns the manual timezone difference in hours.

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

Definition at line 748 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 775 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 766 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by switchUser().

Here is the call graph for this function:

load the configuration from a file

Definition at line 304 of file Configuration.cpp.

Referenced by __daemon_run().

Get the version of this daemon.

Returns:
The version string.

Definition at line 53 of file Configuration.cpp.

References PACKAGE_VERSION, and SVN_REVISION.

Referenced by __daemon_run(), dtn::api::ApiServer::componentRun(), and params().


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