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.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/libopie2/opienet/onetutils.cpp b/libopie2/opienet/onetutils.cpp
index 48cfa43..7794334 100644
--- a/libopie2/opienet/onetutils.cpp
+++ b/libopie2/opienet/onetutils.cpp
@@ -28,24 +28,27 @@
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#include <opie2/onetutils.h> 32#include <opie2/onetutils.h>
33#include <opie2/onetwork.h> 33#include <opie2/onetwork.h>
34#include <opie2/omanufacturerdb.h> 34#include <opie2/omanufacturerdb.h>
35 35
36#include <net/if.h> 36#include <net/if.h>
37#include <assert.h> 37#include <assert.h>
38#include <stdio.h> 38#include <stdio.h>
39 39
40namespace Opie {
41namespace Net {
42
40/*====================================================================================== 43/*======================================================================================
41 * OMacAddress 44 * OMacAddress
42 *======================================================================================*/ 45 *======================================================================================*/
43 46
44// static initializer for broadcast and unknown MAC Adresses 47// static initializer for broadcast and unknown MAC Adresses
45const unsigned char __broadcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; 48const unsigned char __broadcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
46const OMacAddress& OMacAddress::broadcast = OMacAddress( __broadcast ); 49const OMacAddress& OMacAddress::broadcast = OMacAddress( __broadcast );
47const unsigned char __unknown[6] = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }; 50const unsigned char __unknown[6] = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 };
48const OMacAddress& OMacAddress::unknown = OMacAddress( __unknown ); 51const OMacAddress& OMacAddress::unknown = OMacAddress( __unknown );
49 52
50//TODO: Incorporate Ethernet Manufacturer database here! (inline or so) 53//TODO: Incorporate Ethernet Manufacturer database here! (inline or so)
51 54
@@ -176,24 +179,27 @@ int OPrivateIOCTL::typeSetArgs() const
176void OPrivateIOCTL::invoke() const 179void OPrivateIOCTL::invoke() const
177{ 180{
178 ( (OWirelessNetworkInterface*) parent() )->wioctl( _ioctl ); 181 ( (OWirelessNetworkInterface*) parent() )->wioctl( _ioctl );
179} 182}
180 183
181 184
182void OPrivateIOCTL::setParameter( int num, u_int32_t value ) 185void OPrivateIOCTL::setParameter( int num, u_int32_t value )
183{ 186{
184 u_int32_t* arglist = (u_int32_t*) &( (OWirelessNetworkInterface*) parent() )->_iwr.u.name; 187 u_int32_t* arglist = (u_int32_t*) &( (OWirelessNetworkInterface*) parent() )->_iwr.u.name;
185 arglist[num] = value; 188 arglist[num] = value;
186} 189}
187 190
191
192
193namespace Private {
188/*====================================================================================== 194/*======================================================================================
189 * assorted functions 195 * assorted functions
190 *======================================================================================*/ 196 *======================================================================================*/
191 197
192void dumpBytes( const unsigned char* data, int num ) 198void dumpBytes( const unsigned char* data, int num )
193{ 199{
194 printf( "Dumping %d bytes @ %0x", num, data ); 200 printf( "Dumping %d bytes @ %0x", num, data );
195 printf( "-------------------------------------------\n" ); 201 printf( "-------------------------------------------\n" );
196 202
197 for ( int i = 0; i < num; ++i ) 203 for ( int i = 0; i < num; ++i )
198 { 204 {
199 printf( "%02x ", data[i] ); 205 printf( "%02x ", data[i] );
@@ -221,12 +227,15 @@ QString modeToString( int mode )
221 switch ( mode ) 227 switch ( mode )
222 { 228 {
223 case IW_MODE_AUTO: return "auto"; 229 case IW_MODE_AUTO: return "auto";
224 case IW_MODE_ADHOC: return "adhoc"; 230 case IW_MODE_ADHOC: return "adhoc";
225 case IW_MODE_INFRA: return "managed"; 231 case IW_MODE_INFRA: return "managed";
226 case IW_MODE_MASTER: return "master"; 232 case IW_MODE_MASTER: return "master";
227 case IW_MODE_REPEAT: return "repeater"; 233 case IW_MODE_REPEAT: return "repeater";
228 case IW_MODE_SECOND: return "second"; 234 case IW_MODE_SECOND: return "second";
229 case IW_MODE_MONITOR: return "monitor"; 235 case IW_MODE_MONITOR: return "monitor";
230 default: assert( 0 ); 236 default: assert( 0 );
231 } 237 }
232} 238}
239}
240}
241}