#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 57 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 (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. | |
Static Public Member Functions | |
static const char * | action_to_str (action_t action) |
static const char * | state_to_str (state_t state) |
Public Attributes | |
state_t | state_ |
State of the transmission. | |
action_t | action_ |
Forwarding action. | |
std::string | clayer_ |
Convergence layer for the contact. | |
std::string | nexthop_ |
CL-specific nexthop string. | |
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 62 of file ForwardingInfo.h.
The forwarding log state codes.
Definition at line 82 of file ForwardingInfo.h.
dtn::ForwardingInfo::ForwardingInfo | ( | ) | [inline] |
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 118 of file ForwardingInfo.h.
References set_state().
static const char* dtn::ForwardingInfo::action_to_str | ( | action_t | action | ) | [inline, static] |
Definition at line 68 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 91 of file ForwardingInfo.h.
References CANCELLED, CUSTODY_TIMEOUT, IN_FLIGHT, NONE, NOTREACHED, TRANSMIT_FAILED, and TRANSMITTED.
Referenced by dtn::ForwardingLog::dump(), and dtn::TableBasedRouter::should_fwd().
void dtn::ForwardingInfo::set_state | ( | state_t | new_state | ) | [inline] |
Set the state and update the timestamp.
Definition at line 135 of file ForwardingInfo.h.
References dtnsim::gettimeofday(), state_, and timestamp_.
Referenced by ForwardingInfo().
State of the transmission.
Definition at line 141 of file ForwardingInfo.h.
Referenced by dtn::BundleDaemon::handle_bundle_transmitted(), and set_state().
std::string dtn::ForwardingInfo::clayer_ |
std::string dtn::ForwardingInfo::nexthop_ |
struct timeval dtn::ForwardingInfo::timestamp_ |
Timestamp of last state update.
Definition at line 145 of file ForwardingInfo.h.
Referenced by dtn::BundleDaemon::handle_bundle_transmitted(), and set_state().
Custody timer information.
Definition at line 146 of file ForwardingInfo.h.
Referenced by dtn::BundleDaemon::handle_bundle_transmitted().