ndn::autoconfig::GuessFromIdentityName Class Reference

Guessing home router based on the default identity name. More...

#include <tools/ndn-autoconfig/guess-from-identity-name.hpp>

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

Public Member Functions

 GuessFromIdentityName (KeyChain &keyChain)
 
const std::string & getName () const override
 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

Guessing home router based on the default identity name.

This stage assumes that user has configured default certificate using http://ndncert.named-data.net/

  • Request

    The end host loads the default user identity (eg. /ndn/edu/ucla/cs/afanasev), and converts it to DNS format.

    The end host sends a DNS query for an SRV record of name _ndn._udp. + user identity in DNS format + _homehub._auto-conf.named-data.net. For example:

    _ndn._udp.afanasev.cs.ucla.edu.ndn._homehub._autoconf.named-data.net
    
  • Response

    The DNS server should answer with an SRV record that contains the hostname and UDP port number of the home NDN router of this user's site.

Definition at line 55 of file guess-from-identity-name.hpp.

Constructor & Destructor Documentation

◆ GuessFromIdentityName()

ndn::autoconfig::GuessFromIdentityName::GuessFromIdentityName ( KeyChain &  keyChain)
explicit

Definition at line 36 of file guess-from-identity-name.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::GuessFromIdentityName::getName ( ) const
inlineoverridevirtual

Get stage name.

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

Implements ndn::autoconfig::Stage.

Definition at line 62 of file guess-from-identity-name.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.