diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-10 10:52:00 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-10 10:52:00 -0500 |
commit | 0a3b1be6318067d26fd20031f64caa380c55d5cc (patch) | |
tree | 3469cb624417cc2991e4c9a2ce607702aa6fa553 | |
parent | d62684deefe7ee5c654e4fc5b6359db5661dd6a9 (diff) | |
download | tdelibs-0a3b1be6318067d26fd20031f64caa380c55d5cc.tar.gz tdelibs-0a3b1be6318067d26fd20031f64caa380c55d5cc.zip |
Add a couple of needed methods to the network-manager backend API
-rw-r--r-- | tdecore/networkbackends/network-manager/network-manager.cpp | 17 | ||||
-rw-r--r-- | tdecore/networkbackends/network-manager/network-manager.h | 2 | ||||
-rw-r--r-- | tdecore/tdenetworkconnections.cpp | 10 | ||||
-rw-r--r-- | tdecore/tdenetworkconnections.h | 43 |
4 files changed, 68 insertions, 4 deletions
diff --git a/tdecore/networkbackends/network-manager/network-manager.cpp b/tdecore/networkbackends/network-manager/network-manager.cpp index 48f76fd46..713c2d51e 100644 --- a/tdecore/networkbackends/network-manager/network-manager.cpp +++ b/tdecore/networkbackends/network-manager/network-manager.cpp @@ -1478,6 +1478,10 @@ TDENetworkConnectionType::TDENetworkConnectionType TDENetworkConnectionManager_B return connType; } +TQString TDENetworkConnectionManager_BackendNM::backendName() { + return i18n("NetworkManager"); +} + TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags TDENetworkConnectionManager_BackendNM::backendStatus() { if (d->m_networkManagerProxy) { TQ_UINT32 ret; @@ -4535,6 +4539,19 @@ TQStringList TDENetworkConnectionManager_BackendNM::connectionPhysicalDeviceUUID } } +TDENetworkVPNTypeList TDENetworkConnectionManager_BackendNM::availableVPNTypes() { + TDENetworkVPNTypeList ret; + + // FIXME + // This backend should query NetworkManager to verify plugin availability before claiming support for a VPN type! + ret.append(TDENetworkVPNType::OpenVPN); + ret.append(TDENetworkVPNType::PPTP); + ret.append(TDENetworkVPNType::StrongSwan); + ret.append(TDENetworkVPNType::VPNC); + + return ret; +} + TDENetworkConnectionStatus::TDENetworkConnectionStatus TDENetworkConnectionManager_BackendNM::deactivateConnection(TQString uuid) { TQT_DBusObjectPath existingConnection; TQT_DBusError error; diff --git a/tdecore/networkbackends/network-manager/network-manager.h b/tdecore/networkbackends/network-manager/network-manager.h index c9186e442..6a9e8ebc9 100644 --- a/tdecore/networkbackends/network-manager/network-manager.h +++ b/tdecore/networkbackends/network-manager/network-manager.h @@ -137,6 +137,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkCo TDENetworkConnectionManager_BackendNM(TQString macAddress); ~TDENetworkConnectionManager_BackendNM(); + virtual TQString backendName(); virtual TDENetworkDeviceType::TDENetworkDeviceType deviceType(); virtual TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags backendStatus(); virtual TDENetworkDeviceInformation deviceInformation(); @@ -155,6 +156,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkCo virtual TDENetworkHWNeighborList* siteSurvey(); virtual TQStringList connectionPhysicalDeviceUUIDs(TQString uuid); + virtual TDENetworkVPNTypeList availableVPNTypes(); virtual bool networkingEnabled(); virtual bool wiFiHardwareEnabled(); diff --git a/tdecore/tdenetworkconnections.cpp b/tdecore/tdenetworkconnections.cpp index 53bd1f4ec..dcccc64c0 100644 --- a/tdecore/tdenetworkconnections.cpp +++ b/tdecore/tdenetworkconnections.cpp @@ -861,6 +861,11 @@ TDEGlobalNetworkManager::~TDEGlobalNetworkManager() { delete m_internalConnectionManager; } +TQString TDEGlobalNetworkManager::backendName() { + if (!m_internalConnectionManager) return TQString::null; + return m_internalConnectionManager->backendName(); +} + TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags TDEGlobalNetworkManager::backendStatus() { if (!m_internalConnectionManager) return TDENetworkGlobalManagerFlags::BackendUnavailable; return m_internalConnectionManager->backendStatus(); @@ -926,6 +931,11 @@ TQStringList TDEGlobalNetworkManager::connectionPhysicalDeviceUUIDs(TQString uui return m_internalConnectionManager->connectionPhysicalDeviceUUIDs(uuid); } +TDENetworkVPNTypeList TDEGlobalNetworkManager::availableVPNTypes() { + if (!m_internalConnectionManager) return TDENetworkVPNTypeList(); + return m_internalConnectionManager->availableVPNTypes(); +} + bool TDEGlobalNetworkManager::networkingEnabled() { if (!m_internalConnectionManager) return false; return m_internalConnectionManager->networkingEnabled(); diff --git a/tdecore/tdenetworkconnections.h b/tdecore/tdenetworkconnections.h index 3d3976e99..2ba894732 100644 --- a/tdecore/tdenetworkconnections.h +++ b/tdecore/tdenetworkconnections.h @@ -302,6 +302,19 @@ namespace TDENetworkWiFiClientFlags { CREATE_FLAG_BITWISE_MANIPULATION_FUNCTIONS(TDENetworkWiFiClientFlags) }; +namespace TDENetworkVPNType { + enum TDENetworkVPNType { + OpenVPN, + PPTP, + StrongSwan, + VPNC, + Other, + Last = Other + }; +}; + +typedef TQValueList<TDENetworkVPNType::TDENetworkVPNType> TDENetworkVPNTypeList; + namespace TDENetworkWiFiConnectionCipher { enum TDENetworkWiFiConnectionCipher { None, @@ -315,6 +328,8 @@ namespace TDENetworkWiFiConnectionCipher { }; }; +typedef TQValueList<TDENetworkWiFiConnectionCipher::TDENetworkWiFiConnectionCipher> TDENetworkWiFiConnectionCipherList; + namespace TDENetworkWepKeyType { enum TDENetworkWepKeyType { Hexadecimal, @@ -334,8 +349,6 @@ namespace TDENetworkVLANFlags { CREATE_FLAG_BITWISE_MANIPULATION_FUNCTIONS(TDENetworkVLANFlags) }; -typedef TQValueList<TDENetworkWiFiConnectionCipher::TDENetworkWiFiConnectionCipher> TDENetworkWiFiConnectionCipherList; - namespace TDENetworkWiFiKeyType { enum TDENetworkWiFiKeyType { WEP, @@ -976,9 +989,9 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject ~TDENetworkConnectionManager(); /** - * @return the MAC address of this device + * @return a TQString containing the name of the backend in use */ - TQString deviceMACAddress(); + virtual TQString backendName() = 0; /** * @return the type of connection supported by this device @@ -1092,6 +1105,12 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject virtual TQStringList connectionPhysicalDeviceUUIDs(TQString uuid) = 0; /** + * @return a TDENetworkVPNTypeList object containing all supported VPN types + * If a type is not in this list, it is not supported by the backend in use + */ + virtual TDENetworkVPNTypeList availableVPNTypes() = 0; + + /** * @return true if networking is enabled, false if not. */ virtual bool networkingEnabled() = 0; @@ -1174,6 +1193,11 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject virtual TDENetworkConnectionList* connections(); /** + * @return the MAC address of this device + */ + TQString deviceMACAddress(); + + /** * @return a pointer to a TDENetworkConnection object with the specified @param uuid, * or a NULL pointer if no such connection exists. * @@ -1277,6 +1301,11 @@ class TDECORE_EXPORT TDEGlobalNetworkManager : public TQObject ~TDEGlobalNetworkManager(); /** + * @return a TQString containing the name of the backend in use + */ + virtual TQString backendName(); + + /** * @return A TDENetworkGlobalManagerFlags enum value with the current status of the networking backend. */ virtual TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags backendStatus(); @@ -1376,6 +1405,12 @@ class TDECORE_EXPORT TDEGlobalNetworkManager : public TQObject virtual TQStringList connectionPhysicalDeviceUUIDs(TQString uuid); /** + * @return a TDENetworkVPNTypeList object containing all supported VPN types + * If a type is not in this list, it is not supported by the backend in use + */ + virtual TDENetworkVPNTypeList availableVPNTypes(); + + /** * @return true if networking is enabled, false if not. */ virtual bool networkingEnabled(); |