#include <LinkStateRouter.h>
Inheritance diagram for dtn::LinkStateRouter:
Definition at line 49 of file LinkStateRouter.h.
Public Types | |
enum | ls_type { LS_ANNOUNCEMENT } |
Public Member Functions | |
LinkStateRouter () | |
void | handle_event (BundleEvent *event) |
Pure virtual event handler function (copied from BundleEventHandler for clarity). | |
void | handle_contact_down (ContactDownEvent *event) |
Default event handler when a contact is down. | |
void | handle_contact_up (ContactUpEvent *event) |
Default event handler when a new contact is up. | |
LinkStateGraph * | graph () |
void | initialize () |
void | get_routing_state (oasys::StringBuffer *buf) |
Format the given StringBuffer with current routing info. | |
Public Attributes | |
dtn::LinkStateRouter::LinkStateAnnouncement | packed |
Protected Member Functions | |
void | flood_announcement (LinkStateGraph::Edge *edge, bool exists) |
void | send_announcement (LinkStateGraph::Edge *edge, Link *outgoing_link, bool exists) |
void | handle_bundle_received (BundleReceivedEvent *event) |
Default event handler for new bundle arrivals. | |
Protected Attributes | |
LinkStateGraph | graph_ |
LSRegistration * | reg_ |
Classes | |
struct | LinkStateAnnouncement |
class | LSRegistration |
dtn::LinkStateRouter::LinkStateRouter | ( | ) |
Definition at line 59 of file LinkStateRouter.cc.
void dtn::LinkStateRouter::handle_event | ( | BundleEvent * | event | ) | [inline, virtual] |
Pure virtual event handler function (copied from BundleEventHandler for clarity).
Implements dtn::BundleRouter.
Definition at line 70 of file LinkStateRouter.h.
References dtn::BundleEventHandler::dispatch_event().
void dtn::LinkStateRouter::handle_contact_down | ( | ContactDownEvent * | event | ) | [virtual] |
Default event handler when a contact is down.
Reimplemented from dtn::BundleEventHandler.
Definition at line 114 of file LinkStateRouter.cc.
References dtn::ContactDownEvent::contact_, flood_announcement(), dtn::LinkStateGraph::getVertex(), graph_, dtn::BundleEventHandler::handle_contact_down(), dtn::LinkStateGraph::Vertex::incoming_edges_, dtn::BundleDaemon::instance(), log_info, dtn::LinkStateGraph::Vertex::outgoing_edges_, and dtn::LinkStateGraph::removeEdge().
void dtn::LinkStateRouter::handle_contact_up | ( | ContactUpEvent * | event | ) | [virtual] |
Default event handler when a new contact is up.
Reimplemented from dtn::BundleEventHandler.
Definition at line 72 of file LinkStateRouter.cc.
References dtn::LinkStateGraph::addEdge(), dtn::ContactUpEvent::contact_, dtn::LinkStateGraph::edges(), flood_announcement(), dtn::LinkStateGraph::getEdge(), dtn::LinkStateGraph::getVertex(), graph_, dtn::BundleEventHandler::handle_contact_up(), dtn::BundleDaemon::instance(), log_info, and send_announcement().
LinkStateGraph* dtn::LinkStateRouter::graph | ( | ) | [inline] |
Definition at line 77 of file LinkStateRouter.h.
References graph_.
Referenced by dtn::LinkStateRouter::LSRegistration::deliver_bundle().
void dtn::LinkStateRouter::initialize | ( | ) | [virtual] |
Reimplemented from dtn::BundleRouter.
Definition at line 65 of file LinkStateRouter.cc.
References dtn::EVENTSRC_ADMIN, dtn::BundleDaemon::instance(), dtn::BundleDaemon::post(), and reg_.
void dtn::LinkStateRouter::get_routing_state | ( | oasys::StringBuffer * | buf | ) | [virtual] |
Format the given StringBuffer with current routing info.
Implements dtn::BundleRouter.
Definition at line 218 of file LinkStateRouter.cc.
References dtn::LinkStateGraph::dumpGraph(), and graph_.
void dtn::LinkStateRouter::flood_announcement | ( | LinkStateGraph::Edge * | edge, | |
bool | exists | |||
) | [protected] |
Definition at line 231 of file LinkStateRouter.cc.
References dtn::BundleDaemon::contactmgr(), dtn::BundleDaemon::instance(), ExamineDump::l, dtn::ContactManager::links(), dtn::ContactManager::lock(), and send_announcement().
Referenced by dtn::LinkStateRouter::LSRegistration::deliver_bundle(), handle_contact_down(), and handle_contact_up().
void dtn::LinkStateRouter::send_announcement | ( | LinkStateGraph::Edge * | edge, | |
Link * | outgoing_link, | |||
bool | exists | |||
) | [protected] |
Definition at line 242 of file LinkStateRouter.cc.
References dtn::BundleRouter::actions_, dtn::EndpointID::assign(), dtn::LinkStateGraph::Edge::cost_, dtn::Bundle::custodian_, dtn::CustodyTimerSpec::defaults_, dtn::Bundle::dest_, dtn::ForwardingInfo::FORWARD_ACTION, dtn::LinkStateGraph::Edge::from_, dtn::BundleActions::inject_bundle(), dtn::BundleDaemon::instance(), dtn::LinkStateRouter::LinkStateAnnouncement::LINK_DOWN, LS_ANNOUNCEMENT, dtn::EndpointID::NULL_EID(), dtn::Bundle::payload_, dtn::Bundle::replyto_, ROUTER_BCAST_EID, dtn::BundleActions::send_bundle(), dtn::BundlePayload::set_data(), dtn::Bundle::source_, and dtn::LinkStateGraph::Edge::to_.
Referenced by flood_announcement(), and handle_contact_up().
void dtn::LinkStateRouter::handle_bundle_received | ( | BundleReceivedEvent * | event | ) | [protected, virtual] |
Default event handler for new bundle arrivals.
Reimplemented from dtn::BundleEventHandler.
Definition at line 169 of file LinkStateRouter.cc.
References dtn::BundleRouter::actions_, ASSERT, dtn::Bundle::bundleid_, dtn::BundleReceivedEvent::bundleref_, dtn::EndpointID::c_str(), dtn::BundleDaemon::contactmgr(), dtn::CustodyTimerSpec::defaults_, dtn::Bundle::dest_, dtn::LinkStateGraph::Vertex::eid_, dtn::ContactManager::find_link_to(), dtn::LinkStateGraph::findNextHop(), dtn::ForwardingInfo::FORWARD_ACTION, dtn::LinkStateGraph::getMatchingVertex(), dtn::LinkStateGraph::getVertex(), graph_, dtn::BundleDaemon::instance(), dtn::BundleDaemon::local_eid(), log_debug, oasys::Ref< _Type >::object(), dtn::Bundle::owner_, and dtn::BundleActions::send_bundle().
LinkStateGraph dtn::LinkStateRouter::graph_ [protected] |
Definition at line 83 of file LinkStateRouter.h.
Referenced by get_routing_state(), graph(), handle_bundle_received(), handle_contact_down(), and handle_contact_up().
LSRegistration* dtn::LinkStateRouter::reg_ [protected] |