From b4eb5d6af66e7d40f335af72914ff96abe9bd890 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 10 Jun 2013 00:37:32 -0500 Subject: [PATCH] Fix inability to connect with unsecured wireless access point Add plain-text connection failure messages --- .../network-manager/network-manager.cpp | 305 ++++++++++++++---- .../network-manager/network-manager.h | 61 ++++ 2 files changed, 305 insertions(+), 61 deletions(-) diff --git a/tdecore/networkbackends/network-manager/network-manager.cpp b/tdecore/networkbackends/network-manager/network-manager.cpp index f442e19fb..f29d7832c 100644 --- a/tdecore/networkbackends/network-manager/network-manager.cpp +++ b/tdecore/networkbackends/network-manager/network-manager.cpp @@ -1447,9 +1447,178 @@ void TDENetworkConnectionManager_BackendNMPrivate::internalProcessDeviceStateCha m_prevDeviceState = newState; if (newState == NM_DEVICE_STATE_FAILED) { - // FIXME - // This should provide a plain-text interpretation of the NetworkManager-specific error code - m_parent->internalNetworkDeviceEvent(TDENetworkDeviceEventType::Failure, TQString("Connection attempt failed!
NetworkManager returned error %1.").arg(reason)); + TQString errorString; + if (reason == NM_DEVICE_STATE_REASON_NONE) { + errorString = TQString("Connection attempt failed!"); + } + else if (reason == NM_DEVICE_STATE_REASON_UNKNOWN) { + errorString = TQString("Connection attempt failed!
Unknown error detected."); + } + else if (reason == NM_DEVICE_STATE_REASON_NOW_MANAGED) { + errorString = TQString("Connection attempt failed!
Network device is now managed."); + } + else if (reason == NM_DEVICE_STATE_REASON_NOW_UNMANAGED) { + errorString = TQString("Connection attempt failed!
Network device is now unmanaged."); + } + else if (reason == NM_DEVICE_STATE_REASON_CONFIG_FAILED) { + errorString = TQString("Connection attempt failed!
Configuration failed."); + } + else if (reason == NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE) { + errorString = TQString("Connection attempt failed!
IP configuration unavailable."); + } + else if (reason == NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED) { + errorString = TQString("Connection attempt failed!
IP configuration expired."); + } + else if (reason == NM_DEVICE_STATE_REASON_NO_SECRETS) { + errorString = i18n("Connection attempt failed!
Secrets were required to establish a connection, but no secrets were available."); + } + else if (reason == NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT) { + errorString = TQString("Connection attempt failed!
The supplicant was disconnected while attempting to establish a wireless connection."); + } + else if (reason == NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED) { + errorString = TQString("Connection attempt failed!
Supplicant configuration failed while attempting to establish a wireless connection."); + } + else if (reason == NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED) { + errorString = i18n("Connection attempt failed!
The supplicant failed while attempting to establish a wireless connection."); + } + else if (reason == NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT) { + errorString = i18n("Connection attempt failed!
The supplicant timed out while attempting to establish a wireless connection."); + } + else if (reason == NM_DEVICE_STATE_REASON_PPP_START_FAILED) { + errorString = i18n("Connection attempt failed!
The PPP client failed to start."); + } + else if (reason == NM_DEVICE_STATE_REASON_PPP_DISCONNECT) { + errorString = i18n("Connection attempt failed!
The PPP client was disconnected."); + } + else if (reason == NM_DEVICE_STATE_REASON_PPP_FAILED) { + errorString = i18n("Connection attempt failed!
Unknown PPP failure."); + } + else if (reason == NM_DEVICE_STATE_REASON_DHCP_START_FAILED) { + errorString = i18n("Connection attempt failed!
The DHCP client failed to start."); + } + else if (reason == NM_DEVICE_STATE_REASON_DHCP_ERROR) { + errorString = i18n("Connection attempt failed!
The DHCP client encountered an error."); + } + else if (reason == NM_DEVICE_STATE_REASON_DHCP_FAILED) { + errorString = i18n("Connection attempt failed!
Uknown DHCP failure."); + } + else if (reason == NM_DEVICE_STATE_REASON_SHARED_START_FAILED) { + errorString = i18n("Connection attempt failed!
The connection sharing service failed to start."); + } + else if (reason == NM_DEVICE_STATE_REASON_SHARED_FAILED) { + errorString = i18n("Connection attempt failed!
The connection sharing service encountered an error."); + } + else if (reason == NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED) { + errorString = i18n("Connection attempt failed!
The AutoIP service failed to start."); + } + else if (reason == NM_DEVICE_STATE_REASON_AUTOIP_ERROR) { + errorString = i18n("Connection attempt failed!
The AutoIP service encountered an error."); + } + else if (reason == NM_DEVICE_STATE_REASON_AUTOIP_FAILED) { + errorString = i18n("Connection attempt failed!
Unknown AutoIP failure."); + } + else if (reason == NM_DEVICE_STATE_REASON_MODEM_BUSY) { + errorString = i18n("Connection attempt failed!
Modem was busy."); + } + else if (reason == NM_DEVICE_STATE_REASON_MODEM_NO_DIAL_TONE) { + errorString = i18n("Connection attempt failed!
No dial tone."); + } + else if (reason == NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER) { + errorString = i18n("Connection attempt failed!
No carrier detected."); + } + else if (reason == NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT) { + errorString = i18n("Connection attempt failed!
Modem timed out while dialing."); + } + else if (reason == NM_DEVICE_STATE_REASON_MODEM_DIAL_FAILED) { + errorString = i18n("Connection attempt failed!
The modem failed to dial."); + } + else if (reason == NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED) { + errorString = i18n("Connection attempt failed!
Modem initialization failed."); + } + else if (reason == NM_DEVICE_STATE_REASON_GSM_APN_FAILED) { + errorString = i18n("Connection attempt failed!
GSM APN failure."); + } + else if (reason == NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING) { + errorString = i18n("Connection attempt failed!
GSM registration failed to search for networks."); + } + else if (reason == NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED) { + errorString = i18n("Connection attempt failed!
GSM registration attempt was rejected."); + } + else if (reason == NM_DEVICE_STATE_REASON_GSM_REGISTRATION_TIMEOUT) { + errorString = i18n("Connection attempt failed!
GSM registration attempt timed out."); + } + else if (reason == NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED) { + errorString = i18n("Connection attempt failed!
GSM registration attempt failed."); + } + else if (reason == NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED) { + errorString = i18n("Connection attempt failed!
GSM PIN check failed."); + } + else if (reason == NM_DEVICE_STATE_REASON_FIRMWARE_MISSING) { + errorString = i18n("Connection attempt failed!
Network device firmware is missing."); + } + else if (reason == NM_DEVICE_STATE_REASON_REMOVED) { + errorString = i18n("Connection attempt failed!
Network device was removed."); + } + else if (reason == NM_DEVICE_STATE_REASON_SLEEPING) { + errorString = i18n("Connection attempt failed!
Network device is sleeping."); + } + else if (reason == NM_DEVICE_STATE_REASON_CONNECTION_REMOVED) { + errorString = i18n("Connection attempt failed!
Connection was removed."); + } + else if (reason == NM_DEVICE_STATE_REASON_USER_REQUESTED) { + errorString = i18n("Connection attempt failed!
User requested device disconnection."); + } + else if (reason == NM_DEVICE_STATE_REASON_CARRIER) { + errorString = i18n("Connection attempt failed!
Carrier or link status changed."); + } + else if (reason == NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED) { + errorString = i18n("Connection attempt failed!
Device and/or connection already active."); + } + else if (reason == NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE) { + errorString = i18n("Connection attempt failed!
The supplicant is now available."); + } + else if (reason == NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND) { + errorString = i18n("Connection attempt failed!
Requested modem was not found."); + } + else if (reason == NM_DEVICE_STATE_REASON_BT_FAILED) { + errorString = i18n("Connection attempt failed!
Bluetooth connection timeout."); + } + else if (reason == NM_DEVICE_STATE_REASON_GSM_SIM_NOT_INSERTED) { + errorString = i18n("Connection attempt failed!
GSM SIM not inserted."); + } + else if (reason == NM_DEVICE_STATE_REASON_GSM_SIM_PIN_REQUIRED) { + errorString = i18n("Connection attempt failed!
GSM PIN required."); + } + else if (reason == NM_DEVICE_STATE_REASON_GSM_SIM_PUK_REQUIRED) { + errorString = i18n("Connection attempt failed!
GSM PUK required."); + } + else if (reason == NM_DEVICE_STATE_REASON_GSM_SIM_WRONG) { + errorString = i18n("Connection attempt failed!
GSM SIM incorrect."); + } + else if (reason == NM_DEVICE_STATE_REASON_INFINIBAND_MODE) { + errorString = i18n("Connection attempt failed!
Incorrect Infiniband mode."); + } + else if (reason == NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED) { + errorString = i18n("Connection attempt failed!
Dependency failure."); + } + else if (reason == NM_DEVICE_STATE_REASON_BR2684_FAILED) { + errorString = i18n("Connection attempt failed!
Unknown bridge failure."); + } + else if (reason == NM_DEVICE_STATE_REASON_MODEM_MANAGER_UNAVAILABLE) { + errorString = i18n("Connection attempt failed!
ModemManager not available."); + } + else if (reason == NM_DEVICE_STATE_REASON_SSID_NOT_FOUND) { + errorString = i18n("Connection attempt failed!
SSID not found."); + } + else if (reason == NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED) { + errorString = i18n("Connection attempt failed!
Secondary connection failure."); + } + else { + // FIXME + // This should provide a plain-text interpretation of the NetworkManager-specific error code + errorString = TQString("Connection attempt failed!
NetworkManager returned error %1.").arg(reason); + } + m_parent->internalNetworkDeviceEvent(TDENetworkDeviceEventType::Failure, errorString); } m_parent->internalNetworkDeviceStateChanged(nmDeviceStateToTDEDeviceState(newState), m_parent->m_macAddress); @@ -3783,80 +3952,94 @@ bool TDENetworkConnectionManager_BackendNM::saveConnection(TDENetworkConnection* if (wiFiConnection) { TQMap settingsMap = dbusData.toStringKeyMap().toTQMap(); { - { + if (wiFiConnection->securityRequired) { if (wiFiConnection->securityRequired) { settingsMap["key-mgmt"] = convertDBUSDataToVariantData(TQT_DBusData::fromString(tdeWiFiKeyTypeToNMWiFiKeyType(wiFiConnection->securitySettings.keyType))); } + if (wiFiConnection->securitySettings.wepKeyIndex > 0) { + settingsMap["wep-tx-keyidx"] = convertDBUSDataToVariantData(TQT_DBusData::fromUInt32(wiFiConnection->securitySettings.wepKeyIndex)); + } else { - // The key-mgmt entry seems to be required even if no security is available and/or enabled! - // settingsMap.remove("key-mgmt"); - settingsMap["key-mgmt"] = convertDBUSDataToVariantData(TQT_DBusData::fromString("none")); + settingsMap.remove("wep-tx-keyidx"); } - } - if (wiFiConnection->securitySettings.wepKeyIndex > 0) { - settingsMap["wep-tx-keyidx"] = convertDBUSDataToVariantData(TQT_DBusData::fromUInt32(wiFiConnection->securitySettings.wepKeyIndex)); - } - else { - settingsMap.remove("wep-tx-keyidx"); - } - UPDATE_STRING_SETTING_IF_VALID(tdeWiFiAuthTypeToNMWiFiAuthType(wiFiConnection->securitySettings.authType), "auth-alg", settingsMap) - { - TQT_DBusDataValueList valueList; + UPDATE_STRING_SETTING_IF_VALID(tdeWiFiAuthTypeToNMWiFiAuthType(wiFiConnection->securitySettings.authType), "auth-alg", settingsMap) { - TQStringList strings = tdeWiFiWPAVersionToNMWiFiWPAVersion(wiFiConnection->securitySettings.wpaVersion); - for (TQStringList::Iterator it = strings.begin(); it != strings.end(); ++it) { - valueList.append(TQT_DBusData::fromString(*it)); + TQT_DBusDataValueList valueList; + { + TQStringList strings = tdeWiFiWPAVersionToNMWiFiWPAVersion(wiFiConnection->securitySettings.wpaVersion); + for (TQStringList::Iterator it = strings.begin(); it != strings.end(); ++it) { + valueList.append(TQT_DBusData::fromString(*it)); + } } + if (valueList.count() > 0) settingsMap["proto"] = convertDBUSDataToVariantData(TQT_DBusData::fromTQValueList(valueList)); + else settingsMap.remove("proto"); } - if (valueList.count() > 0) settingsMap["proto"] = convertDBUSDataToVariantData(TQT_DBusData::fromTQValueList(valueList)); - else settingsMap.remove("proto"); - } - { - TQT_DBusDataValueList valueList; { - if (wiFiConnection->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::Any)) { - if (!wiFiConnection->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP40)) wiFiConnection->securitySettings.allowedPairWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherWEP40); - if (!wiFiConnection->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP104)) wiFiConnection->securitySettings.allowedPairWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherWEP104); - if (!wiFiConnection->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherTKIP)) wiFiConnection->securitySettings.allowedPairWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherTKIP); - if (!wiFiConnection->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherCCMP)) wiFiConnection->securitySettings.allowedPairWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherCCMP); - } - for (TDENetworkWiFiConnectionCipherList::Iterator it = wiFiConnection->securitySettings.allowedPairWiseCiphers.begin(); it != wiFiConnection->securitySettings.allowedPairWiseCiphers.end(); ++it) { - valueList.append(TQT_DBusData::fromString(tdeWiFiCipherToNMWiFiCipher(*it))); + TQT_DBusDataValueList valueList; + { + if (wiFiConnection->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::Any)) { + if (!wiFiConnection->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP40)) wiFiConnection->securitySettings.allowedPairWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherWEP40); + if (!wiFiConnection->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP104)) wiFiConnection->securitySettings.allowedPairWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherWEP104); + if (!wiFiConnection->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherTKIP)) wiFiConnection->securitySettings.allowedPairWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherTKIP); + if (!wiFiConnection->securitySettings.allowedPairWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherCCMP)) wiFiConnection->securitySettings.allowedPairWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherCCMP); + } + for (TDENetworkWiFiConnectionCipherList::Iterator it = wiFiConnection->securitySettings.allowedPairWiseCiphers.begin(); it != wiFiConnection->securitySettings.allowedPairWiseCiphers.end(); ++it) { + valueList.append(TQT_DBusData::fromString(tdeWiFiCipherToNMWiFiCipher(*it))); + } } + if (valueList.count() > 0) settingsMap["pairwise"] = convertDBUSDataToVariantData(TQT_DBusData::fromTQValueList(valueList)); + else settingsMap.remove("pairwise"); } - if (valueList.count() > 0) settingsMap["pairwise"] = convertDBUSDataToVariantData(TQT_DBusData::fromTQValueList(valueList)); - else settingsMap.remove("pairwise"); - } - { - TQT_DBusDataValueList valueList; { - if (wiFiConnection->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::Any)) { - if (!wiFiConnection->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP40)) wiFiConnection->securitySettings.allowedGroupWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherWEP40); - if (!wiFiConnection->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP104)) wiFiConnection->securitySettings.allowedGroupWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherWEP104); - if (!wiFiConnection->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherTKIP)) wiFiConnection->securitySettings.allowedGroupWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherTKIP); - if (!wiFiConnection->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherCCMP)) wiFiConnection->securitySettings.allowedGroupWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherCCMP); - } - for (TDENetworkWiFiConnectionCipherList::Iterator it = wiFiConnection->securitySettings.allowedGroupWiseCiphers.begin(); it != wiFiConnection->securitySettings.allowedGroupWiseCiphers.end(); ++it) { - valueList.append(TQT_DBusData::fromString(tdeWiFiCipherToNMWiFiCipher(*it))); + TQT_DBusDataValueList valueList; + { + if (wiFiConnection->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::Any)) { + if (!wiFiConnection->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP40)) wiFiConnection->securitySettings.allowedGroupWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherWEP40); + if (!wiFiConnection->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherWEP104)) wiFiConnection->securitySettings.allowedGroupWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherWEP104); + if (!wiFiConnection->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherTKIP)) wiFiConnection->securitySettings.allowedGroupWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherTKIP); + if (!wiFiConnection->securitySettings.allowedGroupWiseCiphers.contains(TDENetworkWiFiConnectionCipher::CipherCCMP)) wiFiConnection->securitySettings.allowedGroupWiseCiphers.append(TDENetworkWiFiConnectionCipher::CipherCCMP); + } + for (TDENetworkWiFiConnectionCipherList::Iterator it = wiFiConnection->securitySettings.allowedGroupWiseCiphers.begin(); it != wiFiConnection->securitySettings.allowedGroupWiseCiphers.end(); ++it) { + valueList.append(TQT_DBusData::fromString(tdeWiFiCipherToNMWiFiCipher(*it))); + } } + if (valueList.count() > 0) settingsMap["group"] = convertDBUSDataToVariantData(TQT_DBusData::fromTQValueList(valueList)); + else settingsMap.remove("group"); + } + UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.leapUsername, "leap-username", settingsMap) + settingsMap["wep-key-flags"] = convertDBUSDataToVariantData(TQT_DBusData::fromUInt32(tdePasswordFlagsToNMPasswordFlags(wiFiConnection->securitySettings.wepKeyFlags))); + settingsMap["wep-key-type"] = convertDBUSDataToVariantData(TQT_DBusData::fromUInt32(tdeWepKeyTypeToNMWepKeyType(wiFiConnection->securitySettings.wepKeyType))); + settingsMap["psk-flags"] = convertDBUSDataToVariantData(TQT_DBusData::fromUInt32(tdePasswordFlagsToNMPasswordFlags(wiFiConnection->securitySettings.pskFlags))); + settingsMap["leap-password-flags"] = convertDBUSDataToVariantData(TQT_DBusData::fromUInt32(tdePasswordFlagsToNMPasswordFlags(wiFiConnection->securitySettings.leapPasswordFlags))); + if (wiFiConnection->securitySettings.secretsValid) { + UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.wepKey0, "wep-key0", settingsMap) + UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.wepKey1, "wep-key1", settingsMap) + UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.wepKey2, "wep-key2", settingsMap) + UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.wepKey3, "wep-key3", settingsMap) + UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.psk, "psk", settingsMap) + UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.leapPassword, "leap-password", settingsMap) + } + else { + settingsMap.remove("wep-key0"); + settingsMap.remove("wep-key1"); + settingsMap.remove("wep-key2"); + settingsMap.remove("wep-key3"); + settingsMap.remove("psk"); + settingsMap.remove("leap-password"); } - if (valueList.count() > 0) settingsMap["group"] = convertDBUSDataToVariantData(TQT_DBusData::fromTQValueList(valueList)); - else settingsMap.remove("group"); - } - UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.leapUsername, "leap-username", settingsMap) - settingsMap["wep-key-flags"] = convertDBUSDataToVariantData(TQT_DBusData::fromUInt32(tdePasswordFlagsToNMPasswordFlags(wiFiConnection->securitySettings.wepKeyFlags))); - settingsMap["wep-key-type"] = convertDBUSDataToVariantData(TQT_DBusData::fromUInt32(tdeWepKeyTypeToNMWepKeyType(wiFiConnection->securitySettings.wepKeyType))); - settingsMap["psk-flags"] = convertDBUSDataToVariantData(TQT_DBusData::fromUInt32(tdePasswordFlagsToNMPasswordFlags(wiFiConnection->securitySettings.pskFlags))); - settingsMap["leap-password-flags"] = convertDBUSDataToVariantData(TQT_DBusData::fromUInt32(tdePasswordFlagsToNMPasswordFlags(wiFiConnection->securitySettings.leapPasswordFlags))); - if (wiFiConnection->securitySettings.secretsValid) { - UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.wepKey0, "wep-key0", settingsMap) - UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.wepKey1, "wep-key1", settingsMap) - UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.wepKey2, "wep-key2", settingsMap) - UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.wepKey3, "wep-key3", settingsMap) - UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.psk, "psk", settingsMap) - UPDATE_STRING_SETTING_IF_VALID(wiFiConnection->securitySettings.leapPassword, "leap-password", settingsMap) } else { + settingsMap.remove("key-mgmt"); + settingsMap.remove("wep-tx-keyidx"); + settingsMap.remove("auth-alg"); + settingsMap.remove("proto"); + settingsMap.remove("pairwise"); + settingsMap.remove("group"); + settingsMap.remove("leap-username"); + settingsMap.remove("wep-key-flags"); + settingsMap.remove("wep-key-type"); + settingsMap.remove("psk-flags"); + settingsMap.remove("leap-password-flags"); settingsMap.remove("wep-key0"); settingsMap.remove("wep-key1"); settingsMap.remove("wep-key2"); diff --git a/tdecore/networkbackends/network-manager/network-manager.h b/tdecore/networkbackends/network-manager/network-manager.h index 2063a036b..a9042f1c4 100644 --- a/tdecore/networkbackends/network-manager/network-manager.h +++ b/tdecore/networkbackends/network-manager/network-manager.h @@ -145,6 +145,67 @@ #define NM_PLUGIN_SERVICE_DIR "/etc/NetworkManager/VPN" //==================================================================================================== +//==================================================================================================== +// Device state change reason codes +// Taken from NetworkManager.h +//==================================================================================================== +#define NM_DEVICE_STATE_REASON_NONE 0 +#define NM_DEVICE_STATE_REASON_UNKNOWN 1 +#define NM_DEVICE_STATE_REASON_NOW_MANAGED 2 +#define NM_DEVICE_STATE_REASON_NOW_UNMANAGED 3 +#define NM_DEVICE_STATE_REASON_CONFIG_FAILED 4 +#define NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE 5 +#define NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED 6 +#define NM_DEVICE_STATE_REASON_NO_SECRETS 7 +#define NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT 8 +#define NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED 9 +#define NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED 10 +#define NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT 11 +#define NM_DEVICE_STATE_REASON_PPP_START_FAILED 12 +#define NM_DEVICE_STATE_REASON_PPP_DISCONNECT 13 +#define NM_DEVICE_STATE_REASON_PPP_FAILED 14 +#define NM_DEVICE_STATE_REASON_DHCP_START_FAILED 15 +#define NM_DEVICE_STATE_REASON_DHCP_ERROR 16 +#define NM_DEVICE_STATE_REASON_DHCP_FAILED 17 +#define NM_DEVICE_STATE_REASON_SHARED_START_FAILED 18 +#define NM_DEVICE_STATE_REASON_SHARED_FAILED 19 +#define NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED 20 +#define NM_DEVICE_STATE_REASON_AUTOIP_ERROR 21 +#define NM_DEVICE_STATE_REASON_AUTOIP_FAILED 22 +#define NM_DEVICE_STATE_REASON_MODEM_BUSY 23 +#define NM_DEVICE_STATE_REASON_MODEM_NO_DIAL_TONE 24 +#define NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER 25 +#define NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT 26 +#define NM_DEVICE_STATE_REASON_MODEM_DIAL_FAILED 27 +#define NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED 28 +#define NM_DEVICE_STATE_REASON_GSM_APN_FAILED 29 +#define NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING 30 +#define NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED 31 +#define NM_DEVICE_STATE_REASON_GSM_REGISTRATION_TIMEOUT 32 +#define NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED 33 +#define NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED 34 +#define NM_DEVICE_STATE_REASON_FIRMWARE_MISSING 35 +#define NM_DEVICE_STATE_REASON_REMOVED 36 +#define NM_DEVICE_STATE_REASON_SLEEPING 37 +#define NM_DEVICE_STATE_REASON_CONNECTION_REMOVED 38 +#define NM_DEVICE_STATE_REASON_USER_REQUESTED 39 +#define NM_DEVICE_STATE_REASON_CARRIER 40 +#define NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED 41 +#define NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE 42 +#define NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND 43 +#define NM_DEVICE_STATE_REASON_BT_FAILED 44 +#define NM_DEVICE_STATE_REASON_GSM_SIM_NOT_INSERTED 45 +#define NM_DEVICE_STATE_REASON_GSM_SIM_PIN_REQUIRED 46 +#define NM_DEVICE_STATE_REASON_GSM_SIM_PUK_REQUIRED 47 +#define NM_DEVICE_STATE_REASON_GSM_SIM_WRONG 48 +#define NM_DEVICE_STATE_REASON_INFINIBAND_MODE 49 +#define NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED 50 +#define NM_DEVICE_STATE_REASON_BR2684_FAILED 51 +#define NM_DEVICE_STATE_REASON_MODEM_MANAGER_UNAVAILABLE 52 +#define NM_DEVICE_STATE_REASON_SSID_NOT_FOUND 53 +#define NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED 54 +//==================================================================================================== + class TDENetworkConnectionManager_BackendNMPrivate; class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkConnectionManager