]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_zeroconf.c
Fix build
[netatalk.git] / etc / afpd / afp_zeroconf.c
index 4c41bc6f7f7b1aeae5d388864d1eb6fa6dd9a841..64347be3f330d18d7c458096f4b3b97adf321ddf 100644 (file)
 #endif
 
 #include "afp_zeroconf.h"
+#include "afp_config.h"
 
-/*
- * Global Definitions
- */
 #ifdef HAVE_AVAHI
-struct context *ctx = NULL;
+#include "afp_avahi.h"
 #endif
 
+
 /*
  * Functions (actually they are just facades)
  */
-void zeroconf_register(int port, const char *hostname)
+void zeroconf_register(const AFPObj *configs)
 {
 #if defined (HAVE_AVAHI)
   LOG(log_debug, logtype_afpd, "Attempting to register with mDNS using Avahi");
 
-       ctx = av_zeroconf_setup(port ? port : AFP_PORT, 
-                                                                                                       (hostname && strlen(hostname) > 0) ? hostname : NULL);
-  av_zeroconf_run(ctx);
+       av_zeroconf_register(configs);
 #endif
 }
 
-void zeroconf_register_volume(const char *volname)
-{
-#if defined (HAVE_AVAHI)
-  LOG(log_debug, logtype_afpd, "Attempting to register volume with mDNS using Avahi");
-
-       ctx = av_zeroconf_setup(-1, volname);
-
-  av_zeroconf_run(ctx);
-#endif
-}
-
-
 void zeroconf_deregister(void)
 {
 #if defined (HAVE_AVAHI)
   LOG(log_debug, logtype_afpd, "Attempting to de-register mDNS using Avahi");
-  if (ctx)
-    av_zeroconf_shutdown(ctx);
+       av_zeroconf_unregister();
 #endif
 }