// -*- c++ -*- ////////////////////////////////////////////////////////////////
// Name: src/unix/dialup.cpp
// Purpose: Network related wxWidgets classes and functions
-// Author: Karsten Ballüder
+// Author: Karsten Ballüder
// Modified by:
// Created: 03.10.99
// RCS-ID: $Id$
-// Copyright: (c) Karsten Ballüder
+// Copyright: (c) Karsten Ballüder
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// first time check for ifconfig location
if ( m_CanUseIfconfig == -1 ) // unknown
{
- static const wxChar *ifconfigLocations[] =
+ static const wxChar *const ifconfigLocations[] =
{
wxT("/sbin"), // Linux, FreeBSD, Darwin
wxT("/usr/sbin"), // SunOS, Solaris, AIX, HP-UX
cmd << wxT(" -a");
#elif defined(__LINUX__) || defined(__SGI__)
// nothing to be added to ifconfig
-#elif defined(__FREEBSD__) || defined(__DARWIN__)
+#elif defined(__FREEBSD__) || defined(__DARWIN__) || defined(__QNX__)
// add -l flag
cmd << wxT(" -l");
#elif defined(__HPUX__)
cmd << wxT(" >") << tmpfile << wxT('\'');
/* I tried to add an option to wxExecute() to not close stdout,
so we could let ifconfig write directly to the tmpfile, but
- this does not work. That should be faster, as it doesn´t call
+ this does not work. That should be faster, as it doesn't call
the shell first. I have no idea why. :-( (KB) */
if ( wxExecute(cmd,true /* sync */) == 0 )
{
// dialup device under SunOS/Solaris
hasModem = strstr(output.fn_str(),"ipdptp") != NULL;
hasLAN = strstr(output.fn_str(), "hme") != NULL;
-#elif defined(__LINUX__) || defined (__FREEBSD__)
+#elif defined(__LINUX__) || defined (__FREEBSD__) || defined (__QNX__)
hasModem = strstr(output.fn_str(),"ppp") // ppp
|| strstr(output.fn_str(),"sl") // slip
|| strstr(output.fn_str(),"pl"); // plip
}
else // could not run ifconfig correctly
{
- m_CanUseIfconfig = 0; // don´t try again
+ m_CanUseIfconfig = 0; // don't try again
}
(void) wxRemoveFile(tmpfile);
defined(__LINUX__) || \
defined(__OSF__) || \
defined(__SGI__) || \
- defined(__VMS)
+ defined(__VMS) || \
+ defined(__QNX__)
cmd << wxT("-c 1 "); // only ping once
#elif defined(__HPUX__)
cmd << wxT("64 1 "); // only ping once (need also specify the packet size)