summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/network/network_NNI.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/network/network_NNI.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/network/network_NNI.cpp47
1 files changed, 34 insertions, 13 deletions
diff --git a/noncore/settings/networksettings2/network/network_NNI.cpp b/noncore/settings/networksettings2/network/network_NNI.cpp
index 054385a..3e368a2 100644
--- a/noncore/settings/networksettings2/network/network_NNI.cpp
+++ b/noncore/settings/networksettings2/network/network_NNI.cpp
@@ -100,41 +100,62 @@ void ANetwork::commit( void ) {
}
bool ANetwork::hasDataFor( const QString & S ) {
return S == "interfaces";
}
bool ANetwork::generateDataForCommonFile( SystemFile & S, long DevNr ) {
QString NIC = runtime()->device()->netNode()->nodeClass()->genNic( DevNr );
if( S.name() == "interfaces" ) {
// we can safely call from here since device item is deeper
if( Data.UseDHCP ) {
- S << "iface " << NIC << "-c" << connection()->number() <<
- "-allowed inet dhcp" << endl;
- S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() <<
- ".up" << Data.IPAddress << endl;
+ S << "iface "
+ << NIC
+ << "-c"
+ << connection()->number()
+ << "-allowed inet dhcp"
+ << endl;
+ S << " up echo \""
+ << NIC
+ << "\" > /tmp/profile-"
+ << connection()->number()
+ << ".up"
+ << endl;
if( Data.SendHostname ) {
- S << " hostname "<< Data.Hostname << endl;
+ S << " hostname "
+ << Data.Hostname
+ << endl;
}
- S << " down rm -f /tmp/profile-" << connection()->number() <<
- ".up" << Data.IPAddress << endl;
+ S << " down rm -f /tmp/profile-"
+ << connection()->number()
+ << ".up"
+ << endl;
} else {
- S << "iface " << NIC << "-c" << connection()->number() <<
- "-allowed inet static" << endl;
- S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() <<
- ".up" << Data.IPAddress << endl;
- S << " down rm -f /tmp/profile-" << connection()->number() <<
- ".up" << Data.IPAddress << endl;
+ S << "iface "
+ << NIC << "-c"
+ << connection()->number()
+ << "-allowed inet static"
+ << endl;
+ S << " up echo \""
+ << NIC
+ << "\" > /tmp/profile-"
+ << connection()->number()
+ << ".up"
+ << endl;
+ S << " down rm -f /tmp/profile-"
+ << connection()->number()
+ << ".up"
+ << endl;
S << " address " << Data.IPAddress << endl;
S << " broadcast " << Data.Broadcast << endl;
S << " netmask " << Data.NetMask << endl;
// derive network address = IPAddress & netmask
{ QString NW;
QStringList ipal = QStringList::split( '.', Data.IPAddress );
QStringList nmal = QStringList::split( '.', Data.NetMask );
NW = QString( "%1.%2.%3.%4" ).
arg( ipal[0].toShort() & nmal[0].toShort() ).
arg( ipal[1].toShort() & nmal[1].toShort() ).