]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/afp_avahi.h
First patch import, missing files
[netatalk.git] / etc / afpd / afp_avahi.h
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: Avahi based Zeroconf support
5  * Docs:    http://avahi.org/download/doxygen/
6  *
7  */
8
9 #ifndef AFPD_AVAHI_H
10 #define AFPD_AVAHI_H
11
12 #include <stdlib.h>
13 #include <assert.h>
14 #include <string.h>
15
16 #include <avahi-client/client.h>
17 #include <avahi-client/publish.h>
18
19 #include <avahi-common/alternative.h>
20
21 #ifndef HAVE_AVAHI_THREADED_POLL\r
22 #include <avahi-common/simple-watch.h>
23 #include <signal.h> /* SIG_BLOCK */\r
24 #else\r
25 #include <avahi-common/thread-watch.h>\r
26 #endif
27
28 #include <avahi-common/malloc.h>
29 #include <avahi-common/error.h>
30
31 #include <atalk/logger.h>
32
33 #define AFP_DNS_SERVICE_TYPE "_afpovertcp._tcp"
34
35 struct context {
36   int thread_running;
37   pthread_t thread_id;
38   pthread_mutex_t mutex;
39   char *name;
40 #ifndef HAVE_AVAHI_THREADED_POLL
41   AvahiSimplePoll   *simple_poll;
42 #else
43   AvahiThreadedPoll *threaded_poll;
44 #endif
45   AvahiClient       *client;
46   AvahiEntryGroup   *group;
47   unsigned long     port;
48 };
49
50 /* prototype definitions */
51 void* av_zeroconf_setup(unsigned long, const char *);
52 int av_zeroconf_run(void*);
53 int av_zeroconf_unregister(void*);
54 void av_zeroconf_shutdown(void*);
55 void av_zeroconf_lock(void *);
56 void av_zeroconf_unlock(void *);
57
58 #endif   /* AFPD_AVAHI_H */