[avahi] DBUS issues - unsure of how to communicate with Avahi via DBUS.

J. R. Carroll jrcarroll at jrcresearch.net
Mon Dec 17 07:48:02 PST 2012


Hi list,

I am new to DBUS and new to Avahi, and I've encountered a major learning
curve issue.

The documentation on the Avahi website doesn't seem to be.... complete to
say the least.  When I go to http://avahi.org/ I see "Error: Failed to load
processor TracNav No macro or processor named 'TracNav' found" and cannot
browse the Wikipedia.

With that said, I am trying to communicate with Avahi via DBUS to return
all broadcasted services of a particular domain.  I will need to get all
the details, similar if I were to use "avahi-browse -d <domain> -aktrp".

I have reviewed the Avahi-introspection document (XML), but it's implicit
(IMHO), and I am not sure what method call does what to avahi.  I've tried
tinkering, and making assumptions about which values/parameters will get me
the desired results, but I am not getting anywhere.  Below is the code I
have started - the only goal of adding this to the email is to show you how
little headway I have made into solving this problem - although I did spend
about 4 hours scouring the internet over the last 3 days trying to find
documentation.

import dbus

__bus_name__ = 'org.freedesktop.Avahi.Server'

sys_bus = dbus.SystemBus()
# get an object called / in org.freedesktop.Avahi to talk to
raw_server = sys_bus.get_object('org.freedesktop.Avahi', '/')

# objects support interfaces. get the org.freedesktop.Avahi.Server
interface to our org.freedesktop.Avahi object.
server_interface = dbus.Interface(raw_server, __bus_name__)



Furthermore, using d-feet (or qdbus from CL) gives me the following methods
to interact with:

bool
> int
> method
> org.freedesktop.Avahi.Server.AddressResolverNew
> org.freedesktop.Avahi.Server.DomainBrowserNew
> org.freedesktop.Avahi.Server.GetState
> org.freedesktop.Avahi.Server.StateChanged
> org.freedesktop.Avahi.Server.EntryGroupNew
> org.freedesktop.Avahi.Server.GetVersionString
> org.freedesktop.DBus.Introspectable.Introspect
> org.freedesktop.Avahi.Server.GetAlternativeHostName
> org.freedesktop.Avahi.Server.HostNameResolverNew
> QDBusObjectPath
> org.freedesktop.Avahi.Server.GetAlternativeServiceName
> org.freedesktop.Avahi.Server.IsNSSSupportAvailable
> QString
> org.freedesktop.Avahi.Server.GetAPIVersion
> org.freedesktop.Avahi.Server.RecordBrowserNew
> signal
> org.freedesktop.Avahi.Server.GetDomainName
> org.freedesktop.Avahi.Server.ResolveAddress
> uint
> org.freedesktop.Avahi.Server.GetHostName
> org.freedesktop.Avahi.Server.ResolveHostName
> void
> org.freedesktop.Avahi.Server.GetHostNameFqdn
> org.freedesktop.Avahi.Server.ServiceBrowserNew
> org.freedesktop.Avahi.Server.GetLocalServiceCookie
> org.freedesktop.Avahi.Server.ServiceResolverNew
> org.freedesktop.Avahi.Server.GetNetworkInterfaceIndexByName
> org.freedesktop.Avahi.Server.ServiceTypeBrowserNew
> org.freedesktop.Avahi.Server.GetNetworkInterfaceNameByIndex
> org.freedesktop.Avahi.Server.SetHostName


What do any of these do?  Some of them are obvious to me, and work just
fine - say for instance "GetState" or "GetAPIVersion".  Those just return a
value.  But Im looking for a little more complexity, perhaps I bit off more
than I can chew?

If anything, I am just looking for a document I can learn from that might
help me figure out how to get a parsable list of services for a particular
domain (which includes the resolved information). Can anyone point me in
the right direction?

Thanks in advance,

-J

----


J. R. Carroll
Independent Researcher through Hurtz Labs
Research Methods, Test Development, and Statistics
www.jrcresearch.net
www.ontvp.com
Cell:  (650) 776-6613
Email: jrcarroll at jrcresearch.net
          jrcarroll at hurtzlab.com
          jrc.csus at gmail.com
<https://www.facebook.com/J.R.Car>
<https://twitter.com/jNammer><http://www.linkedin.com/in/jrcarroll>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/avahi/attachments/20121217/efe3ff99/attachment.html>


More information about the avahi mailing list