ndn::autoconfig::MulticastDiscovery Class Reference

Multicast discovery stage. More...

#include <tools/ndn-autoconfig/multicast-discovery.hpp>

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

Public Member Functions

 MulticastDiscovery (Face &face, nfd::Controller &controller)
 
const std::string & getName () const final
 Get stage name. More...
 
void start ()
 Start running this stage. More...
 

Public Attributes

signal::Signal< Stage, std::string > onFailure
 Signal emitted when discovery fails. More...
 
signal::Signal< Stage, FaceUri > onSuccess
 Signal emitted when a HUB FaceUri is found. More...
 

Protected Member Functions

void fail (const std::string &msg)
 
void provideHubFaceUri (const std::string &s)
 Parse HUB FaceUri from string and declare success. More...
 
void succeed (const FaceUri &hubFaceUri)
 

Detailed Description

Multicast discovery stage.

This stage locates an NDN gateway router, commonly known as a "hub", in the local network by sending a hub discovery Interest ndn:/localhop/ndn-autoconf/hub via multicast. This class configures routes and strategy on local NFD, so that this Interest is multicast to all multi-access faces.

If an NDN gateway router is present in the local network, it should reply with a Data containing its own FaceUri. The Data payload contains a Uri element, and the value of this element is an ASCII-encoded string of the router's FaceUri. The router may use ndn-autoconfig-server program to serve this Data.

Signature on this Data is currently not verified. This stage succeeds when the Data is successfully decoded.

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

Constructor & Destructor Documentation

◆ MulticastDiscovery()

ndn::autoconfig::MulticastDiscovery::MulticastDiscovery ( Face &  face,
nfd::Controller &  controller 
)

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

Member Function Documentation

◆ fail()

void ndn::autoconfig::Stage::fail ( const std::string &  msg)
protectedinherited

Definition at line 63 of file stage.cpp.

◆ getName()

const std::string& ndn::autoconfig::MulticastDiscovery::getName ( ) const
inlinefinalvirtual

Get stage name.

Returns
stage name as a phrase, typically starting with lower case

Implements ndn::autoconfig::Stage.

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

◆ provideHubFaceUri()

void ndn::autoconfig::Stage::provideHubFaceUri ( const std::string &  s)
protectedinherited

Parse HUB FaceUri from string and declare success.

Definition at line 43 of file stage.cpp.

◆ start()

void ndn::autoconfig::Stage::start ( )
inherited

Start running this stage.

Exceptions
Errorstage is already running

Definition at line 31 of file stage.cpp.

◆ succeed()

void ndn::autoconfig::Stage::succeed ( const FaceUri &  hubFaceUri)
protectedinherited

Definition at line 55 of file stage.cpp.

Member Data Documentation

◆ onFailure

signal::Signal<Stage, std::string> ndn::autoconfig::Stage::onFailure
inherited

Signal emitted when discovery fails.

Argument is error message.

Definition at line 92 of file stage.hpp.

◆ onSuccess

signal::Signal<Stage, FaceUri> ndn::autoconfig::Stage::onSuccess
inherited

Signal emitted when a HUB FaceUri is found.

Argument is HUB FaceUri, may not be canonical.

Definition at line 85 of file stage.hpp.