Guessing home router based on DNS query with default suffix. More...
#include <guess-from-search-domains.hpp>
Public Types | |
typedef std::function< void(const std::string &)> | NextStageCallback |
Callback to be called when the stage fails. More... | |
Public Member Functions | |
GuessFromSearchDomains (Face &face, KeyChain &keyChain, const NextStageCallback &nextStageOnFailure) | |
Create stage to guess home router based on DNS query with default suffix. 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 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 49 of file guess-from-search-domains.hpp.
|
inherited |
ndn::tools::autoconfig::GuessFromSearchDomains::GuessFromSearchDomains | ( | Face & | face, |
KeyChain & | keyChain, | ||
const NextStageCallback & | nextStageOnFailure | ||
) |
Create stage to guess home router based on DNS query with default suffix.
Definition at line 32 of file guess-from-search-domains.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-search-domains.cpp.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |