00001 #ifndef LOWPANCONVERGENCELAYER_H_ 00002 #define LOWPANCONVERGENCELAYER_H_ 00003 00004 #include "Component.h" 00005 #include "net/ConvergenceLayer.h" 00006 #include "ibrcommon/Exceptions.h" 00007 #include "net/DiscoveryServiceProvider.h" 00008 #include "ibrcommon/net/NetInterface.h" 00009 #include "ibrcommon/net/lowpansocket.h" 00010 00011 using namespace dtn::data; 00012 00013 namespace dtn 00014 { 00015 namespace net 00016 { 00020 class LOWPANConvergenceLayer : public ConvergenceLayer, public dtn::daemon::IndependentComponent, public DiscoveryServiceProvider 00021 { 00022 public: 00023 LOWPANConvergenceLayer(ibrcommon::NetInterface net, int panid, bool broadcast = false, unsigned int mtu = 127); 00024 00025 virtual ~LOWPANConvergenceLayer(); 00026 00027 virtual void update(std::string &name, std::string &data); 00028 virtual bool onInterface(const ibrcommon::NetInterface &net) const; 00029 00030 dtn::core::Node::Protocol getDiscoveryProtocol() const; 00031 00032 void queue(const dtn::core::Node &n, const ConvergenceLayer::Job &job); 00033 00034 LOWPANConvergenceLayer& operator>>(dtn::data::Bundle&); 00035 00036 protected: 00037 virtual void componentUp(); 00038 virtual void componentRun(); 00039 virtual void componentDown(); 00040 00041 private: 00042 ibrcommon::lowpansocket *_socket; 00043 00044 ibrcommon::NetInterface _net; 00045 int _panid; 00046 int m_socket; 00047 00048 static const int DEFAULT_PANID; 00049 00050 unsigned int m_maxmsgsize; 00051 00052 ibrcommon::Mutex m_writelock; 00053 ibrcommon::Mutex m_readlock; 00054 00055 bool _running; 00056 }; 00057 } 00058 } 00059 #endif /*LOWPANCONVERGENCELAYER_H_*/
1.6.3