summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2016-06-15 20:13:09 +0530
committerNiraj Kumar Goit <niraj.g@samsung.com>2016-06-17 03:33:30 -0700
commit6e3436df89f8293c60ef750a6e442f1203f56d40 (patch)
treee9e19f6567b81ce68400ca0221ee69295db903f7 /src
parent5858fc542fa6bd5766e6caee92e1a437656ce8de (diff)
downloadconnman-6e3436df89f8293c60ef750a6e442f1203f56d40.tar.gz
connman-6e3436df89f8293c60ef750a6e442f1203f56d40.tar.bz2
connman-6e3436df89f8293c60ef750a6e442f1203f56d40.zip
[SPIN] Added the connman disconnect reason property.
Change-Id: I11fd7baa7d00fa3f3a12bdafda7ff7aa6943d020 Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/dhcp.c7
-rwxr-xr-xsrc/network.c20
-rwxr-xr-xsrc/service.c12
3 files changed, 39 insertions, 0 deletions
diff --git a/src/dhcp.c b/src/dhcp.c
index 5514c332..644aac6a 100755
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -528,7 +528,14 @@ static int dhcp_initialize(struct connman_dhcp *dhcp)
dhcp_client = g_dhcp_client_new(G_DHCP_IPV4, index, &error);
if (error != G_DHCP_CLIENT_ERROR_NONE)
+#if defined TIZEN_EXT
+ {
+ DBG("failed g_dhcp_client_new(%d), index(%d)", error, index);
+#endif
return -EINVAL;
+#if defined TIZEN_EXT
+ }
+#endif
#if !defined TIZEN_EXT
if (getenv("CONNMAN_DHCP_DEBUG")) {
diff --git a/src/network.c b/src/network.c
index f67dbb68..57a1db39 100755
--- a/src/network.c
+++ b/src/network.c
@@ -100,6 +100,7 @@ struct connman_network {
unsigned int keymgmt;
char *keymgmt_type;
bool rsn_selected;
+ int disconnect_reason;
#endif
} wifi;
@@ -1962,6 +1963,25 @@ unsigned int connman_network_get_keymgmt(struct connman_network *network)
return network->wifi.keymgmt;
}
+
+int connman_network_set_disconnect_reason(struct connman_network *network,
+ int reason_code)
+{
+ if (network == NULL)
+ return 0;
+
+ network->wifi.disconnect_reason = reason_code;
+
+ return 0;
+}
+
+int connman_network_get_disconnect_reason(struct connman_network *network)
+{
+ if (network == NULL)
+ return 0;
+
+ return network->wifi.disconnect_reason;
+}
#endif
int connman_network_set_nameservers(struct connman_network *network,
diff --git a/src/service.c b/src/service.c
index 2325f64e..81409269 100755
--- a/src/service.c
+++ b/src/service.c
@@ -157,6 +157,13 @@ struct connman_service {
*/
int user_pdn_connection_refcount;
bool storage_reload;
+ /*
+ * Description: In case of EAP security type,
+ * user can select the keymgmt type for roaming(802.11r).
+ * - FT, CCKM, OKC, ...
+ */
+ char *keymgmt_type;
+ int disconnect_reason;
#endif
#if defined TIZEN_TV_EXT
enum connman_dnsconfig_method dns_config_method;
@@ -2845,6 +2852,10 @@ static void append_properties(DBusMessageIter *dict, dbus_bool_t limited,
connman_dbus_dict_append_dict(dict, "Ethernet",
append_ethernet, service);
+
+ connman_dbus_dict_append_basic(dict, "DisconnectReason",
+ DBUS_TYPE_INT32, &service->disconnect_reason);
+
break;
#endif
case CONNMAN_SERVICE_TYPE_ETHERNET:
@@ -6540,6 +6551,7 @@ static int service_indicate_state(struct connman_service *service)
reply_pending(service, ECONNABORTED);
def_service = __connman_service_get_default();
+ service->disconnect_reason = connman_network_get_disconnect_reason(service->network);
if (!__connman_notifier_is_connected() &&
def_service &&