author | mickeyl <mickeyl> | 2003-04-03 14:17:03 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-03 14:17:03 (UTC) |
commit | f62005c53c93148eaa13eac50ea6814a41afb216 (patch) (unidiff) | |
tree | 93e7e626205fd9d06b5ac7c29e78be52ce749e5d /libopie2/opienet/onetutils.cpp | |
parent | e9eeb493c75bfe6078f40952e85e859fb71fe970 (diff) | |
download | opie-f62005c53c93148eaa13eac50ea6814a41afb216.zip opie-f62005c53c93148eaa13eac50ea6814a41afb216.tar.gz opie-f62005c53c93148eaa13eac50ea6814a41afb216.tar.bz2 |
- ONetworkInterfaces are now QObjects
- add support for private IOCTLS
- make buildChannelList() more safe in case of faulty drivers
Diffstat (limited to 'libopie2/opienet/onetutils.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opienet/onetutils.cpp | 59 |
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> |
37 | using namespace std; | 37 | using 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 | |||
110 | OPrivateIOCTL::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 | |||
116 | OPrivateIOCTL::~OPrivateIOCTL() | ||
117 | { | ||
118 | } | ||
119 | |||
120 | |||
121 | inline int OPrivateIOCTL::numberGetArgs() const | ||
122 | { | ||
123 | return _getargs & IW_PRIV_SIZE_MASK; | ||
124 | } | ||
125 | |||
126 | |||
127 | inline int OPrivateIOCTL::typeGetArgs() const | ||
128 | { | ||
129 | return _getargs & IW_PRIV_TYPE_MASK >> 12; | ||
130 | } | ||
131 | |||
132 | |||
133 | inline int OPrivateIOCTL::numberSetArgs() const | ||
134 | { | ||
135 | return _setargs & IW_PRIV_SIZE_MASK; | ||
136 | } | ||
137 | |||
138 | |||
139 | inline int OPrivateIOCTL::typeSetArgs() const | ||
140 | { | ||
141 | return _setargs & IW_PRIV_TYPE_MASK >> 12; | ||
142 | } | ||
143 | |||
144 | |||
145 | /*====================================================================================== | ||
146 | * assorted functions | ||
147 | *======================================================================================*/ | ||
148 | |||
90 | void dumpBytes( const unsigned char* data, int num ) | 149 | void 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 ); |