X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..dbcbe229628c7667da2b6257198467d4f09ab28d:/src/unix/dialup.cpp diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp index f64e45fd90..26fc932862 100644 --- a/src/unix/dialup.cpp +++ b/src/unix/dialup.cpp @@ -46,6 +46,9 @@ #include #include +DEFINE_EVENT_TYPE(wxEVT_DIALUP_CONNECTED) +DEFINE_EVENT_TYPE(wxEVT_DIALUP_DISCONNECTED) + // ---------------------------------------------------------------------------- // A class which groups functions dealing with connecting to the network from a // workstation using dial-up access to the net. There is at most one instance @@ -636,7 +639,11 @@ wxDialUpManagerImpl::CheckProcNet() int wxDialUpManagerImpl::CheckIfconfig() { - // assume that the test doesn't work +#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 @@ -677,18 +684,18 @@ wxDialUpManagerImpl::CheckIfconfig() cmd << " -a"; #elif defined(__LINUX__) || defined(__SGI__) // nothing to be added to ifconfig -#elif defined(__FREEBSD__) +#elif defined(__FREEBSD__) || defined(__WXMAC__) // add -l flag cmd << " -l"; #elif defined(__HPUX__) // VZ: a wild guess (but without it, ifconfig fails completely) cmd << _T(" ppp0"); #else -# pragma warning "No ifconfig information for this OS." - m_CanUseIfconfig = 0; +# pragma warning "No ifconfig information for this OS." + m_CanUseIfconfig = 0; return -1; #endif - cmd << " >" << tmpfile << '\''; + cmd << " >" << tmpfile << '\''; /* 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 @@ -742,6 +749,7 @@ wxDialUpManagerImpl::CheckIfconfig() } return netDevice; +#endif } wxDialUpManagerImpl::NetConnection wxDialUpManagerImpl::CheckPing() @@ -750,10 +758,15 @@ wxDialUpManagerImpl::NetConnection wxDialUpManagerImpl::CheckPing() // which does not take arguments, a la GNU. if(m_CanUsePing == -1) // unknown { +#ifdef __VMS + if(wxFileExists("SYS$SYSTEM:TCPIP$PING.EXE")) + m_PingPath = "$SYS$SYSTEM:TCPIP$PING"; +#else if(wxFileExists("/bin/ping")) m_PingPath = "/bin/ping"; else if(wxFileExists("/usr/sbin/ping")) m_PingPath = "/usr/sbin/ping"; +#endif if(! m_PingPath) { m_CanUsePing = 0; @@ -772,7 +785,7 @@ wxDialUpManagerImpl::NetConnection wxDialUpManagerImpl::CheckPing() cmd << m_PingPath << ' '; #if defined(__SOLARIS__) || defined (__SUNOS__) // nothing to add to ping command -#elif defined(__LINUX__) || defined ( __FREEBSD__) +#elif defined(__LINUX__) || defined ( __FREEBSD__) || defined(__WXMAC__) || defined( __VMS ) cmd << "-c 1 "; // only ping once #elif defined(__HPUX__) cmd << "64 1 "; // only ping once (need also specify the packet size)