Tag Archives: test

Avahi Support for Apache

Post Syndicated from Lennart Poettering original http://0pointer.net/blog/projects/mod_dnssd.html

The first release of mod_dnssd is now available. It adds DNS-SD based Zeroconf support to Apache 2.0 using Avahi.

This work has been inspired by Sander Temme’s and Sebastien Estienne’s mod_zeroconf module, but supersedes it in every way. MacOSX ships with mod_rendezvous/mod_bonjour, but mod_dnssd is much more powerful than this piece of software as well. In short: mod_dnssd is definitely the greatest way to add Zeroconf support to Apache available today.

A few examples just to show how great mod_dnssd is:

DNSSDEnable On

This is everything you need to enable DNS-SD support in Apache after loading the module. It will publish all virtual hosts and all existing mod_userdir directories (i.e. ~/public_html) as services of type _http._tcp.

In case you want to publish some subdirectory of the web server as service, just place DNSSDServiceName inside a <Location> section for that path:

<Location /foobar>
	DNSSDServiceName "A special service called foobar"

You can even use it to publish WebDAV shares using Apache’s mod_dav module:

<Location /webdav>
	Dav On
	DNSSDServiceName "A WebDAV folder"
	DNSSDServiceTypes _webdav._tcp

This especially cool since we now have a free software server counterpart for Gnome’s and KDE’s WebDAV client functionality.

Or to publish your blog as RSS service:

<Location /blog.cgi?rss>
	DNSSDServiceName "The blog"
	DNSSDServiceTypes _rss._tcp

Get it while it is hot!

Avahi 0.6 in Beta

Post Syndicated from Lennart Poettering original http://0pointer.net/blog/projects/avahi-0.6-pre.html

Unless we find any major bugs Avahi 0.6 will be released on friday. We ask everyone to do some testing for us:

There have been a bunch of API changes. However, the API is now frozen, so feel free to start porting your application to the new API now.

A rough overview about the many improvements in Avahi 0.6.

  • Support for (read-only) wide area support. (i.e. DNS-SD over unicast DNS)
  • Ported to FreeBSD, NetBSD, Darwin/MacOSX and to some extent OpenBSD
  • Compatibility layers for HOWL and Bonjour
  • Support for registering/browsing abritrary records
  • Proper support for DNS-SD service subtypes
  • Native C implementations of the client utilities
  • Now passes the Bonjour conformance test suite without any exceptions
  • “Passive observation of failures”
  • chroot() support
  • Many traffic reduction improvements
  • Bugfixes, cleanups

Avahi Gains Compatibility Layers for Apple Bonjour and HOWL

Post Syndicated from Lennart Poettering original http://0pointer.net/blog/projects/avahi-compat.html

A short while ago I checked in to SVN two API/ABI compatibility
modules which implement the HOWL and the Apple
Bonjour (dns_sd.h)
DNS-SD/mDNS APIs on top of Avahi’s
native API. Effectively this means that you can run *all*
Zeroconf-enabled software that is available for free operating systems
seamlessly on top of Avahi. Or at least the software that uses the
limited subset of API functions we support. Missing functions will be
implemented on an on-demand basis. Gnome-VFS/Nautilus works
perfectly, as does Gobby, which are the only real-world applications
we tested until now.

The list of supported/unsupported functions is available from SVN for HOWL and for

The compatibility layers are actually pretty interesting pieces of code: for
compatibility with the way HOWL/Bonjour integrates with event loops we had to
hook up the timeout and I/O watches D-BUS depends on to a single file
descriptor. This involves all kinds of ugly things like threading and
“creative” ways to use the event loop abstraction Avahi provides. Some might
call this “cracktastic”, but it actually works pretty well.

The compatibility layers are not intended to be long term solutions. For
every session object we create a background thread that polls for events and a
DBUS session object. This is an utter waste of resources, especially on
dns_sd.h where every basic operation uses a session object of its own.
In addition, our compatibility layers are incomplete. We do not offer the full
set of functions or the full semantics. Our compatibility is just good enough
to make most Zeroconf-aware programs work with Avahi right now.

We consider neither dns_sd.h nor the HOWL API a “well designed”
API and encourage people to port their programs to our more powerful native
API. To stress this the two modules will warn the user about their usage and
write a warning line to STDERR and syslog. Hopefully this will annoy
people sufficiently that Avahi adoption speeds up a little.

To our own surprise we actually support at least one API function more than each of the
reference implementations! From dns_sd.h we support
DNSServiceEnumerateDomains() which is actually unsupported by
Apple Bonjour on POSIX/Linux systems. The documented HOWL function
sw_ipv4_address_decompose() is actually a NOOP in the
reference implementation, but isn’t in our compatibility layer.

Since dns_sd.h is the only file licensed under a BSD license in the otherwise APSL-licensed
mDNSResponder distribution, we were able to copy it into our sources untouched.

Here’s a screenshot of
Nautilus and Gobby
running on top of Avahi through the HOWL compatibility