747{
749
750 if (error) {
751 BOOST_LOG_TRIVIAL(error) << error.message();
752 return;
753 }
755 return;
756 }
757
760 if (dns_msg) {
762 if (dns_msg->rr_a) { ip = dns_msg->rr_a->ip; }
763 else if (dns_msg->rr_aaaa) { ip = dns_msg->rr_aaaa->ip; }
764
765 for (auto& sdpair : dns_msg->sdmap) {
766 if (!sdpair.second.srv) {
767 continue;
768 }
769
770 const auto& srv = *sdpair.second.srv;
771
773 if (service_name.empty())
774 continue;
775
776 std::string path;
777 std::string version;
778
780 if (sdpair.second.txt) {
781 txt_data = std::move(sdpair.second.txt->data);
782 }
783
784 BonjourReply reply(ip, srv.port, std::move(service_name), srv.hostname, std::move(txt_data));
786 }
787 }
788}
boost::asio::ip::udp::endpoint remote_endpoint
Definition Bonjour.hpp:134
std::vector< char > buffer
Definition Bonjour.hpp:133
Bonjour::ReplyFn replyfn
Definition Bonjour.hpp:136
std::string strip_service_dn(const std::string &service_name, const std::string &service_dn)
Definition Bonjour.cpp:625
std::unordered_map< std::string, std::string > TxtData
Definition Bonjour.hpp:36
static optional< DnsMessage > decode(const std::vector< char > &buffer, const Bonjour::TxtKeys &txt_keys)
Definition Bonjour.cpp:428