• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * ga-service-resolver.h - Header for GaServiceResolver
3  * Copyright (C) 2006-2007 Collabora Ltd.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19 
20 #ifndef __GA_SERVICE_RESOLVER_H__
21 #define __GA_SERVICE_RESOLVER_H__
22 
23 
24 #include <avahi-common/address.h>
25 
26 #include <glib-object.h>
27 #include "ga-client.h"
28 #include "ga-enums.h"
29 
30 G_BEGIN_DECLS
31 
32 typedef struct _GaServiceResolver GaServiceResolver;
33 typedef struct _GaServiceResolverClass GaServiceResolverClass;
34 
35 struct _GaServiceResolverClass {
36     GObjectClass parent_class;
37 };
38 
39 struct _GaServiceResolver {
40     GObject parent;
41 };
42 
43 GType ga_service_resolver_get_type(void);
44 
45 /* TYPE MACROS */
46 #define GA_TYPE_SERVICE_RESOLVER \
47   (ga_service_resolver_get_type())
48 #define GA_SERVICE_RESOLVER(obj) \
49   (G_TYPE_CHECK_INSTANCE_CAST((obj), GA_TYPE_SERVICE_RESOLVER, GaServiceResolver))
50 #define GA_SERVICE_RESOLVER_CLASS(klass) \
51   (G_TYPE_CHECK_CLASS_CAST((klass), GA_TYPE_SERVICE_RESOLVER, GaServiceResolverClass))
52 #define IS_GA_SERVICE_RESOLVER(obj) \
53   (G_TYPE_CHECK_INSTANCE_TYPE((obj), GA_TYPE_SERVICE_RESOLVER))
54 #define IS_GA_SERVICE_RESOLVER_CLASS(klass) \
55   (G_TYPE_CHECK_CLASS_TYPE((klass), GA_TYPE_SERVICE_RESOLVER))
56 #define GA_SERVICE_RESOLVER_GET_CLASS(obj) \
57   (G_TYPE_INSTANCE_GET_CLASS ((obj), GA_TYPE_SERVICE_RESOLVER, GaServiceResolverClass))
58 
59 GaServiceResolver *ga_service_resolver_new(AvahiIfIndex interface,
60                                            AvahiProtocol protocol,
61                                            const gchar * name,
62                                            const gchar * type,
63                                            const gchar * domain,
64                                            AvahiProtocol address_protocol,
65                                            GaLookupFlags flags);
66 
67 gboolean
68 ga_service_resolver_attach(GaServiceResolver * resolver,
69                            GaClient * client, GError ** error);
70 
71 gboolean
72 ga_service_resolver_get_address(GaServiceResolver * resolver,
73                                 AvahiAddress * address, uint16_t * port);
74 G_END_DECLS
75 #endif /* #ifndef __GA_SERVICE_RESOLVER_H__ */
76