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/ppp_NN.cpp9
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.h4
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.cpp10
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.h8
4 files changed, 19 insertions, 12 deletions
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.cpp b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
index 309c9a1..51d17ec 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NN.cpp
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
@@ -35,28 +35,35 @@ const char ** PPPNetNode::needs( void ) {
35 return PPPNeeds; 35 return PPPNeeds;
36} 36}
37 37
38const char * PPPNetNode::provides( void ) { 38const char * PPPNetNode::provides( void ) {
39 return "connection"; 39 return "connection";
40} 40}
41 41
42bool PPPNetNode::generateProperFilesFor( 42bool PPPNetNode::generateProperFilesFor(
43 ANetNodeInstance * ) { 43 ANetNodeInstance * ) {
44 return 1; 44 return 1;
45} 45}
46 46
47bool PPPNetNode::hasDataFor( const QString & ) { 47bool PPPNetNode::hasDataFor( const QString &, bool ) {
48 return 0; 48 return 0;
49} 49}
50 50
51bool PPPNetNode::generateDataForCommonFile( 51bool PPPNetNode::generateDataForCommonFile(
52 SystemFile & , 52 SystemFile & ,
53 long, 53 long,
54 ANetNodeInstance * ) { 54 ANetNodeInstance * ) {
55 return 1; 55 return 1;
56} 56}
57 57
58bool PPPNetNode::generateDeviceDataForCommonFile(
59 SystemFile & ,
60 long ,
61 ANetNodeInstance * ) {
62 return 1;
63}
64
58extern "C" { 65extern "C" {
59void create_plugin( QList<ANetNode> & PNN ) { 66void create_plugin( QList<ANetNode> & PNN ) {
60 PNN.append( new PPPNetNode() ); 67 PNN.append( new PPPNetNode() );
61} 68}
62} 69}
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.h b/noncore/settings/networksettings2/ppp/ppp_NN.h
index 3f9a338..8d56e7f 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NN.h
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.h
@@ -19,26 +19,28 @@ public:
19 19
20 virtual const QString nodeName() 20 virtual const QString nodeName()
21 { return tr("PPP Connection"); } 21 { return tr("PPP Connection"); }
22 22
23 virtual const QString nodeDescription() ; 23 virtual const QString nodeDescription() ;
24 24
25 virtual ANetNodeInstance * createInstance( void ); 25 virtual ANetNodeInstance * createInstance( void );
26 26
27 virtual const char ** needs( void ); 27 virtual const char ** needs( void );
28 virtual const char * provides( void ); 28 virtual const char * provides( void );
29 29
30 virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); 30 virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
31 virtual bool hasDataFor( const QString & S ); 31 virtual bool hasDataFor( const QString & S, bool DS );
32 virtual bool generateDataForCommonFile( 32 virtual bool generateDataForCommonFile(
33 SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); 33 SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
34 virtual bool generateDeviceDataForCommonFile(
35 SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
34 36
35private: 37private:
36 38
37}; 39};
38 40
39extern "C" 41extern "C"
40{ 42{
41 void create_plugin( QList<ANetNode> & PNN ); 43 void create_plugin( QList<ANetNode> & PNN );
42}; 44};
43 45
44#endif 46#endif
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
@@ -7,33 +7,25 @@ PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & 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 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
31bool PPPRun::setState( NodeCollection * NC, Action_t A ) { 23bool 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 );
diff --git a/noncore/settings/networksettings2/ppp/ppprun.h b/noncore/settings/networksettings2/ppp/ppprun.h
index abb9176..765aff2 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.h
+++ b/noncore/settings/networksettings2/ppp/ppprun.h
@@ -6,26 +6,32 @@
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 virtual QString genNic( long NicNr ) 15 virtual QString genNic( long NicNr )
16 { QString S; return S.sprintf( "ppp%ld", NicNr ); } 16 { QString S; return S.sprintf( "ppp%ld", NicNr ); }
17 17
18 virtual AsDevice * asDevice( void )
19 { return (AsDevice *)this; }
20 virtual AsConnection * asConnection( void )
21 { return (AsConnection *)this; }
22
18 virtual AsDevice * device( void ) 23 virtual AsDevice * device( void )
19 { return AsDevice::asDevice(); } 24 { return (AsDevice *)this; }
25
20 virtual RuntimeInfo * runtimeInfo( void ) 26 virtual RuntimeInfo * runtimeInfo( void )
21 { return ( AsConnection *)this; } 27 { return ( AsConnection *)this; }
22 28
23 protected : 29 protected :
24 30
25 void detectState( NodeCollection * NC ); 31 void detectState( NodeCollection * NC );
26 bool setState( NodeCollection * NC, Action_t A ); 32 bool setState( NodeCollection * NC, Action_t A );
27 bool canSetState( State_t S, Action_t A ) 33 bool canSetState( State_t S, Action_t A )
28 { return AsDevice::connection()->findNext( 34 { return AsDevice::connection()->findNext(
29 AsDevice::netNode() )->runtime()->canSetState( S,A ); } 35 AsDevice::netNode() )->runtime()->canSetState( S,A ); }
30 36
31 bool handlesInterface( const QString & I ); 37 bool handlesInterface( const QString & I );