summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
authorwimpie <wimpie>2005-01-12 01:40:53 (UTC)
committer wimpie <wimpie>2005-01-12 01:40:53 (UTC)
commitf9a83585111afa08a47176097a150d9f468bfcdf (patch) (unidiff)
tree6d5a3b5f9716f7c6ca6e7fae8b0e2bac8d6c57da /noncore/settings/networksettings2/ppp/ppp_NNI.cpp
parentb2e60aa0222b348f34aab501feb8bc854e94413c (diff)
downloadopie-f9a83585111afa08a47176097a150d9f468bfcdf.zip
opie-f9a83585111afa08a47176097a150d9f468bfcdf.tar.gz
opie-f9a83585111afa08a47176097a150d9f468bfcdf.tar.bz2
*** empty log message ***
Diffstat (limited to 'noncore/settings/networksettings2/ppp/ppp_NNI.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NNI.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
index 7286d96..9cdd51e 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
+++ b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
@@ -101,102 +101,104 @@ void APPP::setSpecificAttribute( QString & A, QString & V ) {
101void APPP::saveSpecificAttribute( QTextStream & TS ) { 101void APPP::saveSpecificAttribute( QTextStream & TS ) {
102 TS << "dnsserverassigned=" << 102 TS << "dnsserverassigned=" <<
103 ( ( Data.DNS.ServerAssigned ) ? "yes" : "no" ) << endl; 103 ( ( Data.DNS.ServerAssigned ) ? "yes" : "no" ) << endl;
104 TS << "dnsdomainname=" << Data.DNS.DomainName << endl; 104 TS << "dnsdomainname=" << Data.DNS.DomainName << endl;
105 for( unsigned int i = 0; i < Data.DNS.Servers.size(); i ++ ) { 105 for( unsigned int i = 0; i < Data.DNS.Servers.size(); i ++ ) {
106 TS << "dnsserver=" << *(Data.DNS.Servers[i]) << endl; 106 TS << "dnsserver=" << *(Data.DNS.Servers[i]) << endl;
107 } 107 }
108 TS << "authmode=" << Data.Auth.Mode << endl; 108 TS << "authmode=" << Data.Auth.Mode << endl;
109 TS << "authloginexpect=" << quote( Data.Auth.Login.Expect ) << endl; 109 TS << "authloginexpect=" << quote( Data.Auth.Login.Expect ) << endl;
110 TS << "authloginsend=" << quote( Data.Auth.Login.Send ) << endl; 110 TS << "authloginsend=" << quote( Data.Auth.Login.Send ) << endl;
111 TS << "authpasswordexpect=" << quote( Data.Auth.Password.Expect ) << endl; 111 TS << "authpasswordexpect=" << quote( Data.Auth.Password.Expect ) << endl;
112 TS << "authpasswordsend=" << quote( Data.Auth.Password.Send ) << endl; 112 TS << "authpasswordsend=" << quote( Data.Auth.Password.Send ) << endl;
113 TS << "authpcemode=" << Data.Auth.PCEMode << endl; 113 TS << "authpcemode=" << Data.Auth.PCEMode << endl;
114 TS << "authclient=" << Data.Auth.Client << endl; 114 TS << "authclient=" << Data.Auth.Client << endl;
115 TS << "authserver=" << Data.Auth.Server << endl; 115 TS << "authserver=" << Data.Auth.Server << endl;
116 TS << "authsecret=" << quote( Data.Auth.Secret ) << endl; 116 TS << "authsecret=" << quote( Data.Auth.Secret ) << endl;
117 TS << "ipgwautomatic=" << ( ( Data.IP.GWAutomatic ) ? "yes" : "no" ) << endl; 117 TS << "ipgwautomatic=" << ( ( Data.IP.GWAutomatic ) ? "yes" : "no" ) << endl;
118 TS << "ipgwisdefault=" << ( ( Data.IP.GWIsDefault ) ? "yes" : "no" ) << endl; 118 TS << "ipgwisdefault=" << ( ( Data.IP.GWIsDefault ) ? "yes" : "no" ) << endl;
119 TS << "ipgwifnotset=" << ( ( Data.IP.GWIfNotSet ) ? "yes" : "no" ) << endl; 119 TS << "ipgwifnotset=" << ( ( Data.IP.GWIfNotSet ) ? "yes" : "no" ) << endl;
120 TS << "iplocaloverrule=" << ( ( Data.IP.LocalOverrule ) ? "yes" : "no" ) << endl; 120 TS << "iplocaloverrule=" << ( ( Data.IP.LocalOverrule ) ? "yes" : "no" ) << endl;
121 TS << "ipremoteoverrule=" << ( ( Data.IP.RemoteOverrule ) ? "yes" : "no" ) << endl; 121 TS << "ipremoteoverrule=" << ( ( Data.IP.RemoteOverrule ) ? "yes" : "no" ) << endl;
122 TS << "iplocaladdress=" << Data.IP.LocalAddress << endl; 122 TS << "iplocaladdress=" << Data.IP.LocalAddress << endl;
123 TS << "ipremoteaddress=" << Data.IP.RemoteAddress << endl; 123 TS << "ipremoteaddress=" << Data.IP.RemoteAddress << endl;
124 TS << "ipgwaddress=" << Data.IP.GWAddress << endl; 124 TS << "ipgwaddress=" << Data.IP.GWAddress << endl;
125 125
126 TS << "runpreconnect=" << Data.Run.PreConnect << endl; 126 TS << "runpreconnect=" << Data.Run.PreConnect << endl;
127 TS << "runpostconnect=" << Data.Run.PostConnect << endl; 127 TS << "runpostconnect=" << Data.Run.PostConnect << endl;
128 TS << "runpredisconnect=" << Data.Run.PreDisconnect << endl; 128 TS << "runpredisconnect=" << Data.Run.PreDisconnect << endl;
129 TS << "runpostdisconnect=" << Data.Run.PostDisconnect << endl; 129 TS << "runpostdisconnect=" << Data.Run.PostDisconnect << endl;
130 130
131} 131}
132 132
133QWidget * APPP::edit( QWidget * parent ) { 133QWidget * APPP::edit( QWidget * parent ) {
134 GUI = new PPPEdit( parent ); 134 GUI = new PPPEdit( parent );
135 GUI->showData( Data ); 135 GUI->showData( Data );
136 return GUI; 136 return GUI;
137} 137}
138 138
139QString APPP::acceptable( void ) { 139QString APPP::acceptable( void ) {
140 return ( GUI ) ? GUI->acceptable( ) : QString(); 140 return ( GUI ) ? GUI->acceptable( ) : QString();
141} 141}
142 142
143void APPP::commit( void ) { 143void APPP::commit( void ) {
144 if( GUI && GUI->commit( Data ) ) { 144 if( GUI && GUI->commit( Data ) ) {
145 setModified( 1 ); 145 setModified( 1 );
146 } 146 }
147} 147}
148 148
149bool APPP::openFile( SystemFile & SF ) { 149bool APPP::openFile( SystemFile & SF, QStringList & SL ) {
150 if( SF.name() == "peers" ) { 150 if( SF.name() == "peers" ) {
151 SL << "/tmp/ppp" << "peers" ;
151 SF.setPath( removeSpaces( 152 SF.setPath( removeSpaces(
152 QString( "/tmp/ppp/peers/" ) + networkSetup()->name() ) ); 153 QString( "/tmp/ppp/peers/" ) + networkSetup()->name() ) );
153 return 1; 154 return 1;
154 } else if ( SF.name() == "chatscripts" ) { 155 } else if ( SF.name() == "chatscripts" ) {
156 SL << "/tmp/chatscripts";
155 SF.setPath( removeSpaces( 157 SF.setPath( removeSpaces(
156 QString( "/tmp/chatscripts/" ) + networkSetup()->name() ) ); 158 QString( "/tmp/chatscripts/" ) + networkSetup()->name() ) );
157 return 1; 159 return 1;
158 } 160 }
159 return 0; 161 return 0;
160} 162}
161 163
162short APPP::generateFile( SystemFile & SF, long DevNr ) { 164short APPP::generateFile( SystemFile & SF, long DevNr ) {
163 short rvl, rvd; 165 short rvl, rvd;
164 166
165 rvl = 1; 167 rvl = 1;
166 rvd = 1; 168 rvd = 1;
167 169
168 if( SF.name() == "pap-secrets" ) { 170 if( SF.name() == "pap-secrets" ) {
169 Log(("Generate PPP for %s\n", SF.name().latin1() )); 171 Log(("Generate PPP for %s\n", SF.name().latin1() ));
170 172
171 if( Data.Auth.Mode == 1 && Data.Auth.PCEMode == 0 ) { 173 if( Data.Auth.Mode == 1 && Data.Auth.PCEMode == 0 ) {
172 SF << "# secrets for " 174 SF << "# secrets for "
173 << networkSetup()->name().latin1() 175 << networkSetup()->name().latin1()
174 << endl; 176 << endl;
175 SF << Data.Auth.Client 177 SF << Data.Auth.Client
176 << " " 178 << " "
177 << Data.Auth.Server 179 << Data.Auth.Server
178 << " " 180 << " "
179 << Data.Auth.Secret 181 << Data.Auth.Secret
180 << endl; 182 << endl;
181 rvl = 0; 183 rvl = 0;
182 rvd = networkSetup()->getToplevel()->generateFileEmbedded( 184 rvd = networkSetup()->getToplevel()->generateFileEmbedded(
183 SF, DevNr ); 185 SF, DevNr );
184 } 186 }
185 } else if( SF.name() == "chap-secrets" ) { 187 } else if( SF.name() == "chap-secrets" ) {
186 Log(("Generate PPP for %s\n", SF.name().latin1() )); 188 Log(("Generate PPP for %s\n", SF.name().latin1() ));
187 if( Data.Auth.Mode == 1 && Data.Auth.PCEMode != 0 ) { 189 if( Data.Auth.Mode == 1 && Data.Auth.PCEMode != 0 ) {
188 // used for both EAP and Chap 190 // used for both EAP and Chap
189 SF << "# secrets for " 191 SF << "# secrets for "
190 << networkSetup()->name().latin1() 192 << networkSetup()->name().latin1()
191 << endl; 193 << endl;
192 SF << Data.Auth.Client 194 SF << Data.Auth.Client
193 << " " 195 << " "
194 << Data.Auth.Server 196 << Data.Auth.Server
195 << " " 197 << " "
196 << Data.Auth.Secret 198 << Data.Auth.Secret
197 << endl; 199 << endl;
198 200
199 rvl = 0; 201 rvl = 0;
200 rvd = networkSetup()->getToplevel()->generateFileEmbedded( 202 rvd = networkSetup()->getToplevel()->generateFileEmbedded(
201 SF, DevNr ); 203 SF, DevNr );
202 } 204 }