IBR-DTNSuite
0.8
|
00001 /* 00002 * EpidemicRoutingExtension.h 00003 * 00004 * Created on: 18.02.2010 00005 * Author: morgenro 00006 */ 00007 00008 #ifndef EPIDEMICROUTINGEXTENSION_H_ 00009 #define EPIDEMICROUTINGEXTENSION_H_ 00010 00011 #include "core/Node.h" 00012 #include "core/AbstractWorker.h" 00013 00014 #include "routing/SummaryVector.h" 00015 #include "routing/BaseRouter.h" 00016 #include "routing/NeighborDatabase.h" 00017 00018 #include <ibrdtn/data/Block.h> 00019 #include <ibrdtn/data/SDNV.h> 00020 #include <ibrdtn/data/BundleString.h> 00021 #include <ibrdtn/data/ExtensionBlock.h> 00022 00023 #include <ibrcommon/thread/Queue.h> 00024 00025 #include <list> 00026 #include <queue> 00027 00028 namespace dtn 00029 { 00030 namespace routing 00031 { 00032 class EpidemicRoutingExtension : public BaseRouter::ThreadedExtension 00033 { 00034 public: 00035 EpidemicRoutingExtension(); 00036 virtual ~EpidemicRoutingExtension(); 00037 00038 void notify(const dtn::core::Event *evt); 00039 00043 virtual void requestHandshake(const dtn::data::EID&, NodeHandshake&) const; 00044 00045 protected: 00046 void run(); 00047 void __cancellation(); 00048 00049 private: 00050 class Task 00051 { 00052 public: 00053 virtual ~Task() {}; 00054 virtual std::string toString() = 0; 00055 }; 00056 00057 class SearchNextBundleTask : public Task 00058 { 00059 public: 00060 SearchNextBundleTask(const dtn::data::EID &eid); 00061 virtual ~SearchNextBundleTask(); 00062 00063 virtual std::string toString(); 00064 00065 const dtn::data::EID eid; 00066 }; 00067 00071 ibrcommon::Queue<EpidemicRoutingExtension::Task* > _taskqueue; 00072 }; 00073 } 00074 } 00075 00076 #endif /* EPIDEMICROUTINGEXTENSION_H_ */