Lines Matching defs:*
0 #ifndef fooclientpublishhfoo
2 #define fooclientpublishhfoo
4 /* $Id$ */
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
22 USA.
25 #include <inttypes.h>
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 AVAHI_C_DECL_BEGIN
44 /** An entry group object */
45 typedef struct AvahiEntryGroup AvahiEntryGroup;
47 /** The function prototype for the callback of an AvahiEntryGroup */
48 typedef void (*AvahiEntryGroupCallback) (
49 AvahiEntryGroup *g,
50 AvahiEntryGroupState state /**< The new state of the entry group */,
51 void* userdata /* The arbitrary user data pointer originally passed to avahi_entry_group_new()*/);
53 /** @{ \name Construction and destruction */
55 /** Create a new AvahiEntryGroup object */
56 AvahiEntryGroup* avahi_entry_group_new(
57 AvahiClient* c,
58 AvahiEntryGroupCallback callback /**< This callback is called whenever the state of this entry group changes. May not be NULL. Please note that this function is called for the first time from within the avahi_entry_group_new() context! Thus, in the callback you should not make use of global variables that are initialized only after your call to avahi_entry_group_new(). A common mistake is to store the AvahiEntryGroup pointer returned by avahi_entry_group_new() in a global variable and assume that this global variable already contains the valid pointer when the callback is called for the first time. A work-around for this is to always use the AvahiEntryGroup pointer passed to the callback function instead of the global pointer. */,
59 void *userdata /**< This arbitrary user data pointer will be passed to the callback functon */);
61 /** Clean up and free an AvahiEntryGroup object */
62 int avahi_entry_group_free (AvahiEntryGroup *);
64 /** @} */
66 /** @{ \name State */
68 /** Commit an AvahiEntryGroup. The entries in the entry group are now registered on the network. Commiting empty entry groups is considered an error. */
69 int avahi_entry_group_commit (AvahiEntryGroup*);
71 /** Reset an AvahiEntryGroup. This takes effect immediately. */
72 int avahi_entry_group_reset (AvahiEntryGroup*);
74 /** Get an AvahiEntryGroup's state */
75 int avahi_entry_group_get_state (AvahiEntryGroup*);
77 /** Check if an AvahiEntryGroup is empty */
78 int avahi_entry_group_is_empty (AvahiEntryGroup*);
80 /** Get an AvahiEntryGroup's owning client instance */
81 AvahiClient* avahi_entry_group_get_client (AvahiEntryGroup*);
83 /** @} */
85 /** @{ \name Adding and updating entries */
87 /** Add a service. Takes a variable NULL terminated list of TXT record strings as last arguments. Please note that this service is not announced on the network before avahi_entry_group_commit() is called. */
88 int avahi_entry_group_add_service(
89 AvahiEntryGroup *group,
90 AvahiIfIndex interface /**< The interface this service shall be announced on. We recommend to pass AVAHI_IF_UNSPEC here, to announce on all interfaces. */,
91 AvahiProtocol protocol /**< The protocol this service shall be announced with, i.e. MDNS over IPV4 or MDNS over IPV6. We recommend to pass AVAHI_PROTO_UNSPEC here, to announce this service on all protocols the daemon supports. */,
92 AvahiPublishFlags flags /**< Usually 0, unless you know what you do */,
93 const char *name /**< The name for the new service. Must be valid service name. i.e. a string shorter than 63 characters and valid UTF-8. May not be NULL. */,
94 const char *type /**< The service type for the new service, such as _http._tcp. May not be NULL. */,
95 const char *domain /**< The domain to register this domain in. We recommend to pass NULL here, to let the daemon decide */,
96 const char *host /**< The host this services is residing on. We recommend to pass NULL here, the daemon will than automatically insert the local host name in that case */,
97 uint16_t port /**< The IP port number of this service */,
98 ...) AVAHI_GCC_SENTINEL;
100 /** Add a service, takes an AvahiStringList for TXT records. Arguments have the same meaning as for avahi_entry_group_add_service(). */
101 int avahi_entry_group_add_service_strlst(
102 AvahiEntryGroup *group,
103 AvahiIfIndex interface,
104 AvahiProtocol protocol,
105 AvahiPublishFlags flags,
106 const char *name,
107 const char *type,
108 const char *domain,
109 const char *host,
110 uint16_t port,
111 AvahiStringList *txt /**< The TXT data for this service. You may free this object after calling this function, it is not referenced any further */);
113 /** Add a subtype for a service. The service should already be existent in the entry group. You may add as many subtypes for a service as you wish. */
114 int avahi_entry_group_add_service_subtype(
115 AvahiEntryGroup *group,
116 AvahiIfIndex interface /**< The interface this subtype shall be announced on. This should match the value passed for the original avahi_entry_group_add_service() call. */,
117 AvahiProtocol protocol /**< The protocol this subtype shall be announced with. This should match the value passed for the original avahi_entry_group_add_service() call. */,
118 AvahiPublishFlags flags /**< Only != 0 if you really know what you do */,
119 const char *name /**< The name of the service, as passed to avahi_entry_group_add_service(). May not be NULL. */,
120 const char *type /**< The type of the service, as passed to avahi_entry_group_add_service(). May not be NULL. */,
121 const char *domain /**< The domain this service resides is, as passed to avahi_entry_group_add_service(). May be NULL. */,
122 const char *subtype /**< The new subtype to register for the specified service. May not be NULL. */);
124 /** Update a TXT record for an existing service. The service should already be existent in the entry group. */
125 int avahi_entry_group_update_service_txt(
126 AvahiEntryGroup *g,
127 AvahiIfIndex interface /**< The interface this service is announced on. This should match the value passed to the original avahi_entry_group_add_service() call. */,
128 AvahiProtocol protocol /**< The protocol this service is announced with. This should match the value passed to the original avahi_entry_group_add_service() call. */,
129 AvahiPublishFlags flags /**< Only != 0 if you really know what you do */,
130 const char *name /**< The name of the service, as passed to avahi_entry_group_add_service(). May not be NULL. */,
131 const char *type /**< The type of the service, as passed to avahi_entry_group_add_service(). May not be NULL. */,
132 const char *domain /**< The domain this service resides is, as passed to avahi_entry_group_add_service(). May be NULL. */,
133 ...) AVAHI_GCC_SENTINEL;
135 /** Update a TXT record for an existing service. Similar to avahi_entry_group_update_service_txt() but takes an AvahiStringList for the TXT strings, instead of a NULL terminated list of arguments. */
136 int avahi_entry_group_update_service_txt_strlst(
137 AvahiEntryGroup *g,
138 AvahiIfIndex interface,
139 AvahiProtocol protocol,
140 AvahiPublishFlags flags,
141 const char *name,
142 const char *type,
143 const char *domain,
144 AvahiStringList *strlst);
146 /** \cond fulldocs */
147 /** Add a host/address pair */
148 int avahi_entry_group_add_address(
149 AvahiEntryGroup *group,
150 AvahiIfIndex interface,
151 AvahiProtocol protocol,
152 AvahiPublishFlags flags,
153 const char *name /**< The FDQN of the new hostname to register */,
154 const AvahiAddress *a /**< The address this host name shall map to */);
155 /** \endcond */
157 /** Add an arbitrary record. I hope you know what you do. */
158 int avahi_entry_group_add_record(
159 AvahiEntryGroup *group,
160 AvahiIfIndex interface,
161 AvahiProtocol protocol,
162 AvahiPublishFlags flags,
163 const char *name,
164 uint16_t clazz,
165 uint16_t type,
166 uint32_t ttl,
167 const void *rdata,
168 size_t size);
170 /** @} */
172 AVAHI_C_DECL_END
174 #endif