]> git.meshlink.io Git - catta/blob - avahi-client/publish.h
* Add custom user-specific configure flags to bootstrap.sh
[catta] / avahi-client / publish.h
1 #ifndef fooclientpublishhfoo
2 #define fooclientpublishhfoo
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 <inttypes.h>
26
27 #include <avahi-common/cdecl.h>
28 #include <avahi-common/address.h>
29 #include <avahi-common/strlst.h>
30 #include <avahi-common/defs.h>
31 #include <avahi-common/watch.h>
32 #include <avahi-common/gccmacro.h>
33
34 #include <avahi-client/client.h>
35
36 /** \file avahi-client/publish.h Publishing Client API */
37
38 /** \example client-publish-service.c Example how to register a DNS-SD
39  * service using the client interface to avahi-daemon. It behaves like a network
40  * printer registering both an IPP and a BSD LPR service. */
41
42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43 AVAHI_C_DECL_BEGIN
44 #endif
45
46 /** An entry group object */
47 typedef struct AvahiEntryGroup AvahiEntryGroup;
48
49 /** The function prototype for the callback of an AvahiEntryGroup */
50 typedef void (*AvahiEntryGroupCallback) (AvahiEntryGroup *g, AvahiEntryGroupState state, void* userdata);
51
52 /** Create a new AvahiEntryGroup object */
53 AvahiEntryGroup* avahi_entry_group_new (AvahiClient*, AvahiEntryGroupCallback callback, void *userdata);
54
55 /** Clean up and free an AvahiEntryGroup object */
56 int avahi_entry_group_free (AvahiEntryGroup *);
57
58 /** Commit an AvahiEntryGroup */
59 int avahi_entry_group_commit (AvahiEntryGroup*);
60
61 /** Reset an AvahiEntryGroup */
62 int avahi_entry_group_reset (AvahiEntryGroup*);
63
64 /** Get an AvahiEntryGroup's state */
65 int avahi_entry_group_get_state (AvahiEntryGroup*);
66
67 /** Check if an AvahiEntryGroup is empty */
68 int avahi_entry_group_is_empty (AvahiEntryGroup*);
69
70 /** Get an AvahiEntryGroup's owning client instance */
71 AvahiClient* avahi_entry_group_get_client (AvahiEntryGroup*);
72
73 /** Add a service, takes a variable NULL terminated list of text records */
74 int avahi_entry_group_add_service(
75     AvahiEntryGroup *group,
76     AvahiIfIndex interface,
77     AvahiProtocol protocol,
78     AvahiPublishFlags flags,
79     const char *name,
80     const char *type,
81     const char *domain,
82     const char *host,
83     uint16_t port,
84     ...) AVAHI_GCC_SENTINEL;
85
86 /** Add a service, takes an AvahiStringList for text records */
87 int avahi_entry_group_add_service_strlst(
88     AvahiEntryGroup *group,
89     AvahiIfIndex interface,
90     AvahiProtocol protocol,
91     AvahiPublishFlags flags,
92     const char *name,
93     const char *type,
94     const char *domain,
95     const char *host,
96     uint16_t port,
97     AvahiStringList *txt);
98
99 /** Add a service, takes a NULL terminated va_list for text records */
100 int avahi_entry_group_add_service_va(
101     AvahiEntryGroup *group,
102     AvahiIfIndex interface,
103     AvahiProtocol protocol,
104     AvahiPublishFlags flags,
105     const char *name,
106     const char *type,
107     const char *domain,
108     const char *host,
109     uint16_t port,
110     va_list va);
111
112 /** Add a subtype for a service */
113 int avahi_entry_group_add_service_subtype(
114     AvahiEntryGroup *group,
115     AvahiIfIndex interface,
116     AvahiProtocol protocol,
117     AvahiPublishFlags flags,
118     const char *name,
119     const char *type,
120     const char *domain,
121     const char *subtype);
122
123 /** Update a TXT record for an existing service */
124 int avahi_entry_group_update_service_txt(
125     AvahiEntryGroup *g,
126     AvahiIfIndex interface,
127     AvahiProtocol protocol,
128     AvahiPublishFlags flags,
129     const char *name,     
130     const char *type,     
131     const char *domain,   
132     ...) AVAHI_GCC_SENTINEL;
133
134 /** Update a TXT record for an existing service */
135 int avahi_entry_group_update_service_txt_strlst(
136     AvahiEntryGroup *g,
137     AvahiIfIndex interface,
138     AvahiProtocol protocol,
139     AvahiPublishFlags flags,
140     const char *name,     
141     const char *type,     
142     const char *domain,   
143     AvahiStringList *strlst);
144
145 /** Update a TXT record for an existing service */
146 int avahi_entry_group_update_service_txt_va(
147     AvahiEntryGroup *g,
148     AvahiIfIndex interface,
149     AvahiProtocol protocol,
150     AvahiPublishFlags flags,
151     const char *name,     
152     const char *type,     
153     const char *domain,   
154     va_list va);
155
156 /** Add a host/address pair */
157 int avahi_entry_group_add_address(
158     AvahiEntryGroup *group,
159     AvahiIfIndex interface,
160     AvahiProtocol protocol,
161     AvahiPublishFlags flags,
162     const char *name,
163     const AvahiAddress *a);
164
165 #ifndef DOXYGEN_SHOULD_SKIP_THIS
166 AVAHI_C_DECL_END
167 #endif
168
169 #endif