]> git.meshlink.io Git - catta/blob - avahi-client/internal.h
Complete AVAHI_LOOKUP_NO_ADDRESS fix
[catta] / avahi-client / internal.h
1 #ifndef foointernalhfoo
2 #define foointernalhfoo
3
4 /* $Id$ */
5
6 /***
7   This file is part of avahi.
8  
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.
13  
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.
18  
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
22   USA.
23 ***/
24
25 #include <dbus/dbus.h>
26 #include "client.h"
27
28 struct AvahiClient {
29     const AvahiPoll *poll_api;
30     DBusConnection *bus;
31     int error;
32     AvahiClientState state;
33
34     /* Cache for some seldom changing server data */
35     char *version_string, *host_name, *host_name_fqdn, *domain_name;
36     uint32_t local_service_cookie;
37     int local_service_cookie_valid;
38     
39     AvahiClientCallback callback;
40     void *userdata;
41     
42     AVAHI_LLIST_HEAD(AvahiEntryGroup, groups);
43     AVAHI_LLIST_HEAD(AvahiDomainBrowser, domain_browsers);
44     AVAHI_LLIST_HEAD(AvahiServiceBrowser, service_browsers);
45     AVAHI_LLIST_HEAD(AvahiServiceTypeBrowser, service_type_browsers);
46     AVAHI_LLIST_HEAD(AvahiServiceResolver, service_resolvers);
47     AVAHI_LLIST_HEAD(AvahiHostNameResolver, host_name_resolvers);
48     AVAHI_LLIST_HEAD(AvahiAddressResolver, address_resolvers);
49 };
50
51 struct AvahiEntryGroup {
52     char *path;
53     AvahiEntryGroupState state;
54     AvahiClient *client;
55     AvahiEntryGroupCallback callback;
56     void *userdata;
57     AVAHI_LLIST_FIELDS(AvahiEntryGroup, groups);
58 };
59
60 struct AvahiDomainBrowser {
61     char *path;
62     AvahiClient *client;
63     AvahiDomainBrowserCallback callback;
64     void *userdata;
65     AVAHI_LLIST_FIELDS(AvahiDomainBrowser, domain_browsers);
66 };
67
68 struct AvahiServiceBrowser {
69     char *path;
70     AvahiClient *client;
71     AvahiServiceBrowserCallback callback;
72     void *userdata;
73     AVAHI_LLIST_FIELDS(AvahiServiceBrowser, service_browsers);
74 };
75
76 struct AvahiServiceTypeBrowser {
77     char *path;
78     AvahiClient *client;
79     AvahiServiceTypeBrowserCallback callback;
80     void *userdata;
81     AVAHI_LLIST_FIELDS(AvahiServiceTypeBrowser, service_type_browsers);
82 };
83
84 struct AvahiServiceResolver {
85     char *path;
86     AvahiClient *client;
87     AvahiServiceResolverCallback callback;
88     void *userdata;
89     AVAHI_LLIST_FIELDS(AvahiServiceResolver, service_resolvers);
90 };
91
92 struct AvahiHostNameResolver {
93     char *path;
94     AvahiClient *client;
95     AvahiHostNameResolverCallback callback;
96     void *userdata;
97     AVAHI_LLIST_FIELDS(AvahiHostNameResolver, host_name_resolvers);
98 };
99
100 struct AvahiAddressResolver {
101     char *path;
102     AvahiClient *client;
103     AvahiAddressResolverCallback callback;
104     void *userdata;
105     AVAHI_LLIST_FIELDS(AvahiAddressResolver, address_resolvers);
106 };
107
108 int avahi_client_set_errno (AvahiClient *client, int error);
109 int avahi_client_set_dbus_error(AvahiClient *client, DBusError *error);
110
111 void avahi_entry_group_set_state(AvahiEntryGroup *group, AvahiEntryGroupState state);
112
113 DBusHandlerResult avahi_domain_browser_event (AvahiClient *client, AvahiBrowserEvent event, DBusMessage *message);
114 DBusHandlerResult avahi_service_type_browser_event (AvahiClient *client, AvahiBrowserEvent event, DBusMessage *message);
115 DBusHandlerResult avahi_service_browser_event (AvahiClient *client, AvahiBrowserEvent event, DBusMessage *message);
116
117 DBusHandlerResult avahi_service_resolver_event (AvahiClient *client, AvahiResolverEvent event, DBusMessage *message);
118 DBusHandlerResult avahi_host_name_resolver_event (AvahiClient *client, AvahiResolverEvent event, DBusMessage *message);
119 DBusHandlerResult avahi_address_resolver_event (AvahiClient *client, AvahiResolverEvent event, DBusMessage *message);
120
121 int avahi_client_simple_method_call(AvahiClient *client, const char *path, const char *interface, const char *method);
122
123 #endif