summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/ppp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/ppp') (more/less context) (ignore 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.ui255
-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.h14
-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.cpp154
-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.cpp56
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.h34
19 files changed, 327 insertions, 363 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
@@ -37,7 +37,7 @@ QString PPPAuthEdit::acceptable( void ) {
return QString();
}
-bool PPPAuthEdit::commit( PPPData_t & D ) {
+bool PPPAuthEdit::commit( PPPData & D ) {
bool SM = 0;
if( ( D.Auth.Mode == 0 && ! Login_RB->isChecked() ) ||
@@ -70,7 +70,7 @@ bool PPPAuthEdit::commit( PPPData_t & D ) {
return SM;
}
-void PPPAuthEdit::showData( PPPData_t & D ) {
+void PPPAuthEdit::showData( PPPData & D ) {
switch( D.Auth.Mode ) {
case 0 :
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
@@ -7,8 +7,8 @@ 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 );
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
@@ -23,7 +23,7 @@ QString PPPDNSEdit::acceptable( void ) {
return QString();
}
-bool PPPDNSEdit::commit( PPPData_t & D ) {
+bool PPPDNSEdit::commit( PPPData & D ) {
bool SM = 0;
CBM( D.DNS.ServerAssigned, DNSServerAssigned_RB, SM );
@@ -75,7 +75,7 @@ bool PPPDNSEdit::commit( PPPData_t & D ) {
return SM;
}
-void PPPDNSEdit::showData( PPPData_t & D) {
+void PPPDNSEdit::showData( PPPData & D) {
DNSServerAssigned_RB->setChecked( D.DNS.ServerAssigned );
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
@@ -7,8 +7,8 @@ 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 :
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
@@ -11,8 +11,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>124</width>
- <height>29</height>
+ <width>528</width>
+ <height>345</height>
</rect>
</property>
<property stdset="1">
@@ -28,7 +28,7 @@
<vbox>
<property stdset="1">
<name>margin</name>
- <number>2</number>
+ <number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
@@ -54,6 +54,18 @@
<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>
@@ -76,7 +88,7 @@
<width>-1</width>
<height>-1</height>
</sizehint>
- <container>0</container>
+ <container>1</container>
<sizepolicy>
<hordata>7</hordata>
<verdata>7</verdata>
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
@@ -11,8 +11,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>133</width>
- <height>235</height>
+ <width>258</width>
+ <height>232</height>
</rect>
</property>
<property stdset="1">
@@ -28,21 +28,17 @@
<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>
@@ -54,164 +50,90 @@
<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>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
</property>
<property stdset="1">
<name>text</name>
- <string>Server assigned</string>
+ <string>Local</string>
</property>
+ </widget>
+ <widget row="0" column="1" >
+ <class>QLineEdit</class>
<property stdset="1">
- <name>checked</name>
+ <name>name</name>
+ <cstring>LocalAddress_LE</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
<bool>true</bool>
</property>
</widget>
- <widget>
- <class>QRadioButton</class>
+ <widget row="0" column="2" >
+ <class>QCheckBox</class>
<property stdset="1">
<name>name</name>
- <cstring>IPFixed_RB</cstring>
+ <cstring>ServerOverrulesLocal_CB</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Fixed</string>
+ <string>Server Overrules</string>
</property>
</widget>
- <widget>
- <class>QLayoutWidget</class>
+ <widget row="1" column="1" >
+ <class>QLineEdit</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout11</cstring>
+ <cstring>RemoteAddress_LE</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
</property>
- <hbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <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>
- </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>
- </property>
- </spacer>
- <widget>
- <class>QFrame</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Frame8</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>
- </property>
- </widget>
- <widget row="1" column="0" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel3</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Subnetmask</string>
- </property>
- </widget>
- <widget row="0" column="0" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel2</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Address</string>
- </property>
- </widget>
- <widget row="1" column="1" >
- <class>QLineEdit</class>
- <property stdset="1">
- <name>name</name>
- <cstring>IPSubMask_LE</cstring>
- </property>
- </widget>
- </grid>
- </widget>
- </hbox>
</widget>
- </vbox>
+ <widget row="1" column="2" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>ServerOverrulesRemote_CB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Server Overrules</string>
+ </property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Remote</string>
+ </property>
+ </widget>
+ </grid>
</widget>
<widget>
<class>QButtonGroup</class>
@@ -220,6 +142,13 @@
<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>
@@ -232,7 +161,7 @@
<vbox>
<property stdset="1">
<name>margin</name>
- <number>2</number>
+ <number>3</number>
</property>
<property stdset="1">
<name>spacing</name>
@@ -378,7 +307,7 @@
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout3</cstring>
+ <cstring>Layout4</cstring>
</property>
<hbox>
<property stdset="1">
@@ -389,6 +318,17 @@
<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>
@@ -414,17 +354,38 @@
<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>
@@ -434,11 +395,5 @@
<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
@@ -9,16 +9,7 @@ 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() ) )
@@ -28,30 +19,36 @@ QString PPPIPEdit::acceptable( void ) {
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
@@ -7,8 +7,8 @@ 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
@@ -3,6 +3,8 @@
#include "PPPIPedit.h"
#include "PPPDNSedit.h"
#include "PPPAuthedit.h"
+#include "PPPRunedit.h"
+#include "PPPDialingedit.h"
#include "PPPedit.h"
PPPEdit::PPPEdit( QWidget * Parent ) : PPPGUI( Parent ){
@@ -10,9 +12,14 @@ 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 );
}
@@ -29,7 +36,7 @@ QString PPPEdit::acceptable( void ) {
return S;
}
-bool PPPEdit::commit( PPPData_t & Data ) {
+bool PPPEdit::commit( PPPData & Data ) {
bool SM ;
SM = Auth->commit( Data );
SM |= IP->commit( Data );
@@ -37,7 +44,7 @@ bool PPPEdit::commit( PPPData_t & Data ) {
return SM;
}
-void PPPEdit::showData( PPPData_t & Data ) {
+void PPPEdit::showData( PPPData & Data ) {
Auth->showData( Data ) ;
IP->showData( Data );
DNS->showData( Data );
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
@@ -4,6 +4,8 @@
class PPPAuthEdit;
class PPPIPEdit;
class PPPDNSEdit;
+class PPPRunEdit;
+class PPPDialingEdit;
class PPPEdit : public PPPGUI {
@@ -11,8 +13,8 @@ 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 :
@@ -20,8 +22,10 @@ public slots :
private :
- PPPAuthEdit * Auth;
- PPPDNSEdit * DNS;
- PPPIPEdit * IP;
+ 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,4 +1,4 @@
-Package: opie-networksettingsplugin2-ppp
+Package: opie-networksettings2plugin-ppp
Files: plugins/networksettings2/libppp.so*
Priority: optional
Section: opie/settings
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
@@ -6,18 +6,27 @@ HEADERS = ppp_NN.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
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,4 +1,5 @@
#include <qfile.h>
+#include <resources.h>
#include <qtextstream.h>
#include "ppp_NN.h"
#include "ppp_NNI.h"
@@ -6,8 +7,12 @@
QStringList * PPPNetNode::ProperFiles = 0;
static const char * PPPNeeds[] =
- { "line",
- "modem",
+ { "modem",
+ 0
+ };
+
+static const char * PPPProvides[] =
+ { "connection",
0
};
@@ -16,16 +21,10 @@ static const char * PPPNeeds[] =
*/
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 );
}
/**
@@ -50,21 +49,22 @@ 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 ) {
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
@@ -17,15 +17,15 @@ public:
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:
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
@@ -16,12 +16,21 @@ APPP::APPP( PPPNetNode * PNN ) : ANetNodeInstance( PNN ) {
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;
@@ -59,19 +68,33 @@ void APPP::setSpecificAttribute( QString & A, QString & V ) {
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;
+ }
}
}
@@ -91,12 +114,20 @@ void APPP::saveSpecificAttribute( QTextStream & TS ) {
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 ) {
@@ -115,51 +146,33 @@ void APPP::commit( void ) {
}
}
-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;
- }
- } 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;
- }
+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;
}
- if( F ) {
- Log(("Generate proper file %s = %s\n",
- ID.latin1(), F->name().latin1()));
- }
- return F;
+ return 0;
}
-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
<< " "
@@ -167,16 +180,16 @@ short APPP::generateFile( const QString & ID,
<< 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
<< " "
@@ -185,35 +198,36 @@ short APPP::generateFile( const QString & ID,
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 :
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
@@ -16,11 +16,7 @@ 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 );
@@ -29,10 +25,8 @@ public :
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 :
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
@@ -4,15 +4,21 @@
#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 {
@@ -33,6 +39,12 @@ typedef struct PPPData {
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
@@ -2,53 +2,19 @@
#include "ppprun.h"
PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & Data ) :
- AsConnection( NNI ), AsDevice( NNI ), Pat( "eth[0-9]" ) {
- D = &Data;
+ 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 ) {
@@ -68,7 +34,7 @@ bool PPPRun::isMyPPPUp( void ) {
Run->IsPointToPoint
) {
// this is a LAN card
- if( Run->assignedNode() == AsDevice::netNode() ) {
+ if( Run->assignedConnection() == netNode()->connection() ) {
// assigned to us
return 1;
}
@@ -80,3 +46,7 @@ bool PPPRun::isMyPPPUp( void ) {
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
@@ -2,46 +2,36 @@
#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 :
+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