summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/ppp/ppp_NN.cpp
blob: 6c1387db88610e9a0d0618206cc85bc6318b71d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include <qfile.h>
#include <resources.h>
#include <qtextstream.h>
#include "ppp_NN.h"
#include "ppp_NNI.h"

#include "netnodeinterface.h"

QStringList * PPPNetNode::ProperFiles = 0;

static const char * PPPNeeds[] = 
    { "modem", 
      0
    };

static const char * PPPProvides[] = 
    { "connection", 
      0
    };

/**
 * Constructor, find all of the possible interfaces
 */
PPPNetNode::PPPNetNode() : ANetNode(tr("PPP connection")) {

      NSResources->addSystemFile( 
        "pap-secrets", "/etc/ppp/pap-secrets", 0 );
      NSResources->addSystemFile( 
        "chap-secrets", "/etc/ppp/chap-secrets", 0 );
}

/**
 * Delete any interfaces that we own.
 */
PPPNetNode::~PPPNetNode(){
}

const QString PPPNetNode::nodeDescription(){
      return tr("\
<p>Sets up IP using PPP.</p>\
<p>Use this for dialup devices or serial setups</p>\
"
);
}

ANetNodeInstance * PPPNetNode::createInstance( void ) {
      return new APPP( this );
}

const char ** PPPNetNode::needs( void ) {
      return PPPNeeds;
}

const char ** PPPNetNode::provides( void ) {
      return PPPProvides;
}

QStringList PPPNetNode::properFiles( void ) {
      QStringList SL;
      SL << "peers" << "chatscripts"; 
      return SL;
}

// need to generate :
//      /etc/ppp/pap-secrets
//      /etc/ppp/pap-secrets
bool PPPNetNode::hasDataForFile( SystemFile & S ) {
      return S.name() == "pap-secrets" || 
             S.name() == "chap-secrets" ;
}

QString PPPNetNode::genNic( long NicNr ) { 
      QString S; 
      return S.sprintf( "ppp%ld", NicNr ); 
}

void PPPNetNode::setSpecificAttribute( QString & , QString & ) {
}

void PPPNetNode::saveSpecificAttribute( QTextStream & ) {
}

OPIE_NS2_PLUGIN( NetNodeInterface_T<PPPNetNode> )