summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2017-08-04 14:27:34 (GMT)
committerNiraj Kumar Goit <niraj.g@samsung.com>2017-08-09 04:55:38 (GMT)
commit49768e3fb3623e93dce860fca8469cde51902851 (patch)
treeb20896525f73391c79b97dfb9abb4130a5be10e6 /src
parentfd3573b27dcecd10afaaabada6892a0e65974e44 (diff)
downloadconnman-49768e3fb3623e93dce860fca8469cde51902851.zip
connman-49768e3fb3623e93dce860fca8469cde51902851.tar.gz
connman-49768e3fb3623e93dce860fca8469cde51902851.tar.bz2
Change-Id: I560be68a876a5fef516647365db3c56761f2aba1 Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/connman.h4
-rwxr-xr-xsrc/manager.c29
-rwxr-xr-xsrc/network.c27
-rwxr-xr-xsrc/service.c47
4 files changed, 106 insertions, 1 deletions
diff --git a/src/connman.h b/src/connman.h
index 237c1ec..dcd8c7f 100755
--- a/src/connman.h
+++ b/src/connman.h
@@ -917,6 +917,10 @@ int __connman_rtnl_init(void);
void __connman_rtnl_start(void);
void __connman_rtnl_cleanup(void);
+#if defined TIZEN_EXT
+void __connman_wifi_vsie_list_struct(DBusMessageIter *iter);
+#endif
+
enum connman_device_type __connman_rtnl_get_device_type(int index);
unsigned int __connman_rtnl_update_interval_add(unsigned int interval);
unsigned int __connman_rtnl_update_interval_remove(unsigned int interval);
diff --git a/src/manager.c b/src/manager.c
index 32705e4..622ed59 100755
--- a/src/manager.c
+++ b/src/manager.c
@@ -34,6 +34,30 @@
static bool connman_state_idle;
static dbus_bool_t sessionmode;
+#if defined TIZEN_EXT
+static void append_wifi_vsies_structs(DBusMessageIter *iter, void *user_data)
+{
+ __connman_wifi_vsie_list_struct(iter);
+}
+
+static DBusMessage *get_wifi_vsies(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ DBusMessage *reply;
+
+ DBG("ConnMan, get_wifi_vsies API called");
+
+ reply = dbus_message_new_method_return(msg);
+ if (!reply)
+ return NULL;
+
+ __connman_dbus_append_objpath_dict_array(reply,
+ append_wifi_vsies_structs, NULL);
+
+ return reply;
+}
+#endif
+
static DBusMessage *get_properties(DBusConnection *conn,
DBusMessage *msg, void *data)
{
@@ -575,6 +599,11 @@ static const GDBusMethodTable manager_methods[] = {
{ GDBUS_METHOD("UnregisterPeerService",
GDBUS_ARGS({ "specification", "a{sv}" }), NULL,
unregister_peer_service) },
+#if defined TIZEN_EXT
+ { GDBUS_METHOD("GetVsies",
+ NULL, GDBUS_ARGS({ "Vsie", "a(oa{sv})" }),
+ get_wifi_vsies) },
+#endif
{ },
};
diff --git a/src/network.c b/src/network.c
index 8a6b906..546479c 100755
--- a/src/network.c
+++ b/src/network.c
@@ -101,6 +101,8 @@ struct connman_network {
char *keymgmt_type;
bool rsn_mode;
int disconnect_reason;
+ void *wifi_vsie;
+ unsigned int wifi_vsie_len;
#endif
} wifi;
@@ -975,7 +977,9 @@ static void network_destruct(struct connman_network *network)
g_free(network->wifi.private_key_passphrase);
g_free(network->wifi.phase2_auth);
g_free(network->wifi.pin_wps);
-
+#if defined TIZEN_EXT
+ g_free(network->wifi.wifi_vsie);
+#endif
g_free(network->path);
g_free(network->group);
g_free(network->node);
@@ -2424,6 +2428,16 @@ int connman_network_set_blob(struct connman_network *network,
network->wifi.ssid_len = size;
} else
network->wifi.ssid_len = 0;
+#if defined TIZEN_EXT
+ } else if (g_str_equal(key, "WiFi.Vsie")){
+ g_free(network->wifi.wifi_vsie);
+ network->wifi.wifi_vsie = g_try_malloc(size);
+ if (network->wifi.wifi_vsie) {
+ memcpy(network->wifi.wifi_vsie, data, size);
+ network->wifi.wifi_vsie_len = size;
+ } else
+ network->wifi.wifi_vsie_len = 0;
+#endif
} else {
return -EINVAL;
}
@@ -2450,6 +2464,17 @@ const void *connman_network_get_blob(struct connman_network *network,
return network->wifi.ssid;
}
+#if defined TIZEN_EXT
+ if (g_str_equal(key, "WiFi.Vsie")) {
+ if (size) {
+ *size = network->wifi.wifi_vsie_len;
+ DBG("network %p key %s size=%d", network, key, *size);
+ }
+
+ return network->wifi.wifi_vsie;
+ }
+#endif
+
return NULL;
}
diff --git a/src/service.c b/src/service.c
index a5a7f39..4497b39 100755
--- a/src/service.c
+++ b/src/service.c
@@ -3381,6 +3381,53 @@ void __connman_service_list_struct(DBusMessageIter *iter)
g_list_foreach(service_list, append_struct, iter);
}
+#if defined TIZEN_EXT
+static void append_wifi_vsie_properties(DBusMessageIter *iter,
+ struct connman_service *service)
+{
+ DBusMessageIter dict;
+ const void *wifi_vsie;
+ unsigned int wifi_vsie_len;
+
+ connman_dbus_dict_open(iter, &dict);
+
+ wifi_vsie = connman_network_get_blob(service->network, "WiFi.Vsie", &wifi_vsie_len);
+
+ if(wifi_vsie_len > 0) {
+ DBG("ConnMan, service->path=%s vsie length=%d", service->path, wifi_vsie_len);
+ }
+
+ connman_dbus_dict_append_fixed_array(&dict, "Vsie", DBUS_TYPE_BYTE,
+ &wifi_vsie, wifi_vsie_len);
+
+ connman_dbus_dict_close(iter, &dict);
+}
+
+void __connman_wifi_vsie_list_struct(DBusMessageIter *iter)
+{
+ GList *list;
+ DBusMessageIter entry;
+
+ DBG("ConnMan, __connman_wifi_vsie_list_struct API called");
+
+ for (list = service_list; list; list = list->next) {
+ struct connman_service *service = list->data;
+
+ if (!service->path ||
+ service->type != CONNMAN_SERVICE_TYPE_WIFI ||
+ service->network == NULL)
+ continue;
+
+ dbus_message_iter_open_container(iter, DBUS_TYPE_STRUCT,
+ NULL, &entry);
+ dbus_message_iter_append_basic(&entry, DBUS_TYPE_OBJECT_PATH,
+ &service->path);
+ append_wifi_vsie_properties(&entry, service);
+ dbus_message_iter_close_container(iter, &entry);
+ }
+}
+#endif
+
bool __connman_service_is_hidden(struct connman_service *service)
{
return service->hidden;