author | wimpie <wimpie> | 2005-01-04 01:35:26 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-04 01:35:26 (UTC) |
commit | a9c188235c97e07b0eb96b13adbcdfd4bad64767 (patch) (side-by-side diff) | |
tree | 13f6ae5c499dc0c1d1bd4b763a1973a0fa8635cf /noncore/settings/networksettings2/wlan | |
parent | 48b6cd5966ec6cc0b968edf10ba1a1ad96ef165f (diff) | |
download | opie-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/wlan') (more/less context) (show whitespace changes)
10 files changed, 59 insertions, 120 deletions
diff --git a/noncore/settings/networksettings2/wlan/opie-networksettings2plugin-wlan.control b/noncore/settings/networksettings2/wlan/opie-networksettings2plugin-wlan.control index 14afd21..90f195a 100644 --- a/noncore/settings/networksettings2/wlan/opie-networksettings2plugin-wlan.control +++ b/noncore/settings/networksettings2/wlan/opie-networksettings2plugin-wlan.control @@ -1,2 +1,2 @@ -Package: opie-networksettingsplugin2-wlan +Package: opie-networksettings2plugin-wlan Files: plugins/networksettings2/libwlan.so* diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.cpp b/noncore/settings/networksettings2/wlan/wlan_NN.cpp index e4c3f60..36a5c33 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NN.cpp +++ b/noncore/settings/networksettings2/wlan/wlan_NN.cpp @@ -1 +1,2 @@ +#include <resources.h> #include "wlan_NN.h" @@ -7,2 +8,7 @@ static const char * WLanNeeds[] = +static const char * WLanProvides[] = + { "device", + 0 + }; + /** @@ -11,2 +17,4 @@ static const char * WLanNeeds[] = WLanNetNode::WLanNetNode() : ANetNode(tr("WLan Device")) { + NSResources->addSystemFile( + "interfaces", "/etc/network/interfaces", 1 ); InstanceCount = 2; @@ -36,4 +44,4 @@ const char ** WLanNetNode::needs( void ) { -const char * WLanNetNode::provides( void ) { - return "device"; +const char ** WLanNetNode::provides( void ) { + return WLanProvides; } diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.h b/noncore/settings/networksettings2/wlan/wlan_NN.h index c13c05c..4bffd3d 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NN.h +++ b/noncore/settings/networksettings2/wlan/wlan_NN.h @@ -22,3 +22,3 @@ public: virtual const char ** needs( void ); - virtual const char * provides( void ); + virtual const char ** provides( void ); diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp index 0e4fc4c..d5b1014 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp +++ b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp @@ -81,5 +81,3 @@ void AWLan::commit( void ) { -short AWLan::generateFileEmbedded( const QString & ID, - const QString & Path, - QTextStream & TS, +short AWLan::generateFileEmbedded( SystemFile & SF, long DevNr ) { @@ -90,5 +88,5 @@ short AWLan::generateFileEmbedded( const QString & ID, - if( ID == "interfaces" ) { - Log(("Generate WLanNNI for %s\n", ID.latin1() )); - TS << " wireless_essid \"" + if( SF.name() == "interfaces" ) { + Log(("Generate WLanNNI for %s\n", SF.name().latin1() )); + SF << " wireless_essid \"" << Data.ESSID @@ -102,3 +100,3 @@ short AWLan::generateFileEmbedded( const QString & ID, Buf[99] = '\0'; // just to make sure - TS << " wireless_nick " + SF << " wireless_nick " << Buf @@ -107,3 +105,3 @@ short AWLan::generateFileEmbedded( const QString & ID, } else { - TS << " wireless_nick \"" + SF << " wireless_nick \"" << Data.NodeName @@ -126,3 +124,3 @@ short AWLan::generateFileEmbedded( const QString & ID, - TS << " wireless_mode " + SF << " wireless_mode " << M @@ -132,3 +130,3 @@ short AWLan::generateFileEmbedded( const QString & ID, if( ! Data.Key[i].isEmpty() ) { - TS << " wireless_key" + SF << " wireless_key" << i @@ -139,3 +137,3 @@ short AWLan::generateFileEmbedded( const QString & ID, } - TS << " wireless_keymode " + SF << " wireless_keymode " << ((Data.AcceptNonEncrypted) ? "open" : "restricted") @@ -145,3 +143,3 @@ short AWLan::generateFileEmbedded( const QString & ID, } - rvd = ANetNodeInstance::generateFileEmbedded( ID, Path, TS, DevNr); + rvd = ANetNodeInstance::generateFileEmbedded( SF, DevNr); diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.h b/noncore/settings/networksettings2/wlan/wlan_NNI.h index a9be65f..e3251c7 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NNI.h +++ b/noncore/settings/networksettings2/wlan/wlan_NNI.h @@ -28,5 +28,3 @@ public : - virtual short generateFileEmbedded( const QString & ID, - const QString & Path, - QTextStream & TS, + virtual short generateFileEmbedded( SystemFile & Sf, long DevNr ); diff --git a/noncore/settings/networksettings2/wlan/wlandata.h b/noncore/settings/networksettings2/wlan/wlandata.h index 36990a9..f3cc1ab 100644 --- a/noncore/settings/networksettings2/wlan/wlandata.h +++ b/noncore/settings/networksettings2/wlan/wlandata.h @@ -4,3 +4,4 @@ #include <qstring.h> -typedef struct WLanData { +class WLanData { +public : QString ESSID; @@ -13,3 +14,3 @@ typedef struct WLanData { bool AcceptNonEncrypted; -} WLanData_t; +} ; diff --git a/noncore/settings/networksettings2/wlan/wlanedit.cpp b/noncore/settings/networksettings2/wlan/wlanedit.cpp index 8d3979e..74174bf 100644 --- a/noncore/settings/networksettings2/wlan/wlanedit.cpp +++ b/noncore/settings/networksettings2/wlan/wlanedit.cpp @@ -22,3 +22,3 @@ WLanEdit::WLanEdit( QWidget * Parent, ANetNodeInstance * TNNI ) : WE = 0; - if( ( II = Dev->assignedInterface() ) ) { + if( ( II = NNI->connection()->assignedInterface() ) ) { // show data @@ -63,3 +63,3 @@ QString WLanEdit::acceptable( void ) { -void WLanEdit::showData( WLanData_t & Data ) { +void WLanEdit::showData( WLanData & Data ) { Mode_CB->setCurrentItem( Data.Mode ); @@ -78,3 +78,3 @@ void WLanEdit::showData( WLanData_t & Data ) { -bool WLanEdit::commit( WLanData_t & Data ) { +bool WLanEdit::commit( WLanData & Data ) { bool SM = 0; diff --git a/noncore/settings/networksettings2/wlan/wlanedit.h b/noncore/settings/networksettings2/wlan/wlanedit.h index e550c14..8f219d9 100644 --- a/noncore/settings/networksettings2/wlan/wlanedit.h +++ b/noncore/settings/networksettings2/wlan/wlanedit.h @@ -6,3 +6,3 @@ class ANetNodeInstance; -class AsDevice; +class RuntimeInfo; class WExtensions; @@ -16,4 +16,4 @@ public : QString acceptable( void ); - void showData( WLanData_t & Data ); - bool commit( WLanData_t & Data ); + void showData( WLanData & Data ); + bool commit( WLanData & Data ); @@ -27,3 +27,3 @@ private : ANetNodeInstance * NNI; - AsDevice * Dev; + RuntimeInfo * Dev; QTimer RefreshTimer; diff --git a/noncore/settings/networksettings2/wlan/wlanrun.cpp b/noncore/settings/networksettings2/wlan/wlanrun.cpp index 3f1d4a9..fe49c4e 100644 --- a/noncore/settings/networksettings2/wlan/wlanrun.cpp +++ b/noncore/settings/networksettings2/wlan/wlanrun.cpp @@ -7,3 +7,3 @@ -void WLanRun::detectState( NodeCollection * NC ) { +State_t WLanRun::detectState( void ) { @@ -13,2 +13,3 @@ void WLanRun::detectState( NodeCollection * NC ) { + NodeCollection * NC = nodeCollection(); QString S = QString( "/tmp/profile-%1.up" ).arg(NC->number()); @@ -31,6 +32,4 @@ void WLanRun::detectState( NodeCollection * NC ) { if( X == Run->Name ) { - Run->assignNode( netNode() ); - assignInterface( Run ); - NC->setCurrentState( IsUp ); - return; + NC->assignInterface( Run ); + return IsUp; } @@ -40,3 +39,3 @@ void WLanRun::detectState( NodeCollection * NC ) { - if( ( Run = assignedInterface() ) ) { + if( ( Run = NC->assignedInterface() ) ) { // we already have an interface assigned -> still present ? @@ -44,4 +43,3 @@ void WLanRun::detectState( NodeCollection * NC ) { // usb is still free -> keep assignment - NC->setCurrentState( Available ); - return; + return Available; } // else interface is up but NOT us -> some other profile @@ -50,3 +48,3 @@ void WLanRun::detectState( NodeCollection * NC ) { // nothing (valid) assigned to us - assignInterface( 0 ); + NC->assignInterface( 0 ); @@ -66,9 +64,7 @@ void WLanRun::detectState( NodeCollection * NC ) { // proper type, and Not UP -> free - NC->setCurrentState( Off ); - return; + return Off; } } - // no free found - NC->setCurrentState( Unavailable ); + return Unavailable; @@ -76,67 +72,6 @@ void WLanRun::detectState( NodeCollection * NC ) { -bool WLanRun::setState( NodeCollection * NC, Action_t A, bool ) { +QString WLanRun::setMyState( NodeCollection * , Action_t , bool ) { // we only handle activate and deactivate - switch( A ) { - case Activate : - { - if( NC->currentState() != Off ) { - return 0; - } - InterfaceInfo * N = getInterface(); - if( ! N ) { - // no interface available - NC->setCurrentState( Unavailable ); - return 0; - } - // because we were OFF the interface - // we get back is NOT assigned - N->assignNode( netNode() ); - assignInterface( N ); - NC->setCurrentState( Available ); - return 1; - } - case Deactivate : - if( NC->currentState() == IsUp ) { - // bring down first - if( ! connection()->setState( Down ) ) - // could not ... - return 0; - } else if( NC->currentState() != Available ) { - return 1; - } - assignedInterface()->assignNode( 0 ); // release - assignInterface( 0 ); - NC->setCurrentState( Off ); - return 1; - default : - // FT - break; - } - return 0; -} - -bool WLanRun::canSetState( State_t Curr, Action_t A ) { - // we only handle up down activate and deactivate - switch( A ) { - case Activate : - { // at least available - if( Curr == Available ) { - return 1; - } - // or we can make one available - InterfaceInfo * N = getInterface(); - if( ! N || N->assignedNode() != 0 ) { - // non available or assigned - return 0; - } - return 1; - } - case Deactivate : - return ( Curr >= Available ); - default : - // FT - break; - } - return 0; + return QString(); } @@ -161,6 +96,6 @@ InterfaceInfo * WLanRun::getInterface( void ) { // this is a LAN card - if( Run->assignedNode() == netNode() ) { + if( Run->assignedConnection() == netNode()->connection() ) { // assigned to us return Run; - } else if( Run->assignedNode() == 0 ) { + } else if( Run->assignedConnection() == 0 ) { // free diff --git a/noncore/settings/networksettings2/wlan/wlanrun.h b/noncore/settings/networksettings2/wlan/wlanrun.h index 25d5b96..fd325d4 100644 --- a/noncore/settings/networksettings2/wlan/wlanrun.h +++ b/noncore/settings/networksettings2/wlan/wlanrun.h @@ -4,6 +4,6 @@ #include <qregexp.h> -#include <asdevice.h> +#include <netnode.h> #include "wlandata.h" -class WLanRun : public AsDevice { +class WLanRun : public RuntimeInfo { @@ -12,16 +12,9 @@ public : WLanRun( ANetNodeInstance * NNI, WLanData & Data ) : - AsDevice( NNI ), - Pat( "wlan[0-9]" ) - { } + RuntimeInfo( NNI ), + Pat( "wlan[0-9]" ) { + } - virtual AsDevice * device( void ) - { return (AsDevice *)this; } - virtual AsDevice * asDevice( void ) - { return (AsDevice *)this; } + virtual RuntimeInfo * device( void ) + { return this; } -protected : - - void detectState( NodeCollection * ); - bool setState( NodeCollection *, Action_t, bool ); - bool canSetState( State_t, Action_t ); bool handlesInterface( const QString & I ); @@ -29,2 +22,8 @@ protected : + State_t detectState( void ); + +protected : + + QString setMyState( NodeCollection * , Action_t, bool ); + private : |