• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

daemon/src/net/IPNDAgent.h

Go to the documentation of this file.
00001 /*
00002  * IPNDAgent.h
00003  *
00004  *  Created on: 09.09.2009
00005  *      Author: morgenro
00006  *
00007  * IPND is based on the Internet-Draft for DTN-IPND.
00008  *
00009  * MUST support multicast
00010  * SHOULD support broadcast and unicast
00011  *
00012  *
00013  *
00014  */
00015 
00016 #ifndef IPNDAGENT_H_
00017 #define IPNDAGENT_H_
00018 
00019 #include "net/DiscoveryAgent.h"
00020 #include "net/DiscoveryAnnouncement.h"
00021 #include <ibrcommon/net/vinterface.h>
00022 #include <ibrcommon/net/udpsocket.h>
00023 #include <ibrcommon/net/vsocket.h>
00024 #include <ibrcommon/net/LinkManager.h>
00025 #include <list>
00026 #include <map>
00027 
00028 using namespace dtn::data;
00029 
00030 namespace dtn
00031 {
00032         namespace net
00033         {
00034                 class IPNDAgent : public DiscoveryAgent, public ibrcommon::LinkManager::EventCallback
00035                 {
00036                 public:
00037                         IPNDAgent(int port, const ibrcommon::vaddress &address);
00038                         virtual ~IPNDAgent();
00039 
00040                         void bind(const ibrcommon::vinterface &net);
00041 
00045                         virtual const std::string getName() const;
00046 
00047                         void eventNotify(const ibrcommon::LinkManagerEvent &evt);
00048 
00049                 protected:
00050                         void sendAnnoucement(const u_int16_t &sn, std::list<DiscoveryService> &services);
00051                         virtual void componentRun();
00052                         virtual void componentUp();
00053                         virtual void componentDown();
00054                         bool __cancellation();
00055 
00056                 private:
00057                         void __join_multicast_groups__(const ibrcommon::vinterface &iface);
00058                         void send(const DiscoveryAnnouncement &a, const ibrcommon::vinterface &iface, const ibrcommon::vaddress &addr, const unsigned int port);
00059 
00060                         DiscoveryAnnouncement::DiscoveryVersion _version;
00061                         ibrcommon::vsocket _socket;
00062                         ibrcommon::vaddress _destination;
00063                         std::list<ibrcommon::vinterface> _interfaces;
00064 
00065                         int _port;
00066                 };
00067         }
00068 }
00069 
00070 #endif /* IPNDAGENT_H_ */

Generated on Wed Mar 30 2011 11:11:49 for IBR-DTNSuite by  doxygen 1.7.1