author | wimpie <wimpie> | 2004-08-09 02:31:25 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-08-09 02:31:25 (UTC) |
commit | 0784cfdbd261c43856b45be6ab7439841e69b858 (patch) (side-by-side diff) | |
tree | f6a27d6b2e1e6d8dcc908b2ef5836cd320ddfab1 /noncore/settings/networksettings2/network | |
parent | 5e10278e748608766245ff9f59a54d1ae8ff6f7e (diff) | |
download | opie-0784cfdbd261c43856b45be6ab7439841e69b858.zip opie-0784cfdbd261c43856b45be6ab7439841e69b858.tar.gz opie-0784cfdbd261c43856b45be6ab7439841e69b858.tar.bz2 |
Many changes :
bluetooth and usb seems to work
added preliminary support for VPN on top of any network
This version is still very much crippled yet is does DO some
things
Diffstat (limited to 'noncore/settings/networksettings2/network') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/network/networkrun.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp index 41e1c53..3e24c5f 100644 --- a/noncore/settings/networksettings2/network/networkrun.cpp +++ b/noncore/settings/networksettings2/network/networkrun.cpp @@ -4,56 +4,68 @@ void NetworkRun::detectState( NodeCollection * NC ) { RuntimeInfo * RI = netNode()->nextNode()->runtime(); AsDevice * Next = RI->asDevice(); InterfaceInfo * II = Next->assignedInterface(); if( II ) { // device has assigned interface NC->setCurrentState( (( II->IsUp ) ? IsUp : Available) ); return; } + Log(( "%s not ! UP or ava\n", NC->name().latin1() )); // has no interface -> delegate RI->detectState( NC ); } bool NetworkRun::setState( NodeCollection * NC, Action_t A, bool Force ) { // we handle UP and DOWN RuntimeInfo * RI = netNode()->nextNode()->runtime(); AsDevice * Next = RI->asDevice(); InterfaceInfo * II = Next->assignedInterface(); if( A == Up ) { // we can bring UP if lower level is available if( NC->currentState() == Available || Force ) { QString S; S.sprintf( "ifup %s=%s-c%d-allowed", II->Name.latin1(), II->Name.latin1(), connection()->number() ); NSResources->system().runAsRoot( S ); } return 1; } else if( A == Down ) { - if( NC->currentState() == IsUp || Force ) { QString S; + if( Force ) { + Log(("Force mode %d\n", Force )); + for( int i = 0; + i < RI->netNode()->nodeClass()->instanceCount(); + i ++ ) { + S.sprintf( "ifdown %s", + RI->netNode()->nodeClass()->genNic( i ).latin1() ); + NSResources->system().runAsRoot( S ); + } + } else { + if( NC->currentState() == IsUp ) { S.sprintf( "ifdown %s=%s-c%d-allowed", II->Name.latin1(), II->Name.latin1(), connection()->number() ); NSResources->system().runAsRoot( S ); } + } return 1; } // delegate - return RI->setState( NC, A ); + return RI->setState( NC, A, Force ); } bool NetworkRun::canSetState( State_t Curr, Action_t A ) { // we handle UP and DOWN RuntimeInfo * RI = netNode()->nextNode()->runtime(); if( A == Up ) { return ( Curr == Available ); } else if( A == Down ) { return ( Curr == IsUp ); } // delegate |