dtn::RouteEntry Class Reference

#include <RouteEntry.h>

Inheritance diagram for dtn::RouteEntry:

oasys::Formatter 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 73 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.

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.
ForwardingInfo::action_t 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 49 of file RouteEntry.cc.

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

dtn::RouteEntry::~RouteEntry (  ) 

Destructor.

Definition at line 65 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 73 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 110 of file RouteEntry.cc.

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

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

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

Definition at line 122 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 152 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_.


Member Data Documentation

EndpointIDPattern dtn::RouteEntry::dest_pattern_

The pattern that matches bundles' destination eid.

Definition at line 109 of file RouteEntry.h.

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

EndpointIDPattern dtn::RouteEntry::source_pattern_

The pattern that matches bundles' source eid.

Definition at line 112 of file RouteEntry.h.

Referenced by dump(), and parse_options().

u_int dtn::RouteEntry::bundle_cos_

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

Definition at line 115 of file RouteEntry.h.

Referenced by dump(), and parse_options().

u_int dtn::RouteEntry::route_priority_

Route priority.

Definition at line 118 of file RouteEntry.h.

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

Link* dtn::RouteEntry::next_hop_

Next hop link.

Definition at line 121 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()(), and dtn::TableBasedRouter::should_fwd().

ForwardingInfo::action_t dtn::RouteEntry::action_

Forwarding action code.

Definition at line 124 of file RouteEntry.h.

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

CustodyTimerSpec dtn::RouteEntry::custody_timeout_

Custody timer specification.

Definition at line 127 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 131 of file RouteEntry.h.

Referenced by ~RouteEntry().


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