ndn::autoconfig::GuessFromSearchDomains Class Reference

Guessing home router based on DNS query with default suffix. More...

#include <tools/ndn-autoconfig/guess-from-search-domains.hpp>

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

Public Member Functions

const std::string & getName () const override
 Get stage name. More...
 
void start ()
 Start running this stage. More...
 

Public Attributes

util::Signal< Stage, std::string > onFailure
 Signal when discovery fails. More...
 
util::Signal< Stage, FaceUri > onSuccess
 Signal 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

Guessing home router based on DNS query with default suffix.

  • Request

    The end host sends a DNS query that is equivalent to this command:

    dig +search +short +cmd +tries=2 +ndots=10 _ndn._udp srv
    
  • Response

    The DNS server should answer with an SRV record that contains the hostname and UDP port number of the NDN router.

Definition at line 47 of file guess-from-search-domains.hpp.

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::GuessFromSearchDomains::getName ( ) const
inlineoverridevirtual

Get stage name.

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

Implements ndn::autoconfig::Stage.

Definition at line 51 of file guess-from-search-domains.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

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

Signal when discovery fails.

Argument is error message.

Definition at line 89 of file stage.hpp.

◆ onSuccess

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

Signal when a HUB FaceUri is found.

Argument is HUB FaceUri, may not be canonical.

Definition at line 83 of file stage.hpp.