725{
727
730 return;
731 }
733 return;
734 }
735
738 if (dns_msg) {
740 if (dns_msg->rr_a) { ip = dns_msg->rr_a->ip; }
741 else if (dns_msg->rr_aaaa) { ip = dns_msg->rr_aaaa->ip; }
742
743 for (auto& sdpair : dns_msg->sdmap) {
744 if (!sdpair.second.srv) {
745 continue;
746 }
747
748 const auto& srv = *sdpair.second.srv;
749
751 if (service_name.empty())
752 continue;
753
754 std::string path;
756
758 if (sdpair.second.txt) {
759 txt_data = std::move(sdpair.second.txt->data);
760 }
761
762 BonjourReply reply(ip, srv.port, std::move(service_name), srv.hostname, std::move(txt_data));
764 }
765 }
766}
const Bonjour::TxtKeys get_txt_keys() const
Definition Bonjour.hpp:213
const std::string get_service_dn() const
Definition Bonjour.hpp:215
boost::asio::ip::udp::endpoint remote_endpoint
Definition Bonjour.hpp:120
std::vector< char > buffer
Definition Bonjour.hpp:119
Bonjour::ReplyFn replyfn
Definition Bonjour.hpp:122
char * version
Definition main.c:59
std::string strip_service_dn(const std::string &service_name, const std::string &service_dn)
Definition Bonjour.cpp:603
std::unordered_map< std::string, std::string > TxtData
Definition Bonjour.hpp:23
static optional< DnsMessage > decode(const std::vector< char > &buffer, const Bonjour::TxtKeys &txt_keys)
Definition Bonjour.cpp:406
static char error[256]
Definition tga.cpp:50