summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/ppp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/ppp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.cpp2
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/networksettings2/ppp/ppprun.cpp b/noncore/settings/networksettings2/ppp/ppprun.cpp
index 8c75df3..a8abc50 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.cpp
+++ b/noncore/settings/networksettings2/ppp/ppprun.cpp
@@ -1,47 +1,47 @@
1#include <resources.h> 1#include <resources.h>
2#include "ppprun.h" 2#include "ppprun.h"
3 3
4PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & Data ) : 4PPPRun::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
9void PPPRun::detectState( NodeCollection * NC ) { 9void 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 AsDevice::netNode()->nextNode()->runtime()->detectState( NC ); 19 AsDevice::netNode()->nextNode()->runtime()->detectState( NC );
20 } 20 }
21} 21}
22 22
23bool PPPRun::setState( NodeCollection * NC, Action_t A ) { 23bool PPPRun::setState( NodeCollection * NC, Action_t A, bool ) {
24 switch( A ) { 24 switch( A ) {
25 case Activate : 25 case Activate :
26 NC->setCurrentState( Available ); 26 NC->setCurrentState( Available );
27 // no 27 // no
28 break; 28 break;
29 case Deactivate : 29 case Deactivate :
30 if( NC->currentState() == IsUp ) { 30 if( NC->currentState() == IsUp ) {
31 NC->state( Down ); 31 NC->state( Down );
32 } 32 }
33 // cannot really disable 33 // cannot really disable
34 NC->setCurrentState( Available ); 34 NC->setCurrentState( Available );
35 break; 35 break;
36 case Up : 36 case Up :
37 if( NC->currentState() != IsUp ) { 37 if( NC->currentState() != IsUp ) {
38 // start my PPPD 38 // start my PPPD
39 NC->setCurrentState( IsUp ); 39 NC->setCurrentState( IsUp );
40 } 40 }
41 break; 41 break;
42 case Down : 42 case Down :
43 if( NC->currentState() == IsUp ) { 43 if( NC->currentState() == IsUp ) {
44 // stop my PPPD 44 // stop my PPPD
45 NC->setCurrentState( Available ); 45 NC->setCurrentState( Available );
46 } 46 }
47 break; 47 break;
diff --git a/noncore/settings/networksettings2/ppp/ppprun.h b/noncore/settings/networksettings2/ppp/ppprun.h
index af51fbe..90a3f25 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.h
+++ b/noncore/settings/networksettings2/ppp/ppprun.h
@@ -6,42 +6,42 @@
6#include <asdevice.h> 6#include <asdevice.h>
7#include "pppdata.h" 7#include "pppdata.h"
8 8
9class PPPRun : public AsConnection, public AsDevice { 9class PPPRun : public AsConnection, public AsDevice {
10 10
11public : 11public :
12 12
13 PPPRun( ANetNodeInstance * NNI, 13 PPPRun( ANetNodeInstance * NNI,
14 PPPData & Data ); 14 PPPData & Data );
15 15
16 virtual AsDevice * asDevice( void ) 16 virtual AsDevice * asDevice( void )
17 { return (AsDevice *)this; } 17 { return (AsDevice *)this; }
18 virtual AsConnection * asConnection( void ) 18 virtual AsConnection * asConnection( void )
19 { return (AsConnection *)this; } 19 { return (AsConnection *)this; }
20 20
21 virtual AsDevice * device( void ) 21 virtual AsDevice * device( void )
22 { return (AsDevice *)this; } 22 { return (AsDevice *)this; }
23 23
24 virtual RuntimeInfo * runtimeInfo( void ) 24 virtual RuntimeInfo * runtimeInfo( void )
25 { return ( AsConnection *)this; } 25 { return ( AsConnection *)this; }
26 26
27 protected : 27 protected :
28 28
29 void detectState( NodeCollection * NC ); 29 void detectState( NodeCollection * NC );
30 bool setState( NodeCollection * NC, Action_t A ); 30 bool setState( NodeCollection * NC, Action_t A, bool );
31 bool canSetState( State_t S, Action_t A ) 31 bool canSetState( State_t S, Action_t A )
32 { return AsDevice::connection()->findNext( 32 { return AsDevice::connection()->findNext(
33 AsDevice::netNode() )->runtime()->canSetState( S,A ); } 33 AsDevice::netNode() )->runtime()->canSetState( S,A ); }
34 34
35 bool handlesInterface( const QString & I ); 35 bool handlesInterface( const QString & I );
36 36
37private : 37private :
38 38
39 bool isMyPPPDRunning( void ); 39 bool isMyPPPDRunning( void );
40 bool isMyPPPUp( void ); 40 bool isMyPPPUp( void );
41 41
42 PPPData_t * D; 42 PPPData_t * D;
43 QRegExp Pat; 43 QRegExp Pat;
44 44
45}; 45};
46 46
47#endif 47#endif