[avahi] Receive mDNS annoucnements
Jon Fitt
jonfitt at yahoo.com
Wed Nov 26 10:48:40 PST 2014
I'm not able to get a record browser doing what I want. I have modified client-browse-services.c to make a record browser instead of a service browser.
avahi_record_browser_new(client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "BRN30055C232008.local", AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_A, 0, browse_callback, client)
I know my printer BRN30055C232008.local is making DNS A announcements because I can see them in Wireshark. However I just get CACHE_EXHAUSTED then seg fault. I've tried different host names with and without the domain and sometimes that will get CACHE_EXHAUSTED, ALL_FOR_NOW instead of seg fault. I've also tried the hostnames with and without the domain of various Apple devices I know are making DNS A announcements.
I know that my printer is also making _http._tcp service announcements as "Brother DCP-8011DN". If I pass "Brother DCP-8011DN" as the host name then I get:CACHE_EXHAUSTEDDNS failure: NXDOMAIN
That's the closest I get to an outcome. It's worrying because I don't only want to get the DNS A records of hosts that also advertise services, I just want to grab (preferably all) DNS A records that the daemon has in memory.
Regards,
Jonathan
On Tuesday, 25 November 2014, 16:38, Michael Jones <avahi at jonesmz.com> wrote:
In the avahi-client C-API there is the concept of a Service Browser and a Record Browser. Service Browser sounds like what you are using now:
| AvahiServiceBrowser* avahi_service_browser_new | ( | AvahiClient * | client, |
| | | AvahiIfIndex | interface, |
| | | AvahiProtocol | protocol, |
| | | const char * | type, |
| | | const char * | domain, |
| | | AvahiLookupFlags | flags, |
| | | AvahiServiceBrowserCallback | callback, |
| | | void * | userdata |
| | ) |
The type being for example _http._tcp. Whereas a Record Browser looks like this:
| AvahiRecordBrowser* avahi_record_browser_new | ( | AvahiClient * | client, |
| | | AvahiIfIndex | interface, |
| | | AvahiProtocol | protocol, |
| | | const char * | name, |
| | | uint16_t | clazz, |
| | | uint16_t | type, |
| | | AvahiLookupFlags | flags, |
| | | AvahiRecordBrowserCallback | callback, |
| | | void * | userdata |
| | ) |
Hi Jonathan,
Yea, that looks familiar. As far as I remember, the qtzeroconf (either the original, or my fork) doesn't use the avahi_record_browser api.
I'd be happy to collaborate with you on building support for that.
Should be pretty straight forward. Mostly we'll just need to copy and modify the ServiceBrowser class, I think.
--Mike
_______________________________________________
avahi mailing list
avahi at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/avahi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/avahi/attachments/20141126/ef59edb5/attachment.html>
More information about the avahi
mailing list