#include <BundleTimestamp.h>
Although quite similar to a struct timeval, the bundle protocol specification mandates that timestamps should be calculated as seconds since Jan 1, 2000 (not 1970) so we use a different type.
Definition at line 30 of file BundleTimestamp.h.
Static Public Member Functions | |
static u_int32_t | get_current_time () |
Return the current time in the correct format for the bundle protocol, i.e. | |
static bool | check_local_clock () |
Check that the local clock setting is valid (i.e. | |
Public Attributes | |
u_int32_t | seconds_ |
Seconds since 1/1/2000. | |
u_int32_t | seqno_ |
Sub-second sequence number. | |
Static Public Attributes | |
static u_int32_t | TIMEVAL_CONVERSION |
The number of seconds between 1/1/1970 and 1/1/2000. |
u_int32_t dtn::BundleTimestamp::get_current_time | ( | ) | [static] |
Return the current time in the correct format for the bundle protocol, i.e.
seconds since Jan 1, 2000 in UTC.
Definition at line 31 of file BundleTimestamp.cc.
References ASSERT, dtnsim::gettimeofday(), and TIMEVAL_CONVERSION.
Referenced by dtn::CustodySignal::create_custody_signal(), dtn::BundleStatusReport::create_status_report(), dtn::BundleDaemon::handle_bundle_received(), and dtn::Bundle::init().
bool dtn::BundleTimestamp::check_local_clock | ( | ) | [static] |
Check that the local clock setting is valid (i.e.
is at least up to date with the protocol.
Definition at line 41 of file BundleTimestamp.cc.
References dtnsim::gettimeofday(), oasys::LOG_ERR, log_err_p, oasys::logf(), and TIMEVAL_CONVERSION.
Referenced by dtn::BundleDaemon::run().
u_int32_t dtn::BundleTimestamp::seconds_ |
Seconds since 1/1/2000.
Definition at line 31 of file BundleTimestamp.h.
Referenced by dtn::BundleDaemon::add_to_pending(), dtn::CustodySignal::create_custody_signal(), dtn::BundleStatusReport::create_status_report(), dtn::BundleList::find(), dtn::BundleDaemon::find_duplicate(), dtn::Bundle::format_verbose(), dtn::FragmentManager::get_hash_key(), dtn::BundleProtocol::get_timestamp(), dtn::BundleDaemon::handle_bundle_received(), dtn::BundleDaemon::handle_custody_signal(), dtn::Bundle::init(), dtn::ProphetAckList::insert(), dtn::ProphetAckList::is_ackd(), dtnsim::TrAgent::send_bundle(), dtn::CustodySignalEvent::serialize(), dtn::Bundle::serialize(), and dtn::BundleProtocol::set_timestamp().
u_int32_t dtn::BundleTimestamp::seqno_ |
Sub-second sequence number.
Definition at line 32 of file BundleTimestamp.h.
Referenced by dtn::BundleDaemon::add_to_pending(), dtn::CustodySignal::create_custody_signal(), dtn::BundleStatusReport::create_status_report(), dtn::BundleList::find(), dtn::BundleDaemon::find_duplicate(), dtn::Bundle::format_verbose(), dtn::FragmentManager::get_hash_key(), dtn::BundleProtocol::get_timestamp(), dtn::BundleDaemon::handle_bundle_received(), dtn::BundleDaemon::handle_custody_signal(), dtn::Bundle::init(), dtnsim::TrAgent::send_bundle(), dtn::CustodySignalEvent::serialize(), dtn::Bundle::serialize(), and dtn::BundleProtocol::set_timestamp().
u_int32_t dtn::BundleTimestamp::TIMEVAL_CONVERSION [static] |
The number of seconds between 1/1/1970 and 1/1/2000.
Definition at line 49 of file BundleTimestamp.h.
Referenced by dtn::BundleDaemon::add_to_pending(), check_local_clock(), get_current_time(), and main().