Diffstat (limited to 'noncore/settings/networksettings2/ppp/ppp_NN.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/ppp/ppp_NN.cpp | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.cpp b/noncore/settings/networksettings2/ppp/ppp_NN.cpp index b7edf87..ff4465c 100644 --- a/noncore/settings/networksettings2/ppp/ppp_NN.cpp +++ b/noncore/settings/networksettings2/ppp/ppp_NN.cpp | |||
@@ -1,19 +1,34 @@ | |||
1 | #include <qfile.h> | ||
2 | #include <qtextstream.h> | ||
1 | #include "ppp_NN.h" | 3 | #include "ppp_NN.h" |
2 | #include "ppp_NNI.h" | 4 | #include "ppp_NNI.h" |
3 | 5 | ||
6 | QStringList * PPPNetNode::ProperFiles = 0; | ||
7 | |||
4 | static const char * PPPNeeds[] = | 8 | static const char * PPPNeeds[] = |
5 | { "line", | 9 | { "line", |
6 | "modem", | 10 | "modem", |
7 | 0 | 11 | 0 |
8 | }; | 12 | }; |
9 | 13 | ||
10 | /** | 14 | /** |
11 | * Constructor, find all of the possible interfaces | 15 | * Constructor, find all of the possible interfaces |
12 | */ | 16 | */ |
13 | PPPNetNode::PPPNetNode() : ANetNode(tr("PPP Connection")) { | 17 | PPPNetNode::PPPNetNode() : ANetNode(tr("PPP Connection")) { |
18 | |||
19 | // proper files : will leak | ||
20 | ProperFiles =new QStringList; | ||
21 | *ProperFiles << "peers"; | ||
22 | *ProperFiles << "chatscript"; | ||
23 | |||
24 | // system files | ||
25 | NSResources->addSystemFile( | ||
26 | "pap-secrets", "/tmp/pap-secrets", 0 ); | ||
27 | NSResources->addSystemFile( | ||
28 | "chap-secrets", "/tmp/chap-secrets", 0 ); | ||
14 | } | 29 | } |
15 | 30 | ||
16 | /** | 31 | /** |
17 | * Delete any interfaces that we own. | 32 | * Delete any interfaces that we own. |
18 | */ | 33 | */ |
19 | PPPNetNode::~PPPNetNode(){ | 34 | PPPNetNode::~PPPNetNode(){ |
@@ -36,21 +51,23 @@ const char ** PPPNetNode::needs( void ) { | |||
36 | } | 51 | } |
37 | 52 | ||
38 | const char * PPPNetNode::provides( void ) { | 53 | const char * PPPNetNode::provides( void ) { |
39 | return "connection"; | 54 | return "connection"; |
40 | } | 55 | } |
41 | 56 | ||
42 | bool PPPNetNode::generateProperFilesFor( | 57 | QStringList * PPPNetNode::properFiles( void ) { |
43 | ANetNodeInstance * ) { | 58 | return ProperFiles; |
44 | return 0; | 59 | |
45 | } | 60 | } |
46 | 61 | ||
47 | bool PPPNetNode::generateDeviceDataForCommonFile( | 62 | // need to generate : |
48 | SystemFile & , | 63 | // /etc/ppp/pap-secrets |
49 | long ) { | 64 | // /etc/ppp/pap-secrets |
50 | return 0; | 65 | bool PPPNetNode::hasDataForFile( const QString & S ) { |
66 | return S == "pap-secrets" || | ||
67 | S == "chap-secrets" ; | ||
51 | } | 68 | } |
52 | 69 | ||
53 | QString PPPNetNode::genNic( long NicNr ) { | 70 | QString PPPNetNode::genNic( long NicNr ) { |
54 | QString S; | 71 | QString S; |
55 | return S.sprintf( "ppp%ld", NicNr ); | 72 | return S.sprintf( "ppp%ld", NicNr ); |
56 | } | 73 | } |