Mobility::BeaconConsumer Class Reference
[pydtn.mobility]

Listen to traffic to determine the network neighborhood. More...

#include <mobility/BeaconConsumer.h>

Inheritance diagram for Mobility::BeaconConsumer:

Inheritance graph
[legend]
Collaboration diagram for Mobility::BeaconConsumer:

Collaboration graph
[legend]

List of all members.

Public Types

typedef std::map
< DTN::ByteString, Time
NodeMap
 Mapping from node addresses to their last-seen beacons.

Public Member Functions

 BeaconConsumer (MobileNode *owner)
 Constructor.
virtual ~BeaconConsumer ()
 Virtual destructor.
void operator() (const DTN::Bundle &b)
 Functional method.
void send (const DTN::Bundle &b)
 Recording method for sending a Bundle.
void recv (const DTN::Bundle &b)
 Recording method for receiving a Bundle.
const TimelastSend () const
 
Returns:
the time of the last existential message

const Timetimeout () const
 
Returns:
the time after which a silent node is assumed gone

void setTimeout (const Time &t)
 Set the timeout period from when a beacon was last seen to when a node is presumed to have departed.
void clean ()
 Remove neighbors from the visible set if they've timed out.
bool visible (const DTN::ByteString &addr)
 Check if a node is currently visible.
InterpreterItem visible_list ()
 Get the list of nodes that this node thinks are in range.


Detailed Description

Listen to traffic to determine the network neighborhood.

This is a special DTN::Consumer for MobileNodes that monitors all traffic so that it can detect what nodes are sending currently-visible bundles. This is used for passive or active existential beacons.

Definition at line 55 of file BeaconConsumer.h.


Constructor & Destructor Documentation

BeaconConsumer::BeaconConsumer ( MobileNode owner  ) 

Constructor.

Parameters:
owner The mobile node to which this consumer is attached.

Definition at line 41 of file BeaconConsumer.cc.


Member Function Documentation

void BeaconConsumer::operator() ( const DTN::Bundle b  )  [virtual]

Functional method.

This does the actual data processing, and must be defined by a concrete subclass.

Parameters:
b A bundle to process

Implements DTN::Consumer.

Definition at line 52 of file BeaconConsumer.cc.

void BeaconConsumer::send ( const DTN::Bundle b  )  [virtual]

Recording method for sending a Bundle.

Parameters:
b A bundle being sent

Reimplemented from DTN::Consumer.

Definition at line 59 of file BeaconConsumer.cc.

References DTN::Bundle::kBcast, Clock::time(), and DTN::Bundle::type().

void BeaconConsumer::recv ( const DTN::Bundle b  )  [virtual]

Recording method for receiving a Bundle.

Parameters:
b A bundle being received

Reimplemented from DTN::Consumer.

Definition at line 68 of file BeaconConsumer.cc.

References Mobility::MobileNode::notifyApps(), DTN::Bundle::send(), and Clock::time().

void BeaconConsumer::setTimeout ( const Time t  ) 

Set the timeout period from when a beacon was last seen to when a node is presumed to have departed.

Parameters:
t The beacon timeout

Definition at line 80 of file BeaconConsumer.cc.

Referenced by Mobility::MobileNode::configure().

bool BeaconConsumer::visible ( const DTN::ByteString &  addr  ) 

Check if a node is currently visible.

Parameters:
addr The address of a node
Returns:
true if the node is visible

Definition at line 112 of file BeaconConsumer.cc.

References Clock::time().

Referenced by Mobility::MobileNode::visible().

InterpreterItem BeaconConsumer::visible_list (  ) 

Get the list of nodes that this node thinks are in range.

Returns:
a list of node addresses

Definition at line 128 of file BeaconConsumer.cc.

References clean(), and construct_list().

Referenced by Mobility::MobileNode::get().


The documentation for this class was generated from the following files:
Generated on Mon Mar 24 11:15:49 2008 for Pydtn Simulator by  doxygen 1.5.4