ndn::tools::autoconfig::MulticastDiscovery Class Reference

Multicast discovery stage. More...

#include <multicast-discovery.hpp>

Inheritance diagram for ndn::tools::autoconfig::MulticastDiscovery:
Collaboration diagram for ndn::tools::autoconfig::MulticastDiscovery:

Public Types

typedef std::function< void(const std::string &)> NextStageCallback
 Callback to be called when the stage fails. More...
 

Public Member Functions

 MulticastDiscovery (Face &face, KeyChain &keyChain, const NextStageCallback &nextStageOnFailure)
 Create multicast discovery stage. More...
 
void start () override
 Start the stage. More...
 

Protected Member Functions

void connectToHub (const std::string &uri)
 Attempt to connect to local hub using the uri FaceUri. More...
 

Protected Attributes

Face & m_face
 
KeyChain & m_keyChain
 
ndn::nfd::Controller m_controller
 
NextStageCallback m_nextStageOnFailure
 

Detailed Description

Multicast discovery stage.

  • Request

    The end host sends an Interest over a multicast face.

    Interest Name is /localhop/ndn-autoconf/hub.

  • Response

    A producer app on the HUB answer this Interest with a Data packet that contains a TLV-encoded Uri block. The value of this block is the URI for the HUB, preferably a UDP tunnel.

Definition at line 50 of file multicast-discovery.hpp.

Member Typedef Documentation

typedef std::function<void(const std::string&)> ndn::tools::autoconfig::Base::NextStageCallback
inherited

Callback to be called when the stage fails.

Definition at line 64 of file base.hpp.

Constructor & Destructor Documentation

ndn::tools::autoconfig::MulticastDiscovery::MulticastDiscovery ( Face &  face,
KeyChain &  keyChain,
const NextStageCallback nextStageOnFailure 
)

Create multicast discovery stage.

See also
Base::Base

Definition at line 34 of file multicast-discovery.cpp.

Member Function Documentation

void ndn::tools::autoconfig::Base::connectToHub ( const std::string &  uri)
protectedinherited

Attempt to connect to local hub using the uri FaceUri.

Exceptions
Base::Errorwhen failed to establish the tunnel

Definition at line 41 of file base.cpp.

void ndn::tools::autoconfig::MulticastDiscovery::start ( )
overridevirtual

Start the stage.

Implements ndn::tools::autoconfig::Base.

Definition at line 43 of file multicast-discovery.cpp.

Member Data Documentation

ndn::nfd::Controller ndn::tools::autoconfig::Base::m_controller
protectedinherited

Definition at line 113 of file base.hpp.

Face& ndn::tools::autoconfig::Base::m_face
protectedinherited

Definition at line 111 of file base.hpp.

KeyChain& ndn::tools::autoconfig::Base::m_keyChain
protectedinherited

Definition at line 112 of file base.hpp.

NextStageCallback ndn::tools::autoconfig::Base::m_nextStageOnFailure
protectedinherited

Definition at line 114 of file base.hpp.