Zeroconf
From Wzdftpd
Contents |
About ZeroConf
Zero Configuration Networking (ZeroConf) is a set of techniques that automatically create a usable IP network without configuration or special servers. With zeroconf, a user can connect computers and services like FTP without the need to configure the parameters of each service.
ZeroConf in wzdftpd
The zeroconf module for wzdftpd adds service publishing features to wzdftpd. It uses the Multicast DNS (mDNS) and DNS Service Discovery (DNS-SD) protocol, and can use different implementations of this protocols:
- Avahi (a free-software (LGPL) implementation of mDNS/DNS-SD for Linux),
- Bonjour (an implementation of DNS-SD by Apple Computer), or
- Howl, a multiplatform mDNS/DNS-SD implementation based on Bonjour
the current, stable implementation has only been tested with Avahi. Upcoming implementations were tested on:
- Ubuntu (x86): Avahi+Wzdftpd
- FreeBSD (x86): Howl+Wzdftpd
- W2K (ia32): Howl+Wzdftpd
- W2K (ia32): Bonjour+Wzdftpd
- OSX (ppc): Bonjour+Wzdftpd
To compile wzdftpd with zeroconf support, you must add the following flags during configure:
$ ./configure [...] -with-zeroconf (--enable-avahi | --enable-howl | --enable-bonjour)
Please note that avahi requires pkg-config to work. For ex, on debian, you need to install the following packages: pkg-config, libavahi-client-dev and libdbus-1-dev.
Then run make and make install as usual.
change your config file:
- add the zeroconf module to the
modulessection:
[modules] ... /path/to/libwzd_zeroconf.so = allow
- configure the informations to be published in the
GLOBALsection:
[GLOBAL] ... zeroconf_name = my wzdftpd server zeroconf_port = 21
If you do omit the zeroconf_name Wzdftpd will be announced as WZDFTPD Servern on <your hostname>. Restart wzdftpd for the changes to become effective.
Implementation details
During the initialization of the module, a new process is created (or, if you comment the ZEROCONF_USE_PROCESS macro in modules/zeroconf/libwzd_zeroconf.c, a new thread). All operations must be done in this process as Avahi (and surely other implementations) are not thread-safe.
The default choice is to use a separate process, for several reasons:
- code separation: the zeroconf module has no interaction with server
- security: a problem in the zeroconf module should have no consequence for the server
Zero Configuration Networking on Windows
At the time there are two Zeroconf implementations available for Windows. On is called Howl (an Open Souce project) the other is called Bonjour. The latter is provided by Apple. Apple's Bonjour can be downloaded as an installable binary. Howl unfortunatly is only available as a source package. The package contains Microsoft Visual Studio project files. They can be used to compile the sources to finally get a binary version of Howl. No matter which Zeroconf implementation you'll chosse, to use the Wzdftpd Zeroconf module you are required to run a mDNSRessponder instance. This can be done by either manually executing the appropriate executable or by installing a Windows service that gets startet while the system is starting up.
If you did decide to compile Howl you'll need one of the following software packages:
- Microsoft Visual Studio .NET 2003
- Microsoft Visual C++
- Microsoft Visual Studio 2005
- Microsoft Visual C++ Express 2005 plus the Microsoft Platform SDK (important!) and finally the WTL 7.5 package, which cane be dowloaded at sourceforge.net.
No matter which Zeroconf implementation you are going to use, at the time it is necessary to compile the Zerconf module for windows manually, because the default WZDFTPD Windows distribution does not ship with a Zerconf modul neither does it ship with a Zeroconf implementation like Howl or Bonjour. Hence you'll need the Zeroconf headers and libraries to compile the libwzd_zerconf module. Apple provides a Bonjour SDK for that perticular purpose. For Howl you need to download their sources form Sourceforge.
Note: You can't run both the Bonjour and the Howl mDNSResponder at the same time. If you want to test Howl on a system that already runs Bonjour, please make sure to stop the Bonjour mDNSResponder using Windows' control panel.
Links
--pollux 14:15, 17 January 2006 (CET)
