Diffstat (limited to 'libopie2/opienet/onetutils.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opienet/onetutils.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/libopie2/opienet/onetutils.cpp b/libopie2/opienet/onetutils.cpp index 3e11b53..fd8f9e9 100644 --- a/libopie2/opienet/onetutils.cpp +++ b/libopie2/opienet/onetutils.cpp @@ -25,16 +25,17 @@ -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <opie2/onetutils.h> +#include <opie2/onetwork.h> #include <net/if.h> #include <cstdio> using namespace std; #define IW_PRIV_TYPE_MASK 0x7000 #define IW_PRIV_TYPE_NONE 0x0000 @@ -113,40 +114,64 @@ OPrivateIOCTL::OPrivateIOCTL( QObject* parent, const char* name, int cmd, int ge } OPrivateIOCTL::~OPrivateIOCTL() { } -inline int OPrivateIOCTL::numberGetArgs() const +#ifdef QT_NO_DEBUG +inline +#endif +int OPrivateIOCTL::numberGetArgs() const { return _getargs & IW_PRIV_SIZE_MASK; } -inline int OPrivateIOCTL::typeGetArgs() const +#ifdef QT_NO_DEBUG +inline +#endif +int OPrivateIOCTL::typeGetArgs() const { return _getargs & IW_PRIV_TYPE_MASK >> 12; } -inline int OPrivateIOCTL::numberSetArgs() const +#ifdef QT_NO_DEBUG +inline +#endif +int OPrivateIOCTL::numberSetArgs() const { return _setargs & IW_PRIV_SIZE_MASK; } -inline int OPrivateIOCTL::typeSetArgs() const +#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" ); |