-rw-r--r-- | libopie2/opienet/onetwork.cpp | 12 | ||||
-rw-r--r-- | libopie2/opienet/onetwork.h | 10 | ||||
-rw-r--r-- | libopie2/opienet/opcap.cpp | 4 |
3 files changed, 18 insertions, 8 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index b6c9876..e141097 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp @@ -121,3 +121,3 @@ void ONetwork::synchronize() -short ONetwork::wirelessExtensionVersion()
+short ONetwork::wirelessExtensionCompileVersion()
{
@@ -384,3 +384,3 @@ OChannelHopper::OChannelHopper( OWirelessNetworkInterface* iface ) {
- int _maxChannel = iface->channels()+1;
+ int _maxChannel = iface->channels();
// generate fancy hopping sequence honoring the device capabilities
@@ -401,3 +401,2 @@ OChannelHopper::OChannelHopper( OWirelessNetworkInterface* iface ) _channel = _channels.begin();
-
}
@@ -563,2 +562,3 @@ void OWirelessNetworkInterface::buildInformation() int freq = (int) ( double( range.freq[i].m ) * pow( 10.0, range.freq[i].e ) / 1000000.0 );
+ odebug << "OWirelessNetworkInterface::buildInformation: Adding frequency " << freq << " as channel " << i+1 << oendl;
_channels.insert( freq, i+1 );
@@ -573,2 +573,8 @@ void OWirelessNetworkInterface::buildInformation() +short OWirelessNetworkInterface::wirelessExtensionDriverVersion() const
+{
+ return _range.we_version_compiled;
+}
+
+
void OWirelessNetworkInterface::buildPrivateList()
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index f5fbe1d..a49c8fb 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h @@ -127,3 +127,3 @@ class ONetwork : public QObject **/ - static short wirelessExtensionVersion(); + static short wirelessExtensionCompileVersion(); @@ -453,4 +453,8 @@ class OWirelessNetworkInterface : public ONetworkInterface virtual int signalStrength() const; - /** @internal commit pending changes to the driver - * + /** + * @returns the wireless extension version used by the interface driver. + **/ + short wirelessExtensionDriverVersion() const; + /** + * @internal commit pending changes to the driver */ diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp index f8ebe6b..a9dc577 100644 --- a/libopie2/opienet/opcap.cpp +++ b/libopie2/opienet/opcap.cpp @@ -60,5 +60,5 @@ OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char* - _data = new unsigned char[sizeof data]; + _data = new unsigned char[ header.len ]; assert( _data ); - memcpy( const_cast<unsigned char*>(_data), data, sizeof data ); + memcpy( const_cast<unsigned char*>(_data), data, header.len ); // We have to copy the data structure here, because the 'data' pointer handed by libpcap |