+ public void UpdateService (int iface, Protocol proto, PublishFlags flags, string name, string type,
+ string domain, params string[] txt)
+ {
+ IntPtr list = avahi_string_list_new (IntPtr.Zero);
+
+ if (txt != null) {
+ foreach (string item in txt) {
+ list = avahi_string_list_add (list, Utility.StringToBytes (item));
+ }
+ }
+
+ UpdateService (iface, proto, flags, name, type, domain, list);
+ }
+
+ public void UpdateService (int iface, Protocol proto, PublishFlags flags, string name, string type,
+ string domain, params byte[][] txt)
+ {
+ IntPtr list = avahi_string_list_new (IntPtr.Zero);
+
+ if (txt != null) {
+ foreach (byte[] item in txt) {
+ list = avahi_string_list_add (list, item);
+ }
+ }
+
+ UpdateService (iface, proto, flags, name, type, domain, list);
+ }
+
+ private void UpdateService (int iface, Protocol proto, PublishFlags flags, string name, string type,
+ string domain, IntPtr list)
+ {
+ lock (client) {
+ int ret = avahi_entry_group_update_service_strlst (handle, iface, proto, flags,
+ Utility.StringToBytes (name),
+ Utility.StringToBytes (type),
+ Utility.StringToBytes (domain),
+ list);
+
+ avahi_string_list_free (list);
+
+ if (ret < 0) {
+ client.ThrowError ();
+ }
+ }
+ }
+
+ public void AddServiceSubtype (string name, string type, string domain, string subtype)
+ {
+ AddServiceSubtype (-1, Protocol.Unspecified, PublishFlags.None, name, type, domain, subtype);
+ }
+
+ public void AddServiceSubtype (int iface, Protocol proto, PublishFlags flags, string name,
+ string type, string domain, string subtype)
+ {
+ lock (client) {
+ int ret = avahi_entry_group_add_service_subtype (handle, iface, proto, flags,
+ Utility.StringToBytes (name),
+ Utility.StringToBytes (type),
+ Utility.StringToBytes (domain),
+ Utility.StringToBytes (subtype));
+
+ if (ret < 0) {
+ client.ThrowError ();
+ }
+ }
+ }
+
+ public void AddAddress (string name, IPAddress address)
+ {
+ AddAddress (-1, Protocol.Unspecified, PublishFlags.None, name, address);
+ }
+
+ public void AddAddress (int iface, Protocol proto, PublishFlags flags, string name, IPAddress address)
+ {
+ IntPtr addressPtr = Utility.AddressToPtr (address);