dtn::ForwardingInfo Class Reference

#include <ForwardingInfo.h>

List of all members.


Detailed Description

Class to encapsulate bundle forwarding information.

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.


Member Enumeration Documentation

enum dtn::ForwardingInfo::action_t

The forwarding action type codes.

Enumerator:
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.

enum dtn::ForwardingInfo::state_t

The forwarding log state codes.

Enumerator:
NONE  Return value for no entry.
IN_FLIGHT  Currently being sent.
TRANSMITTED  Successfully transmitted.
TRANSMIT_FAILED  Transmission failed.
CANCELLED  Transmission cancelled.
CUSTODY_TIMEOUT  Custody transfer timeout.

Definition at line 82 of file ForwardingInfo.h.


Constructor & Destructor Documentation

dtn::ForwardingInfo::ForwardingInfo (  )  [inline]

Default constructor.

Definition at line 108 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 118 of file ForwardingInfo.h.

References set_state().


Member Function Documentation

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().


Member Data Documentation

state_t dtn::ForwardingInfo::state_

State of the transmission.

Definition at line 141 of file ForwardingInfo.h.

Referenced by dtn::BundleDaemon::handle_bundle_transmitted(), and set_state().

action_t dtn::ForwardingInfo::action_

Forwarding action.

Definition at line 142 of file ForwardingInfo.h.

std::string dtn::ForwardingInfo::clayer_

Convergence layer for the contact.

Definition at line 143 of file ForwardingInfo.h.

std::string dtn::ForwardingInfo::nexthop_

CL-specific nexthop string.

Definition at line 144 of file ForwardingInfo.h.

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().

CustodyTimerSpec dtn::ForwardingInfo::custody_timer_

Custody timer information.

Definition at line 146 of file ForwardingInfo.h.

Referenced by dtn::BundleDaemon::handle_bundle_transmitted().


The documentation for this class was generated from the following file:
Generated on Fri Dec 22 14:48:03 2006 for DTN Reference Implementation by  doxygen 1.5.1