summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-08-10 11:58:59 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-08-14 08:59:37 +0300
commit152171411d7d9891e1ff6b5683a2e624ea2340cd (patch)
tree3eb3143f772327fb48ad9302126883e43938ed47 /src
parent9b7c4dccb6496f1acb9ca44026fc9d91eaddf0b5 (diff)
downloadconnman-152171411d7d9891e1ff6b5683a2e624ea2340cd.tar.gz
connman-152171411d7d9891e1ff6b5683a2e624ea2340cd.tar.bz2
connman-152171411d7d9891e1ff6b5683a2e624ea2340cd.zip
service: Allow plugins to lookup services by networks
Diffstat (limited to 'src')
-rw-r--r--src/connman.h1
-rw-r--r--src/device.c2
-rw-r--r--src/dhcp.c8
-rw-r--r--src/dhcpv6.c8
-rw-r--r--src/network.c50
-rw-r--r--src/service.c8
6 files changed, 38 insertions, 39 deletions
diff --git a/src/connman.h b/src/connman.h
index 822c8eb3..492595dc 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -564,7 +564,6 @@ void __connman_service_cleanup(void);
void __connman_service_list_struct(DBusMessageIter *iter);
-struct connman_service *__connman_service_lookup_from_network(struct connman_network *network);
struct connman_service *__connman_service_lookup_from_index(int index);
struct connman_service *__connman_service_lookup_from_ident(const char *identifier);
struct connman_service *__connman_service_create_from_network(struct connman_network *network);
diff --git a/src/device.c b/src/device.c
index ea176807..13c2c5d0 100644
--- a/src/device.c
+++ b/src/device.c
@@ -237,7 +237,7 @@ int __connman_device_disable(struct connman_device *device)
if (device->network) {
struct connman_service *service =
- __connman_service_lookup_from_network(device->network);
+ connman_service_lookup_from_network(device->network);
if (service != NULL)
__connman_service_disconnect(service);
diff --git a/src/dhcp.c b/src/dhcp.c
index 9d1a95e1..1dbe1baa 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -83,7 +83,7 @@ static void dhcp_invalidate(struct connman_dhcp *dhcp, connman_bool_t callback)
if (dhcp == NULL)
return;
- service = __connman_service_lookup_from_network(dhcp->network);
+ service = connman_service_lookup_from_network(dhcp->network);
if (service == NULL)
goto out;
@@ -198,7 +198,7 @@ static void lease_available_cb(GDHCPClient *dhcp_client, gpointer user_data)
DBG("Lease available");
- service = __connman_service_lookup_from_network(dhcp->network);
+ service = connman_service_lookup_from_network(dhcp->network);
if (service == NULL) {
connman_error("Can not lookup service");
return;
@@ -364,7 +364,7 @@ static void ipv4ll_available_cb(GDHCPClient *dhcp_client, gpointer user_data)
DBG("IPV4LL available");
- service = __connman_service_lookup_from_network(dhcp->network);
+ service = connman_service_lookup_from_network(dhcp->network);
if (service == NULL)
return;
@@ -446,7 +446,7 @@ static int dhcp_request(struct connman_dhcp *dhcp)
dhcp->dhcp_client = dhcp_client;
- service = __connman_service_lookup_from_network(dhcp->network);
+ service = connman_service_lookup_from_network(dhcp->network);
ipconfig = __connman_service_get_ip4config(service);
return g_dhcp_client_start(dhcp_client,
diff --git a/src/dhcpv6.c b/src/dhcpv6.c
index 574b19eb..1d724e51 100644
--- a/src/dhcpv6.c
+++ b/src/dhcpv6.c
@@ -265,7 +265,7 @@ static void info_req_cb(GDHCPClient *dhcp_client, gpointer user_data)
DBG("dhcpv6 information-request %p", dhcp);
- service = __connman_service_lookup_from_network(dhcp->network);
+ service = connman_service_lookup_from_network(dhcp->network);
if (service == NULL) {
connman_error("Can not lookup service");
return;
@@ -353,7 +353,7 @@ static int dhcpv6_info_request(struct connman_dhcpv6 *dhcp)
if (getenv("CONNMAN_DHCPV6_DEBUG"))
g_dhcp_client_set_debug(dhcp_client, dhcpv6_debug, "DHCPv6");
- service = __connman_service_lookup_from_network(dhcp->network);
+ service = connman_service_lookup_from_network(dhcp->network);
if (service == NULL) {
clear_timer(dhcp);
g_dhcp_client_unref(dhcp_client);
@@ -439,7 +439,7 @@ static int set_addresses(GDHCPClient *dhcp_client,
const char *c_address;
char *address = NULL;
- service = __connman_service_lookup_from_network(dhcp->network);
+ service = connman_service_lookup_from_network(dhcp->network);
if (service == NULL) {
connman_error("Can not lookup service");
return -EINVAL;
@@ -1108,7 +1108,7 @@ static int dhcpv6_solicitation(struct connman_dhcpv6 *dhcp)
if (getenv("CONNMAN_DHCPV6_DEBUG"))
g_dhcp_client_set_debug(dhcp_client, dhcpv6_debug, "DHCPv6");
- service = __connman_service_lookup_from_network(dhcp->network);
+ service = connman_service_lookup_from_network(dhcp->network);
if (service == NULL) {
clear_timer(dhcp);
g_dhcp_client_unref(dhcp_client);
diff --git a/src/network.c b/src/network.c
index c37f1281..e72e35f9 100644
--- a/src/network.c
+++ b/src/network.c
@@ -464,7 +464,7 @@ void connman_network_set_index(struct connman_network *network, int index)
struct connman_service *service;
struct connman_ipconfig *ipconfig;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
goto done;
@@ -647,7 +647,7 @@ int connman_network_set_associating(struct connman_network *network,
if (associating == TRUE) {
struct connman_service *service;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
__connman_service_ipconfig_indicate_state(service,
CONNMAN_SERVICE_STATE_ASSOCIATION,
CONNMAN_IPCONFIG_TYPE_IPV4);
@@ -663,7 +663,7 @@ static void set_associate_error(struct connman_network *network)
{
struct connman_service *service;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
__connman_service_indicate_error(service,
CONNMAN_SERVICE_ERROR_CONNECT_FAILED);
@@ -673,7 +673,7 @@ static void set_configure_error(struct connman_network *network)
{
struct connman_service *service;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
__connman_service_indicate_error(service,
CONNMAN_SERVICE_ERROR_CONNECT_FAILED);
@@ -683,7 +683,7 @@ static void set_invalid_key_error(struct connman_network *network)
{
struct connman_service *service;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
__connman_service_indicate_error(service,
CONNMAN_SERVICE_ERROR_INVALID_KEY);
@@ -693,7 +693,7 @@ static void set_connect_error(struct connman_network *network)
{
struct connman_service *service;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
__connman_service_indicate_error(service,
CONNMAN_SERVICE_ERROR_CONNECT_FAILED);
@@ -705,7 +705,7 @@ void connman_network_set_ipv4_method(struct connman_network *network,
struct connman_service *service;
struct connman_ipconfig *ipconfig;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
return;
@@ -722,7 +722,7 @@ void connman_network_set_ipv6_method(struct connman_network *network,
struct connman_service *service;
struct connman_ipconfig *ipconfig;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
return;
@@ -773,7 +773,7 @@ void connman_network_clear_error(struct connman_network *network)
if (network->connecting == TRUE || network->associating == TRUE)
return;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
__connman_service_clear_error(service);
}
@@ -791,7 +791,7 @@ static void set_configuration(struct connman_network *network,
connman_device_set_disconnected(network->device, FALSE);
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
__connman_service_ipconfig_indicate_state(service,
CONNMAN_SERVICE_STATE_CONFIGURATION,
type);
@@ -803,7 +803,7 @@ static void dhcp_success(struct connman_network *network)
struct connman_ipconfig *ipconfig_ipv4;
int err;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
goto err;
@@ -831,7 +831,7 @@ static void dhcp_failure(struct connman_network *network)
{
struct connman_service *service;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
return;
@@ -859,7 +859,7 @@ static int set_connected_fixed(struct connman_network *network)
DBG("");
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
ipconfig_ipv4 = __connman_service_get_ip4config(service);
@@ -894,7 +894,7 @@ static void set_connected_manual(struct connman_network *network)
DBG("network %p", network);
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
ipconfig = __connman_service_get_ip4config(service);
@@ -948,7 +948,7 @@ static int manual_ipv6_set(struct connman_network *network,
DBG("network %p ipv6 %p", network, ipconfig_ipv6);
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
return -EINVAL;
@@ -1011,7 +1011,7 @@ static gboolean dhcpv6_set_addresses(struct connman_network *network)
struct connman_ipconfig *ipconfig_ipv6;
int err = -EINVAL;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
goto err;
@@ -1203,7 +1203,7 @@ static void autoconf_ipv6_set(struct connman_network *network)
network->connecting = FALSE;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
return;
@@ -1232,7 +1232,7 @@ static void set_connected(struct connman_network *network)
network->connected = TRUE;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
ipconfig_ipv4 = __connman_service_get_ip4config(service);
ipconfig_ipv6 = __connman_service_get_ip6config(service);
@@ -1304,7 +1304,7 @@ static void set_disconnected(struct connman_network *network)
network->connected = FALSE;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
ipconfig_ipv4 = __connman_service_get_ip4config(service);
ipconfig_ipv6 = __connman_service_get_ip6config(service);
@@ -1477,7 +1477,7 @@ int connman_network_connect_hidden(struct connman_network *network,
int err = 0;
struct connman_service *service;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
DBG("network %p service %p user_data %p", network, service, user_data);
@@ -1592,7 +1592,7 @@ static int manual_ipv4_set(struct connman_network *network,
struct connman_service *service;
int err;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
return -EINVAL;
@@ -1613,7 +1613,7 @@ int __connman_network_clear_ipconfig(struct connman_network *network,
enum connman_ipconfig_method method;
enum connman_ipconfig_type type;
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
return -EINVAL;
@@ -1709,7 +1709,7 @@ int connman_network_set_ipaddress(struct connman_network *network,
DBG("network %p", network);
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
return -EINVAL;
@@ -1735,7 +1735,7 @@ int connman_network_set_nameservers(struct connman_network *network,
DBG("network %p nameservers %s", network, nameservers);
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
return -EINVAL;
@@ -1763,7 +1763,7 @@ int connman_network_set_domain(struct connman_network *network,
DBG("network %p domain %s", network, domain);
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
return -EINVAL;
diff --git a/src/service.c b/src/service.c
index cafd6054..16b1494d 100644
--- a/src/service.c
+++ b/src/service.c
@@ -5952,12 +5952,12 @@ void connman_service_create_ip6config(struct connman_service *service,
}
/**
- * __connman_service_lookup_from_network:
+ * connman_service_lookup_from_network:
* @network: network structure
*
* Look up a service by network (reference count will not be increased)
*/
-struct connman_service *__connman_service_lookup_from_network(struct connman_network *network)
+struct connman_service *connman_service_lookup_from_network(struct connman_network *network)
{
struct connman_service *service;
const char *ident, *group;
@@ -6278,7 +6278,7 @@ void __connman_service_update_from_network(struct connman_network *network)
DBG("network %p", network);
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
return;
@@ -6339,7 +6339,7 @@ void __connman_service_remove_from_network(struct connman_network *network)
DBG("network %p", network);
- service = __connman_service_lookup_from_network(network);
+ service = connman_service_lookup_from_network(network);
if (service == NULL)
return;