author | wimpie <wimpie> | 2004-04-07 00:09:37 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-07 00:09:37 (UTC) |
commit | b93d9e0c4384be0a6f40be257ba791004388400b (patch) (unidiff) | |
tree | 2ca0e41dc8c99e1af3ce2f0305d458f76d10db45 /noncore/settings/networksettings2/lancard/lancardrun.cpp | |
parent | 1b7aaf904fa70c16eee03155bd826e921798cc22 (diff) | |
download | opie-b93d9e0c4384be0a6f40be257ba791004388400b.zip opie-b93d9e0c4384be0a6f40be257ba791004388400b.tar.gz opie-b93d9e0c4384be0a6f40be257ba791004388400b.tar.bz2 |
MANY changes ... lancards should be OK now
Diffstat (limited to 'noncore/settings/networksettings2/lancard/lancardrun.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/lancard/lancardrun.cpp | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/noncore/settings/networksettings2/lancard/lancardrun.cpp b/noncore/settings/networksettings2/lancard/lancardrun.cpp index 951756d..2e4fc43 100644 --- a/noncore/settings/networksettings2/lancard/lancardrun.cpp +++ b/noncore/settings/networksettings2/lancard/lancardrun.cpp | |||
@@ -1,4 +1,5 @@ | |||
1 | #include <qfile.h> | 1 | #include <qfile.h> |
2 | #include <qtextstream.h> | 2 | #include <qtextstream.h> |
3 | #include <qstringlist.h> | ||
3 | #include <resources.h> | 4 | #include <resources.h> |
4 | #include "lancardrun.h" | 5 | #include "lancardrun.h" |
@@ -54,6 +55,10 @@ void LanCardRun::detectState( NodeCollection * NC ) { | |||
54 | ++It ) { | 55 | ++It ) { |
55 | Run = It.current(); | 56 | Run = It.current(); |
56 | if( handlesInterface( Run->Name ) && | 57 | if( handlesInterface( *Run ) && |
57 | Run->CardType == ARPHRD_ETHER && | 58 | ( Run->CardType == ARPHRD_ETHER |
59 | #ifdef ARPHRD_IEEE1394 | ||
60 | || Run->CardType == ARPHRD_IEEE1394 | ||
61 | #endif | ||
62 | ) && | ||
58 | ! Run->IsUp | 63 | ! Run->IsUp |
59 | ) { | 64 | ) { |
@@ -146,6 +151,10 @@ InterfaceInfo * LanCardRun::getInterface( void ) { | |||
146 | ++It ) { | 151 | ++It ) { |
147 | Run = It.current(); | 152 | Run = It.current(); |
148 | if( handlesInterface( Run->Name ) && | 153 | if( handlesInterface( *Run ) && |
149 | Run->CardType == ARPHRD_ETHER | 154 | ( Run->CardType == ARPHRD_ETHER |
155 | #ifdef ARPHRD_IEEE1394 | ||
156 | || Run->CardType == ARPHRD_IEEE1394 | ||
157 | #endif | ||
158 | ) | ||
150 | ) { | 159 | ) { |
151 | // this is a LAN card | 160 | // this is a LAN card |
@@ -163,4 +172,21 @@ InterfaceInfo * LanCardRun::getInterface( void ) { | |||
163 | 172 | ||
164 | bool LanCardRun::handlesInterface( const QString & S ) { | 173 | bool LanCardRun::handlesInterface( const QString & S ) { |
174 | InterfaceInfo * II; | ||
175 | II = NSResources->system().interface( S ); | ||
176 | if( ( II = NSResources->system().interface( S ) ) ) { | ||
177 | return handlesInterface( *II ); | ||
178 | } | ||
165 | return Pat.match( S ) >= 0; | 179 | return Pat.match( S ) >= 0; |
166 | } | 180 | } |
181 | |||
182 | bool LanCardRun::handlesInterface( const InterfaceInfo & II ) { | ||
183 | if( Pat.match( II.Name ) < 0 ) | ||
184 | return 0; | ||
185 | |||
186 | if( Data->AnyLanCard ) { | ||
187 | return 1; | ||
188 | } | ||
189 | |||
190 | // must also match hardware address | ||
191 | return ( Data->HWAddresses.findIndex( II.MACAddress ) >= 0 ); | ||
192 | } | ||