#include <RouteEntry.h>
Inheritance diagram for dtn::RouteEntry:
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. | |
Link * | next_hop_ |
Next hop link. | |
ForwardingInfo::action_t | action_ |
Forwarding action code. | |
CustodyTimerSpec | custody_timeout_ |
Custody timer specification. | |
RouteEntryInfo * | info_ |
Abstract pointer to any algorithm-specific state that needs to be stored in the route entry. |
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 | ( | ) |
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_.
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().
The pattern that matches bundles' source eid.
Definition at line 112 of file RouteEntry.h.
Referenced by dump(), and parse_options().
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().
Route priority.
Definition at line 118 of file RouteEntry.h.
Referenced by dump(), dtn::RoutePriorityGT::operator()(), parse_options(), and RouteEntry().
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().
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().
Custody timer specification.
Definition at line 127 of file RouteEntry.h.
Referenced by dump(), dtn::TableBasedRouter::fwd_to_nexthop(), and parse_options().
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().