summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/ppp
authorwimpie <wimpie>2005-01-11 21:42:31 (UTC)
committer wimpie <wimpie>2005-01-11 21:42:31 (UTC)
commit96678694f8952f60d0a895cede2b621404b4bfb8 (patch) (unidiff)
tree7138e554e5ba200b8f9ca8b51c89b47531dc34f2 /noncore/settings/networksettings2/ppp
parentf89120a7a1a3d0bf9c0805456490906ca914e560 (diff)
downloadopie-96678694f8952f60d0a895cede2b621404b4bfb8.zip
opie-96678694f8952f60d0a895cede2b621404b4bfb8.tar.gz
opie-96678694f8952f60d0a895cede2b621404b4bfb8.tar.bz2
Major rename of NodeCollection to NetworkSetup
this commit is broken (missing symbols)
Diffstat (limited to 'noncore/settings/networksettings2/ppp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/ppp/PPPDialingedit.cpp5
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.cpp4
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NNI.cpp16
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.cpp4
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.h2
5 files changed, 15 insertions, 16 deletions
diff --git a/noncore/settings/networksettings2/ppp/PPPDialingedit.cpp b/noncore/settings/networksettings2/ppp/PPPDialingedit.cpp
index 9264ceb..2b03c73 100644
--- a/noncore/settings/networksettings2/ppp/PPPDialingedit.cpp
+++ b/noncore/settings/networksettings2/ppp/PPPDialingedit.cpp
@@ -7,19 +7,18 @@
7#include "PPPDialingedit.h" 7#include "PPPDialingedit.h"
8 8
9PPPDialingEdit::PPPDialingEdit( QWidget * Parent ) : 9PPPDialingEdit::PPPDialingEdit( QWidget * Parent ) :
10 PPPDialingGUI( Parent ){ 10 PPPDialingGUI( Parent ){
11 11
12 // populate widget stack 12 // populate widget stack
13} 13}
14 14
15QString PPPDialingEdit::acceptable( void ) { 15QString PPPDialingEdit::acceptable( void ) {
16 return QString(); 16 return QString();
17} 17}
18 18
19bool PPPDialingEdit::commit( PPPData & D ) { 19bool PPPDialingEdit::commit( PPPData & ) {
20 bool SM; 20 return true;
21 return SM;
22} 21}
23 22
24void PPPDialingEdit::showData( PPPData & D ) { 23void PPPDialingEdit::showData( PPPData & D ) {
25} 24}
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.cpp b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
index 8c15e9c..884168c 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NN.cpp
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
@@ -5,32 +5,32 @@
5#include "ppp_NNI.h" 5#include "ppp_NNI.h"
6 6
7#include "netnodeinterface.h" 7#include "netnodeinterface.h"
8 8
9QStringList * PPPNetNode::ProperFiles = 0; 9QStringList * PPPNetNode::ProperFiles = 0;
10 10
11static const char * PPPNeeds[] = 11static const char * PPPNeeds[] =
12 { "modem", 12 { "modem",
13 0 13 0
14 }; 14 };
15 15
16static const char * PPPProvides[] = 16static const char * PPPProvides[] =
17 { "connection", 17 { "NetworkSetup",
18 0 18 0
19 }; 19 };
20 20
21/** 21/**
22 * Constructor, find all of the possible interfaces 22 * Constructor, find all of the possible interfaces
23 */ 23 */
24PPPNetNode::PPPNetNode() : ANetNode(tr("PPP Connection")) { 24PPPNetNode::PPPNetNode() : ANetNode(tr("PPP NetworkSetup")) {
25 25
26 NSResources->addSystemFile( 26 NSResources->addSystemFile(
27 "pap-secrets", "/etc/ppp/pap-secrets", 0 ); 27 "pap-secrets", "/etc/ppp/pap-secrets", 0 );
28 NSResources->addSystemFile( 28 NSResources->addSystemFile(
29 "chap-secrets", "/etc/ppp/chap-secrets", 0 ); 29 "chap-secrets", "/etc/ppp/chap-secrets", 0 );
30} 30}
31 31
32/** 32/**
33 * Delete any interfaces that we own. 33 * Delete any interfaces that we own.
34 */ 34 */
35PPPNetNode::~PPPNetNode(){ 35PPPNetNode::~PPPNetNode(){
36} 36}
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
index 9e3bb64..7286d96 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
+++ b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
@@ -140,96 +140,96 @@ QString 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 ) {
150 if( SF.name() == "peers" ) { 150 if( SF.name() == "peers" ) {
151 SF.setPath( removeSpaces( 151 SF.setPath( removeSpaces(
152 QString( "/tmp/ppp/peers/" ) + connection()->name() ) ); 152 QString( "/tmp/ppp/peers/" ) + networkSetup()->name() ) );
153 return 1; 153 return 1;
154 } else if ( SF.name() == "chatscripts" ) { 154 } else if ( SF.name() == "chatscripts" ) {
155 SF.setPath( removeSpaces( 155 SF.setPath( removeSpaces(
156 QString( "/tmp/chatscripts/" ) + connection()->name() ) ); 156 QString( "/tmp/chatscripts/" ) + networkSetup()->name() ) );
157 return 1; 157 return 1;
158 } 158 }
159 return 0; 159 return 0;
160} 160}
161 161
162short APPP::generateFile( SystemFile & SF, long DevNr ) { 162short APPP::generateFile( SystemFile & SF, long DevNr ) {
163 short rvl, rvd; 163 short rvl, rvd;
164 164
165 rvl = 1; 165 rvl = 1;
166 rvd = 1; 166 rvd = 1;
167 167
168 if( SF.name() == "pap-secrets" ) { 168 if( SF.name() == "pap-secrets" ) {
169 Log(("Generate PPP for %s\n", SF.name().latin1() )); 169 Log(("Generate PPP for %s\n", SF.name().latin1() ));
170 170
171 if( Data.Auth.Mode == 1 && Data.Auth.PCEMode == 0 ) { 171 if( Data.Auth.Mode == 1 && Data.Auth.PCEMode == 0 ) {
172 SF << "# secrets for " 172 SF << "# secrets for "
173 << connection()->name().latin1() 173 << networkSetup()->name().latin1()
174 << endl; 174 << endl;
175 SF << Data.Auth.Client 175 SF << Data.Auth.Client
176 << " " 176 << " "
177 << Data.Auth.Server 177 << Data.Auth.Server
178 << " " 178 << " "
179 << Data.Auth.Secret 179 << Data.Auth.Secret
180 << endl; 180 << endl;
181 rvl = 0; 181 rvl = 0;
182 rvd = connection()->getToplevel()->generateFileEmbedded( 182 rvd = networkSetup()->getToplevel()->generateFileEmbedded(
183 SF, DevNr ); 183 SF, DevNr );
184 } 184 }
185 } else if( SF.name() == "chap-secrets" ) { 185 } else if( SF.name() == "chap-secrets" ) {
186 Log(("Generate PPP for %s\n", SF.name().latin1() )); 186 Log(("Generate PPP for %s\n", SF.name().latin1() ));
187 if( Data.Auth.Mode == 1 && Data.Auth.PCEMode != 0 ) { 187 if( Data.Auth.Mode == 1 && Data.Auth.PCEMode != 0 ) {
188 // used for both EAP and Chap 188 // used for both EAP and Chap
189 SF << "# secrets for " 189 SF << "# secrets for "
190 << connection()->name().latin1() 190 << networkSetup()->name().latin1()
191 << endl; 191 << endl;
192 SF << Data.Auth.Client 192 SF << Data.Auth.Client
193 << " " 193 << " "
194 << Data.Auth.Server 194 << Data.Auth.Server
195 << " " 195 << " "
196 << Data.Auth.Secret 196 << Data.Auth.Secret
197 << endl; 197 << endl;
198 198
199 rvl = 0; 199 rvl = 0;
200 rvd = connection()->getToplevel()->generateFileEmbedded( 200 rvd = networkSetup()->getToplevel()->generateFileEmbedded(
201 SF, DevNr ); 201 SF, DevNr );
202 } 202 }
203 } else if ( SF.name() == "peers" ) { 203 } else if ( SF.name() == "peers" ) {
204 204
205 QFileInfo FI(SF.path()); 205 QFileInfo FI(SF.path());
206 Log(("Generate PPP for %s\n", SF.name().latin1() )); 206 Log(("Generate PPP for %s\n", SF.name().latin1() ));
207 207
208 SF << "connect \"/usr/sbin/chat -v -f /etc/chatscripts/" 208 SF << "connect \"/usr/sbin/chat -v -f /etc/chatscripts/"
209 << FI.baseName() 209 << FI.baseName()
210 << "\"" 210 << "\""
211 << endl; 211 << endl;
212 212
213 if( Data.IP.GWIsDefault ) { 213 if( Data.IP.GWIsDefault ) {
214 SF << "defaultroute" 214 SF << "defaultroute"
215 << endl; 215 << endl;
216 } 216 }
217 217
218 SF << "linkname " 218 SF << "linkname "
219 << removeSpaces( SF.name().latin1() ) 219 << removeSpaces( SF.name().latin1() )
220 << endl; 220 << endl;
221 221
222 // insert other data here 222 // insert other data here
223 rvl = 0; 223 rvl = 0;
224 rvd = connection()->getToplevel()->generateFileEmbedded( 224 rvd = networkSetup()->getToplevel()->generateFileEmbedded(
225 SF, DevNr ); 225 SF, DevNr );
226 } else if ( SF.name() == "chatscripts" ) { 226 } else if ( SF.name() == "chatscripts" ) {
227 Log(("Generate PPP for %s\n", SF.name().latin1() )); 227 Log(("Generate PPP for %s\n", SF.name().latin1() ));
228 rvl = 0; 228 rvl = 0;
229 rvd = connection()->getToplevel()->generateFileEmbedded( 229 rvd = networkSetup()->getToplevel()->generateFileEmbedded(
230 SF, DevNr ); 230 SF, DevNr );
231 } 231 }
232 232
233 return (rvd == 2 || rvl == 2 ) ? 2 : 233 return (rvd == 2 || rvl == 2 ) ? 2 :
234 (rvd == 0 || rvl == 0 ) ? 0 : 1; 234 (rvd == 0 || rvl == 0 ) ? 0 : 1;
235} 235}
diff --git a/noncore/settings/networksettings2/ppp/ppprun.cpp b/noncore/settings/networksettings2/ppp/ppprun.cpp
index 8403e6d..f548483 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.cpp
+++ b/noncore/settings/networksettings2/ppp/ppprun.cpp
@@ -4,46 +4,46 @@
4PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & Data ) : 4PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & Data ) :
5 RuntimeInfo( NNI ), Pat( "eth[0-9]" ) { 5 RuntimeInfo( NNI ), Pat( "eth[0-9]" ) {
6 D = &Data; 6 D = &Data;
7} 7}
8 8
9State_t PPPRun::detectState( void ) { 9State_t PPPRun::detectState( void ) {
10 if( isMyPPPDRunning( ) ) { 10 if( isMyPPPDRunning( ) ) {
11 return ( isMyPPPUp() ) ? IsUp : Available; 11 return ( isMyPPPUp() ) ? IsUp : Available;
12 } 12 }
13 return Off; 13 return Off;
14} 14}
15 15
16QString PPPRun::setMyState( NodeCollection * NC, Action_t A, bool ) { 16QString PPPRun::setMyState( NetworkSetup * , Action_t , bool ) {
17 return QString(); 17 return QString();
18} 18}
19 19
20bool PPPRun::isMyPPPDRunning( void ) { 20bool PPPRun::isMyPPPDRunning( void ) {
21 return 0; 21 return 0;
22} 22}
23 23
24bool PPPRun::isMyPPPUp( void ) { 24bool PPPRun::isMyPPPUp( void ) {
25 System & S = NSResources->system(); 25 System & S = NSResources->system();
26 InterfaceInfo * Run; 26 InterfaceInfo * Run;
27 QRegExp R( "ppp[0-9]" ); 27 QRegExp R( "ppp[0-9]" );
28 28
29 for( QDictIterator<InterfaceInfo> It(S.interfaces()); 29 for( QDictIterator<InterfaceInfo> It(S.interfaces());
30 It.current(); 30 It.current();
31 ++It ) { 31 ++It ) {
32 Run = It.current(); 32 Run = It.current();
33 if( R.match( Run->Name ) >= 0 && 33 if( R.match( Run->Name ) >= 0 &&
34 Run->IsPointToPoint 34 Run->IsPointToPoint
35 ) { 35 ) {
36 // this is a LAN card 36 // this is a LAN card
37 if( Run->assignedConnection() == netNode()->connection() ) { 37 if( Run->assignedToNetworkSetup() == netNode()->networkSetup() ) {
38 // assigned to us 38 // assigned to us
39 return 1; 39 return 1;
40 } 40 }
41 } 41 }
42 } 42 }
43 return 0; 43 return 0;
44} 44}
45 45
46bool PPPRun::handlesInterface( const QString & S ) { 46bool PPPRun::handlesInterface( const QString & S ) {
47 return Pat.match( S ) >= 0; 47 return Pat.match( S ) >= 0;
48} 48}
49 49
diff --git a/noncore/settings/networksettings2/ppp/ppprun.h b/noncore/settings/networksettings2/ppp/ppprun.h
index 2990a96..9535382 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.h
+++ b/noncore/settings/networksettings2/ppp/ppprun.h
@@ -14,24 +14,24 @@ public :
14 14
15 bool handlesInterface( const QString & I ); 15 bool handlesInterface( const QString & I );
16 bool handlesInterface( InterfaceInfo * ); 16 bool handlesInterface( InterfaceInfo * );
17 17
18 State_t detectState( void ); 18 State_t detectState( void );
19 virtual RuntimeInfo * device( void ) 19 virtual RuntimeInfo * device( void )
20 { return this; } 20 { return this; }
21 virtual RuntimeInfo * connection( void ) 21 virtual RuntimeInfo * connection( void )
22 { return this; } 22 { return this; }
23 23
24protected : 24protected :
25 25
26 QString setMyState( NodeCollection * , Action_t, bool ); 26 QString setMyState( NetworkSetup * , Action_t, bool );
27 27
28private : 28private :
29 29
30 bool isMyPPPDRunning( void ); 30 bool isMyPPPDRunning( void );
31 bool isMyPPPUp( void ); 31 bool isMyPPPUp( void );
32 32
33 PPPData * D; 33 PPPData * D;
34 QRegExp Pat; 34 QRegExp Pat;
35}; 35};
36 36
37#endif 37#endif