1 #ifndef foodbusinternalhfoo
2 #define foodbusinternalhfoo
7 This file is part of avahi.
9 avahi is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 2.1 of the
12 License, or (at your option) any later version.
14 avahi is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
17 Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with avahi; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26 #include <dbus/dbus.h>
28 #include <avahi-core/core.h>
29 #include <avahi-core/publish.h>
30 #include <avahi-core/lookup.h>
32 #include <avahi-common/llist.h>
34 typedef struct Server Server;
35 typedef struct Client Client;
36 typedef struct EntryGroupInfo EntryGroupInfo;
37 typedef struct SyncHostNameResolverInfo SyncHostNameResolverInfo;
38 typedef struct AsyncHostNameResolverInfo AsyncHostNameResolverInfo;
39 typedef struct SyncAddressResolverInfo SyncAddressResolverInfo;
40 typedef struct AsyncAddressResolverInfo AsyncAddressResolverInfo;
41 typedef struct DomainBrowserInfo DomainBrowserInfo;
42 typedef struct ServiceTypeBrowserInfo ServiceTypeBrowserInfo;
43 typedef struct ServiceBrowserInfo ServiceBrowserInfo;
44 typedef struct SyncServiceResolverInfo SyncServiceResolverInfo;
45 typedef struct AsyncServiceResolverInfo AsyncServiceResolverInfo;
47 #define CLIENTS_MAX 256
48 #define OBJECTS_PER_CLIENT_MAX 50
49 #define ENTRIES_PER_ENTRY_GROUP_MAX 20
51 struct EntryGroupInfo {
54 AvahiSEntryGroup *entry_group;
59 AVAHI_LLIST_FIELDS(EntryGroupInfo, entry_groups);
62 struct SyncHostNameResolverInfo {
64 AvahiSHostNameResolver *host_name_resolver;
67 AVAHI_LLIST_FIELDS(SyncHostNameResolverInfo, sync_host_name_resolvers);
70 struct AsyncHostNameResolverInfo {
73 AvahiSHostNameResolver *host_name_resolver;
76 AVAHI_LLIST_FIELDS(AsyncHostNameResolverInfo, async_host_name_resolvers);
79 struct SyncAddressResolverInfo {
81 AvahiSAddressResolver *address_resolver;
84 AVAHI_LLIST_FIELDS(SyncAddressResolverInfo, sync_address_resolvers);
87 struct AsyncAddressResolverInfo {
90 AvahiSAddressResolver *address_resolver;
93 AVAHI_LLIST_FIELDS(AsyncAddressResolverInfo, async_address_resolvers);
96 struct DomainBrowserInfo {
99 AvahiSDomainBrowser *domain_browser;
102 AVAHI_LLIST_FIELDS(DomainBrowserInfo, domain_browsers);
105 struct ServiceTypeBrowserInfo {
108 AvahiSServiceTypeBrowser *service_type_browser;
111 AVAHI_LLIST_FIELDS(ServiceTypeBrowserInfo, service_type_browsers);
114 struct ServiceBrowserInfo {
117 AvahiSServiceBrowser *service_browser;
120 AVAHI_LLIST_FIELDS(ServiceBrowserInfo, service_browsers);
123 struct SyncServiceResolverInfo {
125 AvahiSServiceResolver *service_resolver;
126 DBusMessage *message;
128 AVAHI_LLIST_FIELDS(SyncServiceResolverInfo, sync_service_resolvers);
131 struct AsyncServiceResolverInfo {
134 AvahiSServiceResolver *service_resolver;
137 AVAHI_LLIST_FIELDS(AsyncServiceResolverInfo, async_service_resolvers);
146 AVAHI_LLIST_FIELDS(Client, clients);
147 AVAHI_LLIST_HEAD(EntryGroupInfo, entry_groups);
148 AVAHI_LLIST_HEAD(SyncHostNameResolverInfo, sync_host_name_resolvers);
149 AVAHI_LLIST_HEAD(AsyncHostNameResolverInfo, async_host_name_resolvers);
150 AVAHI_LLIST_HEAD(SyncAddressResolverInfo, sync_address_resolvers);
151 AVAHI_LLIST_HEAD(AsyncAddressResolverInfo, async_address_resolvers);
152 AVAHI_LLIST_HEAD(DomainBrowserInfo, domain_browsers);
153 AVAHI_LLIST_HEAD(ServiceTypeBrowserInfo, service_type_browsers);
154 AVAHI_LLIST_HEAD(ServiceBrowserInfo, service_browsers);
155 AVAHI_LLIST_HEAD(SyncServiceResolverInfo, sync_service_resolvers);
156 AVAHI_LLIST_HEAD(AsyncServiceResolverInfo, async_service_resolvers);
161 AVAHI_LLIST_HEAD(Client, clients);
166 extern Server *server;
168 void avahi_dbus_entry_group_free(EntryGroupInfo *i);
169 void avahi_dbus_entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state, void* userdata);
170 DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage *m, void *userdata);
172 void avahi_dbus_sync_host_name_resolver_free(SyncHostNameResolverInfo *i);
173 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);
175 void avahi_dbus_async_host_name_resolver_free(AsyncHostNameResolverInfo *i);
176 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);
177 DBusHandlerResult avahi_dbus_msg_async_host_name_resolver_impl(DBusConnection *c, DBusMessage *m, void *userdata);
179 void avahi_dbus_sync_address_resolver_free(SyncAddressResolverInfo *i);
180 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);
182 void avahi_dbus_async_address_resolver_free(AsyncAddressResolverInfo *i);
183 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);
184 DBusHandlerResult avahi_dbus_msg_async_address_resolver_impl(DBusConnection *c, DBusMessage *m, void *userdata);
186 void avahi_dbus_domain_browser_free(DomainBrowserInfo *i);
187 DBusHandlerResult avahi_dbus_msg_domain_browser_impl(DBusConnection *c, DBusMessage *m, void *userdata);
188 void avahi_dbus_domain_browser_callback(AvahiSDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, AvahiLookupResultFlags flags, void* userdata);
190 void avahi_dbus_service_type_browser_free(ServiceTypeBrowserInfo *i);
191 DBusHandlerResult avahi_dbus_msg_service_type_browser_impl(DBusConnection *c, DBusMessage *m, void *userdata);
192 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);
194 void avahi_dbus_service_browser_free(ServiceBrowserInfo *i);
195 DBusHandlerResult avahi_dbus_msg_service_browser_impl(DBusConnection *c, DBusMessage *m, void *userdata);
196 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);
198 void avahi_dbus_sync_service_resolver_free(SyncServiceResolverInfo *i);
200 void avahi_dbus_sync_service_resolver_callback(
201 AvahiSServiceResolver *r,
202 AvahiIfIndex interface,
203 AvahiProtocol protocol,
204 AvahiResolverEvent event,
208 const char *host_name,
209 const AvahiAddress *a,
211 AvahiStringList *txt,
212 AvahiLookupResultFlags flags,
215 void avahi_dbus_async_service_resolver_free(AsyncServiceResolverInfo *i);
216 void avahi_dbus_async_service_resolver_callback(
217 AvahiSServiceResolver *r,
218 AvahiIfIndex interface,
219 AvahiProtocol protocol,
220 AvahiResolverEvent event,
224 const char *host_name,
225 const AvahiAddress *a,
227 AvahiStringList *txt,
228 AvahiLookupResultFlags flags,
231 DBusHandlerResult avahi_dbus_msg_async_service_resolver_impl(DBusConnection *c, DBusMessage *m, void *userdata);