IBR-DTNSuite
0.8
|
#include <DTNTPWorker.h>
Classes | |
class | TimeSyncMessage |
Public Member Functions | |
DTNTPWorker () | |
virtual | ~DTNTPWorker () |
void | callbackBundleReceived (const Bundle &b) |
void | raiseEvent (const dtn::core::Event *evt) |
void | update (const ibrcommon::vinterface &iface, std::string &name, std::string &data) throw (NoServiceHereException) |
Definition at line 20 of file DTNTPWorker.h.
Definition at line 29 of file DTNTPWorker.cpp.
References dtn::core::EventReceiver::bindEvent(), dtn::core::TimeEvent::className, dtn::core::NodeEvent::className, dtn::daemon::Configuration::TimeSync::hasReference(), IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, dtn::core::AbstractWorker::initialize(), dtn::daemon::DTNTPWorker::TimeSyncMessage::origin_quality, dtn::daemon::DTNTPWorker::TimeSyncMessage::origin_timestamp, dtn::daemon::DTNTPWorker::TimeSyncMessage::peer_quality, dtn::daemon::DTNTPWorker::TimeSyncMessage::peer_timestamp, dtn::utils::Clock::quality, and dtn::daemon::Configuration::TimeSync::syncOnDiscovery().
dtn::daemon::DTNTPWorker::~DTNTPWorker | ( | ) | [virtual] |
Definition at line 61 of file DTNTPWorker.cpp.
References dtn::core::TimeEvent::className, dtn::core::NodeEvent::className, and dtn::core::EventReceiver::unbindEvent().
void dtn::daemon::DTNTPWorker::callbackBundleReceived | ( | const Bundle & | b | ) | [virtual] |
Implements dtn::core::AbstractWorker.
Definition at line 386 of file DTNTPWorker.cpp.
References dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_lifetime, dtn::data::PrimaryBlock::_source, ibrcommon::BLOB::iostream::clear(), dtn::data::PrimaryBlock::DESTINATION_IS_SINGLETON, dtn::data::PayloadBlock::getBLOB(), dtn::data::Bundle::getBlock(), dtn::data::Bundle::getBlocks(), dtn::data::AgeBlock::getMicroseconds(), dtn::data::EID::getNode(), dtn::data::EID::getString(), dtn::utils::Clock::gettimeofday(), IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, ibrcommon::BLOB::Reference::iostream(), dtn::core::BundleCore::local, dtn::data::PrimaryBlock::PRIORITY_BIT1, dtn::data::PrimaryBlock::PRIORITY_BIT2, dtn::data::Bundle::push_front(), dtn::utils::Clock::quality, dtn::data::PrimaryBlock::relabel(), dtn::data::PrimaryBlock::set(), dtn::data::ScopeControlHopLimitBlock::setLimit(), dtn::daemon::DTNTPWorker::TimeSyncMessage::TIMESYNC_REQUEST, dtn::daemon::DTNTPWorker::TimeSyncMessage::TIMESYNC_RESPONSE, and dtn::core::AbstractWorker::transmit().
void dtn::daemon::DTNTPWorker::raiseEvent | ( | const dtn::core::Event * | evt | ) | [virtual] |
decrease the quality of time each x tics
evaluate the current local time
Implements dtn::core::EventReceiver.
Definition at line 130 of file DTNTPWorker.cpp.
References dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_lifetime, dtn::data::PrimaryBlock::_source, ibrcommon::BLOB::create(), dtn::data::PrimaryBlock::DESTINATION_IS_SINGLETON, dtn::core::Node::get(), dtn::core::TimeEvent::getAction(), dtn::core::NodeEvent::getAction(), dtn::core::Node::getEID(), dtn::core::NodeEvent::getNode(), dtn::daemon::Configuration::TimeSync::getQualityOfTimeTick(), dtn::core::TimeEvent::getTimestamp(), dtn::utils::Clock::getUnixTimestamp(), dtn::core::TimeEvent::getUnixTimestamp(), dtn::core::Node::has(), dtn::daemon::Configuration::TimeSync::hasReference(), IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, ibrcommon::BLOB::iostream::iostream(), dtn::core::BundleCore::local, dtn::core::NODE_INFO_UPDATED, dtn::daemon::DTNTPWorker::TimeSyncMessage::peer_quality, dtn::data::PrimaryBlock::PRIORITY_BIT1, dtn::data::PrimaryBlock::PRIORITY_BIT2, dtn::data::Bundle::push_back(), dtn::data::Bundle::push_front(), dtn::utils::Clock::quality, dtn::data::PrimaryBlock::set(), dtn::data::ScopeControlHopLimitBlock::setLimit(), dtn::core::TIME_SECOND_TICK, and dtn::core::AbstractWorker::transmit().
void dtn::daemon::DTNTPWorker::update | ( | const ibrcommon::vinterface & | iface, |
std::string & | name, | ||
std::string & | data | ||
) | throw (NoServiceHereException) [virtual] |
Updates an discovery service block with current values
name | |
data |
Implements dtn::net::DiscoveryServiceProvider.
Definition at line 287 of file DTNTPWorker.cpp.
References dtn::utils::Clock::getTime(), dtn::utils::Clock::quality, and dtn::daemon::Configuration::TimeSync::sendDiscoveryAnnouncements().