#include <mobileforwarding/Protocol.h>


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::Link * | getLink (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) | |||
| ||||
Protected Member Functions | ||||
| Mobility::MobileNode * | node () | |||
| Non-const accessor for the internally stored mobile node. | ||||
| const Mobility::MobileNode * | node () const | |||
| Const accessor for the internally stored mobile node. | ||||
| DTN::Link * | link () | |||
| Non-const accessor for the internally stored link. | ||||
| const DTN::Link * | link () const | |||
| Const accessor for the internally stored link. | ||||
| struct timeval & | lifetime () const | |||
| Const accessor for the default bundle lifetime. | ||||
The derived class will need to implement:
The derived class might override:
Definition at line 70 of file Protocol.h.
| Protocol::Protocol | ( | Mobility::MobileNode * | n, | |
| DTN::Link * | l, | |||
| const struct timeval & | t | |||
| ) |
Constructor.
| 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.
| 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.
| 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.
| addr | The address of a bundle receiver |
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.
| 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 | ) |
| addr | The address of a node |
Definition at line 79 of file Protocol.cc.
References Mobility::MobileNode::visible().
Referenced by MobileForwarding::Forwarding::forward(), and MobileForwarding::Forwarding::forwardOn().
1.5.4