blob: 495bf84b8d1eeb27ff5890e7babc88544bf2a0ff [file] [log] [blame]
akmhoque87347a32014-01-31 11:00:44 -06001#ifndef NLSR_HPP
2#define NLSR_HPP
3
4#include <ndn-cpp-dev/face.hpp>
5#include <ndn-cpp-dev/security/key-chain.hpp>
6#include <ndn-cpp-dev/util/scheduler.hpp>
7
8#include "conf_param.hpp"
9#include "adl.hpp"
10#include "npl.hpp"
akmhoque147f4992014-01-31 15:52:49 -060011#include "nlsr_im.hpp"
12#include "nlsr_dm.hpp"
akmhoque87347a32014-01-31 11:00:44 -060013
14
15using namespace ndn;
16using namespace std;
17
18class nlsr
19{
akmhoque147f4992014-01-31 15:52:49 -060020public:
akmhoque87347a32014-01-31 11:00:44 -060021 nlsr()
22 : io(ndn::make_shared<boost::asio::io_service>())
akmhoque147f4992014-01-31 15:52:49 -060023 , nlsrFace(io)
akmhoque87347a32014-01-31 11:00:44 -060024 , scheduler(*io)
25 , configFileName()
26 , confParam()
27 , adl()
28 , npl()
akmhoque147f4992014-01-31 15:52:49 -060029 , im()
30 , dm()
akmhoque87347a32014-01-31 11:00:44 -060031 {
32 isDaemonProcess=false;
33 configFileName="nlsr.conf";
34 }
35
akmhoque87347a32014-01-31 11:00:44 -060036 void nlsrRegistrationFailed(const ptr_lib::shared_ptr<const Name>&);
akmhoque87347a32014-01-31 11:00:44 -060037
38 void setInterestFilterNlsr(const string& name);
akmhoque87347a32014-01-31 11:00:44 -060039 void startEventLoop();
40
41 int usage(const string& progname);
42
akmhoque147f4992014-01-31 15:52:49 -060043 string getConfFileName()
44 {
akmhoque87347a32014-01-31 11:00:44 -060045 return configFileName;
46 }
47
akmhoque147f4992014-01-31 15:52:49 -060048 void setConfFileName(const string& fileName)
49 {
50 configFileName=fileName;
51 }
akmhoque87347a32014-01-31 11:00:44 -060052
akmhoque147f4992014-01-31 15:52:49 -060053 bool isSetDaemonProcess()
54 {
55 return isDaemonProcess;
56 }
akmhoque87347a32014-01-31 11:00:44 -060057
akmhoque147f4992014-01-31 15:52:49 -060058 void setIsDaemonProcess(bool value)
59 {
60 isDaemonProcess=value;
61 }
akmhoque87347a32014-01-31 11:00:44 -060062
63 ConfParameter confParam;
64 Adl adl;
65 Npl npl;
akmhoque87347a32014-01-31 11:00:44 -060066 ndn::shared_ptr<boost::asio::io_service> io;
67 ndn::Scheduler scheduler;
68 ndn::Face nlsrFace;
69 ndn::KeyChain kChain;
akmhoque147f4992014-01-31 15:52:49 -060070 interestManager im;
71 DataManager dm;
72
73private:
74
akmhoque87347a32014-01-31 11:00:44 -060075 bool isDaemonProcess;
76 string configFileName;
77
78};
79
80#endif