struct connman_service *__connman_service_lookup_from_device(struct connman_device *device);
struct connman_service *__connman_service_create_from_device(struct connman_device *device);
+void __connman_service_remove_from_device(struct connman_device *device);
struct connman_service *__connman_service_lookup_from_network(struct connman_network *network);
struct connman_service *__connman_service_create_from_network(struct connman_network *network);
+void __connman_service_remove_from_network(struct connman_network *network);
unsigned int __connman_service_get_order(struct connman_service *service);
int __connman_profile_remove_device(struct connman_device *device)
{
- struct connman_service *service;
-
DBG("device %p", device);
- service = __connman_service_lookup_from_device(device);
- if (service == NULL)
- return -EINVAL;
-
- __connman_service_disconnect(service);
-
- __connman_service_put(service);
+ __connman_service_remove_from_device(device);
return 0;
}
int __connman_profile_remove_network(struct connman_network *network)
{
- struct connman_service *service;
-
DBG("network %p", network);
- service = __connman_service_lookup_from_network(network);
- if (service == NULL)
- return -EINVAL;
-
- __connman_service_disconnect(service);
-
- __connman_service_put(service);
+ __connman_service_remove_from_network(network);
return 0;
}
reply_pending(service, EIO);
+ __connman_service_disconnect(service);
+
if (service->network != NULL) {
connman_network_unref(service->network);
service->network = NULL;
-
- interval = 5;
}
service->state = CONNMAN_SERVICE_STATE_FAILURE;
return service;
}
+void __connman_service_remove_from_device(struct connman_device *device)
+{
+ struct connman_service *service;
+
+ service = __connman_service_lookup_from_device(device);
+ if (service == NULL)
+ return;
+
+ __connman_service_put(service);
+}
+
/**
* __connman_service_lookup_from_network:
* @network: network structure
service->timeout = 0;
}
- connman_service_ref(service);
-
set_idle(service);
}
+ connman_service_ref(service);
+
update_from_network(service, network);
return service;
}
return service;
}
+void __connman_service_remove_from_network(struct connman_network *network)
+{
+ struct connman_service *service;
+
+ service = __connman_service_lookup_from_network(network);
+ if (service == NULL)
+ return;
+
+ __connman_service_put(service);
+}
+
static int service_load(struct connman_service *service)
{
GKeyFile *keyfile;