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_info, logtype_afpd, "Attempting to register with mDNS using Avahi\n");
30 if (hostname && strlen(hostname) > 0 && port)
32 ctx = av_zeroconf_setup(port, hostname);
34 else if (hostname && strlen(hostname) > 0)
36 ctx = av_zeroconf_setup(AFP_PORT, hostname);
40 ctx = av_zeroconf_setup(AFP_PORT, NULL);
46 void zeroconf_deregister(void)
48 #if defined (HAVE_AVAHI)
49 LOG(log_error, logtype_afpd, "Attempting to de-register mDNS using Avahi\n");
51 av_zeroconf_shutdown(ctx);