#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.
Public Member Functions | |
BundleTimestamp () | |
Default constructor. | |
BundleTimestamp (u_int32_t seconds, u_int32_t seqno) | |
Constructor by parts. | |
bool | operator== (const BundleTimestamp &other) const |
Operator overload for use in STL data structures. | |
bool | operator< (const BundleTimestamp &other) const |
Operator overload for use in STL data structures. | |
bool | operator> (const BundleTimestamp &other) const |
Operator overload for use in STL data structures. | |
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 = 946684800 |
The number of seconds between 1/1/1970 and 1/1/2000. |
dtn::BundleTimestamp::BundleTimestamp | ( | ) | [inline] |
dtn::BundleTimestamp::BundleTimestamp | ( | u_int32_t | seconds, | |
u_int32_t | seqno | |||
) | [inline] |
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 34 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 44 of file BundleTimestamp.cc.
References dtnsim::gettimeofday(), log_err_p, and TIMEVAL_CONVERSION.
Referenced by dtn::BundleDaemon::run().
bool dtn::BundleTimestamp::operator== | ( | const BundleTimestamp & | other | ) | const [inline] |
bool dtn::BundleTimestamp::operator< | ( | const BundleTimestamp & | other | ) | const [inline] |
bool dtn::BundleTimestamp::operator> | ( | const BundleTimestamp & | other | ) | const [inline] |
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::GbofId::equals(), dtn::BundleCommand::exec(), dtn::ProphetBundleList::find(), dtn::BundleList::find(), dtn::BundleDaemon::find_duplicate(), dtn::Bundle::format_verbose(), dtn::PrimaryBlockProcessor::generate_primary(), dtn::FragmentManager::get_hash_key(), dtn::PrimaryBlockProcessor::get_primary_len(), dtn::BundleProtocol::get_timestamp(), dtn::BundleDaemon::handle_bundle_received(), dtn::APIClient::handle_cancel(), dtn::APIClient::handle_recv(), dtn::Bundle::init(), dtnsim::SimLog::log_entry(), operator<(), operator==(), operator>(), dtn::TclRegistration::parse_bundle_data(), dtn::BundleStatusReport::parse_status_report(), dtn::Bundle::serialize(), dtn::BundleProtocol::set_timestamp(), dtn::GbofId::str(), dtn::BundleProtocol::ts_encoding_len(), and dtn::DTLSRRouter::update_current_lsa().
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::GbofId::equals(), dtn::BundleCommand::exec(), dtn::ProphetBundleList::find(), dtn::BundleList::find(), dtn::BundleDaemon::find_duplicate(), dtn::Bundle::format_verbose(), dtn::PrimaryBlockProcessor::generate_primary(), dtn::FragmentManager::get_hash_key(), dtn::PrimaryBlockProcessor::get_primary_len(), dtn::BundleProtocol::get_timestamp(), dtn::BundleDaemon::handle_bundle_received(), dtn::APIClient::handle_cancel(), dtn::APIClient::handle_recv(), dtn::Bundle::init(), dtnsim::SimLog::log_entry(), operator<(), operator==(), operator>(), dtn::TclRegistration::parse_bundle_data(), dtn::BundleStatusReport::parse_status_report(), dtn::Bundle::serialize(), dtn::BundleProtocol::set_timestamp(), dtn::GbofId::str(), and dtn::BundleProtocol::ts_encoding_len().
u_int32_t dtn::BundleTimestamp::TIMEVAL_CONVERSION = 946684800 [static] |
The number of seconds between 1/1/1970 and 1/1/2000.
Definition at line 90 of file BundleTimestamp.h.
Referenced by dtn::BundleDaemon::add_to_pending(), check_local_clock(), get_current_time(), and DTNSim::main().