MobileForwarding::Protocol Class Reference
[libmobileforwarding]

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

#include <mobileforwarding/Protocol.h>

Inheritance diagram for MobileForwarding::Protocol:

Inheritance graph
[legend]
Collaboration diagram for MobileForwarding::Protocol:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Protocol (Mobility::MobileNode *n, DTN::Link *l, const struct timeval &t)
 Constructor.
virtual ~Protocol ()
 Virtual destructor.
void setOwner (DTN::Node *owner)
 Set the owner node.
virtual DTN::LinkgetLink (const DTN::ByteString &addr)=0
 Get the mock link for an address.
virtual void tweak (DTN::Bundle *b)
 Modify a bundle, if necessary.
bool visible (const DTN::ByteString &addr)
 
Parameters:
addr The address of a node


Protected Member Functions

Mobility::MobileNodenode ()
 Non-const accessor for the internally stored mobile node.
const Mobility::MobileNodenode () const
 Const accessor for the internally stored mobile node.
DTN::Linklink ()
 Non-const accessor for the internally stored link.
const DTN::Linklink () const
 Const accessor for the internally stored link.
struct timeval & lifetime () const
 Const accessor for the default bundle lifetime.


Detailed Description

Application skeleton to handle forwarding control messages.

The derived class will need to implement:

The derived class might override:

Definition at line 70 of file Protocol.h.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
n The mobile node running this protocol instance
l The physical link through which bundles are sent
t The lifetime for a bundle

Definition at line 39 of file Protocol.cc.


Member Function Documentation

void Protocol::setOwner ( DTN::Node owner  )  [virtual]

Set the owner node.

Because we don't necessarily have a handle for the node, we allow consumers to set this later.

Parameters:
owner The consumer's owner node.

Reimplemented from DTN::Consumer.

Definition at line 54 of file Protocol.cc.

References DTN::Node::setForwardingPolicy().

virtual DTN::Link* MobileForwarding::Protocol::getLink ( const DTN::ByteString &  addr  )  [pure virtual]

Get the mock link for an address.

Parameters:
addr The address of a bundle receiver
Returns:
a pointer to a DTN::Link, or NULL

Implemented in BasicEpidemic::EpidemicApp.

Referenced by MobileForwarding::Forwarding::forward(), and MobileForwarding::Forwarding::forwardOn().

void Protocol::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 in BasicEpidemic::EpidemicApp.

Definition at line 74 of file Protocol.cc.

Referenced by MobileForwarding::Forwarding::forward().

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

Parameters:
addr The address of a node

Returns:
whether we can currently see this node

Definition at line 79 of file Protocol.cc.

References Mobility::MobileNode::visible().

Referenced by MobileForwarding::Forwarding::forward(), and MobileForwarding::Forwarding::forwardOn().


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