multicast-discovery.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_TOOLS_NDN_AUTOCONFIG_MULTICAST_DISCOVERY_HPP
27 #define NFD_TOOLS_NDN_AUTOCONFIG_MULTICAST_DISCOVERY_HPP
28 
29 #include "base.hpp"
30 
31 namespace ndn {
32 namespace tools {
33 namespace autoconfig {
34 
50 class MulticastDiscovery : public Base
51 {
52 public:
57  MulticastDiscovery(Face& face, KeyChain& keyChain, const NextStageCallback& nextStageOnFailure);
58 
59  void
60  start() override;
61 
62 private:
63  void
64  collectMulticastFaces();
65 
66  void
67  registerHubDiscoveryPrefix(const std::vector<ndn::nfd::FaceStatus>& dataset);
68 
69  void
70  onRegisterSuccess();
71 
72  void
73  onRegisterFailure(const ControlResponse& response);
74 
75  void
76  setStrategy();
77 
78  void
79  onSetStrategyFailure(const ControlResponse& response);
80 
81  // Start to look for a hub (NDN hub discovery first stage)
82  void
83  requestHubData();
84 
85  void
86  onSuccess(const Data& data);
87 
88 private:
89  size_t m_nRequestedRegs;
90  size_t m_nFinishedRegs;
91 };
92 
93 } // namespace autoconfig
94 } // namespace tools
95 } // namespace ndn
96 
97 #endif // NFD_TOOLS_NDN_AUTOCONFIG_MULTICAST_DISCOVERY_HPP
Copyright (c) 2014-2016, Regents of the University of California, Arizona Board of Regents...
Definition: nfd.hpp:35
void start() override
Start the stage.
std::function< void(const std::string &)> NextStageCallback
Callback to be called when the stage fails.
Definition: base.hpp:64
Base class for discovery stages.
Definition: base.hpp:48
MulticastDiscovery(Face &face, KeyChain &keyChain, const NextStageCallback &nextStageOnFailure)
Create multicast discovery stage.