dtn::ForwardingInfo Class Reference

#include <ForwardingInfo.h>

Inheritance diagram for dtn::ForwardingInfo:

oasys::SerializableObject

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

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 42 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 62 of file ForwardingInfo.h.


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 88 of file ForwardingInfo.h.

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


Member Function Documentation

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_.


Member Data Documentation

int dtn::ForwardingInfo::state_

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

int dtn::ForwardingInfo::action_

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

CustodyTimerSpec dtn::ForwardingInfo::custody_timer_

Custody timer information.

Definition at line 138 of file ForwardingInfo.h.

Referenced by dtn::ForwardingLog::dump(), and dtn::BundleDaemon::handle_bundle_transmitted().


The documentation for this class was generated from the following files:
Generated on Sat Sep 8 08:43:44 2007 for DTN Reference Implementation by  doxygen 1.5.3