IBR-DTN  1.0.0
dtn::daemon::NativeDaemon Class Reference

#include <NativeDaemon.h>

Inheritance diagram for dtn::daemon::NativeDaemon:
Inheritance graph
Collaboration diagram for dtn::daemon::NativeDaemon:
Collaboration graph

Public Member Functions

 NativeDaemon (NativeDaemonCallback *statecb=NULL, NativeEventCallback *eventcb=NULL)
 
virtual ~NativeDaemon ()
 
DaemonRunLevel getRunLevel () const throw ()
 
void init (DaemonRunLevel rl) throw (NativeDaemonException)
 
void wait (DaemonRunLevel rl) throw ()
 
void reload () throw ()
 
void setDebug (int level) throw ()
 
void setLogging (const std::string &defaultTag, int logLevel) const throw ()
 
void setLogFile (const std::string &path, int logLevel) const throw ()
 
void setConfigFile (const std::string &config_file)
 
std::string getLocalUri () const throw ()
 
std::vector< std::string > getNeighbors () const throw ()
 
NativeNode getInfo (const std::string &neighbor_eid) const throw (NativeDaemonException)
 
NativeStats getStats () throw ()
 
void addConnection (std::string eid, std::string protocol, std::string address, std::string service, bool local=false) const throw ()
 
void removeConnection (std::string eid, std::string protocol, std::string address, std::string service, bool local=false) const throw ()
 
void initiateConnection (std::string eid) const
 
void setGloballyConnected (bool connected) const
 
void onKeyExchangeBegin (std::string eid, int protocol, std::string password) const
 
void onKeyExchangeResponse (std::string eid, int protocol, int session, int step, std::string data) const
 
NativeKeyInfo getKeyInfo (std::string eid) const throw (NativeDaemonException)
 
void removeKey (std::string eid) const throw (NativeDaemonException)
 
virtual void raiseEvent (const dtn::core::NodeEvent &evt) throw ()
 
virtual void raiseEvent (const dtn::core::GlobalEvent &evt) throw ()
 
virtual void raiseEvent (const dtn::core::CustodyEvent &evt) throw ()
 
virtual void raiseEvent (const dtn::net::BundleReceivedEvent &evt) throw ()
 
virtual void raiseEvent (const dtn::net::TransferAbortedEvent &evt) throw ()
 
virtual void raiseEvent (const dtn::net::TransferCompletedEvent &evt) throw ()
 
virtual void raiseEvent (const dtn::net::ConnectionEvent &evt) throw ()
 
virtual void raiseEvent (const dtn::routing::QueueBundleEvent &evt) throw ()
 
std::vector< std::string > getVersion () const throw ()
 
void clearStorage () const throw ()
 
void startDiscovery () const throw ()
 
void stopDiscovery () const throw ()
 
void setLeMode (bool low_energy) const throw ()
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::core::NodeEvent >
virtual ~EventReceiver ()
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::core::GlobalEvent >
virtual ~EventReceiver ()
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::core::CustodyEvent >
virtual ~EventReceiver ()
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::net::BundleReceivedEvent >
virtual ~EventReceiver ()
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::net::TransferAbortedEvent >
virtual ~EventReceiver ()
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::net::TransferCompletedEvent >
virtual ~EventReceiver ()
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::net::ConnectionEvent >
virtual ~EventReceiver ()
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::routing::QueueBundleEvent >
virtual ~EventReceiver ()
 

Detailed Description

Definition at line 165 of file NativeDaemon.h.

Constructor & Destructor Documentation

dtn::daemon::NativeDaemon::NativeDaemon ( NativeDaemonCallback statecb = NULL,
NativeEventCallback eventcb = NULL 
)

Constructor

Definition at line 147 of file NativeDaemon.cpp.

dtn::daemon::NativeDaemon::~NativeDaemon ( )
virtual

Destructor

Definition at line 153 of file NativeDaemon.cpp.

Member Function Documentation

void dtn::daemon::NativeDaemon::addConnection ( std::string  eid,
std::string  protocol,
std::string  address,
std::string  service,
bool  local = false 
) const
throw (
)
void dtn::daemon::NativeDaemon::clearStorage ( ) const
throw (
)

Delete all bundles in the storage

Definition at line 165 of file NativeDaemon.cpp.

References dtn::storage::BundleStorage::clear(), dtn::core::BundleCore::getInstance(), and dtn::core::BundleCore::getStorage().

Here is the call graph for this function:

std::string dtn::daemon::NativeDaemon::getLocalUri ( ) const
throw (
)

NATIVE DAEMON METHODS Get the local EID of this node

Definition at line 536 of file NativeDaemon.cpp.

References dtn::data::EID::getString(), and dtn::core::BundleCore::local.

Here is the call graph for this function:

std::vector< std::string > dtn::daemon::NativeDaemon::getNeighbors ( ) const
throw (
)
DaemonRunLevel dtn::daemon::NativeDaemon::getRunLevel ( ) const
throw (
)

Get the current runlevel

Definition at line 863 of file NativeDaemon.cpp.

std::vector< std::string > dtn::daemon::NativeDaemon::getVersion ( ) const
throw (
)

Returns version information about the native daemon

Definition at line 157 of file NativeDaemon.cpp.

References BUILD_NUMBER, and VERSION.

void dtn::daemon::NativeDaemon::init ( DaemonRunLevel  rl)
throw (NativeDaemonException
)

Switch the runlevel of the daemon

Definition at line 868 of file NativeDaemon.cpp.

Referenced by __daemon_run(), and ServiceMain().

void dtn::daemon::NativeDaemon::initiateConnection ( std::string  eid) const

initiate a connection to a given neighbor

Definition at line 687 of file NativeDaemon.cpp.

References dtn::core::BundleCore::getConnectionManager(), dtn::core::BundleCore::getInstance(), dtn::net::ConnectionManager::getNeighbor(), and dtn::net::ConnectionManager::open().

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::onKeyExchangeBegin ( std::string  eid,
int  protocol,
std::string  password 
) const

Start the key exchange with the given neighbor and protocol

Definition at line 705 of file NativeDaemon.cpp.

References dtn::security::KeyExchangeEvent::raise(), and dtn::security::KeyExchangeData::START.

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::onKeyExchangeResponse ( std::string  eid,
int  protocol,
int  session,
int  step,
std::string  data 
) const

Respond to a exchange request

Definition at line 719 of file NativeDaemon.cpp.

References dtn::security::KeyExchangeEvent::raise(), dtn::security::KeyExchangeData::RESPONSE, dtn::security::KeyExchangeData::setSessionId(), and dtn::security::KeyExchangeData::setStep().

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::raiseEvent ( const dtn::core::NodeEvent evt)
throw (
)
virtual
void dtn::daemon::NativeDaemon::raiseEvent ( const dtn::core::CustodyEvent evt)
throw (
)
virtual
void dtn::daemon::NativeDaemon::raiseEvent ( const dtn::net::BundleReceivedEvent evt)
throw (
)
virtual
void dtn::daemon::NativeDaemon::raiseEvent ( const dtn::net::TransferAbortedEvent evt)
throw (
)
virtual
void dtn::daemon::NativeDaemon::raiseEvent ( const dtn::net::TransferCompletedEvent evt)
throw (
)
virtual
void dtn::daemon::NativeDaemon::raiseEvent ( const dtn::routing::QueueBundleEvent evt)
throw (
)
virtual
void dtn::daemon::NativeDaemon::reload ( )
throw (
)

Generate a reload signal

Definition at line 1708 of file NativeDaemon.cpp.

References dtn::core::GlobalEvent::GLOBAL_RELOAD, and dtn::core::GlobalEvent::raise().

Referenced by func_sighandler().

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::removeConnection ( std::string  eid,
std::string  protocol,
std::string  address,
std::string  service,
bool  local = false 
) const
throw (
)
void dtn::daemon::NativeDaemon::removeKey ( std::string  eid) const
throw (NativeDaemonException
)
void dtn::daemon::NativeDaemon::setConfigFile ( const std::string &  config_file)
void dtn::daemon::NativeDaemon::setDebug ( int  level)
throw (
)

Enable / disable debugging at runtime

Definition at line 1720 of file NativeDaemon.cpp.

Referenced by func_sighandler(), and InitService().

void dtn::daemon::NativeDaemon::setGloballyConnected ( bool  connected) const

Set the globally connected state

Definition at line 700 of file NativeDaemon.cpp.

References dtn::core::BundleCore::getInstance(), and dtn::core::BundleCore::setGloballyConnected().

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::setLeMode ( bool  low_energy) const
throw (
)

Control the Low-energy mode of the daemon

Definition at line 170 of file NativeDaemon.cpp.

References dtn::core::GlobalEvent::GLOBAL_LOW_ENERGY, dtn::core::GlobalEvent::GLOBAL_NORMAL, and dtn::core::GlobalEvent::raise().

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::setLogFile ( const std::string &  path,
int  logLevel 
) const
throw (
)

Set the path to the log file

Definition at line 830 of file NativeDaemon.cpp.

References logopts, and logsys.

Referenced by InitService().

void dtn::daemon::NativeDaemon::setLogging ( const std::string &  defaultTag,
int  logLevel 
) const
throw (
)

Set the config file and enable default logging capabilities

setup logging capabilities

Definition at line 778 of file NativeDaemon.cpp.

References logsys.

Referenced by InitService().

void dtn::daemon::NativeDaemon::startDiscovery ( ) const
throw (
)

Enable discovery mechanisms IPND beacons

Definition at line 175 of file NativeDaemon.cpp.

References dtn::core::GlobalEvent::GLOBAL_START_DISCOVERY, and dtn::core::GlobalEvent::raise().

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::stopDiscovery ( ) const
throw (
)

Disable discovery mechanism like IPND beacons

Definition at line 180 of file NativeDaemon.cpp.

References dtn::core::GlobalEvent::GLOBAL_STOP_DISCOVERY, and dtn::core::GlobalEvent::raise().

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::wait ( DaemonRunLevel  rl)
throw (
)

Wait until the runlevel is reached

Definition at line 997 of file NativeDaemon.cpp.


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