summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/ppp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/ppp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.h2
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NNI.h2
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.cpp19
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.h20
4 files changed, 31 insertions, 12 deletions
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.h b/noncore/settings/networksettings2/ppp/ppp_NN.h
index a933523..3f9a338 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NN.h
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.h
@@ -15,7 +15,7 @@ public:
virtual ~PPPNetNode();
virtual const QString pixmapName()
- { return "ppp"; }
+ { return "Devices/ppp"; }
virtual const QString nodeName()
{ return tr("PPP Connection"); }
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.h b/noncore/settings/networksettings2/ppp/ppp_NNI.h
index 08dca1d..a17721a 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NNI.h
+++ b/noncore/settings/networksettings2/ppp/ppp_NNI.h
@@ -21,7 +21,7 @@ public :
RuntimeInfo * runtime( void )
{ if( RT == 0 )
RT = new PPPRun( this, Data );
- return RT;
+ return RT->runtimeInfo();
}
virtual void * data( void )
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,6 +1,11 @@
#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() ) {
@@ -11,7 +16,15 @@ void PPPRun::detectState( NodeCollection * NC ) {
} 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 );
}
}
@@ -52,7 +65,7 @@ bool PPPRun::isMyPPPDRunning( void ) {
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());
@@ -63,7 +76,7 @@ bool PPPRun::isMyPPPUp( void ) {
Run->IsPointToPoint
) {
// this is a LAN card
- if( Run->assignedNode() == netNode() ) {
+ if( Run->assignedNode() == AsDevice::netNode() ) {
// assigned to us
return 1;
}
diff --git a/noncore/settings/networksettings2/ppp/ppprun.h b/noncore/settings/networksettings2/ppp/ppprun.h
index 76a05be..abb9176 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.h
+++ b/noncore/settings/networksettings2/ppp/ppprun.h
@@ -3,24 +3,30 @@
#include <qregexp.h>
#include <asconnection.h>
+#include <asdevice.h>
#include "pppdata.h"
-class PPPRun : public AsConnection {
+class PPPRun : public AsConnection, public AsDevice {
public :
PPPRun( ANetNodeInstance * NNI,
- PPPData & Data ) :
- AsConnection( NNI ),
- Pat( "eth[0-9]" )
- { D = &Data; }
+ PPPData & Data );
+ virtual QString genNic( long NicNr )
+ { QString S; return S.sprintf( "ppp%ld", NicNr ); }
-protected :
+ virtual AsDevice * device( void )
+ { return AsDevice::asDevice(); }
+ virtual RuntimeInfo * runtimeInfo( void )
+ { return ( AsConnection *)this; }
+
+ protected :
void detectState( NodeCollection * NC );
bool setState( NodeCollection * NC, Action_t A );
bool canSetState( State_t S, Action_t A )
- { return connection()->findNext( netNode() )->runtime()->canSetState( S,A ); }
+ { return AsDevice::connection()->findNext(
+ AsDevice::netNode() )->runtime()->canSetState( S,A ); }
bool handlesInterface( const QString & I );