author | mickeyl <mickeyl> | 2003-04-04 10:31:26 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-04 10:31:26 (UTC) |
commit | 089385bb8ab768fbf6f394f326e565e3589163fc (patch) (side-by-side diff) | |
tree | 23891b81b11310186c43179612531bc92e52ae65 /libopie2/opienet/onetutils.cpp | |
parent | 7da7e9cbfb52988ce801310f66b1336e0809db28 (diff) | |
download | opie-089385bb8ab768fbf6f394f326e565e3589163fc.zip opie-089385bb8ab768fbf6f394f326e565e3589163fc.tar.gz opie-089385bb8ab768fbf6f394f326e565e3589163fc.tar.bz2 |
low-level network programming is sick. some wlan-drivers don't honor struct sizes
and simply write bytes _after_ the struct... this patch makes calling
SIOCGIWRANGE more failure-proof.
Diffstat (limited to 'libopie2/opienet/onetutils.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opienet/onetutils.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libopie2/opienet/onetutils.cpp b/libopie2/opienet/onetutils.cpp index fd8f9e9..b317810 100644 --- a/libopie2/opienet/onetutils.cpp +++ b/libopie2/opienet/onetutils.cpp @@ -122,64 +122,65 @@ OPrivateIOCTL::~OPrivateIOCTL() #ifdef QT_NO_DEBUG inline #endif int OPrivateIOCTL::numberGetArgs() const { return _getargs & IW_PRIV_SIZE_MASK; } #ifdef QT_NO_DEBUG inline #endif int OPrivateIOCTL::typeGetArgs() const { return _getargs & IW_PRIV_TYPE_MASK >> 12; } #ifdef QT_NO_DEBUG inline #endif int OPrivateIOCTL::numberSetArgs() const { return _setargs & IW_PRIV_SIZE_MASK; } #ifdef QT_NO_DEBUG inline #endif int OPrivateIOCTL::typeSetArgs() const { return _setargs & IW_PRIV_TYPE_MASK >> 12; } void OPrivateIOCTL::invoke() const { ( (OWirelessNetworkInterface*) parent() )->wioctl( _ioctl ); } void OPrivateIOCTL::setParameter( int num, u_int32_t value ) { u_int32_t* arglist = (u_int32_t*) &( (OWirelessNetworkInterface*) parent() )->_iwr.u.name; arglist[num] = value; } /*====================================================================================== * assorted functions *======================================================================================*/ void dumpBytes( const unsigned char* data, int num ) { printf( "Dumping %d bytes @ %0x", num, data ); printf( "-------------------------------------------\n" ); for ( int i = 0; i < num; ++i ) { printf( "%02x ", data[i] ); if ( !((i+1) % 32) ) printf( "\n" ); } printf( "\n\n" ); } + |