00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef __MOBILE_FORWARDING_PROTOCOL_H__
00032 #define __MOBILE_FORWARDING_PROTOCOL_H__
00033
00034 #include "config.h"
00035
00036 #include "mobility/MobileApp.h"
00037 #include "mobility/MobileNode.h"
00038 #include "mobility/MockLink.h"
00039
00040 #include <map>
00041
00042 namespace MobileForwarding
00043 {
00057
00070 class Protocol : public Mobility::MobileApp
00071 {
00072 public :
00077 Protocol( Mobility::MobileNode* n,
00078 DTN::Link* l,
00079 const struct timeval& t );
00080
00082 virtual ~Protocol();
00083
00084 void setOwner( DTN::Node* owner );
00085
00089 virtual DTN::Link* getLink( const DTN::ByteString& addr ) = 0;
00090
00095 virtual void tweak( DTN::Bundle* b );
00096
00099 bool visible( const DTN::ByteString& addr );
00100
00101 protected :
00103 Mobility::MobileNode* node() { return m_node; }
00105 const Mobility::MobileNode* node() const { return m_node; }
00107 DTN::Link* link() { return m_link; }
00109 const DTN::Link* link() const { return m_link; }
00111 const struct timeval& lifetime() const { return m_lifetime; }
00112
00113 private :
00114 Mobility::MobileNode* m_node;
00115 DTN::Link* m_link;
00116 struct timeval m_lifetime;
00117 };
00118
00120 }
00121
00122 #endif // __MOBILE_FORWARDING_PROTOCOL_H__