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.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/noncore/settings/networksettings2/network/network_NNI.cpp b/noncore/settings/networksettings2/network/network_NNI.cpp index 7130764..eac2d66 100644 --- a/noncore/settings/networksettings2/network/network_NNI.cpp +++ b/noncore/settings/networksettings2/network/network_NNI.cpp | |||
@@ -83,53 +83,48 @@ void ANetwork::saveSpecificAttribute( QTextStream & TS ) { | |||
83 | TS << "postdown=" << quote(*it) << endl; | 83 | TS << "postdown=" << quote(*it) << endl; |
84 | } | 84 | } |
85 | } | 85 | } |
86 | 86 | ||
87 | QWidget * ANetwork::edit( QWidget * parent ) { | 87 | QWidget * ANetwork::edit( QWidget * parent ) { |
88 | GUI = new NetworkEdit( parent ); | 88 | GUI = new NetworkEdit( parent ); |
89 | GUI->showData( Data ); | 89 | GUI->showData( Data ); |
90 | return GUI; | 90 | return GUI; |
91 | } | 91 | } |
92 | 92 | ||
93 | QString ANetwork::acceptable( void ) { | 93 | QString ANetwork::acceptable( void ) { |
94 | return ( GUI ) ? GUI->acceptable( ) : QString(); | 94 | return ( GUI ) ? GUI->acceptable( ) : QString(); |
95 | } | 95 | } |
96 | 96 | ||
97 | void ANetwork::commit( void ) { | 97 | void ANetwork::commit( void ) { |
98 | if( GUI && GUI->commit( Data ) ) | 98 | if( GUI && GUI->commit( Data ) ) |
99 | setModified( 1 ); | 99 | setModified( 1 ); |
100 | } | 100 | } |
101 | 101 | ||
102 | bool ANetwork::generateDataForCommonFile( SystemFile & S, long DevNr ) { | 102 | bool ANetwork::generateDataForCommonFile( SystemFile & S, long DevNr ) { |
103 | AsDevice * Dev = runtime()->device(); | 103 | AsDevice * Dev = runtime()->device(); |
104 | QString NIC = Dev->genNic( DevNr ); | 104 | QString NIC = Dev->genNic( DevNr ); |
105 | 105 | ||
106 | if( S.name() == "interfaces" ) { | 106 | if( S.name() == "interfaces" ) { |
107 | // generate mapping stanza for this interface | ||
108 | S << "# check if " << NIC << " can be brought UP" << endl; | ||
109 | S << "mapping " << NIC << endl; | ||
110 | S << " script networksettings2-request" << endl << endl; | ||
111 | |||
112 | // we can safely call from here since device item is deeper | 107 | // we can safely call from here since device item is deeper |
113 | if( Data.UseDHCP ) { | 108 | if( Data.UseDHCP ) { |
114 | S << "iface " << NIC << "-c" << connection()->number() << | 109 | S << "iface " << NIC << "-c" << connection()->number() << |
115 | "-allowed inet dhcp" << endl; | 110 | "-allowed inet dhcp" << endl; |
116 | S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() << | 111 | S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() << |
117 | ".up" << Data.IPAddress << endl; | 112 | ".up" << Data.IPAddress << endl; |
118 | if( Data.SendHostname ) { | 113 | if( Data.SendHostname ) { |
119 | S << " hostname "<< Data.Hostname << endl; | 114 | S << " hostname "<< Data.Hostname << endl; |
120 | } | 115 | } |
121 | 116 | ||
122 | S << " down rm -f /tmp/profile-" << connection()->number() << | 117 | S << " down rm -f /tmp/profile-" << connection()->number() << |
123 | ".up" << Data.IPAddress << endl; | 118 | ".up" << Data.IPAddress << endl; |
124 | } else { | 119 | } else { |
125 | S << "iface " << NIC << "-c" << connection()->number() << | 120 | S << "iface " << NIC << "-c" << connection()->number() << |
126 | "-allowed inet static" << endl; | 121 | "-allowed inet static" << endl; |
127 | S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() << | 122 | S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() << |
128 | ".up" << Data.IPAddress << endl; | 123 | ".up" << Data.IPAddress << endl; |
129 | S << " down rm -f /tmp/profile-" << connection()->number() << | 124 | S << " down rm -f /tmp/profile-" << connection()->number() << |
130 | ".up" << Data.IPAddress << endl; | 125 | ".up" << Data.IPAddress << endl; |
131 | S << " address " << Data.IPAddress << endl; | 126 | S << " address " << Data.IPAddress << endl; |
132 | S << " broadcast " << Data.Broadcast << endl; | 127 | S << " broadcast " << Data.Broadcast << endl; |
133 | S << " netmask " << Data.NetMask << endl; | 128 | S << " netmask " << Data.NetMask << endl; |
134 | 129 | ||
135 | // derive network address = IPAddress & netmask | 130 | // derive network address = IPAddress & netmask |