#include <ForwardingInfo.h>
This is created when a bundle is forwarded to log a record of the forwarding event, along with any route-specific information about the action, such as the custody timer.
Routing algorithms consult this log to determine their course of action, for instance if they don't want to retransmit to the same next hop twice.
Definition at line 37 of file ForwardingInfo.h.
Public Types | |
enum | action_t { INVALID_ACTION = 0, FORWARD_ACTION, COPY_ACTION } |
The forwarding action type codes. More... | |
enum | state_t { NONE, IN_FLIGHT, TRANSMITTED, TRANSMIT_FAILED, CANCELLED, CUSTODY_TIMEOUT } |
The forwarding log state codes. More... | |
Public Member Functions | |
ForwardingInfo () | |
Default constructor. | |
ForwardingInfo (const oasys::Builder &) | |
ForwardingInfo (state_t state, action_t action, const std::string &clayer, const std::string &nexthop, const CustodyTimerSpec &custody_timer) | |
Constructor used for new entries. | |
void | set_state (state_t new_state) |
Set the state and update the timestamp. | |
virtual void | serialize (oasys::SerializeAction *a) |
This should call v->process() on each of the types that are to be serialized in the object. | |
Static Public Member Functions | |
static const char * | action_to_str (action_t action) |
static const char * | state_to_str (state_t state) |
Public Attributes | |
int | state_ |
State of the transmission. | |
int | action_ |
Forwarding action. | |
std::string | clayer_ |
Convergence layer for the contact. | |
std::string | nexthop_ |
CL-specific nexthop string. | |
struct timeval | timestamp_ |
Timestamp of last state update. | |
CustodyTimerSpec | custody_timer_ |
Custody timer information. |
The forwarding action type codes.
INVALID_ACTION | Invalid action. |
FORWARD_ACTION | Forward the bundle to only this next hop. |
COPY_ACTION | Forward a copy of the bundle. |
Definition at line 42 of file ForwardingInfo.h.
The forwarding log state codes.
Definition at line 62 of file ForwardingInfo.h.
dtn::ForwardingInfo::ForwardingInfo | ( | ) | [inline] |
dtn::ForwardingInfo::ForwardingInfo | ( | const oasys::Builder & | ) | [inline] |
Definition at line 98 of file ForwardingInfo.h.
dtn::ForwardingInfo::ForwardingInfo | ( | state_t | state, | |
action_t | action, | |||
const std::string & | clayer, | |||
const std::string & | nexthop, | |||
const CustodyTimerSpec & | custody_timer | |||
) | [inline] |
Constructor used for new entries.
Definition at line 108 of file ForwardingInfo.h.
References set_state().
static const char* dtn::ForwardingInfo::action_to_str | ( | action_t | action | ) | [inline, static] |
Definition at line 48 of file ForwardingInfo.h.
References COPY_ACTION, FORWARD_ACTION, INVALID_ACTION, and NOTREACHED.
Referenced by dtn::RouteEntry::dump(), dtn::ForwardingLog::dump(), and dtn::RouteEntry::format().
static const char* dtn::ForwardingInfo::state_to_str | ( | state_t | state | ) | [inline, static] |
Definition at line 71 of file ForwardingInfo.h.
References CANCELLED, CUSTODY_TIMEOUT, IN_FLIGHT, NONE, NOTREACHED, TRANSMIT_FAILED, and TRANSMITTED.
Referenced by dtn::ForwardingLog::dump(), dtn::TableBasedRouter::should_fwd(), dtn::ProphetDecider::should_fwd(), and dtn::ProphetEncounter::should_fwd().
void dtn::ForwardingInfo::set_state | ( | state_t | new_state | ) | [inline] |
Set the state and update the timestamp.
Definition at line 125 of file ForwardingInfo.h.
References dtnsim::gettimeofday(), state_, and timestamp_.
Referenced by ForwardingInfo().
void dtn::ForwardingInfo::serialize | ( | oasys::SerializeAction * | a | ) | [virtual] |
This should call v->process() on each of the types that are to be serialized in the object.
Implements oasys::SerializableObject.
Definition at line 48 of file ForwardingInfo.cc.
References action_, clayer_, nexthop_, oasys::SerializeAction::process(), state_, and timestamp_.
State of the transmission.
Definition at line 133 of file ForwardingInfo.h.
Referenced by dtn::ForwardingLog::dump(), dtn::ForwardingLog::get_latest_entry(), dtn::BundleDaemon::handle_bundle_transmitted(), serialize(), set_state(), dtn::TableBasedRouter::should_fwd(), dtn::ProphetDecider::should_fwd(), and dtn::ProphetEncounter::should_fwd().
Forwarding action.
Definition at line 134 of file ForwardingInfo.h.
Referenced by dtn::ForwardingLog::dump(), and serialize().
std::string dtn::ForwardingInfo::clayer_ |
Convergence layer for the contact.
Definition at line 135 of file ForwardingInfo.h.
Referenced by dtn::ForwardingLog::dump(), and serialize().
std::string dtn::ForwardingInfo::nexthop_ |
CL-specific nexthop string.
Definition at line 136 of file ForwardingInfo.h.
Referenced by dtn::ForwardingLog::dump(), and serialize().
struct timeval dtn::ForwardingInfo::timestamp_ [read] |
Timestamp of last state update.
Definition at line 137 of file ForwardingInfo.h.
Referenced by dtn::ForwardingLog::dump(), dtn::BundleDaemon::handle_bundle_transmitted(), serialize(), and set_state().
Custody timer information.
Definition at line 138 of file ForwardingInfo.h.
Referenced by dtn::ForwardingLog::dump(), and dtn::BundleDaemon::handle_bundle_transmitted().