e_dbus/connman: add Domains property
authorlucas <lucas@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 14 Nov 2011 15:19:46 +0000 (15:19 +0000)
committerlucas <lucas@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 14 Nov 2011 15:19:46 +0000 (15:19 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@65183 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/connman/E_Connman.h
src/lib/connman/e_connman.c
src/lib/connman/e_connman_private.h
src/lib/connman/e_connman_service.c

index 69f8921..a8ed701 100644 (file)
@@ -152,6 +152,7 @@ EAPI Eina_Bool              e_connman_service_login_required_get(const E_Connman
 
 EAPI Eina_Bool              e_connman_service_roaming_get(const E_Connman_Element *service, Eina_Bool *roaming) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
 EAPI Eina_Bool              e_connman_service_nameservers_get(const E_Connman_Element *service, unsigned int *count, const char ***nameserver) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT;
+EAPI Eina_Bool              e_connman_service_domains_get(const E_Connman_Element *service, unsigned int *count, const char ***domains) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT;
 
 EAPI Eina_Bool              e_connman_service_ipv4_method_get(const E_Connman_Element *service, const char **method) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
 EAPI Eina_Bool              e_connman_service_ipv4_address_get(const E_Connman_Element *service, const char **address) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
index 57f086c..d8306c4 100644 (file)
@@ -63,6 +63,7 @@ const char *e_connman_prop_technologies_available = NULL;
 const char *e_connman_prop_technologies_enabled = NULL;
 const char *e_connman_prop_technologies_connected = NULL;
 const char *e_connman_prop_nameservers = NULL;
+const char *e_connman_prop_domains = NULL;
 
 int _e_dbus_connman_log_dom = -1;
 
@@ -312,6 +313,7 @@ e_connman_system_init(E_DBus_Connection *edbus_conn)
    ADD_STRINGSHARE(e_connman_prop_technologies_connected,
                    "ConnectedTechnologies");
    ADD_STRINGSHARE(e_connman_prop_nameservers, "Nameservers");
+   ADD_STRINGSHARE(e_connman_prop_domains, "Domains");
 
 #undef ADD_STRINGSHARE
 
@@ -406,6 +408,7 @@ e_connman_system_shutdown(void)
    _stringshare_del(&e_connman_prop_technologies_enabled);
    _stringshare_del(&e_connman_prop_technologies_connected);
    _stringshare_del(&e_connman_prop_nameservers);
+   _stringshare_del(&e_connman_prop_domains);
 
    if (pending_get_name_owner)
      {
index 3a87ed1..ddc3e5e 100644 (file)
@@ -74,6 +74,7 @@ extern const char *e_connman_prop_technologies_enabled;
 extern const char *e_connman_prop_technologies_connected;
 extern const char *e_connman_prop_login_required;
 extern const char *e_connman_prop_nameservers;
+extern const char *e_connman_prop_domains;
 
 extern int _e_dbus_connman_log_dom;
 
index f593cd6..12f1f26 100644 (file)
@@ -697,6 +697,38 @@ e_connman_service_nameservers_get(const E_Connman_Element *service, unsigned int
 }
 
 /**
+ * Get property "Domains" value.
+ *
+ * If this property isn't found then @c EINA_FALSE is returned.
+ * If @c EINA_FALSE is returned, then this call failed and parameter-returned
+ * values shall be considered invalid.
+ * The list of currently active domains for this service. If the server is
+ * not in READY or ONLINE state than this list will be empty.
+ *
+ * The list of currently used search domains.
+ *
+ * @param service path to get property.
+ * @param count return the number of elements in array.
+ * @param domains array with pointers to internal strings. These
+ *        strings are not copied in any way, and they are granted to
+ *        be eina_stringshare instances, so one can use
+ *        eina_stringshare_ref() if he wants to save memory and cpu to
+ *        get an extra reference. The array itself is allocated using
+ *        malloc() and should be freed after usage is done. This
+ *        pointer is just set if return is @c EINA_TRUE.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
+Eina_Bool
+e_connman_service_domains_get(const E_Connman_Element *service, unsigned int *count, const char ***domains)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(domains, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(count, EINA_FALSE);
+   return e_connman_element_strings_array_get_stringshared
+             (service, e_connman_prop_domains, count, domains);
+}
+/**
  * Get property "IPv4.Method" value.
  *
  * If this property isn't found then @c EINA_FALSE is returned.