summaryrefslogtreecommitdiff
path: root/libopie2
Side-by-side diff
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp12
-rw-r--r--libopie2/opienet/onetwork.h10
-rw-r--r--libopie2/opienet/opcap.cpp4
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
@@ -120,5 +120,5 @@ void ONetwork::synchronize()
-short ONetwork::wirelessExtensionVersion()
+short ONetwork::wirelessExtensionCompileVersion()
{
return WIRELESS_EXT;
@@ -383,5 +383,5 @@ OChannelHopper::OChannelHopper( OWirelessNetworkInterface* iface )
_iface( iface ), _interval( 0 ), _tid( 0 )
{
- int _maxChannel = iface->channels()+1;
+ int _maxChannel = iface->channels();
// generate fancy hopping sequence honoring the device capabilities
if ( _maxChannel >= 1 ) _channels.append( 1 );
@@ -400,5 +400,4 @@ OChannelHopper::OChannelHopper( OWirelessNetworkInterface* iface )
if ( _maxChannel >= 12 ) _channels.append( 12 );
_channel = _channels.begin();
-
}
@@ -562,4 +561,5 @@ 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 );
}
@@ -572,4 +572,10 @@ 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
@@ -126,5 +126,5 @@ class ONetwork : public QObject
* @returns the wireless extension version used at compile time.
**/
- static short wirelessExtensionVersion();
+ static short wirelessExtensionCompileVersion();
protected:
@@ -452,6 +452,10 @@ 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
*/
void commit() const;
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
@@ -59,7 +59,7 @@ 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
// points to an internal region which is reused by lipcap.