summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/ppp/ppprun.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/ppp/ppprun.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/noncore/settings/networksettings2/ppp/ppprun.cpp b/noncore/settings/networksettings2/ppp/ppprun.cpp
index 4ac0c5a..8c75df3 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.cpp
+++ b/noncore/settings/networksettings2/ppp/ppprun.cpp
@@ -1,51 +1,43 @@
#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
- 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 );
+ AsDevice::netNode()->nextNode()->runtime()->detectState( NC );
}
}
bool PPPRun::setState( NodeCollection * NC, Action_t A ) {
switch( A ) {
case Activate :
NC->setCurrentState( Available );
// no
break;
case Deactivate :
if( NC->currentState() == IsUp ) {
NC->state( Down );
}
// cannot really disable
NC->setCurrentState( Available );
break;
case Up :
if( NC->currentState() != IsUp ) {
// start my PPPD
NC->setCurrentState( IsUp );
}
break;
case Down :
if( NC->currentState() == IsUp ) {