summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetutils.cpp
Unidiff
Diffstat (limited to 'libopie2/opienet/onetutils.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetutils.cpp59
1 files changed, 59 insertions, 0 deletions
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 @@
36#include <cstdio> 36#include <cstdio>
37using namespace std; 37using namespace std;
38 38
39#define IW_PRIV_TYPE_MASK 0x7000
40#define IW_PRIV_TYPE_NONE 0x0000
41#define IW_PRIV_TYPE_BYTE 0x1000
42#define IW_PRIV_TYPE_CHAR 0x2000
43#define IW_PRIV_TYPE_INT 0x4000
44#define IW_PRIV_TYPE_FLOAT 0x5000
45#define IW_PRIV_TYPE_ADDR 0x6000
46#define IW_PRIV_SIZE_FIXED 0x0800
47#define IW_PRIV_SIZE_MASK 0x07FF
48
39/*====================================================================================== 49/*======================================================================================
40 * OMacAddress 50 * OMacAddress
41 *======================================================================================*/ 51 *======================================================================================*/
@@ -87,6 +97,55 @@ bool operator==( const OMacAddress &m1, const OMacAddress &m2 )
87 return memcmp( &m1._bytes, &m2._bytes, 6 ) == 0; 97 return memcmp( &m1._bytes, &m2._bytes, 6 ) == 0;
88} 98}
89 99
100
101/*======================================================================================
102 * OHostAddress
103 *======================================================================================*/
104
105
106/*======================================================================================
107 * OPrivateIOCTL
108 *======================================================================================*/
109
110OPrivateIOCTL::OPrivateIOCTL( QObject* parent, const char* name, int cmd, int getargs, int setargs )
111 :QObject( parent, name ), _ioctl( cmd ), _getargs( getargs ), _setargs( setargs )
112{
113}
114
115
116OPrivateIOCTL::~OPrivateIOCTL()
117{
118}
119
120
121inline int OPrivateIOCTL::numberGetArgs() const
122{
123 return _getargs & IW_PRIV_SIZE_MASK;
124}
125
126
127inline int OPrivateIOCTL::typeGetArgs() const
128{
129 return _getargs & IW_PRIV_TYPE_MASK >> 12;
130}
131
132
133inline int OPrivateIOCTL::numberSetArgs() const
134{
135 return _setargs & IW_PRIV_SIZE_MASK;
136}
137
138
139inline int OPrivateIOCTL::typeSetArgs() const
140{
141 return _setargs & IW_PRIV_TYPE_MASK >> 12;
142}
143
144
145/*======================================================================================
146 * assorted functions
147 *======================================================================================*/
148
90void dumpBytes( const unsigned char* data, int num ) 149void dumpBytes( const unsigned char* data, int num )
91{ 150{
92 printf( "Dumping %d bytes @ %0x", num, data ); 151 printf( "Dumping %d bytes @ %0x", num, data );