author | wimpie <wimpie> | 2004-04-04 15:23:16 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-04 15:23:16 (UTC) |
commit | fd9146de7698a796659b68606429da490f817138 (patch) (side-by-side diff) | |
tree | f026bf2a7adcaaa3a0dd0429e7474f536787253d /noncore/settings/networksettings2/lancard/lancard_NN.cpp | |
parent | 5b52572e2ec9f0f6f39706aceb9ec1e98440fd3d (diff) | |
download | opie-fd9146de7698a796659b68606429da490f817138.zip opie-fd9146de7698a796659b68606429da490f817138.tar.gz opie-fd9146de7698a796659b68606429da490f817138.tar.bz2 |
Many changes
Diffstat (limited to 'noncore/settings/networksettings2/lancard/lancard_NN.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/lancard/lancard_NN.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.cpp b/noncore/settings/networksettings2/lancard/lancard_NN.cpp index 7d36918..480ddf9 100644 --- a/noncore/settings/networksettings2/lancard/lancard_NN.cpp +++ b/noncore/settings/networksettings2/lancard/lancard_NN.cpp @@ -21,47 +21,52 @@ const QString LanCardNetNode::nodeDescription(){ <p>Sets up a wired regular LAN card.</p>\ <p>Use this to set up 10/100/1000 MBit LAN cards.</p>\ " ); } ANetNodeInstance * LanCardNetNode::createInstance( void ) { return new ALanCard( this ); } const char ** LanCardNetNode::needs( void ) { return LanCardNeeds; } const char * LanCardNetNode::provides( void ) { return "device"; } bool LanCardNetNode::generateProperFilesFor( ANetNodeInstance * ) { return 1; } -bool LanCardNetNode::hasDataFor( const QString & S, bool DS ) { - return DS && S == "interfaces"; -} - -bool LanCardNetNode::generateDataForCommonFile( - SystemFile & , - long , - ANetNodeInstance * ) { - return 1; +bool LanCardNetNode::hasDataFor( const QString & S ) { + return S == "interfaces"; } bool LanCardNetNode::generateDeviceDataForCommonFile( SystemFile & S , - long DevNr , - ANetNodeInstance * NNI ) { - return ((ALanCard *)NNI)->generateDeviceDataForCommonFile(S, DevNr); + long DevNr ) { + QString NIC = genNic( DevNr ); + + if( S.name() == "interfaces" ) { + // generate mapping stanza for this interface + S << "# check if " << NIC << " can be brought UP" << endl; + S << "mapping " << NIC << endl; + S << " script networksettings2-request" << endl << endl; + } + return 0; +} + +QString LanCardNetNode::genNic( long nr ) { + QString S; + return S.sprintf( "eth%ld", nr ); } extern "C" { void create_plugin( QList<ANetNode> & PNN ) { PNN.append( new LanCardNetNode() ); } } |