dtn::RouteEntry Class Reference

Class to represent route table entry. More...

#include <RouteEntry.h>

List of all members.

Classes

class  DestMatches
 Predicate to match the destination pattern for a route. More...
class  NextHopMatches
 Predicate to match the destination pattern for a route. More...

Public Types

typedef ForwardingInfo::action_t action_t
 Share the ForwardingInfo::action_t type.

Public Member Functions

 RouteEntry (const EndpointIDPattern &dest_pattern, const LinkRef &link)
 First constructor requires a destination pattern and a next hop link.
 RouteEntry (const EndpointIDPattern &dest_pattern, const EndpointIDPattern &route_to)
 Alternate constructor requires a destination pattern and a route destination endpoint id.
 ~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, oasys::StringVector *long_strings, int dest_eid_width, int source_eid_width, int next_hop_width) const
 Dump a string representation of the route entry.
virtual void serialize (oasys::SerializeAction *a)
 Virtual from SerializableObject.
const EndpointIDPatterndest_pattern () const
 Accessors.
const EndpointIDPatternsource_pattern () const
 Accessors.
const LinkReflink () const
 Accessors.
const EndpointIDPatternroute_to () const
 Accessors.
u_int priority () const
 Accessors.
RouteEntryInfoinfo () const
 Accessors.
const CustodyTimerSpeccustody_spec () const
 Accessors.
action_t action () const
 Accessors.
const std::string & next_hop_str () const
 Accessors.
void set_action (action_t action)
 Setters.
void set_info (RouteEntryInfo *info)
 Setters.

Static Public Member Functions

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

Static Private Member Functions

static void append_long_string (oasys::StringBuffer *buf, oasys::StringVector *long_strings, int width, const std::string &str)
 Helper for dump().

Private 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 priority_
 Route priority.
LinkRef link_
 Next hop link if known.
EndpointIDPattern route_to_
 Route destination for recursive lookups.
u_int32_t action_
 Forwarding action code.
CustodyTimerSpec custody_spec_
 Custody timer specification.
RouteEntryInfoinfo_
 Abstract pointer to any algorithm-specific state that needs to be stored in the route entry.


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 54 of file RouteEntry.h.


Member Typedef Documentation

Share the ForwardingInfo::action_t type.

Definition at line 58 of file RouteEntry.h.


Constructor & Destructor Documentation

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

First constructor requires a destination pattern and a next hop link.

Definition at line 30 of file RouteEntry.cc.

dtn::RouteEntry::RouteEntry ( const EndpointIDPattern dest_pattern,
const EndpointIDPattern route_to 
)

Alternate constructor requires a destination pattern and a route destination endpoint id.

Definition at line 47 of file RouteEntry.cc.

dtn::RouteEntry::~RouteEntry (  ) 

Destructor.

Definition at line 64 of file RouteEntry.cc.

References info_.


Member Function Documentation

action_t dtn::RouteEntry::action (  )  const [inline]

void dtn::RouteEntry::append_long_string ( oasys::StringBuffer *  buf,
oasys::StringVector *  long_strings,
int  width,
const std::string &  str 
) [static, private]

Helper for dump().

Definition at line 172 of file RouteEntry.cc.

Referenced by dump().

const CustodyTimerSpec& dtn::RouteEntry::custody_spec (  )  const [inline]

Accessors.

Definition at line 123 of file RouteEntry.h.

References custody_spec_.

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

const EndpointIDPattern& dtn::RouteEntry::dest_pattern (  )  const [inline]

void dtn::RouteEntry::dump ( oasys::StringBuffer *  buf,
oasys::StringVector *  long_strings,
int  dest_eid_width,
int  source_eid_width,
int  next_hop_width 
) const

Dump a string representation of the route entry.

Any endpoint ids or link names that don't fit into the column width get put into the long_strings vector.

Definition at line 199 of file RouteEntry.cc.

References action(), dtn::ForwardingInfo::action_to_str(), append_long_string(), bundle_cos_, dtn::Bundle::COS_BULK, dtn::Bundle::COS_EXPEDITED, dtn::Bundle::COS_NORMAL, custody_spec(), dest_pattern(), next_hop_str(), priority(), and source_pattern().

void dtn::RouteEntry::dump_header ( oasys::StringBuffer *  buf,
int  dest_eid_width,
int  source_eid_width,
int  next_hop_width 
) [static]

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

Definition at line 136 of file RouteEntry.cc.

References dtn::DASHES.

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

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

Virtual from formatter.

Definition at line 116 of file RouteEntry.cc.

References action(), dtn::ForwardingInfo::action_to_str(), dest_pattern(), and next_hop_str().

RouteEntryInfo* dtn::RouteEntry::info (  )  const [inline]

Accessors.

Definition at line 122 of file RouteEntry.h.

References info_.

Referenced by dtn::DTLSRRouter::is_dynamic_route().

const LinkRef& dtn::RouteEntry::link (  )  const [inline]

const std::string& dtn::RouteEntry::next_hop_str (  )  const [inline]

Accessors.

Definition at line 127 of file RouteEntry.h.

References link(), route_to(), and dtn::EndpointID::str().

Referenced by dump(), format(), and dtn::TableBasedRouter::tcl_dump_state().

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

u_int dtn::RouteEntry::priority (  )  const [inline]

Accessors.

Definition at line 121 of file RouteEntry.h.

References priority_.

Referenced by dump(), dtn::RoutePrioritySort::operator()(), and dtn::TableBasedRouter::tcl_dump_state().

const EndpointIDPattern& dtn::RouteEntry::route_to (  )  const [inline]

Accessors.

Definition at line 120 of file RouteEntry.h.

References route_to_.

Referenced by dtn::RouteTable::dump(), dtn::RouteTable::get_matching_helper(), and next_hop_str().

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

Virtual from SerializableObject.

Definition at line 225 of file RouteEntry.cc.

References action_, bundle_cos_, custody_spec_, dest_pattern_, link_, priority_, route_to_, and source_pattern_.

void dtn::RouteEntry::set_action ( action_t  action  )  [inline]

Setters.

Definition at line 133 of file RouteEntry.h.

References action_.

Referenced by dtn::TableBasedRouter::add_nexthop_route(), and dtn::TableBasedRouter::add_subscriber().

void dtn::RouteEntry::set_info ( RouteEntryInfo info  )  [inline]

Setters.

Definition at line 134 of file RouteEntry.h.

References info_.

const EndpointIDPattern& dtn::RouteEntry::source_pattern (  )  const [inline]

Accessors.

Definition at line 118 of file RouteEntry.h.

References source_pattern_.

Referenced by dtn::RouteTable::dump(), dump(), and dtn::TableBasedRouter::tcl_dump_state().


Member Data Documentation

u_int32_t dtn::RouteEntry::action_ [private]

Forwarding action code.

Definition at line 163 of file RouteEntry.h.

Referenced by action(), parse_options(), serialize(), and set_action().

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

Definition at line 151 of file RouteEntry.h.

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

Custody timer specification.

Definition at line 166 of file RouteEntry.h.

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

The pattern that matches bundles' destination eid.

Definition at line 145 of file RouteEntry.h.

Referenced by dest_pattern(), and serialize().

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

Definition at line 170 of file RouteEntry.h.

Referenced by info(), set_info(), and ~RouteEntry().

Next hop link if known.

Definition at line 157 of file RouteEntry.h.

Referenced by link(), and serialize().

u_int dtn::RouteEntry::priority_ [private]

Route priority.

Definition at line 154 of file RouteEntry.h.

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

Route destination for recursive lookups.

Definition at line 160 of file RouteEntry.h.

Referenced by route_to(), and serialize().

The pattern that matches bundles' source eid.

Definition at line 148 of file RouteEntry.h.

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


The documentation for this class was generated from the following files:

Generated on Fri Jan 30 09:43:15 2009 for DTN Reference Implementation by  doxygen 1.5.8