- int rc = -1;
-
- // First time check for ifconfig location. We only use the variant which
- // does not take arguments, a la GNU.
- if ( m_CanUseIfconfig == -1 ) // unknown
- {
- static const wxChar *ifconfigLocations[] =
- {
- _T("/sbin"), // Linux, FreeBSD
- _T("/usr/sbin"), // SunOS, Solaris, AIX, HP-UX
- _T("/usr/etc"), // IRIX
- };
-
- for ( size_t n = 0; n < WXSIZEOF(ifconfigLocations); n++ )
- {
- wxString path(ifconfigLocations[n]);
- path << _T("/ifconfig");
-
- if ( wxFileExists(path) )
- {
- m_IfconfigPath = path;
- break;
- }
- }
- }
-
- wxLogNull ln; // suppress all error messages
- // Let´s try the ifconfig method first, should be fastest:
- if(m_CanUseIfconfig != 0) // unknown or yes
- {
- wxASSERT(m_IfconfigPath.length());
-
- wxString tmpfile = wxGetTempFileName("_wxdialuptest");
- wxString cmd = "/bin/sh -c \'";
- cmd << m_IfconfigPath;
-#if defined(__SOLARIS__) || defined (__SUNOS__)
- // need to add -a flag
- cmd << " -a";
-#elif defined(__LINUX__) || defined (__FREEBSD__) || defined(__SGI__)
- // nothing to be added to ifconfig
+#ifdef __VMS
+ m_CanUseIfconfig = 0;
+ return -1;
+#else
+ // assume that the test doesn't work
+ int netDevice = NetDevice_Unknown;
+
+ // first time check for ifconfig location
+ if ( m_CanUseIfconfig == -1 ) // unknown
+ {
+ static const wxChar *ifconfigLocations[] =
+ {
+ _T("/sbin"), // Linux, FreeBSD, Darwin
+ _T("/usr/sbin"), // SunOS, Solaris, AIX, HP-UX
+ _T("/usr/etc"), // IRIX
+ _T("/etc"), // AIX 5
+ };
+
+ for ( size_t n = 0; n < WXSIZEOF(ifconfigLocations); n++ )
+ {
+ wxString path(ifconfigLocations[n]);
+ path << _T("/ifconfig");
+
+ if ( wxFileExists(path) )
+ {
+ m_IfconfigPath = path;
+ break;
+ }
+ }
+ }
+
+ if ( m_CanUseIfconfig != 0 ) // unknown or yes
+ {
+ wxLogNull ln; // suppress all error messages
+
+ wxASSERT_MSG( m_IfconfigPath.length(),
+ _T("can't use ifconfig if it wasn't found") );
+
+ wxString tmpfile = wxGetTempFileName( wxT("_wxdialuptest") );
+ wxString cmd = wxT("/bin/sh -c \'");
+ cmd << m_IfconfigPath;
+#if defined(__AIX__) || \
+ defined(__OSF__) || \
+ defined(__SOLARIS__) || defined (__SUNOS__)
+ // need to add -a flag
+ cmd << wxT(" -a");
+#elif defined(__LINUX__) || defined(__SGI__)
+ // nothing to be added to ifconfig
+#elif defined(__FREEBSD__) || defined(__DARWIN__)
+ // add -l flag
+ cmd << wxT(" -l");