1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
3 * Author: Daniel S. Haischt <me@daniel.stefan.haischt.name>
4 * Purpose: Zeroconf facade, that abstracts access to a
5 * particular Zeroconf implementation
6 * Doc: http://www.dns-sd.org/
14 #include "afp_zeroconf.h"
20 struct context *ctx = NULL;
24 * Functions (actually they are just facades)
26 void zeroconf_register(int port, const char *hostname)
28 #if defined (HAVE_AVAHI)
29 LOG(log_debug, logtype_afpd, "Attempting to register with mDNS using Avahi");
31 ctx = av_zeroconf_setup(port ? port : AFP_PORT,
32 (hostname && strlen(hostname) > 0) ? hostname : NULL);
37 void zeroconf_register_volume(const char *volname)
39 #if defined (HAVE_AVAHI)
40 LOG(log_debug, logtype_afpd, "Attempting to register volume with mDNS using Avahi");
42 ctx = av_zeroconf_setup(-1, volname);
49 void zeroconf_deregister(void)
51 #if defined (HAVE_AVAHI)
52 LOG(log_debug, logtype_afpd, "Attempting to de-register mDNS using Avahi");
54 av_zeroconf_shutdown(ctx);