00001 #include <qfile.h> 00002 #include <resources.h> 00003 #include <qtextstream.h> 00004 #include "ppp_NN.h" 00005 #include "ppp_NNI.h" 00006 00007 #include "netnodeinterface.h" 00008 00009 QStringList * PPPNetNode::ProperFiles = 0; 00010 00011 static const char * PPPNeeds[] = 00012 { "modem", 00013 0 00014 }; 00015 00016 static const char * PPPProvides[] = 00017 { "connection", 00018 0 00019 }; 00020 00024 PPPNetNode::PPPNetNode() : ANetNode(tr("PPP connection")) { 00025 00026 NSResources->addSystemFile( 00027 "pap-secrets", "/etc/ppp/pap-secrets", 0 ); 00028 NSResources->addSystemFile( 00029 "chap-secrets", "/etc/ppp/chap-secrets", 0 ); 00030 } 00031 00035 PPPNetNode::~PPPNetNode(){ 00036 } 00037 00038 const QString PPPNetNode::nodeDescription(){ 00039 return tr("\ 00040 <p>Sets up IP using PPP.</p>\ 00041 <p>Use this for dialup devices or serial setups</p>\ 00042 " 00043 ); 00044 } 00045 00046 ANetNodeInstance * PPPNetNode::createInstance( void ) { 00047 return new APPP( this ); 00048 } 00049 00050 const char ** PPPNetNode::needs( void ) { 00051 return PPPNeeds; 00052 } 00053 00054 const char ** PPPNetNode::provides( void ) { 00055 return PPPProvides; 00056 } 00057 00058 QStringList PPPNetNode::properFiles( void ) { 00059 QStringList SL; 00060 SL << "peers" << "chatscripts"; 00061 return SL; 00062 } 00063 00064 // need to generate : 00065 // /etc/ppp/pap-secrets 00066 // /etc/ppp/pap-secrets 00067 bool PPPNetNode::hasDataForFile( SystemFile & S ) { 00068 return S.name() == "pap-secrets" || 00069 S.name() == "chap-secrets" ; 00070 } 00071 00072 QString PPPNetNode::genNic( long NicNr ) { 00073 QString S; 00074 return S.sprintf( "ppp%ld", NicNr ); 00075 } 00076 00077 void PPPNetNode::setSpecificAttribute( QString & , QString & ) { 00078 } 00079 00080 void PPPNetNode::saveSpecificAttribute( QTextStream & ) { 00081 } 00082 00083 OPIE_NS2_PLUGIN( NetNodeInterface_T<PPPNetNode> )
1.4.2