From c5cc53a55762ad05d9d63581e880973ceb73aa66 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 23 Feb 2011 10:25:49 -0600 Subject: [PATCH] core: add new SECONDARIES device state for dependent connections Will be used for things like activating a VPN connection before signaling that the device is activated, or maybe for bridges and bonds, to ensure that applications don't think the system has connectivity before everything is set up. --- cli/src/devices.c | 2 ++ include/NetworkManager.h | 10 +++++++--- introspection/nm-device.xml | 11 ++++++++--- src/nm-device-wifi.c | 1 + 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/cli/src/devices.c b/cli/src/devices.c index 9678b9b594..e263a88596 100644 --- a/cli/src/devices.c +++ b/cli/src/devices.c @@ -295,6 +295,8 @@ device_state_to_string (NMDeviceState state) return _("connecting (getting IP configuration)"); case NM_DEVICE_STATE_IP_CHECK: return _("connecting (checking IP connectivity)"); + case NM_DEVICE_STATE_SECONDARIES: + return _("connecting (starting secondary connections)"); case NM_DEVICE_STATE_ACTIVATED: return _("connected"); case NM_DEVICE_STATE_DEACTIVATING: diff --git a/include/NetworkManager.h b/include/NetworkManager.h index c83ad37fdf..4b68731536 100644 --- a/include/NetworkManager.h +++ b/include/NetworkManager.h @@ -201,6 +201,9 @@ typedef enum { * required for the requested network connection. This may include checking * whether only local network access is available, whether a captive portal * is blocking access to the Internet, etc. + * @NM_DEVICE_STATE_SECONDARIES: the device is waiting for a secondary + * connection (like a VPN) which must activated before the device can be + * activated * @NM_DEVICE_STATE_ACTIVATED: the device has a network connection, either local * or global. * @NM_DEVICE_STATE_DEACTIVATING: the device's network connection is no longer @@ -218,9 +221,10 @@ typedef enum { NM_DEVICE_STATE_NEED_AUTH = 60, NM_DEVICE_STATE_IP_CONFIG = 70, NM_DEVICE_STATE_IP_CHECK = 80, - NM_DEVICE_STATE_ACTIVATED = 90, - NM_DEVICE_STATE_DEACTIVATING = 100, - NM_DEVICE_STATE_FAILED = 110 + NM_DEVICE_STATE_SECONDARIES = 90, + NM_DEVICE_STATE_ACTIVATED = 100, + NM_DEVICE_STATE_DEACTIVATING = 110, + NM_DEVICE_STATE_FAILED = 120 } NMDeviceState; diff --git a/introspection/nm-device.xml b/introspection/nm-device.xml index f6c70e92be..e2f018c8d7 100644 --- a/introspection/nm-device.xml +++ b/introspection/nm-device.xml @@ -144,17 +144,22 @@ The device's IP connectivity ability is being determined. - + + + The device is waiting for secondary connections to be activated. + + + The device is active. - + The device's network connection is being torn down. - + The device is in a failure state following an attempt to activate it. diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 4e824eec6c..35d2ebee4d 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -1921,6 +1921,7 @@ scanning_allowed (NMDeviceWifi *self) case NM_DEVICE_STATE_NEED_AUTH: case NM_DEVICE_STATE_IP_CONFIG: case NM_DEVICE_STATE_IP_CHECK: + case NM_DEVICE_STATE_SECONDARIES: case NM_DEVICE_STATE_DEACTIVATING: /* Don't scan when unusable or activating */ return FALSE;