prophet::Controller Class Reference

#include <Controller.h>

Inheritance diagram for prophet::Controller:
prophet::Oracle prophet::ExpirationHandler

List of all members.

Public Types

typedef std::list< Encounter * > List

Public Member Functions

 Controller (BundleCore *core, Repository *repository, ProphetParams *params)
 Constructor.
virtual ~Controller ()
 Destructor.
void new_neighbor (const Link *link)
 Signal Prophet that a new neighbor has been discovered.
void neighbor_gone (const Link *link)
 Signal Prophet that contact with neighbor is lost.
bool accept_bundle (const Bundle *bundle)
 Query whether Bundle should be accepted.
void handle_bundle_received (const Bundle *b, const Link *link)
 Add Bundle to Prophet storage.
void handle_bundle_transmitted (const Bundle *b, const Link *link)
 Update Prophet statistics on successful transmission.
void ack (const Bundle *b)
 Add Prophet ACK for bundle.
void set_queue_policy ()
 Set Prophet's storage policy (query params_ for change).
void set_hello_interval ()
 Set Hello interval (longest acceptable delay in peering; query params_ for change).
void set_max_route ()
 Callback for runtime changes made to ProphetParams::max_table_size_.
void shutdown ()
 Callback for host system to notify of shutdown event.
void handle_timeout ()
 Virtual from ExpirationHandler.

const ProphetParamsparams () const
 virtual from Oracle
Statsstats ()
 virtual from Oracle
Tablenodes ()
 virtual from Oracle
AckListacks ()
 virtual from Oracle
BundleCorecore ()
 virtual from Oracle

const List::const_iterator begin () const
 Iterators over Encounter list ... not thread safe.
const List::const_iterator end () const
 Iterators over Encounter list ... not thread safe.

size_t size ()
 Accessors.
bool empty ()
 Accessors.

Protected Member Functions

bool find (const Link *link, List::iterator &i)
 Search for Encounter based on Link properties.
bool is_prophet_control (const Bundle *b) const
 Check Bundle destination for Prophet node endpoint ID.

Protected Attributes

BundleCorecore_
 facade interface for interacting with Bundle host
ProphetParamsparams_
 tuneable parameter struct
Stats stats_
 forwarding statistics per bundle, used by queue policy
u_int max_route_
 upper limit to number of routes retained by Prophet
Table nodes_
 table of routes learned by local node
AckList acks_
 Prophet ack's for successfully delivered bundles.
u_int16_t next_instance_
 used to generate serial number for Encounters
Alarmalarm_
 timeout handler for aging Nodes and Acks
u_int timeout_
 protocol timeout value (mirrors params_->hello_interval_)
Repositoryrepository_
 Prophet's queue policy enforcement.
List list_
 active Prophet peering sessions

Detailed Description

Definition at line 33 of file Controller.h.


Member Typedef Documentation

typedef std::list<Encounter*> prophet::Controller::List

Definition at line 37 of file Controller.h.


Constructor & Destructor Documentation

prophet::Controller::Controller ( BundleCore core,
Repository repository,
ProphetParams params 
)
prophet::Controller::~Controller (  )  [virtual]

Destructor.

Definition at line 63 of file Controller.cc.

References list_.


Member Function Documentation

bool prophet::Controller::accept_bundle ( const Bundle bundle  ) 
void prophet::Controller::ack ( const Bundle b  )  [virtual]

Add Prophet ACK for bundle.

Reimplemented from prophet::Oracle.

Definition at line 269 of file Controller.cc.

References is_prophet_control(), LOG, and prophet::Bundle::sequence_num().

Referenced by dtn::ProphetRouter::handle_bundle_delivered().

AckList* prophet::Controller::acks (  )  [inline, virtual]

virtual from Oracle

Implements prophet::Oracle.

Definition at line 106 of file Controller.h.

References acks_.

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

const List::const_iterator prophet::Controller::begin (  )  const [inline]

Iterators over Encounter list ... not thread safe.

Definition at line 111 of file Controller.h.

References list_.

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

BundleCore* prophet::Controller::core (  )  [inline, virtual]

virtual from Oracle

Implements prophet::Oracle.

Definition at line 107 of file Controller.h.

References core_.

Referenced by handle_bundle_transmitted().

bool prophet::Controller::empty (  )  [inline]

Accessors.

Definition at line 117 of file Controller.h.

References list_.

const List::const_iterator prophet::Controller::end (  )  const [inline]

Iterators over Encounter list ... not thread safe.

Definition at line 112 of file Controller.h.

References list_.

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

bool prophet::Controller::find ( const Link link,
List::iterator &  i 
) [protected]

Search for Encounter based on Link properties.

Definition at line 74 of file Controller.cc.

References list_.

Referenced by handle_bundle_received(), neighbor_gone(), and new_neighbor().

void prophet::Controller::handle_bundle_received ( const Bundle b,
const Link link 
)
void prophet::Controller::handle_bundle_transmitted ( const Bundle b,
const Link link 
)
void prophet::Controller::handle_timeout (  )  [virtual]
bool prophet::Controller::is_prophet_control ( const Bundle b  )  const [protected]

Check Bundle destination for Prophet node endpoint ID.

Definition at line 88 of file Controller.cc.

References prophet::Bundle::destination_id().

Referenced by ack(), handle_bundle_received(), and handle_bundle_transmitted().

void prophet::Controller::neighbor_gone ( const Link link  ) 

Signal Prophet that contact with neighbor is lost.

Definition at line 135 of file Controller.cc.

References find(), list_, LOG, and prophet::Link::remote_eid().

Referenced by dtn::ProphetRouter::handle_contact_down().

void prophet::Controller::new_neighbor ( const Link link  ) 

Signal Prophet that a new neighbor has been discovered.

Definition at line 98 of file Controller.cc.

References find(), list_, prophet::Encounter::local_instance(), LOG, prophet::Encounter::neighbor_gone(), NEXT_INSTANCE, and prophet::Link::remote_eid().

Referenced by dtn::ProphetRouter::handle_contact_up().

Table* prophet::Controller::nodes (  )  [inline, virtual]

virtual from Oracle

Implements prophet::Oracle.

Definition at line 105 of file Controller.h.

References nodes_.

Referenced by dtn::ProphetRouter::get_routing_state(), and dtn::ProphetRouter::initialize().

const ProphetParams* prophet::Controller::params (  )  const [inline, virtual]

virtual from Oracle

Implements prophet::Oracle.

Definition at line 103 of file Controller.h.

References params_.

void prophet::Controller::set_hello_interval (  ) 

Set Hello interval (longest acceptable delay in peering; query params_ for change).

Definition at line 298 of file Controller.cc.

References prophet::ProphetParams::hello_interval_, list_, LOG, params_, and timeout_.

Referenced by dtn::ProphetRouter::set_hello_interval().

void prophet::Controller::set_max_route (  ) 
void prophet::Controller::set_queue_policy (  ) 
void prophet::Controller::shutdown (  ) 

Callback for host system to notify of shutdown event.

Definition at line 351 of file Controller.cc.

References alarm_, prophet::Alarm::cancel(), list_, LOG, and prophet::Alarm::pending().

Referenced by dtn::ProphetRouter::shutdown().

size_t prophet::Controller::size (  )  [inline]

Accessors.

Definition at line 116 of file Controller.h.

References list_.

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

Stats* prophet::Controller::stats (  )  [inline, virtual]

virtual from Oracle

Implements prophet::Oracle.

Definition at line 104 of file Controller.h.

References stats_.

Referenced by dtn::ProphetRouter::handle_bundle_expired().


Member Data Documentation

Prophet ack's for successfully delivered bundles.

Definition at line 142 of file Controller.h.

Referenced by acks(), and handle_timeout().

timeout handler for aging Nodes and Acks

Definition at line 145 of file Controller.h.

Referenced by Controller(), handle_timeout(), and shutdown().

facade interface for interacting with Bundle host

Definition at line 137 of file Controller.h.

Referenced by accept_bundle(), Controller(), core(), handle_bundle_received(), and handle_timeout().

upper limit to number of routes retained by Prophet

Definition at line 140 of file Controller.h.

Referenced by Controller(), and set_max_route().

u_int16_t prophet::Controller::next_instance_ [protected]

used to generate serial number for Encounters

Definition at line 143 of file Controller.h.

table of routes learned by local node

Definition at line 141 of file Controller.h.

Referenced by Controller(), handle_bundle_transmitted(), handle_timeout(), nodes(), set_max_route(), and set_queue_policy().

tuneable parameter struct

Definition at line 138 of file Controller.h.

Referenced by accept_bundle(), Controller(), handle_timeout(), params(), set_hello_interval(), set_max_route(), and set_queue_policy().

Prophet's queue policy enforcement.

Definition at line 148 of file Controller.h.

Referenced by Controller(), handle_bundle_transmitted(), and set_queue_policy().

forwarding statistics per bundle, used by queue policy

Definition at line 139 of file Controller.h.

Referenced by Controller(), handle_bundle_transmitted(), set_queue_policy(), and stats().

u_int prophet::Controller::timeout_ [protected]

protocol timeout value (mirrors params_->hello_interval_)

Definition at line 146 of file Controller.h.

Referenced by Controller(), handle_timeout(), and set_hello_interval().


The documentation for this class was generated from the following files:
Generated on Sun Nov 21 11:41:15 2010 for DTN Reference Implementation by  doxygen 1.6.3