diff options
| author | 2011-01-01 20:19:56 +0000 | |
|---|---|---|
| committer | 2011-01-01 20:19:56 +0000 | |
| commit | c601b5a27f74b16158adafe429faefbe573e64a2 (patch) | |
| tree | a3cde3206a45628f8ac86e8dfbdab70b20c3a831 /src/modules/dcc/utils.cpp | |
| parent | probable compilation fix for rijndaled/crypto++ (diff) | |
| download | KVIrc-c601b5a27f74b16158adafe429faefbe573e64a2.tar.gz KVIrc-c601b5a27f74b16158adafe429faefbe573e64a2.tar.bz2 KVIrc-c601b5a27f74b16158adafe429faefbe573e64a2.zip | |
The big rename for modules. Still some details remaining.
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5284 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/dcc/utils.cpp')
| -rw-r--r-- | src/modules/dcc/utils.cpp | 170 |
1 files changed, 0 insertions, 170 deletions
diff --git a/src/modules/dcc/utils.cpp b/src/modules/dcc/utils.cpp deleted file mode 100644 index 8817bc0fa..000000000 --- a/src/modules/dcc/utils.cpp +++ /dev/null @@ -1,170 +0,0 @@ -//============================================================================= -// -// File : utils.cpp -// Creation date : Tue Jul 23 02:54:44 2002 GMT by Szymon Stefanek -// -// This file is part of the KVIrc irc client distribution -// Copyright (C) 2002-2010 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -#define _UTILS_CPP_ - -#include "utils.h" - -#include "KviOptions.h" -#include "KviLocale.h" -#include "KviNetUtils.h" -#include "KviIrcSocket.h" -#include "KviIrcLink.h" -#include "KviQString.h" - -/* -bool dcc_module_get_listen_ip_address(KviCommand *c,KviConsoleWindow * pConsole,QString &szListenIp) -{ - // - // Find an interface suitable for listening.... - // Either from user options or from the current connection... - // - - if(KVI_OPTION_BOOL(KviOption_boolDccListenOnSpecifiedInterfaceByDefault)) - { - KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).trimmed(); - if(!KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).isEmpty()) - { - if(kvi_isValidStringIp(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data())) - { - if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface),"0.0.0.0")) - { - // Try to find the first available IPv4 interface - if(!kvi_getLocalHostAddress(szListenIp)) - { - if(c)c->warning(__tr2qs_ctx("Can't retrieve a suitable local IPV4 address","dcc"), - KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data()); - return false; - } - } else { - szListenIp = KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface); - } - return true; - } -#ifdef COMPILE_IPV6_SUPPORT - if(kvi_isValidStringIPv6(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data())) - { - szListenIp = KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface); - } else { -#endif - if(!kvi_getInterfaceAddress(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data(),szListenIp)) - { - KVI_OPTION_BOOL(KviOption_boolDccListenOnSpecifiedInterfaceByDefault) = false; - if(c)c->warning(__tr2qs_ctx("Can't listen on default interface '%s': fix it in the options dialog, disabling the option (so the next dcc will work)","dcc"), - KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data()); - return false; - } -#ifdef COMPILE_IPV6_SUPPORT - } -#endif - return true; - } else { - // the option was empty.. disable it - KVI_OPTION_BOOL(KviOption_boolDccListenOnSpecifiedInterfaceByDefault) = false; - } - } - - if(pConsole) - { - if(pConsole->isConnected()) - { - //#warning "The IPV6 choice is not OK here.... and maybe allow to bind to specified ports" - pConsole->socket()->getLocalHostIp(szListenIp,pConsole->isIPv6Connection()); - } else { - szListenIp = "0.0.0.0"; // huh ? :) - } - } else { - szListenIp = "0.0.0.0"; - } - - return true; -} -*/ - -bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsoleWindow * pConsole,QString &szListenIp) -{ - // - // Find an interface suitable for listening.... - // Either from user options or from the current connection... - // - - if(KVI_OPTION_BOOL(KviOption_boolDccListenOnSpecifiedInterfaceByDefault)) - { - KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).trimmed(); - if(!KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).isEmpty()) - { - if(KviNetUtils::isValidStringIp(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data())) - { - if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface),"0.0.0.0")) - { - // Try to find the first available IPv4 interface - if(!kvi_getLocalHostAddress(szListenIp)) - { - if(c)c->warning(__tr2qs_ctx("Can't retrieve a suitable local IPV4 address","dcc"), - KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data()); - return false; - } - } else { - szListenIp = KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface); - } - return true; - } -#ifdef COMPILE_IPV6_SUPPORT - if(KviNetUtils::isValidStringIPv6(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data())) - { - szListenIp = KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface); - } else { -#endif - if(!KviNetUtils::getInterfaceAddress(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface),szListenIp)) - { - KVI_OPTION_BOOL(KviOption_boolDccListenOnSpecifiedInterfaceByDefault) = false; - if(c)c->warning(__tr2qs_ctx("Can't listen on default interface '%s': fix it in the options dialog, disabling the option (so the next dcc will work)","dcc"), - KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data()); - return false; - } -#ifdef COMPILE_IPV6_SUPPORT - } -#endif - return true; - } else { - // the option was empty.. disable it - KVI_OPTION_BOOL(KviOption_boolDccListenOnSpecifiedInterfaceByDefault) = false; - } - } - - if(pConsole) - { - if(pConsole->isConnected()) - { - //#warning "The IPV6 choice is not OK here.... and maybe allow to bind to specified ports" - pConsole->connection()->link()->socket()->getLocalHostIp(szListenIp,pConsole->isIPv6Connection()); - } else { - szListenIp = "0.0.0.0"; // huh ? :) - } - } else { - szListenIp = "0.0.0.0"; - } - - return true; -} |
