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.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 ) {
return PPPNeeds;
}
const char * PPPNetNode::provides( void ) {
return "connection";
}
bool PPPNetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 1;
}
-bool PPPNetNode::hasDataFor( const QString & ) {
+bool PPPNetNode::hasDataFor( const QString &, bool ) {
return 0;
}
bool PPPNetNode::generateDataForCommonFile(
SystemFile & ,
long,
ANetNodeInstance * ) {
return 1;
}
+bool PPPNetNode::generateDeviceDataForCommonFile(
+ SystemFile & ,
+ long ,
+ ANetNodeInstance * ) {
+ return 1;
+}
+
extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
PNN.append( new PPPNetNode() );
}
}
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:
virtual const QString nodeName()
{ return tr("PPP Connection"); }
virtual const QString nodeDescription() ;
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char * provides( void );
virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
+ virtual bool hasDataFor( const QString & S, bool DS );
virtual bool generateDataForCommonFile(
SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
private:
};
extern "C"
{
void create_plugin( QList<ANetNode> & PNN );
};
#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 ) :
}
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 );
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 @@
#include <asdevice.h>
#include "pppdata.h"
class PPPRun : public AsConnection, public AsDevice {
public :
PPPRun( ANetNodeInstance * NNI,
PPPData & Data );
virtual QString genNic( long NicNr )
{ QString S; return S.sprintf( "ppp%ld", NicNr ); }
+ virtual AsDevice * asDevice( void )
+ { return (AsDevice *)this; }
+ virtual AsConnection * asConnection( void )
+ { return (AsConnection *)this; }
+
virtual AsDevice * device( void )
- { return AsDevice::asDevice(); }
+ { return (AsDevice *)this; }
+
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 AsDevice::connection()->findNext(
AsDevice::netNode() )->runtime()->canSetState( S,A ); }
bool handlesInterface( const QString & I );