diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2012-09-21 14:36:46 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2012-09-24 10:38:26 +0200 |
commit | 07fc3dcb9099536197a67734bb42c610d67f37a0 (patch) | |
tree | 47353a3ce36beb0884b3939a896c083aa89a60b7 | |
parent | ece5e209cdc409a21e249dacbdbc953a1db4c6b7 (diff) |
api: add NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED reason and use that
-rw-r--r-- | cli/src/common.c | 3 | ||||
-rw-r--r-- | include/NetworkManager.h | 3 | ||||
-rw-r--r-- | introspection/nm-device.xml | 5 | ||||
-rw-r--r-- | src/nm-device.c | 2 | ||||
-rw-r--r-- | src/nm-policy.c | 5 |
5 files changed, 16 insertions, 2 deletions
diff --git a/cli/src/common.c b/cli/src/common.c index 1126dc87..58598dc2 100644 --- a/cli/src/common.c +++ b/cli/src/common.c @@ -557,6 +557,9 @@ nmc_device_reason_to_string (NMDeviceStateReason reason) case NM_DEVICE_STATE_REASON_SSID_NOT_FOUND: return _("The Wi-Fi network could not be found"); + case NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED: + return _("A seconadary connection of the base connection failed"); + default: return _("Unknown"); } diff --git a/include/NetworkManager.h b/include/NetworkManager.h index 3a8462a2..91b03f8f 100644 --- a/include/NetworkManager.h +++ b/include/NetworkManager.h @@ -498,6 +498,9 @@ typedef enum { /* The WiFi network could not be found */ NM_DEVICE_STATE_REASON_SSID_NOT_FOUND = 53, + /* A seconadary connection of the base connection failed */ + NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED = 54, + /* Unused */ NM_DEVICE_STATE_REASON_LAST = 0xFFFF } NMDeviceStateReason; diff --git a/introspection/nm-device.xml b/introspection/nm-device.xml index 54fc73f7..8d99c6ab 100644 --- a/introspection/nm-device.xml +++ b/introspection/nm-device.xml @@ -569,6 +569,11 @@ The 802.11 Wi-Fi network could not be found. </tp:docstring> </tp:enumvalue> + <tp:enumvalue suffix="SECONDARY_CONNECTION_FAILED" value="54"> + <tp:docstring> + A secondary connection of the base connection failed. + </tp:docstring> + </tp:enumvalue> </tp:enum> <tp:struct name="NM_DEVICE_STATE_REASON_STRUCT"> diff --git a/src/nm-device.c b/src/nm-device.c index a0e7fc54..0aed298d 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -4513,6 +4513,8 @@ reason_to_string (NMDeviceStateReason reason) return "modem-manager-unavailable"; case NM_DEVICE_STATE_REASON_SSID_NOT_FOUND: return "SSID not found"; + case NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED: + return "secondary-connection-failed"; default: break; } diff --git a/src/nm-policy.c b/src/nm-policy.c index 74b4c33d..00cf67e2 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1003,7 +1003,8 @@ process_secondaries (NMPolicy *policy, /* Secondary connection failed -> do not watch other connections */ policy->pending_secondaries = g_slist_remove (policy->pending_secondaries, secondary_data); pending_secondary_data_free (secondary_data); - nm_device_state_changed (item_device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED); + nm_device_state_changed (item_device, NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED); return; } } @@ -1454,7 +1455,7 @@ device_state_changed (NMDevice *device, /* Activate secondary (VPN) connections */ if (!activate_secondary_connections (policy, connection, device)) nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, - NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED); + NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED); } else nm_device_state_changed (device, NM_DEVICE_STATE_ACTIVATED, NM_DEVICE_STATE_REASON_NONE); |