Diffstat (limited to 'noncore/settings/networksettings2/ppp/ppprun.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/ppp/ppprun.cpp | 10 |
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 @@ | |||
1 | #include <resources.h> | 1 | #include <resources.h> |
2 | #include "ppprun.h" | 2 | #include "ppprun.h" |
3 | 3 | ||
4 | PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & Data ) : | 4 | PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & Data ) : |
5 | AsConnection( NNI ), AsDevice( NNI ), Pat( "eth[0-9]" ) { | 5 | AsConnection( NNI ), AsDevice( NNI ), Pat( "eth[0-9]" ) { |
6 | D = &Data; | 6 | D = &Data; |
7 | } | 7 | } |
8 | 8 | ||
9 | void PPPRun::detectState( NodeCollection * NC ) { | 9 | void PPPRun::detectState( NodeCollection * NC ) { |
10 | if( isMyPPPDRunning( ) ) { | 10 | if( isMyPPPDRunning( ) ) { |
11 | if( isMyPPPUp() ) { | 11 | if( isMyPPPUp() ) { |
12 | NC->setCurrentState( IsUp ); | 12 | NC->setCurrentState( IsUp ); |
13 | } else { | 13 | } else { |
14 | NC->setCurrentState( Available ); | 14 | NC->setCurrentState( Available ); |
15 | } | 15 | } |
16 | } else { | 16 | } else { |
17 | NC->setCurrentState( Off ); // at least this | 17 | NC->setCurrentState( Off ); // at least this |
18 | // but could also be unavailable | 18 | // but could also be unavailable |
19 | ANetNodeInstance * NNI; | 19 | AsDevice::netNode()->nextNode()->runtime()->detectState( NC ); |
20 | RuntimeInfo * RI; | ||
21 | NNI = AsDevice::netNode(); | ||
22 | printf( "%p\n", NNI ); | ||
23 | NNI = NNI->nextNode(); | ||
24 | printf( "%p\n", NNI ); | ||
25 | RI = NNI->runtime(); | ||
26 | printf( "%p\n", RI ); | ||
27 | RI->detectState( NC ); | ||
28 | } | 20 | } |
29 | } | 21 | } |
30 | 22 | ||
31 | bool PPPRun::setState( NodeCollection * NC, Action_t A ) { | 23 | bool PPPRun::setState( NodeCollection * NC, Action_t A ) { |
32 | switch( A ) { | 24 | switch( A ) { |
33 | case Activate : | 25 | case Activate : |
34 | NC->setCurrentState( Available ); | 26 | NC->setCurrentState( Available ); |
35 | // no | 27 | // no |
36 | break; | 28 | break; |
37 | case Deactivate : | 29 | case Deactivate : |
38 | if( NC->currentState() == IsUp ) { | 30 | if( NC->currentState() == IsUp ) { |
39 | NC->state( Down ); | 31 | NC->state( Down ); |
40 | } | 32 | } |
41 | // cannot really disable | 33 | // cannot really disable |
42 | NC->setCurrentState( Available ); | 34 | NC->setCurrentState( Available ); |
43 | break; | 35 | break; |
44 | case Up : | 36 | case Up : |
45 | if( NC->currentState() != IsUp ) { | 37 | if( NC->currentState() != IsUp ) { |
46 | // start my PPPD | 38 | // start my PPPD |
47 | NC->setCurrentState( IsUp ); | 39 | NC->setCurrentState( IsUp ); |
48 | } | 40 | } |
49 | break; | 41 | break; |
50 | case Down : | 42 | case Down : |
51 | if( NC->currentState() == IsUp ) { | 43 | if( NC->currentState() == IsUp ) { |