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 CLIENTS_MAX 256
47 #define OBJECTS_PER_CLIENT_MAX 250
48 #define ENTRIES_PER_ENTRY_GROUP_MAX 20
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;
179 extern Server *server;
181 void avahi_dbus_entry_group_free(EntryGroupInfo *i);
182 void avahi_dbus_entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state, void* userdata);
183 DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage *m, void *userdata);
185 void avahi_dbus_sync_host_name_resolver_free(SyncHostNameResolverInfo *i);
186 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);
188 void avahi_dbus_async_host_name_resolver_free(AsyncHostNameResolverInfo *i);
189 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);
190 DBusHandlerResult avahi_dbus_msg_async_host_name_resolver_impl(DBusConnection *c, DBusMessage *m, void *userdata);
192 void avahi_dbus_sync_address_resolver_free(SyncAddressResolverInfo *i);
193 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);
195 void avahi_dbus_async_address_resolver_free(AsyncAddressResolverInfo *i);
196 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);
197 DBusHandlerResult avahi_dbus_msg_async_address_resolver_impl(DBusConnection *c, DBusMessage *m, void *userdata);
199 void avahi_dbus_domain_browser_free(DomainBrowserInfo *i);
200 DBusHandlerResult avahi_dbus_msg_domain_browser_impl(DBusConnection *c, DBusMessage *m, void *userdata);
201 void avahi_dbus_domain_browser_callback(AvahiSDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, AvahiLookupResultFlags flags, void* userdata);
203 void avahi_dbus_service_type_browser_free(ServiceTypeBrowserInfo *i);
204 DBusHandlerResult avahi_dbus_msg_service_type_browser_impl(DBusConnection *c, DBusMessage *m, void *userdata);
205 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);
207 void avahi_dbus_service_browser_free(ServiceBrowserInfo *i);
208 DBusHandlerResult avahi_dbus_msg_service_browser_impl(DBusConnection *c, DBusMessage *m, void *userdata);
209 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);
211 void avahi_dbus_sync_service_resolver_free(SyncServiceResolverInfo *i);
213 void avahi_dbus_sync_service_resolver_callback(
214 AvahiSServiceResolver *r,
215 AvahiIfIndex interface,
216 AvahiProtocol protocol,
217 AvahiResolverEvent event,
221 const char *host_name,
222 const AvahiAddress *a,
224 AvahiStringList *txt,
225 AvahiLookupResultFlags flags,
228 void avahi_dbus_async_service_resolver_free(AsyncServiceResolverInfo *i);
229 void avahi_dbus_async_service_resolver_callback(
230 AvahiSServiceResolver *r,
231 AvahiIfIndex interface,
232 AvahiProtocol protocol,
233 AvahiResolverEvent event,
237 const char *host_name,
238 const AvahiAddress *a,
240 AvahiStringList *txt,
241 AvahiLookupResultFlags flags,
244 DBusHandlerResult avahi_dbus_msg_async_service_resolver_impl(DBusConnection *c, DBusMessage *m, void *userdata);
246 void avahi_dbus_record_browser_free(RecordBrowserInfo *i);
247 DBusHandlerResult avahi_dbus_msg_record_browser_impl(DBusConnection *c, DBusMessage *m, void *userdata);
248 void avahi_dbus_record_browser_callback(AvahiSRecordBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, AvahiRecord *record, AvahiLookupResultFlags flags, void* userdata);