ndn::tools::autoconfig::BaseDns Class Referenceabstract

Base class for stages that use DNS-based guessing. More...

#include <base-dns.hpp>

Inheritance diagram for ndn::tools::autoconfig::BaseDns:
Collaboration diagram for ndn::tools::autoconfig::BaseDns:

Classes

class  Error
 

Public Types

typedef std::function< void(const std::string &)> NextStageCallback
 Callback to be called when the stage fails. More...
 

Public Member Functions

virtual void start ()=0
 Start the stage. More...
 

Protected Member Functions

 BaseDns (Face &face, KeyChain &keyChain, const NextStageCallback &nextStageOnFailure)
 
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
 

Detailed Description

Base class for stages that use DNS-based guessing.

Definition at line 38 of file base-dns.hpp.

Member Typedef Documentation

typedef std::function<void(const std::string&)> ndn::tools::autoconfig::Base::NextStageCallback
inherited

Callback to be called when the stage fails.

Definition at line 64 of file base.hpp.

Constructor & Destructor Documentation

ndn::tools::autoconfig::BaseDns::BaseDns ( Face &  face,
KeyChain &  keyChain,
const NextStageCallback nextStageOnFailure 
)
protected

Definition at line 47 of file base-dns.cpp.

Member Function Documentation

void ndn::tools::autoconfig::Base::connectToHub ( const std::string &  uri)
protectedinherited

Attempt to connect to local hub using the uri FaceUri.

Exceptions
Base::Errorwhen failed to establish the tunnel

Definition at line 41 of file base.cpp.

std::string ndn::tools::autoconfig::BaseDns::querySrvRr ( const std::string &  fqdn)
protected

Send DNS SRV request for a fqdn fully qualified domain name.

Returns
FaceUri of the hub from the requested SRV record
Exceptions
Errorif query returns nothing or SRV record cannot be parsed

Definition at line 53 of file base-dns.cpp.

std::string ndn::tools::autoconfig::BaseDns::querySrvRrSearch ( )
protected

Send DNS SRV request using search domain list.

Returns
FaceUri of the hub from the requested SRV record
Exceptions
Errorif query returns nothing or SRV record cannot be parsed

Definition at line 80 of file base-dns.cpp.

virtual void ndn::tools::autoconfig::Base::start ( )
pure virtualinherited

Member Data Documentation

ndn::nfd::Controller ndn::tools::autoconfig::Base::m_controller
protectedinherited

Definition at line 113 of file base.hpp.

Face& ndn::tools::autoconfig::Base::m_face
protectedinherited

Definition at line 111 of file base.hpp.

KeyChain& ndn::tools::autoconfig::Base::m_keyChain
protectedinherited

Definition at line 112 of file base.hpp.

NextStageCallback ndn::tools::autoconfig::Base::m_nextStageOnFailure
protectedinherited

Definition at line 114 of file base.hpp.