summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/ppp/ppp_NN.cpp
Unidiff
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.cpp36
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,85 +1,85 @@
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
6QStringList * PPPNetNode::ProperFiles = 0; 7QStringList * PPPNetNode::ProperFiles = 0;
7 8
8static const char * PPPNeeds[] = 9static const char * PPPNeeds[] =
9 { "line", 10 { "modem",
10 "modem", 11 0
12 };
13
14static 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 */
17PPPNetNode::PPPNetNode() : ANetNode(tr("PPP Connection")) { 22PPPNetNode::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 */
34PPPNetNode::~PPPNetNode(){ 33PPPNetNode::~PPPNetNode(){
35} 34}
36 35
37const QString PPPNetNode::nodeDescription(){ 36const QString PPPNetNode::nodeDescription(){
38 return tr("\ 37 return tr("\
39<p>Sets up IP using PPP.</p>\ 38<p>Sets up IP using PPP.</p>\
40<p>Use this for dialup devices or serial setups</p>\ 39<p>Use this for dialup devices or serial setups</p>\
41" 40"
42); 41);
43} 42}
44 43
45ANetNodeInstance * PPPNetNode::createInstance( void ) { 44ANetNodeInstance * PPPNetNode::createInstance( void ) {
46 return new APPP( this ); 45 return new APPP( this );
47} 46}
48 47
49const char ** PPPNetNode::needs( void ) { 48const char ** PPPNetNode::needs( void ) {
50 return PPPNeeds; 49 return PPPNeeds;
51} 50}
52 51
53const char * PPPNetNode::provides( void ) { 52const char ** PPPNetNode::provides( void ) {
54 return "connection"; 53 return PPPProvides;
55} 54}
56 55
57QStringList * PPPNetNode::properFiles( void ) { 56QStringList 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
65bool PPPNetNode::hasDataForFile( const QString & S ) { 65bool 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
70QString PPPNetNode::genNic( long NicNr ) { 70QString 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}
74 74
75void PPPNetNode::setSpecificAttribute( QString & , QString & ) { 75void PPPNetNode::setSpecificAttribute( QString & , QString & ) {
76} 76}
77 77
78void PPPNetNode::saveSpecificAttribute( QTextStream & ) { 78void PPPNetNode::saveSpecificAttribute( QTextStream & ) {
79} 79}
80 80
81extern "C" { 81extern "C" {
82void create_plugin( QList<ANetNode> & PNN ) { 82void create_plugin( QList<ANetNode> & PNN ) {
83 PNN.append( new PPPNetNode() ); 83 PNN.append( new PPPNetNode() );
84} 84}
85} 85}