summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-03-11 19:44:43 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-03-11 19:44:43 +0100
commit925e46442d09bccaec4e5077011eb2c45189a3e2 (patch)
treec97f074f0789da75352d8caf1b047b15560f4847 /src
parent571d1f1862ec992aca5c175f48dc482d1285a4c1 (diff)
downloadconnman-925e46442d09bccaec4e5077011eb2c45189a3e2.tar.gz
connman-925e46442d09bccaec4e5077011eb2c45189a3e2.tar.bz2
connman-925e46442d09bccaec4e5077011eb2c45189a3e2.zip
Add skeleton for profile/service integration
Diffstat (limited to 'src')
-rw-r--r--src/connman.h6
-rw-r--r--src/device.c20
-rw-r--r--src/network.c4
-rw-r--r--src/profile.c28
4 files changed, 58 insertions, 0 deletions
diff --git a/src/connman.h b/src/connman.h
index 729dc42d..36d65efa 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -179,6 +179,9 @@ connman_bool_t __connman_device_has_driver(struct connman_device *device);
int __connman_device_set_offlinemode(connman_bool_t offlinemode);
+int __connman_profile_add_device(struct connman_device *device);
+int __connman_profile_remove_device(struct connman_device *device);
+
#include <connman/network.h>
int __connman_network_init(void);
@@ -191,6 +194,9 @@ int __connman_network_disconnect(struct connman_network *network);
connman_bool_t __connman_network_has_driver(struct connman_network *network);
+int __connman_profile_add_network(struct connman_network *network);
+int __connman_profile_remove_network(struct connman_network *network);
+
#include <connman/rtnl.h>
int __connman_rtnl_init(void);
diff --git a/src/device.c b/src/device.c
index a354fe23..93a076f5 100644
--- a/src/device.c
+++ b/src/device.c
@@ -645,6 +645,16 @@ static int setup_device(struct connman_device *device)
return err;
}
+ switch (device->mode) {
+ case CONNMAN_DEVICE_MODE_UNKNOWN:
+ case CONNMAN_DEVICE_MODE_NETWORK_SINGLE:
+ case CONNMAN_DEVICE_MODE_NETWORK_MULTIPLE:
+ break;
+ case CONNMAN_DEVICE_MODE_TRANSPORT_IP:
+ __connman_profile_add_device(device);
+ break;
+ }
+
device_enable(device);
return 0;
@@ -679,6 +689,16 @@ static void remove_device(struct connman_device *device)
device_disable(device);
+ switch (device->mode) {
+ case CONNMAN_DEVICE_MODE_UNKNOWN:
+ case CONNMAN_DEVICE_MODE_NETWORK_SINGLE:
+ case CONNMAN_DEVICE_MODE_NETWORK_MULTIPLE:
+ break;
+ case CONNMAN_DEVICE_MODE_TRANSPORT_IP:
+ __connman_profile_remove_device(device);
+ break;
+ }
+
unregister_interface(&device->element);
if (device->driver->remove)
diff --git a/src/network.c b/src/network.c
index 8cda5586..2618dad9 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1062,6 +1062,8 @@ static int network_probe(struct connman_element *element)
return err;
}
+ __connman_profile_add_network(network);
+
return 0;
}
@@ -1077,6 +1079,8 @@ static void network_remove(struct connman_element *element)
if (network->driver == NULL)
return;
+ __connman_profile_remove_network(network);
+
unregister_interface(element);
if (network->driver->remove)
diff --git a/src/profile.c b/src/profile.c
index 44dcf55f..f9d643ce 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -28,6 +28,34 @@
#include "connman.h"
+int __connman_profile_add_device(struct connman_device *device)
+{
+ DBG("device %p", device);
+
+ return 0;
+}
+
+int __connman_profile_remove_device(struct connman_device *device)
+{
+ DBG("device %p", device);
+
+ return 0;
+}
+
+int __connman_profile_add_network(struct connman_network *network)
+{
+ DBG("network %p", network);
+
+ return 0;
+}
+
+int __connman_profile_remove_network(struct connman_network *network)
+{
+ DBG("network %p", network);
+
+ return 0;
+}
+
void __connman_profile_list(DBusMessageIter *iter)
{
const char *path = "/profile/default";