const char *str;
GSList *list;
- str = __connman_service_type2string(service->type);
- if (str)
- connman_dbus_dict_append_basic(dict, "Type",
- DBUS_TYPE_STRING, &str);
-
- connman_dbus_dict_append_array(dict, "Security",
- DBUS_TYPE_STRING, append_security, service);
-
#if defined TIZEN_EXT
unsigned int frequency = 0U;
if (service && service->network) {
}
#endif
+ str = __connman_service_type2string(service->type);
+ if (str)
+ connman_dbus_dict_append_basic(dict, "Type",
+ DBUS_TYPE_STRING, &str);
+
+ connman_dbus_dict_append_array(dict, "Security",
+ DBUS_TYPE_STRING, append_security, service);
+
str = state2string(service->state);
if (str)
connman_dbus_dict_append_basic(dict, "State",
if (err < 0) {
if (is_connected_state(service, state) ||
is_connecting_state(service, state)) {
- __connman_network_enable_ipconfig(service->network,
+ if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
+ __connman_network_enable_ipconfig(service->network,
service->ipconfig_ipv4);
- __connman_network_enable_ipconfig(service->network,
+ else
+ __connman_network_enable_ipconfig(service->network,
service->ipconfig_ipv6);
}
ipv6_configuration_changed(service);
if (is_connecting(service) || is_connected(service)) {
- __connman_network_enable_ipconfig(service->network,
- service->ipconfig_ipv4);
- __connman_network_enable_ipconfig(service->network,
- service->ipconfig_ipv6);
+ if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
+ __connman_network_enable_ipconfig(service->network,
+ service->ipconfig_ipv4);
+ else
+ __connman_network_enable_ipconfig(service->network,
+ service->ipconfig_ipv6);
}
service_save(service);
if (!service->path)
return;
+#if !defined TIZEN_EXT
if (!allow_property_changed(service))
return;
+#endif
str = error2string(service->error);
active_count);
}
-#if defined TIZEN_CONNMAN_USE_BLACKLIST
-static connman_bool_t is_allowed(struct connman_service *service)
-{
- connman_bool_t allowed;
- const char *security = NULL;
-
- if (!service)
- return false;
-
- security = security2string(service->security);
- if (!security)
- return false;
-
- /* check if service is existed in blacklist */
- allowed = __connman_agent_request_blacklist_check(service->name,
- security, service->eap);
- if (allowed == false) {
- DBG("service %p is not allowed", service);
- service->autoconnect = false;
- }
-
- return allowed;
-}
-#endif
-
struct preferred_tech_data {
GList *preferred_list;
enum connman_service_type type;
CONNMAN_SERVICE_STATE_IDLE)
continue;
-#if defined TIZEN_CONNMAN_USE_BLACKLIST
- if (is_allowed(service) == false)
- continue;
-#endif
-
if (autoconnecting && !active_sessions[service->type]) {
DBG("service %p type %s has no users", service,
__connman_service_type2string(service->type));
DBusMessage *msg, void *user_data)
{
struct connman_service *service = user_data;
+#if defined TIZEN_EXT
+ int err = 0;
+#else
int index, err = 0;
GList *list;
+#endif
DBG("service %p", service);
}
}
+#if !defined TIZEN_EXT
index = __connman_service_get_index(service);
for (list = service_list; list; list = list->next) {
}
if (err == -EINPROGRESS)
return __connman_error_operation_timeout(msg);
+#endif
service->ignore = false;
__connman_provider_is_immutable(service->provider))
return false;
+#if !defined TIZEN_EXT
if (!service->favorite && service->state !=
CONNMAN_SERVICE_STATE_FAILURE)
return false;
+#endif
__connman_service_disconnect(service);
searchdomain_add_all(service);
}
-#if defined TIZEN_EXT
-void __connman_service_set_autoconnect(struct connman_service *service,
- bool autoconnect)
-{
- if (service == NULL)
- return;
-
- if (service->autoconnect != autoconnect) {
- DBG("updated autoconnect flag (%d)", autoconnect);
- service->autoconnect = autoconnect;
- service_save(service);
- }
-}
-#endif
-
static void service_complete(struct connman_service *service)
{
reply_pending(service, EIO);
return 0;
}
-#if defined TIZEN_EXT
-static int __connman_service_connect_hidden(struct connman_service *service,
- const char *name, int name_len,
- const char *identity, const char *passphrase, void *user_data)
-{
- GList *list;
-
- for (list = service_list; list; list = list->next) {
- struct connman_service *target = list->data;
- const char *target_ssid = NULL;
- unsigned int target_ssid_len = 0;
-
- if (service->network != NULL &&
- service->security == target->security) {
- target_ssid = connman_network_get_blob(service->network,
- "WiFi.SSID", &target_ssid_len);
- if (target_ssid_len == name_len &&
- memcmp(target_ssid, name, name_len) == 0) {
- return connman_network_connect_hidden(service->network,
- (char *)identity, (char *)passphrase, user_data);
- }
- }
- }
-
- return -ENOENT;
-}
-#endif
-
static void request_input_cb(struct connman_service *service,
bool values_received,
const char *name, int name_len,
}
if (service->hidden && name_len > 0 && name_len <= 32) {
-#if defined TIZEN_EXT
- /* TIZEN already has Wi-Fi hidden scan before this hidden connection */
- err = __connman_service_connect_hidden(service, name, name_len,
- identity, passphrase, user_data);
- if (err == 0 || err == -EALREADY || err == -EINPROGRESS)
- return;
-#endif
-
device = connman_network_get_device(service->network);
security = connman_network_get_string(service->network,
"WiFi.Security");
#if defined TIZEN_EXT
if (service->type == CONNMAN_SERVICE_TYPE_WIFI)
service->order = 5;
+ __connman_service_auto_connect(CONNMAN_SERVICE_CONNECT_REASON_AUTO);
#endif
if (service->connect_reason == CONNMAN_SERVICE_CONNECT_REASON_USER &&
connman_agent_report_error(service, service->path,
service->error == CONNMAN_SERVICE_ERROR_CONNECT_FAILED)
__connman_service_disconnect_default(service);
+ if (service->type == CONNMAN_SERVICE_TYPE_WIFI &&
+ service->error == CONNMAN_SERVICE_ERROR_INVALID_KEY) {
+ g_free(service->passphrase);
+ service->passphrase = NULL;
+ }
#endif
__connman_service_ipconfig_indicate_state(service,
if (service->hidden)
return -EPERM;
+#if defined TIZEN_EXT
+ GList *list;
+ int index;
+
+ index = __connman_service_get_index(service);
+
+ for (list = service_list; list; list = list->next) {
+ struct connman_service *temp = list->data;
+
+ if (service->type == CONNMAN_SERVICE_TYPE_CELLULAR)
+ break;
+
+ if (!is_connecting(temp) && !is_connected(temp))
+ break;
+
+ if (service == temp)
+ continue;
+
+ if (service->type != temp->type)
+ continue;
+
+ if (__connman_service_get_index(temp) == index &&
+ __connman_service_disconnect(temp) == -EINPROGRESS)
+ return -EINPROGRESS;
+ }
+#endif
+
switch (service->type) {
case CONNMAN_SERVICE_TYPE_UNKNOWN:
case CONNMAN_SERVICE_TYPE_SYSTEM: