| #ifndef NLSR_HPP |
| #define NLSR_HPP |
| |
| #include <ndn-cpp-dev/face.hpp> |
| #include <ndn-cpp-dev/security/key-chain.hpp> |
| #include <ndn-cpp-dev/util/scheduler.hpp> |
| |
| #include "nlsr_conf_param.hpp" |
| #include "nlsr_adl.hpp" |
| #include "nlsr_npl.hpp" |
| #include "communication/nlsr_im.hpp" |
| #include "communication/nlsr_dm.hpp" |
| #include "nlsr_lsdb.hpp" |
| #include "nlsr_sm.hpp" |
| #include "route/nlsr_rt.hpp" |
| #include "route/nlsr_npt.hpp" |
| #include "route/nlsr_fib.hpp" |
| #include "utility/nlsr_logger.hpp" |
| #include "security/nlsr_km.hpp" |
| #include "communication/nlsr_slh.hpp" |
| |
| |
| namespace nlsr |
| { |
| |
| using namespace ndn; |
| using namespace std; |
| |
| class Nlsr |
| { |
| public: |
| Nlsr() |
| : io(ndn::make_shared<boost::asio::io_service>()) |
| , nlsrFace(make_shared<ndn::Face>(io)) |
| , scheduler(*io) |
| , confParam() |
| , adl() |
| , npl() |
| , im() |
| , dm() |
| , sm() |
| , km() |
| , isDaemonProcess(false) |
| , configFileName("nlsr.conf") |
| , nlsrLsdb() |
| , adjBuildCount(0) |
| , isBuildAdjLsaSheduled(0) |
| , isRouteCalculationScheduled(0) |
| , isRoutingTableCalculating(0) |
| , routingTable() |
| , npt() |
| , fib() |
| , slh(io) |
| , nlsrLogger() |
| {} |
| |
| void nlsrRegistrationFailed(const ndn::Name& name); |
| |
| void setInterestFilterNlsr(const string& name); |
| void startEventLoop(); |
| |
| int usage(const string& progname); |
| |
| string getConfFileName() |
| { |
| return configFileName; |
| } |
| |
| void setConfFileName(const string& fileName) |
| { |
| configFileName=fileName; |
| } |
| |
| bool isSetDaemonProcess() |
| { |
| return isDaemonProcess; |
| } |
| |
| void setIsDaemonProcess(bool value) |
| { |
| isDaemonProcess=value; |
| } |
| |
| ConfParameter& getConfParameter() |
| { |
| return confParam; |
| } |
| |
| Adl& getAdl() |
| { |
| return adl; |
| } |
| |
| Npl& getNpl() |
| { |
| return npl; |
| } |
| |
| ndn::shared_ptr<boost::asio::io_service>& getIo() |
| { |
| return io; |
| } |
| |
| ndn::Scheduler& getScheduler() |
| { |
| return scheduler; |
| } |
| |
| ndn::shared_ptr<ndn::Face> getNlsrFace() |
| { |
| return nlsrFace; |
| } |
| |
| KeyManager& getKeyManager() |
| { |
| return km; |
| } |
| |
| |
| interestManager& getIm() |
| { |
| return im; |
| } |
| |
| DataManager& getDm() |
| { |
| return dm; |
| } |
| |
| SequencingManager& getSm() |
| { |
| return sm; |
| } |
| |
| Lsdb& getLsdb() |
| { |
| return nlsrLsdb; |
| } |
| |
| RoutingTable& getRoutingTable() |
| { |
| return routingTable; |
| } |
| |
| Npt& getNpt() |
| { |
| return npt; |
| } |
| |
| Fib& getFib() |
| { |
| return fib; |
| } |
| |
| long int getAdjBuildCount() |
| { |
| return adjBuildCount; |
| } |
| |
| void incrementAdjBuildCount() |
| { |
| adjBuildCount++; |
| } |
| |
| void setAdjBuildCount(long int abc) |
| { |
| adjBuildCount=abc; |
| } |
| |
| int getIsBuildAdjLsaSheduled() |
| { |
| return isBuildAdjLsaSheduled; |
| } |
| |
| void setIsBuildAdjLsaSheduled(int iabls) |
| { |
| isBuildAdjLsaSheduled=iabls; |
| } |
| |
| |
| void setApiPort(int ap) |
| { |
| apiPort=ap; |
| } |
| |
| int getApiPort() |
| { |
| return apiPort; |
| } |
| |
| int getIsRoutingTableCalculating() |
| { |
| return isRoutingTableCalculating; |
| } |
| |
| void setIsRoutingTableCalculating(int irtc) |
| { |
| isRoutingTableCalculating=irtc; |
| } |
| |
| int getIsRouteCalculationScheduled() |
| { |
| return isRouteCalculationScheduled; |
| } |
| |
| void setIsRouteCalculationScheduled(int ircs) |
| { |
| isRouteCalculationScheduled=ircs; |
| } |
| |
| SyncLogicHandler& getSlh() |
| { |
| return slh; |
| } |
| |
| NlsrLogger& getNlsrLogger() |
| { |
| return nlsrLogger; |
| } |
| |
| void initNlsr(); |
| |
| private: |
| ConfParameter confParam; |
| Adl adl; |
| Npl npl; |
| ndn::shared_ptr<boost::asio::io_service> io; |
| ndn::Scheduler scheduler; |
| ndn::shared_ptr<ndn::Face> nlsrFace; |
| interestManager im; |
| DataManager dm; |
| SequencingManager sm; |
| KeyManager km; |
| bool isDaemonProcess; |
| string configFileName; |
| int apiPort; |
| |
| Lsdb nlsrLsdb; |
| RoutingTable routingTable; |
| Npt npt; |
| Fib fib; |
| SyncLogicHandler slh; |
| NlsrLogger nlsrLogger; |
| |
| long int adjBuildCount; |
| int isBuildAdjLsaSheduled; |
| int isRouteCalculationScheduled; |
| int isRoutingTableCalculating; |
| |
| |
| |
| }; |
| |
| } //namespace nlsr |
| |
| #endif |