summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/ppp/ppprun.cpp
authorwimpie <wimpie>2004-04-04 00:27:59 (UTC)
committer wimpie <wimpie>2004-04-04 00:27:59 (UTC)
commita416c6c9630d6d63ee63cf520953b86af8b7cddc (patch) (side-by-side diff)
treedbd0f5173728129f5a3faffdafd4f73d8cc72407 /noncore/settings/networksettings2/ppp/ppprun.cpp
parent152ffce2a4e8191d28738e3b40d8a726250a8767 (diff)
downloadopie-a416c6c9630d6d63ee63cf520953b86af8b7cddc.zip
opie-a416c6c9630d6d63ee63cf520953b86af8b7cddc.tar.gz
opie-a416c6c9630d6d63ee63cf520953b86af8b7cddc.tar.bz2
*** empty log message ***
Diffstat (limited to 'noncore/settings/networksettings2/ppp/ppprun.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/noncore/settings/networksettings2/ppp/ppprun.cpp b/noncore/settings/networksettings2/ppp/ppprun.cpp
index 8933f85..4ac0c5a 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.cpp
+++ b/noncore/settings/networksettings2/ppp/ppprun.cpp
@@ -1,20 +1,33 @@
#include <resources.h>
#include "ppprun.h"
+PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & Data ) :
+ AsConnection( NNI ), AsDevice( NNI ), Pat( "eth[0-9]" ) {
+ D = &Data;
+}
+
void PPPRun::detectState( NodeCollection * NC ) {
if( isMyPPPDRunning( ) ) {
if( isMyPPPUp() ) {
NC->setCurrentState( IsUp );
} else {
NC->setCurrentState( Available );
}
} else {
NC->setCurrentState( Off ); // at least this
// but could also be unavailable
- netNode()->nextNode()->runtime()->detectState( NC );
+ ANetNodeInstance * NNI;
+ RuntimeInfo * RI;
+ NNI = AsDevice::netNode();
+ printf( "%p\n", NNI );
+ NNI = NNI->nextNode();
+ printf( "%p\n", NNI );
+ RI = NNI->runtime();
+ printf( "%p\n", RI );
+ RI->detectState( NC );
}
}
bool PPPRun::setState( NodeCollection * NC, Action_t A ) {
switch( A ) {
case Activate :
@@ -49,24 +62,24 @@ bool PPPRun::setState( NodeCollection * NC, Action_t A ) {
bool PPPRun::isMyPPPDRunning( void ) {
return 0;
}
bool PPPRun::isMyPPPUp( void ) {
System & S = NSResources->system();
- InterfaceInfo * best = 0, * Run;
+ InterfaceInfo * Run;
QRegExp R( "ppp[0-9]" );
for( QDictIterator<InterfaceInfo> It(S.interfaces());
It.current();
++It ) {
Run = It.current();
if( R.match( Run->Name ) >= 0 &&
Run->IsPointToPoint
) {
// this is a LAN card
- if( Run->assignedNode() == netNode() ) {
+ if( Run->assignedNode() == AsDevice::netNode() ) {
// assigned to us
return 1;
}
}
}
return 0;