Guessing home router based on the default identity name. More...
#include <guess-from-identity-name.hpp>
Public Types | |
typedef std::function< void(const std::string &)> | NextStageCallback |
Callback to be called when the stage fails. More... | |
Public Member Functions | |
GuessFromIdentityName (Face &face, KeyChain &keyChain, const NextStageCallback &nextStageOnFailure) | |
Create stage to guess home router based on the default identity name. More... | |
virtual void | start () override |
Start the stage. More... | |
Protected Member Functions | |
std::string | querySrvRr (const std::string &fqdn) |
Send DNS SRV request for a fqdn fully qualified domain name. More... | |
std::string | querySrvRrSearch () |
Send DNS SRV request using search domain list. More... | |
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 |
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 56 of file guess-from-identity-name.hpp.
|
inherited |
ndn::tools::autoconfig::GuessFromIdentityName::GuessFromIdentityName | ( | Face & | face, |
KeyChain & | keyChain, | ||
const NextStageCallback & | nextStageOnFailure | ||
) |
Create stage to guess home router based on the default identity name.
Definition at line 32 of file guess-from-identity-name.cpp.
|
protectedinherited |
Attempt to connect to local hub using the uri
FaceUri.
Base::Error | when failed to establish the tunnel |
|
protectedinherited |
Send DNS SRV request for a fqdn
fully qualified domain name.
Error | if query returns nothing or SRV record cannot be parsed |
Definition at line 53 of file base-dns.cpp.
|
protectedinherited |
Send DNS SRV request using search domain list.
Error | if query returns nothing or SRV record cannot be parsed |
Definition at line 80 of file base-dns.cpp.
|
overridevirtual |
Start the stage.
Implements ndn::tools::autoconfig::Base.
Definition at line 39 of file guess-from-identity-name.cpp.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |