diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-09 20:40:11 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-09 20:40:11 -0500 |
commit | b5bdfd2c41c0be5b79831c1b9d5a3f292d129264 (patch) | |
tree | 8956791ee1e32656b6abd8eb9eb3dd8800472302 /tdecore/tdenetworkconnections.cpp | |
parent | 642f227036520a1a616e27db086a2c82e7dd1489 (diff) | |
download | tdelibs-b5bdfd2c41c0be5b79831c1b9d5a3f292d129264.tar.gz tdelibs-b5bdfd2c41c0be5b79831c1b9d5a3f292d129264.zip |
Extend API to include default device(s)
Diffstat (limited to 'tdecore/tdenetworkconnections.cpp')
-rw-r--r-- | tdecore/tdenetworkconnections.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/tdecore/tdenetworkconnections.cpp b/tdecore/tdenetworkconnections.cpp index 9b435b2ac..f3f427687 100644 --- a/tdecore/tdenetworkconnections.cpp +++ b/tdecore/tdenetworkconnections.cpp @@ -781,6 +781,27 @@ TQString TDENetworkConnectionManager::friendlyConnectionTypeName(TDENetworkConne } } +bool TDENetworkConnectionManager::validateIPAddress(TQHostAddress address) { + if (address.isIPv4Address()) { + TQ_UINT32 rawaddress = address.toIPv4Address(); + if ((((rawaddress & 0xff000000) >> 24) == 0) || ((rawaddress & 0x000000ff) == 0) || ((rawaddress & 0x000000ff) == 255)) { + return false; + } + } + else if (address.isIPv6Address()) { + Q_IPV6ADDR rawaddress = address.toIPv6Address(); + if (rawaddress.c[0] == 0xff) { + return false; + } + } + return true; +} + +bool TDENetworkConnectionManager::validateIPNeworkMask(TQHostAddress netmask) { + Q_UNUSED(netmask); + return TRUE; +} + void TDENetworkConnectionManager::clearTDENetworkConnectionList() { TDENetworkConnection *connection; for (connection = m_connectionList->first(); connection; connection = m_connectionList->next()) { @@ -870,9 +891,9 @@ bool TDEGlobalNetworkManager::deleteConnection(TQString uuid) { return m_internalConnectionManager->deleteConnection(uuid); } -bool TDEGlobalNetworkManager::verifyConnectionSettings(TDENetworkConnection* connection) { +bool TDEGlobalNetworkManager::verifyConnectionSettings(TDENetworkConnection* connection, TDENetworkConnectionErrorFlags::TDENetworkConnectionErrorFlags* type, TDENetworkErrorStringMap* reason) { if (!m_internalConnectionManager) return false; - return m_internalConnectionManager->verifyConnectionSettings(connection); + return m_internalConnectionManager->verifyConnectionSettings(connection, type, reason); } TDENetworkConnectionStatus::TDENetworkConnectionStatus TDEGlobalNetworkManager::initiateConnection(TQString uuid) { @@ -925,6 +946,11 @@ bool TDEGlobalNetworkManager::wiFiEnabled() { return m_internalConnectionManager->wiFiEnabled(); } +TQStringList TDEGlobalNetworkManager::defaultNetworkDevices() { + if (!m_internalConnectionManager) return NULL; + return m_internalConnectionManager->defaultNetworkDevices(); +} + TDENetworkConnectionList* TDEGlobalNetworkManager::connections() { if (!m_internalConnectionManager) return NULL; return m_internalConnectionManager->connections(); |