1 #ifndef foodbusinternalhfoo
2 #define foodbusinternalhfoo
5 This file is part of avahi.
7 avahi is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation; either version 2.1 of the
10 License, or (at your option) any later version.
12 avahi is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
15 Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with avahi; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 #include <dbus/dbus.h>
26 #include <avahi-core/core.h>
27 #include <avahi-core/publish.h>
28 #include <avahi-core/lookup.h>
30 #include <avahi-common/llist.h>
32 typedef struct Server Server;
33 typedef struct Client Client;
34 typedef struct EntryGroupInfo EntryGroupInfo;
35 typedef struct SyncHostNameResolverInfo SyncHostNameResolverInfo;
36 typedef struct AsyncHostNameResolverInfo AsyncHostNameResolverInfo;
37 typedef struct SyncAddressResolverInfo SyncAddressResolverInfo;
38 typedef struct AsyncAddressResolverInfo AsyncAddressResolverInfo;
39 typedef struct DomainBrowserInfo DomainBrowserInfo;
40 typedef struct ServiceTypeBrowserInfo ServiceTypeBrowserInfo;
41 typedef struct ServiceBrowserInfo ServiceBrowserInfo;
42 typedef struct SyncServiceResolverInfo SyncServiceResolverInfo;
43 typedef struct AsyncServiceResolverInfo AsyncServiceResolverInfo;
44 typedef struct RecordBrowserInfo RecordBrowserInfo;
46 #define DEFAULT_CLIENTS_MAX 4096
47 #define DEFAULT_OBJECTS_PER_CLIENT_MAX 1024
48 #define DEFAULT_ENTRIES_PER_ENTRY_GROUP_MAX 32
50 struct EntryGroupInfo {
53 AvahiSEntryGroup *entry_group;
58 AVAHI_LLIST_FIELDS(EntryGroupInfo, entry_groups);
61 struct SyncHostNameResolverInfo {
63 AvahiSHostNameResolver *host_name_resolver;
66 AVAHI_LLIST_FIELDS(SyncHostNameResolverInfo, sync_host_name_resolvers);
69 struct AsyncHostNameResolverInfo {
72 AvahiSHostNameResolver *host_name_resolver;
75 AVAHI_LLIST_FIELDS(AsyncHostNameResolverInfo, async_host_name_resolvers);
78 struct SyncAddressResolverInfo {
80 AvahiSAddressResolver *address_resolver;
83 AVAHI_LLIST_FIELDS(SyncAddressResolverInfo, sync_address_resolvers);
86 struct AsyncAddressResolverInfo {
89 AvahiSAddressResolver *address_resolver;
92 AVAHI_LLIST_FIELDS(AsyncAddressResolverInfo, async_address_resolvers);
95 struct DomainBrowserInfo {
98 AvahiSDomainBrowser *domain_browser;
101 AVAHI_LLIST_FIELDS(DomainBrowserInfo, domain_browsers);
104 struct ServiceTypeBrowserInfo {
107 AvahiSServiceTypeBrowser *service_type_browser;
110 AVAHI_LLIST_FIELDS(ServiceTypeBrowserInfo, service_type_browsers);
113 struct ServiceBrowserInfo {
116 AvahiSServiceBrowser *service_browser;
119 AVAHI_LLIST_FIELDS(ServiceBrowserInfo, service_browsers);
122 struct SyncServiceResolverInfo {
124 AvahiSServiceResolver *service_resolver;
125 DBusMessage *message;
127 AVAHI_LLIST_FIELDS(SyncServiceResolverInfo, sync_service_resolvers);
130 struct AsyncServiceResolverInfo {
133 AvahiSServiceResolver *service_resolver;
136 AVAHI_LLIST_FIELDS(AsyncServiceResolverInfo, async_service_resolvers);
139 struct RecordBrowserInfo {
142 AvahiSRecordBrowser *record_browser;
145 AVAHI_LLIST_FIELDS(RecordBrowserInfo, record_browsers);
154 AVAHI_LLIST_FIELDS(Client, clients);
155 AVAHI_LLIST_HEAD(EntryGroupInfo, entry_groups);
156 AVAHI_LLIST_HEAD(SyncHostNameResolverInfo, sync_host_name_resolvers);
157 AVAHI_LLIST_HEAD(AsyncHostNameResolverInfo, async_host_name_resolvers);
158 AVAHI_LLIST_HEAD(SyncAddressResolverInfo, sync_address_resolvers);
159 AVAHI_LLIST_HEAD(AsyncAddressResolverInfo, async_address_resolvers);
160 AVAHI_LLIST_HEAD(DomainBrowserInfo, domain_browsers);
161 AVAHI_LLIST_HEAD(ServiceTypeBrowserInfo, service_type_browsers);
162 AVAHI_LLIST_HEAD(ServiceBrowserInfo, service_browsers);
163 AVAHI_LLIST_HEAD(SyncServiceResolverInfo, sync_service_resolvers);
164 AVAHI_LLIST_HEAD(AsyncServiceResolverInfo, async_service_resolvers);
165 AVAHI_LLIST_HEAD(RecordBrowserInfo, record_browsers);
169 const AvahiPoll *poll_api;
171 AVAHI_LLIST_HEAD(Client, clients);
175 AvahiTimeout *reconnect_timeout;
178 unsigned n_clients_max;
179 unsigned n_objects_per_client_max;
180 unsigned n_entries_per_entry_group_max;
182 int disable_user_service_publishing;
185 extern Server *server;
187 void avahi_dbus_entry_group_free(EntryGroupInfo *i);
188 void avahi_dbus_entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state, void* userdata);
189 DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage *m, void *userdata);
191 void avahi_dbus_sync_host_name_resolver_free(SyncHostNameResolverInfo *i);
192 void avahi_dbus_sync_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const char *host_name, const AvahiAddress *a, AvahiLookupResultFlags flags, void* userdata);
194 void avahi_dbus_async_host_name_resolver_free(AsyncHostNameResolverInfo *i);
195 void avahi_dbus_async_host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const char *host_name, const AvahiAddress *a, AvahiLookupResultFlags flags, void* userdata);
196 DBusHandlerResult avahi_dbus_msg_async_host_name_resolver_impl(DBusConnection *c, DBusMessage *m, void *userdata);
198 void avahi_dbus_sync_address_resolver_free(SyncAddressResolverInfo *i);
199 void avahi_dbus_sync_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const AvahiAddress *address, const char *host_name, AvahiLookupResultFlags flags, void* userdata);
201 void avahi_dbus_async_address_resolver_free(AsyncAddressResolverInfo *i);
202 void avahi_dbus_async_address_resolver_callback(AvahiSAddressResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const AvahiAddress *address, const char *host_name, AvahiLookupResultFlags flags, void* userdata);
203 DBusHandlerResult avahi_dbus_msg_async_address_resolver_impl(DBusConnection *c, DBusMessage *m, void *userdata);
205 void avahi_dbus_domain_browser_free(DomainBrowserInfo *i);
206 DBusHandlerResult avahi_dbus_msg_domain_browser_impl(DBusConnection *c, DBusMessage *m, void *userdata);
207 void avahi_dbus_domain_browser_callback(AvahiSDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, AvahiLookupResultFlags flags, void* userdata);
209 void avahi_dbus_service_type_browser_free(ServiceTypeBrowserInfo *i);
210 DBusHandlerResult avahi_dbus_msg_service_type_browser_impl(DBusConnection *c, DBusMessage *m, void *userdata);
211 void avahi_dbus_service_type_browser_callback(AvahiSServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *type, const char *domain, AvahiLookupResultFlags flags, void* userdata);
213 void avahi_dbus_service_browser_free(ServiceBrowserInfo *i);
214 DBusHandlerResult avahi_dbus_msg_service_browser_impl(DBusConnection *c, DBusMessage *m, void *userdata);
215 void avahi_dbus_service_browser_callback(AvahiSServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *name, const char *type, const char *domain, AvahiLookupResultFlags flags, void* userdata);
217 void avahi_dbus_sync_service_resolver_free(SyncServiceResolverInfo *i);
219 void avahi_dbus_sync_service_resolver_callback(
220 AvahiSServiceResolver *r,
221 AvahiIfIndex interface,
222 AvahiProtocol protocol,
223 AvahiResolverEvent event,
227 const char *host_name,
228 const AvahiAddress *a,
230 AvahiStringList *txt,
231 AvahiLookupResultFlags flags,
234 void avahi_dbus_async_service_resolver_free(AsyncServiceResolverInfo *i);
235 void avahi_dbus_async_service_resolver_callback(
236 AvahiSServiceResolver *r,
237 AvahiIfIndex interface,
238 AvahiProtocol protocol,
239 AvahiResolverEvent event,
243 const char *host_name,
244 const AvahiAddress *a,
246 AvahiStringList *txt,
247 AvahiLookupResultFlags flags,
250 DBusHandlerResult avahi_dbus_msg_async_service_resolver_impl(DBusConnection *c, DBusMessage *m, void *userdata);
252 void avahi_dbus_record_browser_free(RecordBrowserInfo *i);
253 DBusHandlerResult avahi_dbus_msg_record_browser_impl(DBusConnection *c, DBusMessage *m, void *userdata);
254 void avahi_dbus_record_browser_callback(AvahiSRecordBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, AvahiRecord *record, AvahiLookupResultFlags flags, void* userdata);