#include <basicepidemic/EpidemicApp.h>


Public Types | |
|
typedef std::list < DTN::ByteString > | DigestList |
| A simple type for lists of digests. | |
|
typedef std::map < DTN::ByteString, Mobility::MockLink * > | LinkMap |
| Type for mapping addresses to mock links. | |
Public Member Functions | |
| EpidemicApp (Mobility::MobileNode *n, DTN::Link *l, const struct timeval &t) | |
| Constructor. | |
| virtual | ~EpidemicApp () |
| Virtual destructor. | |
| void | newNeighbor (const DTN::ByteString &addr) |
| Notify the application of a new neighbor. | |
| DTN::Link * | getLink (const DTN::ByteString &addr) |
| Get the mock link for an address. | |
| void | tweak (DTN::Bundle *b) |
| Modify a bundle, if necessary. | |
Static Public Attributes | |
| static DTN::ByteString | kIdentifier |
| The unique identifier for this application. | |
| static unsigned char | kSummaryVector = 0 |
| One-byte message type for sending a summary vector. | |
| static unsigned char | kDataRequest = 1 |
| One-byte message type for sending a data request. | |
Protected Member Functions | |
| const DTN::ByteString & | appID () const |
| Application identifier for Bundles. | |
| void | process (const DTN::Bundle &b) |
| Call the application on a received Bundle. | |
Definition at line 50 of file EpidemicApp.h.
| EpidemicApp::EpidemicApp | ( | Mobility::MobileNode * | n, | |
| DTN::Link * | l, | |||
| const struct timeval & | t | |||
| ) |
Constructor.
| n | The mobile node | |
| l | The physical link through which bundles are sent | |
| t | The lifetime for a bundle |
Definition at line 48 of file EpidemicApp.cc.
| void EpidemicApp::newNeighbor | ( | const DTN::ByteString & | addr | ) | [virtual] |
Notify the application of a new neighbor.
| addr | The address of the node that has just come into view |
Implements Mobility::MobileApp.
Definition at line 88 of file EpidemicApp.cc.
References appID(), DTN::BundlePointer::isNull(), DTN::Bundle::kData, kSummaryVector, MobileForwarding::Protocol::lifetime(), MobileForwarding::Protocol::link(), DTN::Consumer::m_owner, DTN::BundlePointer::next(), DTN::Bundle::recv(), stringify(), and verbosity().
| DTN::Link * EpidemicApp::getLink | ( | const DTN::ByteString & | addr | ) | [virtual] |
Get the mock link for an address.
| addr | The address of a bundle receiver |
NULL Implements MobileForwarding::Protocol.
Definition at line 281 of file EpidemicApp.cc.
| void EpidemicApp::tweak | ( | DTN::Bundle * | b | ) | [virtual] |
Modify a bundle, if necessary.
Some protocols might need to modify flags, or even annotate the bundle contents. The default behavior is to do nothing.
| b | The bundle being handled |
Reimplemented from MobileForwarding::Protocol.
Definition at line 290 of file EpidemicApp.cc.
References DTN::Bundle::kNoACK, and DTN::Bundle::type().
1.5.4