author | wimpie <wimpie> | 2005-01-11 15:35:46 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-11 15:35:46 (UTC) |
commit | 4c4cdd76caea5a8be4a971892375c7c6b4f4a8b9 (patch) (side-by-side diff) | |
tree | 0e8adcc616a1d20b637aad3de568dcb45af05f71 /noncore/settings/networksettings2/network | |
parent | 32e8aa951218c0bd6118ee04bb22ef83b3b7ec2e (diff) | |
download | opie-4c4cdd76caea5a8be4a971892375c7c6b4f4a8b9.zip opie-4c4cdd76caea5a8be4a971892375c7c6b4f4a8b9.tar.gz opie-4c4cdd76caea5a8be4a971892375c7c6b4f4a8b9.tar.bz2 |
vpn should now work IF only the vpn plugin would do something.
shortened logical interface names (busybox only supports 10 characters
and then ONLY if you recompile it with mappings enabled)
Other small fixes
Diffstat (limited to 'noncore/settings/networksettings2/network') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/network/network_NNI.cpp | 11 | ||||
-rw-r--r-- | noncore/settings/networksettings2/network/networkrun.cpp | 9 |
2 files changed, 11 insertions, 9 deletions
diff --git a/noncore/settings/networksettings2/network/network_NNI.cpp b/noncore/settings/networksettings2/network/network_NNI.cpp index 78e6545..34dac54 100644 --- a/noncore/settings/networksettings2/network/network_NNI.cpp +++ b/noncore/settings/networksettings2/network/network_NNI.cpp @@ -95,74 +95,75 @@ QString ANetwork::acceptable( void ) { } void ANetwork::commit( void ) { if( GUI && GUI->commit( Data ) ) setModified( 1 ); } bool ANetwork::hasDataForFile( SystemFile & S ) { return S.name() == "interfaces"; } short ANetwork::generateFile( SystemFile &SF, long DevNr ) { short rvl, rvd ; QString NIC = runtime()->device()->netNode()->nodeClass()->genNic( DevNr ); rvl = 1; if( SF.name() == "interfaces" ) { Log(("Generate Network for %s\n", SF.name().latin1() )); // we can safely call from here since device item is deeper if( Data.UseDHCP ) { SF << "iface " - << NIC - << "-c" + << "A" << connection()->number() - << "-allowed inet dhcp" + << NIC + << " inet dhcp" << endl; SF << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() << ".up" << endl; if( Data.SendHostname ) { SF << " hostname " << Data.Hostname << endl; } SF << " down rm -f /tmp/profile-" << connection()->number() << ".up" << endl; } else { SF << "iface " - << NIC << "-c" + << "A" << connection()->number() - << "-allowed inet static" + << NIC + << " inet static" << endl; SF << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() << ".up" << endl; SF << " down rm -f /tmp/profile-" << connection()->number() << ".up" << endl; SF << " address " << Data.IPAddress << endl; SF << " broadcast " << Data.Broadcast << endl; SF << " netmask " << Data.NetMask << endl; // derive network address = IPAddress & netmask { QString NW; QStringList ipal = QStringList::split( '.', Data.IPAddress ); diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp index 2c93d9d..74467ad 100644 --- a/noncore/settings/networksettings2/network/networkrun.cpp +++ b/noncore/settings/networksettings2/network/networkrun.cpp @@ -1,50 +1,51 @@ #include <system.h> #include <netnode.h> #include <resources.h> #include "networkrun.h" State_t NetworkRun::detectState( void ) { InterfaceInfo * II = nodeCollection()->assignedInterface(); - Log(( "Interface %p : %d\n", II, (II) ? II->IsUp : 0 )); + Log(( "Interface %p %p : %d\n", II, nodeCollection(), (II) ? II->IsUp : 0 )); if( II && II->IsUp ) { // device has assigned interface return IsUp; } // had no interface or interface is no longer up -> release nodeCollection()->assignInterface( 0 ); return Unknown; } QString NetworkRun::setMyState( NodeCollection * NC, Action_t A, bool ) { // we handle UP and DOWN InterfaceInfo * II = NC->assignedInterface(); if( ! II ) { Log(( "no interface assigned." )); return QString(); } QStringList SL; if( A == Up ) { // we can bring UP if lower level is available SL << "ifup"; } else if( A == Down ) { SL << "ifdown"; } else { return QString(); } - SL << QString().sprintf( "%s=%s-c%d-allowed", - II->Name.latin1(), II->Name.latin1(), - nodeCollection()->number() ); + SL << QString().sprintf( "%s=A%ld%s", + II->Name.latin1(), + nodeCollection()->number(), + II->Name.latin1() ); if( ! NSResources->system().runAsRoot( SL ) ) { return QString("Cannot call %1").arg(SL.join(" ")); } return QString(); } |