]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/afp_zeroconf.c
Spotlight: use async Tracker SPARQL API
[netatalk.git] / etc / afpd / afp_zeroconf.c
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
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/
7  *
8  */
9
10 #ifdef HAVE_CONFIG_H
11 #include <config.h>
12 #endif
13
14 #include "afp_zeroconf.h"
15 #include "afp_config.h"
16
17 #ifdef HAVE_MDNS
18 #include "afp_mdns.h"
19 #elif defined (HAVE_AVAHI)
20 #include "afp_avahi.h"
21 #endif
22
23
24 /*
25  * Functions (actually they are just facades)
26  */
27 void zeroconf_register(const AFPObj *configs)
28 {
29 #if defined (HAVE_MDNS)
30   LOG(log_debug, logtype_afpd, "Attempting to register with mDNS using mDNSResponder");
31
32         md_zeroconf_register(configs);
33 #elif defined (HAVE_AVAHI)
34   LOG(log_debug, logtype_afpd, "Attempting to register with mDNS using Avahi");
35
36         av_zeroconf_register(configs);
37 #endif
38 }
39
40 void zeroconf_deregister(void)
41 {
42 #if defined (HAVE_MDNS)
43   LOG(log_debug, logtype_afpd, "Attempting to de-register mDNS using mDNSResponder");
44         md_zeroconf_unregister();
45 #elif defined (HAVE_AVAHI)
46   LOG(log_debug, logtype_afpd, "Attempting to de-register mDNS using Avahi");
47         av_zeroconf_unregister();
48 #endif
49 }