Diffstat (limited to 'libopie2/opienet/onetutils.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opienet/onetutils.cpp | 9 |
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 @@ -24,32 +24,35 @@ -_. . . )=. = Library General Public License along with -- :-=` 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 <opie2/omanufacturerdb.h> #include <net/if.h> #include <assert.h> #include <stdio.h> +namespace Opie { +namespace Net { + /*====================================================================================== * OMacAddress *======================================================================================*/ // static initializer for broadcast and unknown MAC Adresses const unsigned char __broadcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; const OMacAddress& OMacAddress::broadcast = OMacAddress( __broadcast ); const unsigned char __unknown[6] = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }; const OMacAddress& OMacAddress::unknown = OMacAddress( __unknown ); //TODO: Incorporate Ethernet Manufacturer database here! (inline or so) OMacAddress::OMacAddress() { memcpy( _bytes, __unknown, 6 ); } @@ -172,32 +175,35 @@ 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; } + + +namespace Private { /*====================================================================================== * assorted functions *======================================================================================*/ void dumpBytes( const unsigned char* data, int num ) { printf( "Dumping %d bytes @ %0x", num, data ); printf( "-------------------------------------------\n" ); for ( int i = 0; i < num; ++i ) { printf( "%02x ", data[i] ); if ( !((i+1) % 32) ) printf( "\n" ); } printf( "\n\n" ); } @@ -217,16 +223,19 @@ int stringToMode( const QString& mode ) QString modeToString( int mode ) { switch ( mode ) { case IW_MODE_AUTO: return "auto"; case IW_MODE_ADHOC: return "adhoc"; case IW_MODE_INFRA: return "managed"; case IW_MODE_MASTER: return "master"; case IW_MODE_REPEAT: return "repeater"; case IW_MODE_SECOND: return "second"; case IW_MODE_MONITOR: return "monitor"; default: assert( 0 ); } } +} +} +} |