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