Classes | Public Types | Public Member Functions | Static Public Member Functions

dtn::daemon::Configuration Class Reference

#include <Configuration.h>

Collaboration diagram for dtn::daemon::Configuration:
Collaboration graph
[legend]

List of all members.

Classes

class  Debug
class  Discovery
class  Extension
class  Logger
class  NetConfig
class  Network
class  ParameterNotFoundException
class  ParameterNotSetException
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 ()
unsigned int getGID ()
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

Static Public Member Functions

static ConfigurationgetInstance ()

Detailed Description

This class contains the hole configuration for the daemon.

Definition at line 21 of file Configuration.h.


Member Enumeration Documentation

Enumerator:
DEFAULT_ROUTING 
EPIDEMIC_ROUTING 
FLOOD_ROUTING 

Definition at line 135 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 484 of file Configuration.cpp.

Referenced by main().

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

Definition at line 267 of file Configuration.cpp.

References dtn::daemon::Configuration::NetConfig::NETWORK_TCP.

Referenced by main().

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

Definition at line 276 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by main().

Here is the call graph for this function:

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

Definition at line 81 of file Configuration.cpp.

Referenced by main().

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

Definition at line 71 of file Configuration.cpp.

Referenced by main().

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

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

Returns:
The GID of the group.

Definition at line 454 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by switchUser().

Here is the call graph for this function:

Configuration & dtn::daemon::Configuration::getInstance (  )  [static]
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 555 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 86 of file Configuration.cpp.

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

Definition at line 91 of file Configuration.cpp.

Referenced by createConvergenceLayers(), and main().

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

Returns the name of the node

Definition at line 219 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by dtn::routing::EpidemicRoutingExtension::EpidemicRoutingExtension(), dtn::routing::FloodRoutingExtension::FloodRoutingExtension(), and 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 489 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by main().

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:
name The prefix of the path to get.
Returns:
The path as file object.

Definition at line 432 of file Configuration.cpp.

References ibrcommon::ConfigFile::read().

Referenced by createBundleStorage(), and setGlobalVars().

Here is the call graph for this function:

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

Definition at line 76 of file Configuration.cpp.

Referenced by main().

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

Get the type of bundle storage to use.

Returns:

Definition at line 285 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 427 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 (  ) 

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 UID of the user.

Definition at line 445 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 162 of file Configuration.cpp.

Referenced by main().

void dtn::daemon::Configuration::load ( string  filename  ) 
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 32 of file Configuration.cpp.

References SVN_REVISION.

Referenced by main(), and params().


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