From f62005c53c93148eaa13eac50ea6814a41afb216 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Thu, 03 Apr 2003 14:17:03 +0000 Subject: - ONetworkInterfaces are now QObjects - add support for private IOCTLS - make buildChannelList() more safe in case of faulty drivers --- (limited to 'libopie2/opienet/onetutils.cpp') diff --git a/libopie2/opienet/onetutils.cpp b/libopie2/opienet/onetutils.cpp index 8006f41..3e11b53 100644 --- a/libopie2/opienet/onetutils.cpp +++ b/libopie2/opienet/onetutils.cpp @@ -36,6 +36,16 @@ #include using namespace std; +#define IW_PRIV_TYPE_MASK 0x7000 +#define IW_PRIV_TYPE_NONE 0x0000 +#define IW_PRIV_TYPE_BYTE 0x1000 +#define IW_PRIV_TYPE_CHAR 0x2000 +#define IW_PRIV_TYPE_INT 0x4000 +#define IW_PRIV_TYPE_FLOAT 0x5000 +#define IW_PRIV_TYPE_ADDR 0x6000 +#define IW_PRIV_SIZE_FIXED 0x0800 +#define IW_PRIV_SIZE_MASK 0x07FF + /*====================================================================================== * OMacAddress *======================================================================================*/ @@ -87,6 +97,55 @@ bool operator==( const OMacAddress &m1, const OMacAddress &m2 ) return memcmp( &m1._bytes, &m2._bytes, 6 ) == 0; } + +/*====================================================================================== + * OHostAddress + *======================================================================================*/ + + +/*====================================================================================== + * OPrivateIOCTL + *======================================================================================*/ + +OPrivateIOCTL::OPrivateIOCTL( QObject* parent, const char* name, int cmd, int getargs, int setargs ) + :QObject( parent, name ), _ioctl( cmd ), _getargs( getargs ), _setargs( setargs ) +{ +} + + +OPrivateIOCTL::~OPrivateIOCTL() +{ +} + + +inline int OPrivateIOCTL::numberGetArgs() const +{ + return _getargs & IW_PRIV_SIZE_MASK; +} + + +inline int OPrivateIOCTL::typeGetArgs() const +{ + return _getargs & IW_PRIV_TYPE_MASK >> 12; +} + + +inline int OPrivateIOCTL::numberSetArgs() const +{ + return _setargs & IW_PRIV_SIZE_MASK; +} + + +inline int OPrivateIOCTL::typeSetArgs() const +{ + return _setargs & IW_PRIV_TYPE_MASK >> 12; +} + + +/*====================================================================================== + * assorted functions + *======================================================================================*/ + void dumpBytes( const unsigned char* data, int num ) { printf( "Dumping %d bytes @ %0x", num, data ); -- cgit v0.9.0.2