3 * Copyright (C) 2009 Sebastian Noack
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.
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.
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 Street, Fifth Floor, Boston, MA 02110-1301 USA
19 * As a special exception, if you use inline functions from this file, this
20 * file does not by itself cause the resulting executable to be covered by
21 * the GNU Lesser General Public License.
24 * Sebastian Noack <sebastian.noack@gmail.com>
27 [CCode(cprefix="Ga", lower_case_cprefix="ga_")]
31 [CCode(cheader_filename="avahi-gobject/ga-error.h", cprefix="AVAHI_ERR_")]
32 public errordomain Error {
68 INVALID_SERVICE_SUBTYPE,
93 [CCode(cheader_filename="avahi-gobject/ga-error.h", cname="avahi_strerror")]
94 public unowned string strerror(int errno);
99 [CCode(cheader_filename="avahi-gobject/ga-enums.h", cprefix="GA_LOOKUP_RESULT_")]
100 public enum LookupResultFlags {
110 [CCode(cheader_filename="avahi-gobject/ga-enums.h", cprefix="GA_LOOKUP_")]
111 public enum LookupFlags {
122 [CCode(cheader_filename="avahi-gobject/ga-client.h")]
123 public enum ClientState {
133 [CCode(cheader_filename="avahi-gobject/ga-client.h", cprefix="GA_CLIENT_FLAG_")]
134 public enum ClientFlags {
140 [CCode(cheader_filename="avahi-gobject/ga-client.h")]
141 public class Client : GLib.Object {
142 public Client(ClientFlags flags=ClientFlags.NO_FLAGS);
144 public void start() throws Error;
147 public ClientState state { get; }
149 public ClientFlags flags { get; construct; }
151 public signal void state_changed(ClientState state);
157 [CCode(cheader_filename="avahi-gobject/ga-record-browser.h")]
158 public class RecordBrowser : GLib.Object {
159 public RecordBrowser(string name, uint16 type);
160 public RecordBrowser.full(Interface interface, Protocol protocol, string name, uint16 class, uint16 type, LookupFlags flags=LookupFlags.NO_FLAGS);
162 public void attach(Client client) throws Error;
165 public Protocol protocol { get; set; }
167 public Interface interface { get; set; }
169 public string name { owned get; set; }
171 public uint16 type { get; set; }
173 public uint16 class { get; set; }
175 public LookupFlags flags { get; set; }
177 public signal void new_record(Interface interface, Protocol protocol, string name, uint16 class, uint16 type, char[] data, LookupResultFlags flags);
178 public signal void removed_record(Interface interface, Protocol protocol, string name, uint16 class, uint16 type, char[] data, LookupResultFlags flags);
179 public signal void all_for_now();
180 public signal void cache_exhausted();
181 public signal void failure(GLib.Error error);
185 /* Service browser */
187 [CCode(cheader_filename="avahi-gobject/ga-service-browser.h")]
188 public class ServiceBrowser : GLib.Object {
189 public ServiceBrowser(string type);
190 public ServiceBrowser.full(Interface interface, Protocol protocol, string type, string? domain=null, LookupFlags flags=LookupFlags.NO_FLAGS);
192 public void attach(Client client) throws Error;
195 public Protocol protocol { get; set; }
197 public Protocol aprotocol { get; set; }
199 public Interface interface { get; set; }
201 public string type { owned get; set; }
203 public string? domain { owned get; set; }
205 public LookupFlags flags { get; set; }
207 public signal void new_service(Interface interface, Protocol protocol, string name, string type, string domain, LookupResultFlags flags);
208 public signal void removed_service(Interface interface, Protocol protocol, string name, string type, string domain, LookupResultFlags flags);
209 public signal void all_for_now();
210 public signal void cache_exhausted();
211 public signal void failure(GLib.Error error);
215 /* Service resolver */
217 [CCode(cheader_filename="avahi-gobject/ga-service-resolver.h")]
218 public class ServiceResolver : GLib.Object {
219 public ServiceResolver(Interface interface, Protocol protocol, string name, string type, string domain, Protocol address_protocol, LookupFlags flags=LookupFlags.NO_FLAGS);
221 public void attach(Client client) throws Error;
222 public bool get_address(out Address address, out uint16 port);
225 public Protocol protocol { get; set; }
227 public Protocol aprotocol { get; set; }
229 public Interface interface { get; set; }
231 public string name { owned get; set; }
233 public string type { owned get; set; }
235 public string domain { owned get; set; }
237 public LookupFlags flags { get; set; }
239 public signal void found(Interface interface, Protocol protocol, string name, string type, string domain, string hostname, Address? address, uint16 port, StringList? txt, LookupResultFlags flags);
240 public signal void failure(GLib.Error error);
243 [CCode(cheader_filename="avahi-gobject/ga-entry-group.h")]
244 public enum EntryGroupState {
253 [CCode(cheader_filename="avahi-gobject/ga-entry-group.h", ref_function="", unref_function="")]
254 public class EntryGroupService {
255 public Interface interface;
256 public Protocol protocol;
257 public PublishFlags flags;
260 public string domain;
264 public void freeze();
265 public void set(string key, string value) throws Error;
266 public void set_arbitrary(string key, char[] value) throws Error;
267 public void remove_key(string key) throws Error;
268 public void thaw() throws Error;
271 [CCode(cheader_filename="avahi-gobject/ga-entry-group.h")]
272 public class EntryGroup : GLib.Object {
275 public void attach(Client client) throws Error;
277 public EntryGroupService add_service_strlist(string name, string type, uint16 port, ...) throws Error;
279 public EntryGroupService add_service_full_strlist(Interface interface, Protocol protocol, PublishFlags flags, string name, string type, string domain, string host, uint16 port, ...) throws Error;
280 public EntryGroupService add_service(string name, string type, uint16 port, ...) throws Error;
281 public EntryGroupService add_service_full(Interface interface, Protocol protocol, PublishFlags flags, string name, string type, string domain, string host, uint16 port, ...) throws Error;
282 public void add_record(PublishFlags flags, string name, uint16 type, uint32 ttl, char[] data) throws Error;
283 public void add_record_full(Interface interface, Protocol protocol, PublishFlags flags, string name, uint16 class, uint16 type, uint32 ttl, char[] data) throws Error;
284 public void commit() throws Error;
285 public void reset() throws Error;
288 public EntryGroupState state { get; }
290 public signal void state_changed(EntryGroupState state);