avahi  0.7
ga-entry-group.h
Go to the documentation of this file.
1 /*
2  * ga-entry-group.h - Header for GaEntryGroup
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_ENTRY_GROUP_H__
21 #define __GA_ENTRY_GROUP_H__
22 
23 #include <glib-object.h>
24 #include <avahi-client/publish.h>
25 #include <avahi-client/client.h>
26 
27 #include "ga-client.h"
28 
29 G_BEGIN_DECLS
30 
31 typedef enum {
38 
40 typedef struct _GaEntryGroup GaEntryGroup;
42 
47  gchar *name;
48  gchar *type;
49  gchar *domain;
50  gchar *host;
51  guint16 port;
52 };
53 
55  GObjectClass parent_class;
56 };
57 
58 struct _GaEntryGroup {
59  GObject parent;
60 };
61 
62 GType ga_entry_group_get_type(void);
63 
64 /* TYPE MACROS */
65 #define GA_TYPE_ENTRY_GROUP \
66  (ga_entry_group_get_type())
67 #define GA_ENTRY_GROUP(obj) \
68  (G_TYPE_CHECK_INSTANCE_CAST((obj), GA_TYPE_ENTRY_GROUP, GaEntryGroup))
69 #define GA_ENTRY_GROUP_CLASS(klass) \
70  (G_TYPE_CHECK_CLASS_CAST((klass), GA_TYPE_ENTRY_GROUP, GaEntryGroupClass))
71 #define IS_GA_ENTRY_GROUP(obj) \
72  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GA_TYPE_ENTRY_GROUP))
73 #define IS_GA_ENTRY_GROUP_CLASS(klass) \
74  (G_TYPE_CHECK_CLASS_TYPE((klass), GA_TYPE_ENTRY_GROUP))
75 #define GA_ENTRY_GROUP_GET_CLASS(obj) \
76  (G_TYPE_INSTANCE_GET_CLASS ((obj), GA_TYPE_ENTRY_GROUP, GaEntryGroupClass))
77 
79 
80 gboolean ga_entry_group_attach(GaEntryGroup * group,
81  GaClient * client, GError ** error);
82 
84  const gchar * name,
85  const gchar * type,
86  guint16 port,
87  GError ** error,
89  txt);
90 
92  group,
94  interface,
96  protocol,
98  flags,
99  const gchar *
100  name,
101  const gchar *
102  type,
103  const gchar *
104  domain,
105  const gchar *
106  host,
107  guint16 port,
108  GError ** error,
110  txt);
112  const gchar * name,
113  const gchar * type,
114  guint16 port, GError ** error,
115  ...);
116 
121  const gchar * name,
122  const gchar * type,
123  const gchar * domain,
124  const gchar * host,
125  guint16 port,
126  GError ** error, ...);
127 
128 /* Add raw record */
129 gboolean ga_entry_group_add_record(GaEntryGroup * group,
131  const gchar * name,
132  guint16 type,
133  guint32 ttl,
134  const void *rdata, gsize size, GError ** error);
139  const gchar * name,
140  guint16 clazz,
141  guint16 type,
142  guint32 ttl,
143  const void *rdata,
144  gsize size, GError ** error);
145 
146 
147 
149 
150 /* Set a key in the service record. If the service isn't frozen it's committed
151  * immediately */
153  const gchar * key, const gchar * value,
154  GError ** error);
155 
157  const gchar * key, const guint8 * value,
158  gsize size, GError ** error);
159 
160 /* Remove one key from the service record */
162  const gchar * key, GError ** error);
163 
164 /* Update the txt record of the frozen service */
165 gboolean ga_entry_group_service_thaw(GaEntryGroupService * service, GError ** error);
166 
167 /* Commit all newly added services */
168 gboolean ga_entry_group_commit(GaEntryGroup * group, GError ** error);
169 
170 /* Invalidated all GaEntryGroupServices */
171 gboolean ga_entry_group_reset(GaEntryGroup * group, GError ** error);
172 
173 G_END_DECLS
174 #endif /* #ifndef __GA_ENTRY_GROUP_H__ */
AvahiPublishFlags flags
GaEntryGroupService * ga_entry_group_add_service_full(GaEntryGroup *group, AvahiIfIndex interface, AvahiProtocol protocol, AvahiPublishFlags flags, const gchar *name, const gchar *type, const gchar *domain, const gchar *host, guint16 port, GError **error,...)
int AvahiIfIndex
Numeric network interface index.
Definition: address.h:36
gboolean ga_entry_group_add_record(GaEntryGroup *group, AvahiPublishFlags flags, const gchar *name, guint16 type, guint32 ttl, const void *rdata, gsize size, GError **error)
guint16 port
gboolean ga_entry_group_reset(GaEntryGroup *group, GError **error)
The entries have successfully been established.
Definition: defs.h:233
GObject parent
int AvahiProtocol
Protocol family specification, takes the values AVAHI_PROTO_INET, AVAHI_PROTO_INET6, AVAHI_PROTO_UNSPEC.
Definition: address.h:33
A name collision for one of the entries in the group has been detected, the entries have been withdra...
Definition: defs.h:234
GaEntryGroupService * ga_entry_group_add_service_strlist(GaEntryGroup *group, const gchar *name, const gchar *type, guint16 port, GError **error, AvahiStringList *txt)
void ga_entry_group_service_freeze(GaEntryGroupService *service)
The entries of the group are currently being registered.
Definition: defs.h:232
GObjectClass parent_class
gchar * type
AvahiPublishFlags
Some flags for publishing functions.
Definition: defs.h:243
Linked list of strings that can contain any number of binary characters, including NUL bytes...
Definition: strlst.h:40
gboolean ga_entry_group_commit(GaEntryGroup *group, GError **error)
GaEntryGroupService * ga_entry_group_add_service(GaEntryGroup *group, const gchar *name, const gchar *type, guint16 port, GError **error,...)
AvahiIfIndex interface
gboolean ga_entry_group_service_set(GaEntryGroupService *service, const gchar *key, const gchar *value, GError **error)
gchar * host
gboolean ga_entry_group_add_record_full(GaEntryGroup *group, AvahiIfIndex interface, AvahiProtocol protocol, AvahiPublishFlags flags, const gchar *name, guint16 clazz, guint16 type, guint32 ttl, const void *rdata, gsize size, GError **error)
gchar * domain
GaEntryGroupState
GaEntryGroup * ga_entry_group_new(void)
The group has not yet been commited, the user must still call avahi_entry_group_commit() ...
Definition: defs.h:231
Some kind of failure happened, the entries have been withdrawn.
Definition: defs.h:235
Publishing Client API.
Definitions and functions for the client API over D-Bus.
gboolean ga_entry_group_service_thaw(GaEntryGroupService *service, GError **error)
gboolean ga_entry_group_service_remove_key(GaEntryGroupService *service, const gchar *key, GError **error)
gchar * name
GaEntryGroupService * ga_entry_group_add_service_full_strlist(GaEntryGroup *group, AvahiIfIndex interface, AvahiProtocol protocol, AvahiPublishFlags flags, const gchar *name, const gchar *type, const gchar *domain, const gchar *host, guint16 port, GError **error, AvahiStringList *txt)
gboolean ga_entry_group_service_set_arbitrary(GaEntryGroupService *service, const gchar *key, const guint8 *value, gsize size, GError **error)
AvahiProtocol protocol
gboolean ga_entry_group_attach(GaEntryGroup *group, GaClient *client, GError **error)
GType ga_entry_group_get_type(void)