BasicEpidemic::EpidemicApp Class Reference
[pydtn.mobility.basicepidemic]

Application to handle epidemic forwarding control messages. More...

#include <basicepidemic/EpidemicApp.h>

Inheritance diagram for BasicEpidemic::EpidemicApp:

Inheritance graph
[legend]
Collaboration diagram for BasicEpidemic::EpidemicApp:

Collaboration graph
[legend]

List of all members.

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::LinkgetLink (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.


Detailed Description

Application to handle epidemic forwarding control messages.

Definition at line 50 of file EpidemicApp.h.


Constructor & Destructor Documentation

EpidemicApp::EpidemicApp ( Mobility::MobileNode n,
DTN::Link l,
const struct timeval &  t 
)

Constructor.

Parameters:
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.


Member Function Documentation

void EpidemicApp::newNeighbor ( const DTN::ByteString &  addr  )  [virtual]

Notify the application of a new neighbor.

Parameters:
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.

Parameters:
addr The address of a bundle receiver
Returns:
a pointer to the stored Mobility::MockLink, or 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.

Parameters:
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().


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