summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/ppp
authorwimpie <wimpie>2005-01-04 01:35:26 (UTC)
committer wimpie <wimpie>2005-01-04 01:35:26 (UTC)
commita9c188235c97e07b0eb96b13adbcdfd4bad64767 (patch) (side-by-side diff)
tree13f6ae5c499dc0c1d1bd4b763a1973a0fa8635cf /noncore/settings/networksettings2/ppp
parent48b6cd5966ec6cc0b968edf10ba1a1ad96ef165f (diff)
downloadopie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.zip
opie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.tar.gz
opie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.tar.bz2
CONTROL files : changed version string
NS2 many changes and first release of OT2
Diffstat (limited to 'noncore/settings/networksettings2/ppp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/ppp/PPPAuthedit.cpp4
-rw-r--r--noncore/settings/networksettings2/ppp/PPPAuthedit.h4
-rw-r--r--noncore/settings/networksettings2/ppp/PPPDNSedit.cpp4
-rw-r--r--noncore/settings/networksettings2/ppp/PPPDNSedit.h4
-rw-r--r--noncore/settings/networksettings2/ppp/PPPGUI.ui20
-rw-r--r--noncore/settings/networksettings2/ppp/PPPIPGUI.ui209
-rw-r--r--noncore/settings/networksettings2/ppp/PPPIPedit.cpp37
-rw-r--r--noncore/settings/networksettings2/ppp/PPPIPedit.h4
-rw-r--r--noncore/settings/networksettings2/ppp/PPPedit.cpp11
-rw-r--r--noncore/settings/networksettings2/ppp/PPPedit.h8
-rw-r--r--noncore/settings/networksettings2/ppp/opie-networksettings2plugin-ppp.control2
-rw-r--r--noncore/settings/networksettings2/ppp/ppp.pro11
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.cpp36
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.h6
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NNI.cpp152
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NNI.h12
-rw-r--r--noncore/settings/networksettings2/ppp/pppdata.h22
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.cpp52
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.h32
19 files changed, 297 insertions, 333 deletions
diff --git a/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp b/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp
index 450d560..9403694 100644
--- a/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp
+++ b/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp
@@ -34,13 +34,13 @@ QString PPPAuthEdit::acceptable( void ) {
if( Secret_LE->text().isEmpty() )
return tr("Pap/Chap/EAP secret id missing");
}
return QString();
}
-bool PPPAuthEdit::commit( PPPData_t & D ) {
+bool PPPAuthEdit::commit( PPPData & D ) {
bool SM = 0;
if( ( D.Auth.Mode == 0 && ! Login_RB->isChecked() ) ||
( D.Auth.Mode == 1 && ! PAP_Checked() ) ||
( D.Auth.Mode == 2 && ! Terminal_RB->isChecked() ) ) {
// mode modifed
@@ -67,13 +67,13 @@ bool PPPAuthEdit::commit( PPPData_t & D ) {
D.Auth.PCEMode = 2;
}
}
return SM;
}
-void PPPAuthEdit::showData( PPPData_t & D ) {
+void PPPAuthEdit::showData( PPPData & D ) {
switch( D.Auth.Mode ) {
case 0 :
Login_RB->setChecked( TRUE );
break;
case 1 :
diff --git a/noncore/settings/networksettings2/ppp/PPPAuthedit.h b/noncore/settings/networksettings2/ppp/PPPAuthedit.h
index 2392569..7a06657 100644
--- a/noncore/settings/networksettings2/ppp/PPPAuthedit.h
+++ b/noncore/settings/networksettings2/ppp/PPPAuthedit.h
@@ -4,14 +4,14 @@
class PPPAuthEdit : public PPPAuthGUI {
public :
PPPAuthEdit( QWidget * parent );
QString acceptable( void );
- bool commit( PPPData_t & Data );
- void showData( PPPData_t & Data );
+ bool commit( PPPData & Data );
+ void showData( PPPData & Data );
bool PAP_Checked( void );
private :
};
diff --git a/noncore/settings/networksettings2/ppp/PPPDNSedit.cpp b/noncore/settings/networksettings2/ppp/PPPDNSedit.cpp
index 22f8e59..270f695 100644
--- a/noncore/settings/networksettings2/ppp/PPPDNSedit.cpp
+++ b/noncore/settings/networksettings2/ppp/PPPDNSedit.cpp
@@ -20,13 +20,13 @@ QString PPPDNSEdit::acceptable( void ) {
if( Servers_LB->count() == 0 )
tr("DNS Servers needed");
}
return QString();
}
-bool PPPDNSEdit::commit( PPPData_t & D ) {
+bool PPPDNSEdit::commit( PPPData & D ) {
bool SM = 0;
CBM( D.DNS.ServerAssigned, DNSServerAssigned_RB, SM );
TXTM( D.DNS.DomainName, DomainName_LE, SM );
// new items in old ?
@@ -72,13 +72,13 @@ bool PPPDNSEdit::commit( PPPData_t & D ) {
D.DNS.Servers.resize( D.DNS.Servers.size()-1 );
}
}
return SM;
}
-void PPPDNSEdit::showData( PPPData_t & D) {
+void PPPDNSEdit::showData( PPPData & D) {
DNSServerAssigned_RB->setChecked( D.DNS.ServerAssigned );
DomainName_LE->setText( D.DNS.DomainName );
for( unsigned i = 0; i < D.DNS.Servers.size(); i ++ ) {
Servers_LB->insertItem( *(D.DNS.Servers[i]) );
diff --git a/noncore/settings/networksettings2/ppp/PPPDNSedit.h b/noncore/settings/networksettings2/ppp/PPPDNSedit.h
index 43e0067..1ca8c21 100644
--- a/noncore/settings/networksettings2/ppp/PPPDNSedit.h
+++ b/noncore/settings/networksettings2/ppp/PPPDNSedit.h
@@ -4,14 +4,14 @@
class PPPDNSEdit : public PPPDNSGUI {
public :
PPPDNSEdit( QWidget * parent );
QString acceptable( void );
- bool commit( PPPData_t & Data );
- void showData( PPPData_t & Data );
+ bool commit( PPPData & Data );
+ void showData( PPPData & Data );
public slots :
void SLOT_AddServer( void );
void SLOT_RemoveServer( void );
diff --git a/noncore/settings/networksettings2/ppp/PPPGUI.ui b/noncore/settings/networksettings2/ppp/PPPGUI.ui
index 777e4a9..4c79fe3 100644
--- a/noncore/settings/networksettings2/ppp/PPPGUI.ui
+++ b/noncore/settings/networksettings2/ppp/PPPGUI.ui
@@ -8,14 +8,14 @@
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>124</width>
- <height>29</height>
+ <width>528</width>
+ <height>345</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>PPP</string>
</property>
@@ -25,13 +25,13 @@
<property>
<name>layoutSpacing</name>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
- <number>2</number>
+ <number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>2</number>
</property>
<widget>
@@ -51,12 +51,24 @@
<item>
<property>
<name>text</name>
<string>DNS Settings</string>
</property>
</item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>Commands</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>Dialing</string>
+ </property>
+ </item>
<property stdset="1">
<name>name</name>
<cstring>PPPOptions_CB</cstring>
</property>
</widget>
<widget>
@@ -73,13 +85,13 @@
<class>QWidgetStack</class>
<header location="global">qwidgetstack.h</header>
<sizehint>
<width>-1</width>
<height>-1</height>
</sizehint>
- <container>0</container>
+ <container>1</container>
<sizepolicy>
<hordata>7</hordata>
<verdata>7</verdata>
</sizepolicy>
<pixmap>image0</pixmap>
<slot access="public">raiseWidget( int )</slot>
diff --git a/noncore/settings/networksettings2/ppp/PPPIPGUI.ui b/noncore/settings/networksettings2/ppp/PPPIPGUI.ui
index f3d5019..21bd29e 100644
--- a/noncore/settings/networksettings2/ppp/PPPIPGUI.ui
+++ b/noncore/settings/networksettings2/ppp/PPPIPGUI.ui
@@ -8,14 +8,14 @@
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>133</width>
- <height>235</height>
+ <width>258</width>
+ <height>232</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>PPPIP</string>
</property>
@@ -25,217 +25,146 @@
<property>
<name>layoutSpacing</name>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
- <number>3</number>
+ <number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
- <number>2</number>
+ <number>1</number>
</property>
<widget>
- <class>QButtonGroup</class>
+ <class>QGroupBox</class>
<property stdset="1">
<name>name</name>
- <cstring>ButtonGroup4</cstring>
- </property>
- <property stdset="1">
- <name>frameShape</name>
- <enum>Box</enum>
+ <cstring>GroupBox1</cstring>
</property>
<property stdset="1">
<name>title</name>
<string>IP</string>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
- <vbox>
+ <grid>
<property stdset="1">
<name>margin</name>
- <number>2</number>
+ <number>3</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>2</number>
</property>
- <widget>
- <class>QRadioButton</class>
+ <widget row="0" column="0" >
+ <class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>IPServerAssigned_RB</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Server assigned</string>
+ <cstring>TextLabel1</cstring>
</property>
<property stdset="1">
- <name>checked</name>
+ <name>enabled</name>
<bool>true</bool>
</property>
- </widget>
- <widget>
- <class>QRadioButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>IPFixed_RB</cstring>
- </property>
<property stdset="1">
<name>text</name>
- <string>Fixed</string>
+ <string>Local</string>
</property>
</widget>
- <widget>
- <class>QLayoutWidget</class>
+ <widget row="0" column="1" >
+ <class>QLineEdit</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout11</cstring>
+ <cstring>LocalAddress_LE</cstring>
</property>
- <hbox>
<property stdset="1">
- <name>margin</name>
- <number>0</number>
+ <name>enabled</name>
+ <bool>true</bool>
</property>
+ </widget>
+ <widget row="0" column="2" >
+ <class>QCheckBox</class>
<property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <spacer>
- <property>
<name>name</name>
- <cstring>Spacer8</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Horizontal</enum>
+ <cstring>ServerOverrulesLocal_CB</cstring>
</property>
<property stdset="1">
- <name>sizeType</name>
- <enum>Fixed</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- <property>
- <name>layoutMargin</name>
- </property>
- <property>
- <name>layoutSpacing</name>
+ <name>text</name>
+ <string>Server Overrules</string>
</property>
- </spacer>
- <widget>
- <class>QFrame</class>
+ </widget>
+ <widget row="1" column="1" >
+ <class>QLineEdit</class>
<property stdset="1">
<name>name</name>
- <cstring>Frame8</cstring>
+ <cstring>RemoteAddress_LE</cstring>
</property>
<property stdset="1">
<name>enabled</name>
- <bool>false</bool>
- </property>
- <property stdset="1">
- <name>sizePolicy</name>
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>5</vsizetype>
- </sizepolicy>
- </property>
- <property stdset="1">
- <name>frameShape</name>
- <enum>NoFrame</enum>
- </property>
- <property stdset="1">
- <name>frameShadow</name>
- <enum>Raised</enum>
- </property>
- <property>
- <name>layoutMargin</name>
- </property>
- <property>
- <name>layoutSpacing</name>
- </property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>2</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>2</number>
- </property>
- <widget row="0" column="1" >
- <class>QLineEdit</class>
- <property stdset="1">
- <name>name</name>
- <cstring>IPAddress_LE</cstring>
+ <bool>true</bool>
</property>
</widget>
- <widget row="1" column="0" >
- <class>QLabel</class>
+ <widget row="1" column="2" >
+ <class>QCheckBox</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel3</cstring>
+ <cstring>ServerOverrulesRemote_CB</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Subnetmask</string>
+ <string>Server Overrules</string>
</property>
</widget>
- <widget row="0" column="0" >
+ <widget row="1" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel2</cstring>
+ <cstring>TextLabel1_2</cstring>
</property>
<property stdset="1">
- <name>text</name>
- <string>Address</string>
+ <name>enabled</name>
+ <bool>true</bool>
</property>
- </widget>
- <widget row="1" column="1" >
- <class>QLineEdit</class>
<property stdset="1">
- <name>name</name>
- <cstring>IPSubMask_LE</cstring>
+ <name>text</name>
+ <string>Remote</string>
</property>
</widget>
</grid>
</widget>
- </hbox>
- </widget>
- </vbox>
- </widget>
<widget>
<class>QButtonGroup</class>
<property stdset="1">
<name>name</name>
<cstring>ButtonGroup5</cstring>
</property>
<property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
<name>title</name>
<string>Gateway</string>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
- <number>2</number>
+ <number>3</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>2</number>
</property>
<widget>
@@ -375,23 +304,34 @@
</hbox>
</widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout3</cstring>
+ <cstring>Layout4</cstring>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GWIsDefault_CB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Set as default</string>
+ </property>
+ </widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer3</cstring>
</property>
<property stdset="1">
@@ -411,34 +351,49 @@
</property>
</spacer>
<widget>
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
- <cstring>GWIsDefault_CB</cstring>
+ <cstring>GWIfNotSet_CB</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Set as default</string>
+ <string>Only if not yet set</string>
</property>
</widget>
</hbox>
</widget>
</vbox>
</widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer4</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
</vbox>
</widget>
<connections>
<connection>
<sender>GWFixed_RB</sender>
<signal>toggled(bool)</signal>
<receiver>Frame9</receiver>
<slot>setEnabled(bool)</slot>
</connection>
- <connection>
- <sender>IPFixed_RB</sender>
- <signal>toggled(bool)</signal>
- <receiver>Frame8</receiver>
- <slot>setEnabled(bool)</slot>
- </connection>
</connections>
</UI>
diff --git a/noncore/settings/networksettings2/ppp/PPPIPedit.cpp b/noncore/settings/networksettings2/ppp/PPPIPedit.cpp
index 6965e5a..ef1b7c0 100644
--- a/noncore/settings/networksettings2/ppp/PPPIPedit.cpp
+++ b/noncore/settings/networksettings2/ppp/PPPIPedit.cpp
@@ -6,52 +6,49 @@
#include "PPPIPedit.h"
PPPIPEdit::PPPIPEdit( QWidget * Parent ) : PPPIPGUI( Parent ){
}
QString PPPIPEdit::acceptable( void ) {
- if( IPFixed_RB->isChecked() ) {
- if( IPAddress_LE->text().isEmpty() )
- return tr("IPAddress needed" );
- if( ! validIP( IPAddress_LE->text() ) )
- return tr("IPAddress not valid" );
- if( IPSubMask_LE->text().isEmpty() )
- return tr("Subnet mask needed" );
- if( ! validIP( IPSubMask_LE->text() ) )
- return tr("Subnet mask not valid" );
- } else if( GWFixed_RB->isChecked() ) {
+ if( GWFixed_RB->isChecked() ) {
if( GWAddress_LE->text().isEmpty() )
return tr("Gateway address needed" );
if( ! validIP( GWAddress_LE->text() ) )
return tr("Gateway address not valid" );
};
return QString();
}
-bool PPPIPEdit::commit( PPPData_t & D ) {
+bool PPPIPEdit::commit( PPPData & D ) {
bool SM = 0;
- CBM( D.IP.IPAutomatic, IPServerAssigned_RB, SM );
- if( ! D.IP.IPAutomatic ) {
- TXTM( D.IP.IPAddress, IPAddress_LE, SM );
- TXTM( D.IP.IPSubMask, IPSubMask_LE, SM );
- }
+ CBM( D.IP.LocalOverrule, ServerOverrulesLocal_CB, SM );
+ CBM( D.IP.RemoteOverrule, ServerOverrulesRemote_CB, SM );
+
+ TXTM( D.IP.LocalAddress, LocalAddress_LE, SM );
+ TXTM( D.IP.RemoteAddress, RemoteAddress_LE, SM );
CBM( D.IP.GWAutomatic, GWServerAssigned_RB, SM );
+
if( ! D.IP.GWAutomatic ) {
TXTM( D.IP.GWAddress, GWAddress_LE, SM );
}
CBM( D.IP.GWIsDefault, GWIsDefault_CB, SM );
+ CBM( D.IP.GWIfNotSet, GWIfNotSet_CB, SM );
+
return SM;
}
-void PPPIPEdit::showData( PPPData_t & D ) {
- IPServerAssigned_RB->setChecked( D.IP.IPAutomatic );
- IPAddress_LE->setText( D.IP.IPAddress );
- IPSubMask_LE->setText( D.IP.IPSubMask );
+void PPPIPEdit::showData( PPPData & D ) {
+ ServerOverrulesLocal_CB->setChecked( D.IP.LocalOverrule );
+ ServerOverrulesRemote_CB->setChecked( D.IP.RemoteOverrule );
+ LocalAddress_LE->setText( D.IP.LocalAddress );
+ RemoteAddress_LE->setText( D.IP.RemoteAddress );
+
GWServerAssigned_RB->setChecked( D.IP.GWAutomatic );
GWAddress_LE->setText( D.IP.GWAddress );
GWIsDefault_CB->setChecked( D.IP.GWIsDefault );
+ GWIfNotSet_CB->setChecked( D.IP.GWIfNotSet );
}
diff --git a/noncore/settings/networksettings2/ppp/PPPIPedit.h b/noncore/settings/networksettings2/ppp/PPPIPedit.h
index 153ee68..5ca4326 100644
--- a/noncore/settings/networksettings2/ppp/PPPIPedit.h
+++ b/noncore/settings/networksettings2/ppp/PPPIPedit.h
@@ -4,12 +4,12 @@
class PPPIPEdit : public PPPIPGUI {
public :
PPPIPEdit( QWidget * parent );
QString acceptable( void );
- bool commit( PPPData_t & Data );
- void showData( PPPData_t & Data );
+ bool commit( PPPData & Data );
+ void showData( PPPData & Data );
private :
};
diff --git a/noncore/settings/networksettings2/ppp/PPPedit.cpp b/noncore/settings/networksettings2/ppp/PPPedit.cpp
index eb4fdbf..17889aa 100644
--- a/noncore/settings/networksettings2/ppp/PPPedit.cpp
+++ b/noncore/settings/networksettings2/ppp/PPPedit.cpp
@@ -1,21 +1,28 @@
#include <qwidgetstack.h>
#include "PPPIPedit.h"
#include "PPPDNSedit.h"
#include "PPPAuthedit.h"
+#include "PPPRunedit.h"
+#include "PPPDialingedit.h"
#include "PPPedit.h"
PPPEdit::PPPEdit( QWidget * Parent ) : PPPGUI( Parent ){
Auth = new PPPAuthEdit( Options_WS );
IP = new PPPIPEdit( Options_WS );
DNS = new PPPDNSEdit( Options_WS );
+ Run = new PPPRunEdit( Options_WS );
+ Dialing = new PPPDialingEdit( Options_WS );
+
Options_WS->addWidget( Auth, 0 );
Options_WS->addWidget( IP, 1 );
Options_WS->addWidget( DNS, 2 );
+ Options_WS->addWidget( Run, 3 );
+ Options_WS->addWidget( Dialing, 4 );
Options_WS->raiseWidget( 0 );
}
QString PPPEdit::acceptable( void ) {
QString S;
@@ -26,21 +33,21 @@ QString PPPEdit::acceptable( void ) {
S = DNS->acceptable();
}
}
return S;
}
-bool PPPEdit::commit( PPPData_t & Data ) {
+bool PPPEdit::commit( PPPData & Data ) {
bool SM ;
SM = Auth->commit( Data );
SM |= IP->commit( Data );
SM |= DNS->commit( Data );
return SM;
}
-void PPPEdit::showData( PPPData_t & Data ) {
+void PPPEdit::showData( PPPData & Data ) {
Auth->showData( Data ) ;
IP->showData( Data );
DNS->showData( Data );
}
void PPPEdit::SLOT_SelectTopic( int v ) {
diff --git a/noncore/settings/networksettings2/ppp/PPPedit.h b/noncore/settings/networksettings2/ppp/PPPedit.h
index 57d38ee..f674b17 100644
--- a/noncore/settings/networksettings2/ppp/PPPedit.h
+++ b/noncore/settings/networksettings2/ppp/PPPedit.h
@@ -1,27 +1,31 @@
#include "pppdata.h"
#include "PPPGUI.h"
class PPPAuthEdit;
class PPPIPEdit;
class PPPDNSEdit;
+class PPPRunEdit;
+class PPPDialingEdit;
class PPPEdit : public PPPGUI {
public :
PPPEdit( QWidget * parent );
QString acceptable( void );
- bool commit( PPPData_t & Data );
- void showData( PPPData_t & Data );
+ bool commit( PPPData & Data );
+ void showData( PPPData & Data );
public slots :
void SLOT_SelectTopic( int );
private :
PPPAuthEdit * Auth;
PPPDNSEdit * DNS;
PPPIPEdit * IP;
+ PPPRunEdit * Run;
+ PPPDialingEdit * Dialing;
};
diff --git a/noncore/settings/networksettings2/ppp/opie-networksettings2plugin-ppp.control b/noncore/settings/networksettings2/ppp/opie-networksettings2plugin-ppp.control
index 7dfde38..19d1c89 100644
--- a/noncore/settings/networksettings2/ppp/opie-networksettings2plugin-ppp.control
+++ b/noncore/settings/networksettings2/ppp/opie-networksettings2plugin-ppp.control
@@ -1,7 +1,7 @@
-Package: opie-networksettingsplugin2-ppp
+Package: opie-networksettings2plugin-ppp
Files: plugins/networksettings2/libppp.so*
Priority: optional
Section: opie/settings
Maintainer: Wim Delvaux <wimpie@handhelds.org>
Architecture: arm
Depends: opie-networksettings2, libopiecore2, libopienet2
diff --git a/noncore/settings/networksettings2/ppp/ppp.pro b/noncore/settings/networksettings2/ppp/ppp.pro
index f866bee..dd3408c 100644
--- a/noncore/settings/networksettings2/ppp/ppp.pro
+++ b/noncore/settings/networksettings2/ppp/ppp.pro
@@ -3,22 +3,31 @@ CONFIG += qt warn_on release
DESTDIR = $(OPIEDIR)/plugins/networksettings2
HEADERS = ppp_NN.h \
ppp_NNI.h \
PPPedit.h \
PPPAuthedit.h \
PPPDNSedit.h \
+ PPPRunedit.h \
+ PPPDialingedit.h \
PPPIPedit.h
SOURCES = ppp_NN.cpp \
ppp_NNI.cpp \
PPPedit.cpp \
PPPDNSedit.cpp \
+ PPPRunedit.cpp \
+ PPPDialingedit.cpp \
PPPAuthedit.cpp \
ppprun.cpp \
PPPIPedit.cpp
INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2
DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2
LIBS += -lqpe
-INTERFACES = PPPGUI.ui PPPAuthGUI.ui PPPIPGUI.ui PPPDNSGUI.ui
+INTERFACES = PPPGUI.ui \
+ PPPAuthGUI.ui \
+ PPPIPGUI.ui \
+ PPPDNSGUI.ui \
+ PPPDialingGUI.ui \
+ PPPRunGUI.ui
TARGET = ppp
VERSION = 1.0.0
include( $(OPIEDIR)/include.pro )
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 @@
#include <qfile.h>
+#include <resources.h>
#include <qtextstream.h>
#include "ppp_NN.h"
#include "ppp_NNI.h"
QStringList * PPPNetNode::ProperFiles = 0;
static const char * PPPNeeds[] =
- { "line",
- "modem",
+ { "modem",
+ 0
+ };
+
+static const char * PPPProvides[] =
+ { "connection",
0
};
/**
* Constructor, find all of the possible interfaces
*/
PPPNetNode::PPPNetNode() : ANetNode(tr("PPP Connection")) {
- // proper files : will leak
- ProperFiles =new QStringList;
- *ProperFiles << "peers";
- *ProperFiles << "chatscript";
-
- // system files
NSResources->addSystemFile(
- "pap-secrets", "/tmp/pap-secrets", 0 );
+ "pap-secrets", "/etc/ppp/pap-secrets", 0 );
NSResources->addSystemFile(
- "chap-secrets", "/tmp/chap-secrets", 0 );
+ "chap-secrets", "/etc/ppp/chap-secrets", 0 );
}
/**
* Delete any interfaces that we own.
*/
PPPNetNode::~PPPNetNode(){
@@ -47,27 +46,28 @@ ANetNodeInstance * PPPNetNode::createInstance( void ) {
}
const char ** PPPNetNode::needs( void ) {
return PPPNeeds;
}
-const char * PPPNetNode::provides( void ) {
- return "connection";
+const char ** PPPNetNode::provides( void ) {
+ return PPPProvides;
}
-QStringList * PPPNetNode::properFiles( void ) {
- return ProperFiles;
-
+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( const QString & S ) {
- return S == "pap-secrets" ||
- S == "chap-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 );
}
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.h b/noncore/settings/networksettings2/ppp/ppp_NN.h
index 249be5a..3ead10e 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NN.h
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.h
@@ -14,21 +14,21 @@ public:
PPPNetNode();
virtual ~PPPNetNode();
virtual const QString pixmapName()
{ return "Devices/ppp"; }
- virtual bool hasDataForFile( const QString & S );
+ virtual bool hasDataForFile( SystemFile & S );
virtual const QString nodeDescription() ;
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
- virtual const char * provides( void );
+ virtual const char ** provides( void );
virtual QString genNic( long NicNr );
- virtual QStringList * properFiles( void );
+ virtual QStringList properFiles( void );
private:
virtual void setSpecificAttribute( QString & Attr, QString & Value );
virtual void saveSpecificAttribute( QTextStream & TS );
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
index ba639de..9e3bb64 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
+++ b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
@@ -13,18 +13,27 @@ APPP::APPP( PPPNetNode * PNN ) : ANetNodeInstance( PNN ) {
Data.Auth.Password.Expect = "assword:";
Data.Auth.PCEMode = 0;
Data.Auth.Client = "*";
Data.Auth.Server = "*";
Data.Auth.Secret = "";
- Data.IP.IPAutomatic = 1;
- Data.IP.IPAddress = "";
- Data.IP.IPSubMask = "";
+ Data.IP.LocalAddress = "10.0.0.1";
+ Data.IP.RemoteAddress = "10.0.0.2";
+ Data.IP.LocalOverrule = 1;
+ Data.IP.RemoteOverrule = 1;
+
Data.IP.GWAutomatic = 1;
Data.IP.GWAddress = "";
Data.IP.GWIsDefault = 1;
+ Data.IP.GWIfNotSet = 1;
+
+ Data.Run.PreConnect = "";
+ Data.Run.PostConnect = "";
+ Data.Run.PreDisconnect = "";
+ Data.Run.PostDisconnect = "";
+
GUI = 0;
RT = 0;
}
void APPP::setSpecificAttribute( QString & A, QString & V ) {
@@ -56,25 +65,39 @@ void APPP::setSpecificAttribute( QString & A, QString & V ) {
} else if( A == "authserver" ) {
Data.Auth.Server = V;
} else if( A == "authsecret" ) {
Data.Auth.Secret = V;
}
} else if( A.startsWith( "ip" ) ) {
- if( A == "ipautomatic" ) {
- Data.IP.IPAutomatic = (V == "yes");
- } else if( A == "gwautomatic" ) {
+ if( A == "iplocaloverrule" ) {
+ Data.IP.LocalOverrule = (V == "yes");
+ } else if( A == "ipremoteoverrule" ) {
+ Data.IP.RemoteOverrule = (V == "yes");
+ } else if( A == "ipgwautomatic" ) {
Data.IP.GWAutomatic = (V == "yes");
- } else if( A == "gwisdefault" ) {
+ } else if( A == "ipgwisdefault" ) {
Data.IP.GWIsDefault = (V == "yes");
- } else if( A == "ipaddress" ) {
- Data.IP.IPAddress = V;
- } else if( A == "ipsubmask" ) {
- Data.IP.IPSubMask = V;
- } else if( A == "gwaddress" ) {
+ } else if( A == "ipgwifnotset" ) {
+ Data.IP.GWIfNotSet = (V == "yes");
+ } else if( A == "iplocaladdress" ) {
+ Data.IP.LocalAddress = V;
+ } else if( A == "ipremoteaddress" ) {
+ Data.IP.RemoteAddress = V;
+ } else if( A == "ipgwaddress" ) {
Data.IP.GWAddress = V;
}
+ } else if( A.startsWith( "run" ) ) {
+ if( A == "runpreconnect" ) {
+ Data.Run.PreConnect = V;
+ } else if( A == "runpostconnect" ) {
+ Data.Run.PostConnect = V;
+ } else if( A == "runpredisconnect" ) {
+ Data.Run.PreDisconnect = V;
+ } else if( A == "runpostdisconnect" ) {
+ Data.Run.PostDisconnect = V;
+ }
}
}
void APPP::saveSpecificAttribute( QTextStream & TS ) {
TS << "dnsserverassigned=" <<
( ( Data.DNS.ServerAssigned ) ? "yes" : "no" ) << endl;
@@ -88,18 +111,26 @@ void APPP::saveSpecificAttribute( QTextStream & TS ) {
TS << "authpasswordexpect=" << quote( Data.Auth.Password.Expect ) << endl;
TS << "authpasswordsend=" << quote( Data.Auth.Password.Send ) << endl;
TS << "authpcemode=" << Data.Auth.PCEMode << endl;
TS << "authclient=" << Data.Auth.Client << endl;
TS << "authserver=" << Data.Auth.Server << endl;
TS << "authsecret=" << quote( Data.Auth.Secret ) << endl;
- TS << "ipautomatic=" << ( ( Data.IP.IPAutomatic ) ? "yes" : "no" ) << endl;
- TS << "gwautomatic=" << ( ( Data.IP.GWAutomatic ) ? "yes" : "no" ) << endl;
- TS << "gwisdefault=" << ( ( Data.IP.GWIsDefault ) ? "yes" : "no" ) << endl;
- TS << "ipaddress=" << Data.IP.IPAddress << endl;
- TS << "ipsubmask=" << Data.IP.IPSubMask << endl;
- TS << "gwaddress=" << Data.IP.GWAddress << endl;
+ TS << "ipgwautomatic=" << ( ( Data.IP.GWAutomatic ) ? "yes" : "no" ) << endl;
+ TS << "ipgwisdefault=" << ( ( Data.IP.GWIsDefault ) ? "yes" : "no" ) << endl;
+ TS << "ipgwifnotset=" << ( ( Data.IP.GWIfNotSet ) ? "yes" : "no" ) << endl;
+ TS << "iplocaloverrule=" << ( ( Data.IP.LocalOverrule ) ? "yes" : "no" ) << endl;
+ TS << "ipremoteoverrule=" << ( ( Data.IP.RemoteOverrule ) ? "yes" : "no" ) << endl;
+ TS << "iplocaladdress=" << Data.IP.LocalAddress << endl;
+ TS << "ipremoteaddress=" << Data.IP.RemoteAddress << endl;
+ TS << "ipgwaddress=" << Data.IP.GWAddress << endl;
+
+ TS << "runpreconnect=" << Data.Run.PreConnect << endl;
+ TS << "runpostconnect=" << Data.Run.PostConnect << endl;
+ TS << "runpredisconnect=" << Data.Run.PreDisconnect << endl;
+ TS << "runpostdisconnect=" << Data.Run.PostDisconnect << endl;
+
}
QWidget * APPP::edit( QWidget * parent ) {
GUI = new PPPEdit( parent );
GUI->showData( Data );
return GUI;
@@ -112,110 +143,93 @@ QString APPP::acceptable( void ) {
void APPP::commit( void ) {
if( GUI && GUI->commit( Data ) ) {
setModified( 1 );
}
}
-QFile * APPP::openFile( const QString & ID ) {
- QFile * F = 0;
- QString S;
-
- if( ID == "peers" ) {
- S = removeSpaces( QString("/tmp/") + connection()->name() );
-
- F = new QFile( S );
-
- if( ! F->open( IO_WriteOnly ) ) {
- Log(("Cannot open file %s\n", S.latin1() ));
- return 0;
+bool APPP::openFile( SystemFile & SF ) {
+ if( SF.name() == "peers" ) {
+ SF.setPath( removeSpaces(
+ QString( "/tmp/ppp/peers/" ) + connection()->name() ) );
+ return 1;
+ } else if ( SF.name() == "chatscripts" ) {
+ SF.setPath( removeSpaces(
+ QString( "/tmp/chatscripts/" ) + connection()->name() ) );
+ return 1;
}
- } else if ( ID == "chatscripts" ) {
- S = removeSpaces( QString("/tmp/") + connection()->name() + ".chat" );
- F = new QFile( S );
-
- if( ! F->open( IO_WriteOnly ) ) {
- Log(("Cannot open file %s\n", S.latin1() ));
return 0;
}
- }
- if( F ) {
- Log(("Generate proper file %s = %s\n",
- ID.latin1(), F->name().latin1()));
- }
- return F;
-}
-short APPP::generateFile( const QString & ID,
- const QString & Path,
- QTextStream & TS,
- long DevNr ) {
+short APPP::generateFile( SystemFile & SF, long DevNr ) {
short rvl, rvd;
rvl = 1;
rvd = 1;
- if( ID == "pap-secrets" ) {
- Log(("Generate PPP for %s\n", ID.latin1() ));
+ if( SF.name() == "pap-secrets" ) {
+ Log(("Generate PPP for %s\n", SF.name().latin1() ));
+
if( Data.Auth.Mode == 1 && Data.Auth.PCEMode == 0 ) {
- TS << "# secrets for "
+ SF << "# secrets for "
<< connection()->name().latin1()
<< endl;
- TS << Data.Auth.Client
+ SF << Data.Auth.Client
<< " "
<< Data.Auth.Server
<< " "
<< Data.Auth.Secret
<< endl;
rvl = 0;
rvd = connection()->getToplevel()->generateFileEmbedded(
- ID, Path, TS, DevNr );
+ SF, DevNr );
}
- } else if( ID == "chap-secrets" ) {
- Log(("Generate PPP for %s\n", ID.latin1() ));
+ } else if( SF.name() == "chap-secrets" ) {
+ Log(("Generate PPP for %s\n", SF.name().latin1() ));
if( Data.Auth.Mode == 1 && Data.Auth.PCEMode != 0 ) {
// used for both EAP and Chap
- TS << "# secrets for "
+ SF << "# secrets for "
<< connection()->name().latin1()
<< endl;
- TS << Data.Auth.Client
+ SF << Data.Auth.Client
<< " "
<< Data.Auth.Server
<< " "
<< Data.Auth.Secret
<< endl;
rvl = 0;
rvd = connection()->getToplevel()->generateFileEmbedded(
- ID, Path, TS, DevNr );
+ SF, DevNr );
}
- } else if ( ID == "peers" ) {
- QFileInfo FI(Path);
- Log(("Generate PPP for %s\n", ID.latin1() ));
+ } else if ( SF.name() == "peers" ) {
+
+ QFileInfo FI(SF.path());
+ Log(("Generate PPP for %s\n", SF.name().latin1() ));
- TS << "connect \"/usr/sbin/chat -v -f /etc/ppp/"
+ SF << "connect \"/usr/sbin/chat -v -f /etc/chatscripts/"
<< FI.baseName()
- << ".chat\""
+ << "\""
<< endl;
if( Data.IP.GWIsDefault ) {
- TS << "defaultroute"
+ SF << "defaultroute"
<< endl;
}
- TS << "linkname "
- << removeSpaces( ID.latin1() )
+ SF << "linkname "
+ << removeSpaces( SF.name().latin1() )
<< endl;
// insert other data here
rvl = 0;
rvd = connection()->getToplevel()->generateFileEmbedded(
- ID, Path, TS, DevNr );
- } else if ( ID == "chatscripts" ) {
- Log(("Generate PPP for %s\n", ID.latin1() ));
+ SF, DevNr );
+ } else if ( SF.name() == "chatscripts" ) {
+ Log(("Generate PPP for %s\n", SF.name().latin1() ));
rvl = 0;
rvd = connection()->getToplevel()->generateFileEmbedded(
- ID, Path, TS, DevNr );
+ SF, DevNr );
}
return (rvd == 2 || rvl == 2 ) ? 2 :
(rvd == 0 || rvl == 0 ) ? 0 : 1;
}
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.h b/noncore/settings/networksettings2/ppp/ppp_NNI.h
index 0bf8fa9..76afb21 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NNI.h
+++ b/noncore/settings/networksettings2/ppp/ppp_NNI.h
@@ -13,29 +13,23 @@ class APPP : public ANetNodeInstance {
public :
APPP( PPPNetNode * PNN );
RuntimeInfo * runtime( void )
- { if( RT == 0 ) {
- RT = new PPPRun( this, Data );
- }
- return RT->runtimeInfo();
- }
+ { return (RT) ? RT : (RT = new PPPRun( this, Data ) ); }
QWidget * edit( QWidget * parent );
QString acceptable( void );
void commit( void );
virtual void * data( void )
{ return (void *)&Data; }
- virtual QFile * openFile( const QString & ID );
- short generateFile( const QString & ID,
- const QString & Path,
- QTextStream & TS,
+ virtual bool openFile( SystemFile & Sf );
+ short generateFile( SystemFile & TS,
long DevNr );
protected :
virtual void setSpecificAttribute( QString & Attr, QString & Value );
virtual void saveSpecificAttribute( QTextStream & TS );
diff --git a/noncore/settings/networksettings2/ppp/pppdata.h b/noncore/settings/networksettings2/ppp/pppdata.h
index 9e8543c..68666f8 100644
--- a/noncore/settings/networksettings2/ppp/pppdata.h
+++ b/noncore/settings/networksettings2/ppp/pppdata.h
@@ -1,21 +1,27 @@
#ifndef PPP_DATA_H
#define PPP_DATA_H
#include <qstring.h>
#include <qarray.h>
-typedef struct PPPData {
+class PPPData {
+
+public :
+
struct {
- bool IPAutomatic;
- QString IPAddress;
- QString IPSubMask;
+ bool LocalOverrule;
+ bool RemoteOverrule;
+ QString LocalAddress;
+ QString RemoteAddress;
bool GWAutomatic;
QString GWAddress;
bool GWIsDefault;
+ bool GWIfNotSet;
} IP;
+
struct {
short Mode; // 0 login, 1 chap/pap, 2 Terminal
struct {
QString Expect;
QString Send;
} Login;
@@ -30,9 +36,15 @@ typedef struct PPPData {
} Auth;
struct {
bool ServerAssigned;
QString DomainName;
QArray<QString *> Servers;
} DNS;
-} PPPData_t;
+ struct {
+ QString PreConnect;
+ QString PostConnect;
+ QString PreDisconnect;
+ QString PostDisconnect;
+ } Run;
+};
#endif
diff --git a/noncore/settings/networksettings2/ppp/ppprun.cpp b/noncore/settings/networksettings2/ppp/ppprun.cpp
index a8abc50..8403e6d 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.cpp
+++ b/noncore/settings/networksettings2/ppp/ppprun.cpp
@@ -1,57 +1,23 @@
#include <resources.h>
#include "ppprun.h"
PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & Data ) :
- AsConnection( NNI ), AsDevice( NNI ), Pat( "eth[0-9]" ) {
+ RuntimeInfo( NNI ), Pat( "eth[0-9]" ) {
D = &Data;
}
-void PPPRun::detectState( NodeCollection * NC ) {
+State_t PPPRun::detectState( void ) {
if( isMyPPPDRunning( ) ) {
- if( isMyPPPUp() ) {
- NC->setCurrentState( IsUp );
- } else {
- NC->setCurrentState( Available );
- }
- } else {
- NC->setCurrentState( Off ); // at least this
- // but could also be unavailable
- AsDevice::netNode()->nextNode()->runtime()->detectState( NC );
+ return ( isMyPPPUp() ) ? IsUp : Available;
}
+ return Off;
}
-bool PPPRun::setState( NodeCollection * NC, Action_t A, bool ) {
- switch( A ) {
- case Activate :
- NC->setCurrentState( Available );
- // no
- break;
- case Deactivate :
- if( NC->currentState() == IsUp ) {
- NC->state( Down );
- }
- // cannot really disable
- NC->setCurrentState( Available );
- break;
- case Up :
- if( NC->currentState() != IsUp ) {
- // start my PPPD
- NC->setCurrentState( IsUp );
- }
- break;
- case Down :
- if( NC->currentState() == IsUp ) {
- // stop my PPPD
- NC->setCurrentState( Available );
- }
- break;
- default : // FT
- break;
- }
- return 1;
+QString PPPRun::setMyState( NodeCollection * NC, Action_t A, bool ) {
+ return QString();
}
bool PPPRun::isMyPPPDRunning( void ) {
return 0;
}
@@ -65,18 +31,22 @@ bool PPPRun::isMyPPPUp( void ) {
++It ) {
Run = It.current();
if( R.match( Run->Name ) >= 0 &&
Run->IsPointToPoint
) {
// this is a LAN card
- if( Run->assignedNode() == AsDevice::netNode() ) {
+ if( Run->assignedConnection() == netNode()->connection() ) {
// assigned to us
return 1;
}
}
}
return 0;
}
bool PPPRun::handlesInterface( const QString & S ) {
return Pat.match( S ) >= 0;
}
+
+bool PPPRun::handlesInterface( InterfaceInfo * I ) {
+ return handlesInterface( I->Name );
+}
diff --git a/noncore/settings/networksettings2/ppp/ppprun.h b/noncore/settings/networksettings2/ppp/ppprun.h
index 90a3f25..2990a96 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.h
+++ b/noncore/settings/networksettings2/ppp/ppprun.h
@@ -1,47 +1,37 @@
#ifndef PPPRUN_H
#define PPPRUN_H
#include <qregexp.h>
-#include <asconnection.h>
-#include <asdevice.h>
+#include <netnode.h>
#include "pppdata.h"
-class PPPRun : public AsConnection, public AsDevice {
+class PPPRun : public RuntimeInfo {
public :
PPPRun( ANetNodeInstance * NNI,
PPPData & Data );
- virtual AsDevice * asDevice( void )
- { return (AsDevice *)this; }
- virtual AsConnection * asConnection( void )
- { return (AsConnection *)this; }
-
- virtual AsDevice * device( void )
- { return (AsDevice *)this; }
+ bool handlesInterface( const QString & I );
+ bool handlesInterface( InterfaceInfo * );
- virtual RuntimeInfo * runtimeInfo( void )
- { return ( AsConnection *)this; }
+ State_t detectState( void );
+ virtual RuntimeInfo * device( void )
+ { return this; }
+ virtual RuntimeInfo * connection( void )
+ { return this; }
protected :
- void detectState( NodeCollection * NC );
- bool setState( NodeCollection * NC, Action_t A, bool );
- bool canSetState( State_t S, Action_t A )
- { return AsDevice::connection()->findNext(
- AsDevice::netNode() )->runtime()->canSetState( S,A ); }
-
- bool handlesInterface( const QString & I );
+ QString setMyState( NodeCollection * , Action_t, bool );
private :
bool isMyPPPDRunning( void );
bool isMyPPPUp( void );
- PPPData_t * D;
+ PPPData * D;
QRegExp Pat;
-
};
#endif