1 #ifndef fooclientpublishhfoo
2 #define fooclientpublishhfoo
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
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>
34 #include <avahi-client/client.h>
36 /** \file avahi-client/publish.h Publishing Client API */
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. */
42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
46 /** An entry group object */
47 typedef struct AvahiEntryGroup AvahiEntryGroup;
49 /** The function prototype for the callback of an AvahiEntryGroup */
50 typedef void (*AvahiEntryGroupCallback) (AvahiEntryGroup *g, AvahiEntryGroupState state, void* userdata);
52 /** Create a new AvahiEntryGroup object */
53 AvahiEntryGroup* avahi_entry_group_new (AvahiClient*, AvahiEntryGroupCallback callback, void *userdata);
55 /** Clean up and free an AvahiEntryGroup object */
56 int avahi_entry_group_free (AvahiEntryGroup *);
58 /** Commit an AvahiEntryGroup */
59 int avahi_entry_group_commit (AvahiEntryGroup*);
61 /** Reset an AvahiEntryGroup */
62 int avahi_entry_group_reset (AvahiEntryGroup*);
64 /** Get an AvahiEntryGroup's state */
65 int avahi_entry_group_get_state (AvahiEntryGroup*);
67 /** Check if an AvahiEntryGroup is empty */
68 int avahi_entry_group_is_empty (AvahiEntryGroup*);
70 /** Get an AvahiEntryGroup's owning client instance */
71 AvahiClient* avahi_entry_group_get_client (AvahiEntryGroup*);
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,
84 ...) AVAHI_GCC_SENTINEL;
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,
97 AvahiStringList *txt);
99 /** Add a subtype for a service */
100 int avahi_entry_group_add_service_subtype(
101 AvahiEntryGroup *group,
102 AvahiIfIndex interface,
103 AvahiProtocol protocol,
104 AvahiPublishFlags flags,
108 const char *subtype);
110 /** Update a TXT record for an existing service */
111 int avahi_entry_group_update_service_txt(
113 AvahiIfIndex interface,
114 AvahiProtocol protocol,
115 AvahiPublishFlags flags,
119 ...) AVAHI_GCC_SENTINEL;
121 /** Update a TXT record for an existing service */
122 int avahi_entry_group_update_service_txt_strlst(
124 AvahiIfIndex interface,
125 AvahiProtocol protocol,
126 AvahiPublishFlags flags,
130 AvahiStringList *strlst);
132 /** Add a host/address pair */
133 int avahi_entry_group_add_address(
134 AvahiEntryGroup *group,
135 AvahiIfIndex interface,
136 AvahiProtocol protocol,
137 AvahiPublishFlags flags,
139 const AvahiAddress *a);
141 #ifndef DOXYGEN_SHOULD_SKIP_THIS