Diffstat (limited to 'noncore/settings/networksettings2/network/network_NN.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/network/network_NN.cpp | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/noncore/settings/networksettings2/network/network_NN.cpp b/noncore/settings/networksettings2/network/network_NN.cpp index b4313c4..1feffdb 100644 --- a/noncore/settings/networksettings2/network/network_NN.cpp +++ b/noncore/settings/networksettings2/network/network_NN.cpp @@ -1,8 +1,9 @@ +#include <asdevice.h> #include "network_NN.h" #include "network_NNI.h" static const char * NetworkNeeds[] = { "device", 0 }; @@ -25,33 +26,52 @@ const QString NetworkNetNode::nodeDescription(){ " ); } ANetNodeInstance * NetworkNetNode::createInstance( void ) { return new ANetwork( this ); } -const char ** NetworkNetNode::needs( void ) { - return NetworkNeeds; +bool NetworkNetNode::hasDataForFile( const QString & S ) { + return S == "interfaces"; } -const char * NetworkNetNode::provides( void ) { - return "connection"; -} +short NetworkNetNode::generateFile( const QString & ID, + const QString & , + QTextStream & TS, + ANetNodeInstance * NNI, + long DevNr ) { + + QString NIC = NNI->runtime()->device()->netNode()->nodeClass()->genNic( DevNr ); -bool NetworkNetNode::generateProperFilesFor( - ANetNodeInstance * ) { + if( ID == "interfaces" ) { + Log(("Generate entry for %s in %s\n", NIC.latin1(), ID.latin1() )); + // generate mapping stanza for this interface + TS << "# check if " + << NIC + << " can be brought UP" + << endl; + TS << "mapping " + << NIC + << endl; + TS << " script networksettings2-request" + << endl + << endl; return 0; } + return 1; +} -bool NetworkNetNode::generateDeviceDataForCommonFile( - SystemFile & , - long ) { - return 0; +const char ** NetworkNetNode::needs( void ) { + return NetworkNeeds; +} + +const char * NetworkNetNode::provides( void ) { + return "connection"; } void NetworkNetNode::setSpecificAttribute( QString & , QString & ) { } void NetworkNetNode::saveSpecificAttribute( QTextStream & ) { } |