dtn::RouteTable Class Reference

#include <RouteTable.h>

Inheritance diagram for dtn::RouteTable:

oasys::Logger List of all members.

Detailed Description

Class that implements the routing table, implemented with an stl vector.

Definition at line 53 of file RouteTable.h.

Public Member Functions

 RouteTable (const std::string &router_name)
 Constructor.
virtual ~RouteTable ()
 Destructor.
bool add_entry (RouteEntry *entry)
 Add a route entry.
bool del_entry (const EndpointIDPattern &dest, Link *next_hop)
 Remove a route entry.
size_t del_entries (const EndpointIDPattern &dest)
 Remove all entries to the given endpoint id pattern.
size_t del_entries_for_nexthop (Link *next_hop)
 Remove all entries that rely on the given next_hop link.
size_t get_matching (const EndpointID &eid, Link *next_hop, RouteEntryVec *entry_set) const
 Fill in the entry_set with the list of all entries whose patterns match the given eid and next hop.
size_t get_matching (const EndpointID &eid, RouteEntryVec *entry_set) const
 Syntactic sugar to call get_matching for all links.
void dump (oasys::StringBuffer *buf, EndpointIDVector *long_eids) const
 Dump the routing table.
int size ()
 Return the size of the table.

Protected Attributes

RouteEntryVec route_table_
 The routing table itself.


Constructor & Destructor Documentation

dtn::RouteTable::RouteTable ( const std::string &  router_name  ) 

Constructor.

Definition at line 47 of file RouteTable.cc.

dtn::RouteTable::~RouteTable (  )  [virtual]

Destructor.

Definition at line 55 of file RouteTable.cc.


Member Function Documentation

bool dtn::RouteTable::add_entry ( RouteEntry entry  ) 

Add a route entry.

Definition at line 63 of file RouteTable.cc.

References log_debug, and route_table_.

Referenced by dtn::TableBasedRouter::add_route(), and dtn::TcaRouter::create_route().

bool dtn::RouteTable::del_entry ( const EndpointIDPattern dest,
Link next_hop 
)

Remove a route entry.

Definition at line 76 of file RouteTable.cc.

References dtn::EndpointID::c_str(), dtn::RouteEntry::dest_pattern_, dtn::EndpointID::equals(), log_debug, dtn::RouteEntry::next_hop_, dtn::Link::nexthop(), and route_table_.

size_t dtn::RouteTable::del_entries ( const EndpointIDPattern dest  ) 

Remove all entries to the given endpoint id pattern.

Returns:
the number of entries removed

Definition at line 102 of file RouteTable.cc.

References dtn::EndpointID::c_str(), dtn::RouteEntry::dest_pattern_, dtn::EndpointID::equals(), log_debug, and route_table_.

Referenced by dtn::TableBasedRouter::del_route(), and dtn::TcaRouter::handle_del_route().

size_t dtn::RouteTable::del_entries_for_nexthop ( Link next_hop  ) 

Remove all entries that rely on the given next_hop link.

Returns:
the number of entries removed

Definition at line 139 of file RouteTable.cc.

References log_debug, dtn::Link::name(), dtn::RouteEntry::next_hop_, and route_table_.

Referenced by dtn::ProphetRouter::handle_contact_down(), and dtn::NeighborhoodRouter::handle_contact_down().

size_t dtn::RouteTable::get_matching ( const EndpointID eid,
Link next_hop,
RouteEntryVec entry_set 
) const

Fill in the entry_set with the list of all entries whose patterns match the given eid and next hop.

If the next hop is NULL, it is ignored.

Returns:
the count of matching entries

Definition at line 187 of file RouteTable.cc.

References dtn::EndpointID::c_str(), count, dtn::RouteEntry::dest_pattern_, log_debug, dtn::EndpointIDPattern::match(), dtn::RouteEntry::next_hop_, and route_table_.

Referenced by dtn::TcaRouter::fwd_to_all(), dtn::TableBasedRouter::fwd_to_matching(), dtn::TcaRouter::fwd_to_matching_r(), get_matching(), and dtn::TcaRouter::handle_get_routes().

size_t dtn::RouteTable::get_matching ( const EndpointID eid,
RouteEntryVec entry_set 
) const [inline]

Syntactic sugar to call get_matching for all links.

Returns:
the count of matching entries

Definition at line 104 of file RouteTable.h.

References get_matching().

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

Dump the routing table.

Definition at line 220 of file RouteTable.cc.

References dtn::RouteEntry::dump_header(), and route_table_.

Referenced by dtn::TableBasedRouter::get_routing_state().

int dtn::RouteTable::size (  )  [inline]

Return the size of the table.

Definition at line 118 of file RouteTable.h.

References route_table_.


Member Data Documentation

RouteEntryVec dtn::RouteTable::route_table_ [protected]

The routing table itself.

Definition at line 122 of file RouteTable.h.

Referenced by add_entry(), del_entries(), del_entries_for_nexthop(), del_entry(), dump(), get_matching(), and size().


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