29 #include <ndn-cxx/security/pib/identity.hpp>
30 #include <ndn-cxx/security/pib/pib.hpp>
37 : m_keyChain(keyChain)
42 GuessFromIdentityName::doStart()
44 std::cerr <<
"Trying default identity name..." << std::endl;
46 Name identity = m_keyChain.getPib().getDefaultIdentity().getName();
48 std::ostringstream serverName;
49 for (
auto i = identity.rbegin(); i != identity.rend(); ++i) {
50 serverName << i->toUri() <<
".";
52 serverName <<
"_homehub._autoconf.named-data.net";
55 std::string hubUri =
querySrvRr(serverName.str());
58 catch (
const DnsSrvError& e) {
GuessFromIdentityName(KeyChain &keyChain)
void provideHubFaceUri(const std::string &s)
Parse HUB FaceUri from string and declare success.
void fail(const std::string &msg)
provide synchronous DNS SRV record querying
std::string querySrvRr(const std::string &fqdn)
Send DNS SRV request for fqdn.