]> git.meshlink.io Git - catta/blob - avahi-client/publish.h
change rdata type from "uint8_t*" to "const void*"
[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 AVAHI_C_DECL_BEGIN
43
44 /** An entry group object */
45 typedef struct AvahiEntryGroup AvahiEntryGroup;
46
47 /** The function prototype for the callback of an AvahiEntryGroup */
48 typedef void (*AvahiEntryGroupCallback) (AvahiEntryGroup *g, AvahiEntryGroupState state, void* userdata);
49
50 /** Create a new AvahiEntryGroup object */
51 AvahiEntryGroup* avahi_entry_group_new (AvahiClient*, AvahiEntryGroupCallback callback, void *userdata);
52
53 /** Clean up and free an AvahiEntryGroup object */
54 int avahi_entry_group_free (AvahiEntryGroup *);
55
56 /** Commit an AvahiEntryGroup */
57 int avahi_entry_group_commit (AvahiEntryGroup*);
58
59 /** Reset an AvahiEntryGroup */
60 int avahi_entry_group_reset (AvahiEntryGroup*);
61
62 /** Get an AvahiEntryGroup's state */
63 int avahi_entry_group_get_state (AvahiEntryGroup*);
64
65 /** Check if an AvahiEntryGroup is empty */
66 int avahi_entry_group_is_empty (AvahiEntryGroup*);
67
68 /** Get an AvahiEntryGroup's owning client instance */
69 AvahiClient* avahi_entry_group_get_client (AvahiEntryGroup*);
70
71 /** Add a service, takes a variable NULL terminated list of text records */
72 int avahi_entry_group_add_service(
73     AvahiEntryGroup *group,
74     AvahiIfIndex interface,
75     AvahiProtocol protocol,
76     AvahiPublishFlags flags,
77     const char *name,
78     const char *type,
79     const char *domain,
80     const char *host,
81     uint16_t port,
82     ...) AVAHI_GCC_SENTINEL;
83
84 /** Add a service, takes an AvahiStringList for text records */
85 int avahi_entry_group_add_service_strlst(
86     AvahiEntryGroup *group,
87     AvahiIfIndex interface,
88     AvahiProtocol protocol,
89     AvahiPublishFlags flags,
90     const char *name,
91     const char *type,
92     const char *domain,
93     const char *host,
94     uint16_t port,
95     AvahiStringList *txt);
96
97 /** Add a subtype for a service */
98 int avahi_entry_group_add_service_subtype(
99     AvahiEntryGroup *group,
100     AvahiIfIndex interface,
101     AvahiProtocol protocol,
102     AvahiPublishFlags flags,
103     const char *name,
104     const char *type,
105     const char *domain,
106     const char *subtype);
107
108 /** Update a TXT record for an existing service */
109 int avahi_entry_group_update_service_txt(
110     AvahiEntryGroup *g,
111     AvahiIfIndex interface,
112     AvahiProtocol protocol,
113     AvahiPublishFlags flags,
114     const char *name,     
115     const char *type,     
116     const char *domain,   
117     ...) AVAHI_GCC_SENTINEL;
118
119 /** Update a TXT record for an existing service */
120 int avahi_entry_group_update_service_txt_strlst(
121     AvahiEntryGroup *g,
122     AvahiIfIndex interface,
123     AvahiProtocol protocol,
124     AvahiPublishFlags flags,
125     const char *name,     
126     const char *type,     
127     const char *domain,   
128     AvahiStringList *strlst);
129
130 /** Add a host/address pair */
131 int avahi_entry_group_add_address(
132     AvahiEntryGroup *group,
133     AvahiIfIndex interface,
134     AvahiProtocol protocol,
135     AvahiPublishFlags flags,
136     const char *name,
137     const AvahiAddress *a);
138
139 /** Add an arbitrary record */
140 int avahi_entry_group_add_record(
141     AvahiEntryGroup *group,
142     AvahiIfIndex interface,
143     AvahiProtocol protocol,
144     AvahiPublishFlags flags,
145     const char *name,
146     uint16_t clazz,
147     uint16_t type,
148     uint32_t ttl,
149     const void *rdata,
150     size_t size);
151
152 AVAHI_C_DECL_END
153
154 #endif