#include <mobility/BeaconConsumer.h>
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 Time & | lastSend () const |
| |
| const Time & | timeout () const |
| |
| 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. | |
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.
| BeaconConsumer::BeaconConsumer | ( | MobileNode * | owner | ) |
Constructor.
| owner | The mobile node to which this consumer is attached. |
Definition at line 41 of file BeaconConsumer.cc.
| void BeaconConsumer::operator() | ( | const DTN::Bundle & | b | ) | [virtual] |
Functional method.
This does the actual data processing, and must be defined by a concrete subclass.
| 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.
| 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.
| 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.
| 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.
| addr | The address of a node |
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.
Definition at line 128 of file BeaconConsumer.cc.
References clean(), and construct_list().
Referenced by Mobility::MobileNode::get().
1.5.4