dtn::RouteEntry Class Reference

#include <RouteEntry.h>

Inheritance diagram for dtn::RouteEntry:

oasys::Formatter oasys::SerializableObject List of all members.

Detailed Description

Class to represent route table entry.

Each entry contains an endpoint id pattern that is matched against the destination address in the various bundles to determine if the route entry should be used for the bundle.

An entry also has a forwarding action type code which indicates whether the bundle should be forwarded to this next hop and others (ForwardingInfo::COPY_ACTION) or sent only to the given next hop (ForwardingInfo::FORWARD_ACTION). The entry also stores the custody transfer timeout parameters, unique for a given route.

There is also a pointer to either an interface or a link for each entry. In case the entry contains a link, then that link will be used to send the bundle. If there is no link, there must be an interface. In that case, bundles which match the entry will cause the router to create a new link to the given endpoint whenever a bundle arrives that matches the route entry. This new link is then typically added to the route table.

Definition at line 53 of file RouteEntry.h.

Public Member Functions

 RouteEntry (const EndpointIDPattern &dest_pattern, Link *link)
 Default constructor requires a destination pattern and a link.
 ~RouteEntry ()
 Destructor.
int parse_options (int argc, const char **argv, const char **invalidp=NULL)
 Hook to parse route configuration options.
int format (char *buf, size_t sz) const
 Virtual from formatter.
void dump (oasys::StringBuffer *buf, EndpointIDVector *long_eids) const
 Dump a string representation of the route entry.
virtual void serialize (oasys::SerializeAction *a)
 Virtual from SerializableObject.

Static Public Member Functions

static void dump_header (oasys::StringBuffer *buf)
 Dump a header string in preparation for subsequent calls to dump();.

Public Attributes

EndpointIDPattern dest_pattern_
 The pattern that matches bundles' destination eid.
EndpointIDPattern source_pattern_
 The pattern that matches bundles' source eid.
u_int bundle_cos_
 Bit vector of the bundle priority classes that should match this route.
u_int route_priority_
 Route priority.
Linknext_hop_
 Next hop link.
int action_
 Forwarding action code.
CustodyTimerSpec custody_timeout_
 Custody timer specification.
RouteEntryInfoinfo_
 Abstract pointer to any algorithm-specific state that needs to be stored in the route entry.


Constructor & Destructor Documentation

dtn::RouteEntry::RouteEntry ( const EndpointIDPattern dest_pattern,
Link link 
)

Default constructor requires a destination pattern and a link.

Definition at line 28 of file RouteEntry.cc.

References dtn::BundleRouter::config_, dtn::BundleRouter::Config::default_priority_, and route_priority_.

dtn::RouteEntry::~RouteEntry (  ) 

Destructor.

Definition at line 44 of file RouteEntry.cc.

References info_.


Member Function Documentation

int dtn::RouteEntry::parse_options ( int  argc,
const char **  argv,
const char **  invalidp = NULL 
)

Hook to parse route configuration options.

Definition at line 52 of file RouteEntry.cc.

References action_, oasys::OptParser::addopt(), bundle_cos_, dtn::ForwardingInfo::COPY_ACTION, custody_timeout_, dtn::ForwardingInfo::FORWARD_ACTION, oasys::OptParser::parse_and_shift(), dtn::CustodyTimerSpec::parse_options(), route_priority_, and source_pattern_.

Referenced by dtn::RouteCommand::exec().

int dtn::RouteEntry::format ( char *  buf,
size_t  sz 
) const [virtual]

Virtual from formatter.

Implements oasys::Formatter.

Definition at line 89 of file RouteEntry.cc.

References action_, dtn::ForwardingInfo::action_to_str(), dtn::EndpointID::c_str(), dest_pattern_, next_hop_, dtn::Link::nexthop(), and snprintf().

void dtn::RouteEntry::dump_header ( oasys::StringBuffer buf  )  [static]

Dump a header string in preparation for subsequent calls to dump();.

Definition at line 102 of file RouteEntry.cc.

References oasys::StringBuffer::appendf().

Referenced by dtn::RouteTable::dump().

void dtn::RouteEntry::dump ( oasys::StringBuffer buf,
EndpointIDVector long_eids 
) const

Dump a string representation of the route entry.

Any endpoint ids that don't fit into the column width get put into the long_eids vector.

Definition at line 132 of file RouteEntry.cc.

References action_, dtn::ForwardingInfo::action_to_str(), oasys::StringBuffer::appendf(), bundle_cos_, dtn::EndpointID::c_str(), dtn::Bundle::COS_BULK, dtn::Bundle::COS_EXPEDITED, dtn::Bundle::COS_NORMAL, custody_timeout_, dest_pattern_, dtn::EndpointID::length(), dtn::CustodyTimerSpec::lifetime_pct_, dtn::CustodyTimerSpec::max_, dtn::CustodyTimerSpec::min_, dtn::Link::name(), next_hop_, route_priority_, and source_pattern_.

void dtn::RouteEntry::serialize ( oasys::SerializeAction a  )  [virtual]

Virtual from SerializableObject.

Implements oasys::SerializableObject.

Definition at line 166 of file RouteEntry.cc.

References action_, dest_pattern_, dtn::Link::name_str(), next_hop_, oasys::SerializeAction::process(), route_priority_, and source_pattern_.


Member Data Documentation

EndpointIDPattern dtn::RouteEntry::dest_pattern_

The pattern that matches bundles' destination eid.

Definition at line 95 of file RouteEntry.h.

Referenced by dtn::RouteTable::del_entries(), dtn::RouteTable::del_entry(), dump(), format(), dtn::RouteTable::get_matching(), and serialize().

EndpointIDPattern dtn::RouteEntry::source_pattern_

The pattern that matches bundles' source eid.

Definition at line 98 of file RouteEntry.h.

Referenced by dump(), parse_options(), and serialize().

u_int dtn::RouteEntry::bundle_cos_

Bit vector of the bundle priority classes that should match this route.

Definition at line 101 of file RouteEntry.h.

Referenced by dump(), and parse_options().

u_int dtn::RouteEntry::route_priority_

Route priority.

Definition at line 104 of file RouteEntry.h.

Referenced by dump(), dtn::RoutePriorityGT::operator()(), parse_options(), RouteEntry(), and serialize().

Link* dtn::RouteEntry::next_hop_

Next hop link.

Definition at line 107 of file RouteEntry.h.

Referenced by dtn::TableBasedRouter::add_route(), dtn::RouteTable::del_entries_for_nexthop(), dtn::RouteTable::del_entry(), dump(), format(), dtn::TableBasedRouter::fwd_to_nexthop(), dtn::RouteTable::get_matching(), dtn::RoutePriorityGT::operator()(), serialize(), and dtn::TableBasedRouter::should_fwd().

int dtn::RouteEntry::action_

Forwarding action code.

Definition at line 110 of file RouteEntry.h.

Referenced by dump(), format(), dtn::TableBasedRouter::fwd_to_nexthop(), dtn::TableBasedRouter::handle_link_created(), dtn::FloodBundleRouter::handle_link_created(), parse_options(), serialize(), and dtn::TableBasedRouter::should_fwd().

CustodyTimerSpec dtn::RouteEntry::custody_timeout_

Custody timer specification.

Definition at line 113 of file RouteEntry.h.

Referenced by dump(), dtn::TableBasedRouter::fwd_to_nexthop(), and parse_options().

RouteEntryInfo* dtn::RouteEntry::info_

Abstract pointer to any algorithm-specific state that needs to be stored in the route entry.

Definition at line 117 of file RouteEntry.h.

Referenced by ~RouteEntry().


The documentation for this class was generated from the following files:
Generated on Thu Jun 7 12:54:34 2007 for DTN Reference Implementation by  doxygen 1.5.1