summaryrefslogtreecommitdiff
path: root/libopie2/opienet
Side-by-side diff
Diffstat (limited to 'libopie2/opienet') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opienet/odebugmapper.cpp2
-rw-r--r--libopie2/opienet/odebugmapper.h2
-rw-r--r--libopie2/opienet/onetutils.cpp2
-rw-r--r--libopie2/opienet/onetutils.h2
-rw-r--r--libopie2/opienet/onetwork.cpp4
5 files changed, 6 insertions, 6 deletions
diff --git a/libopie2/opienet/odebugmapper.cpp b/libopie2/opienet/odebugmapper.cpp
index f679afb..0de1247 100644
--- a/libopie2/opienet/odebugmapper.cpp
+++ b/libopie2/opienet/odebugmapper.cpp
@@ -1,38 +1,38 @@
/*
* debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
*/
#include <opie2/odebug.h>
#include "odebugmapper.h"
using namespace Opie::Core;
namespace Opie {
namespace Net {
-namespace Private {
+namespace Internal {
DebugMapper::DebugMapper()
{
odebug << "DebugMapper::DebugMapper()" << oendl;
_map.insert( 0x8902, new QString("SIOCSPGRP") );
_map.insert( 0x8904, new QString("SIOCGPGRP") );
_map.insert( 0x8905, new QString("SIOCATMARK") );
_map.insert( 0x8906, new QString("SIOCGSTAMP") );
_map.insert( 0x890B, new QString("SIOCADDRT") );
_map.insert( 0x890C, new QString("SIOCDELRT") );
_map.insert( 0x890D, new QString("SIOCRTMSG") );
_map.insert( 0x8910, new QString("SIOCGIFNAME") );
_map.insert( 0x8911, new QString("SIOCSIFLINK") );
_map.insert( 0x8912, new QString("SIOCGIFCONF") );
_map.insert( 0x8913, new QString("SIOCGIFFLAGS") );
_map.insert( 0x8914, new QString("SIOCSIFFLAGS") );
_map.insert( 0x8915, new QString("SIOCGIFADDR") );
_map.insert( 0x8916, new QString("SIOCSIFADDR") );
_map.insert( 0x8917, new QString("SIOCGIFDSTADDR") );
_map.insert( 0x8918, new QString("SIOCSIFDSTADDR") );
_map.insert( 0x8919, new QString("SIOCGIFBRDADDR") );
_map.insert( 0x891a, new QString("SIOCSIFBRDADDR") );
diff --git a/libopie2/opienet/odebugmapper.h b/libopie2/opienet/odebugmapper.h
index f47db47..79fb42e 100644
--- a/libopie2/opienet/odebugmapper.h
+++ b/libopie2/opienet/odebugmapper.h
@@ -1,36 +1,36 @@
/*
* debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
*/
#ifndef DEBUGMAPPER_H
#define DEBUGMAPPER_H
#include <qstring.h>
#include <qintdict.h>
namespace Opie {
namespace Net {
-namespace Private {
+namespace Internal {
typedef QIntDict<QString> IntStringMap;
class DebugMapper
{
public:
DebugMapper();
~DebugMapper();
const QString& map( int value ) const;
private:
IntStringMap _map;
class Private;
Private *d;
};
}
}
}
#endif
diff --git a/libopie2/opienet/onetutils.cpp b/libopie2/opienet/onetutils.cpp
index 7794334..c185805 100644
--- a/libopie2/opienet/onetutils.cpp
+++ b/libopie2/opienet/onetutils.cpp
@@ -169,49 +169,49 @@ int OPrivateIOCTL::numberSetArgs() const
return _setargs & IW_PRIV_SIZE_MASK;
}
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 {
+namespace Internal {
/*======================================================================================
* 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" );
}
int stringToMode( const QString& mode )
{
if ( mode == "auto" ) return IW_MODE_AUTO;
else if ( mode == "adhoc" ) return IW_MODE_ADHOC;
else if ( mode == "managed" ) return IW_MODE_INFRA;
else if ( mode == "master" ) return IW_MODE_MASTER;
diff --git a/libopie2/opienet/onetutils.h b/libopie2/opienet/onetutils.h
index ca6815d..4a09426 100644
--- a/libopie2/opienet/onetutils.h
+++ b/libopie2/opienet/onetutils.h
@@ -111,49 +111,49 @@ class OPrivateIOCTL : public QObject
~OPrivateIOCTL();
int numberGetArgs() const;
int typeGetArgs() const;
int numberSetArgs() const;
int typeSetArgs() const;
// FIXME return int? as ::ioctl does? -zecke
void invoke() const;
void setParameter( int, u_int32_t );
private:
u_int32_t _ioctl;
u_int16_t _getargs;
u_int16_t _setargs;
class Private;
Private *d;
};
/*======================================================================================
* Miscellaneous
*======================================================================================*/
-namespace Private {
+namespace Internal {
void dumpBytes( const unsigned char* data, int num );
QString modeToString( int );
int stringToMode( const QString& );
}
}
}
#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
#ifndef ARPHRD_IEEE80211
#define ARPHRD_IEEE80211 801
#endif
#ifndef ARPHRD_IEEE80211_PRISM
#define ARPHRD_IEEE80211_PRISM 802
#endif
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 26a6c81..b6c9876 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -39,92 +39,92 @@
#include <qfile.h>
#include <qtextstream.h>
/* UNIX */
#include <assert.h>
#include <arpa/inet.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <linux/sockios.h>
#include <net/if_arp.h>
#include <stdarg.h>
#ifndef NODEBUG
#include <opie2/odebugmapper.h>
using namespace Opie::Core;
-using namespace Opie::Net::Private;
+using namespace Opie::Net::Internal;
DebugMapper* debugmapper = new DebugMapper();
#endif
/*======================================================================================
* ONetwork
*======================================================================================*/
namespace Opie {
namespace Net {
ONetwork* ONetwork::_instance = 0;
ONetwork::ONetwork()
{
odebug << "ONetwork::ONetwork()" << oendl;
odebug << "ONetwork: This code has been compiled against Wireless Extensions V" << WIRELESS_EXT << oendl;
synchronize();
}
void ONetwork::synchronize()
{
// gather available interfaces by inspecting /proc/net/dev
//FIXME: we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices
//FIXME: Use SIOCGIFCONF anway, because we can disable listing of aliased devices
//FIXME: Best is use SIOCGIFCONF and if this doesn't work (result=-1), then fallback to parsing /proc/net/dev
_interfaces.clear();
QString str;
QFile f( "/proc/net/dev" );
bool hasFile = f.open( IO_ReadOnly );
if ( !hasFile )
{
odebug << "ONetwork: /proc/net/dev not existing. No network devices available" << oendl;
return;
}
QTextStream s( &f );
s.readLine();
s.readLine();
while ( !s.atEnd() )
{
s >> str;
str.truncate( str.find( ':' ) );
odebug << "ONetwork: found interface '" << str << "'" << oendl;
- ONetworkInterface* iface;
+ ONetworkInterface* iface = 0;
if ( isWirelessInterface( str ) )
{
iface = new OWirelessNetworkInterface( this, (const char*) str );
odebug << "ONetwork: interface '" << str << "' has Wireless Extensions" << oendl;
}
else
{
iface = new ONetworkInterface( this, (const char*) str );
}
_interfaces.insert( str, iface );
s.readLine();
}
}
short ONetwork::wirelessExtensionVersion()
{
return WIRELESS_EXT;
}
int ONetwork::count() const
{
return _interfaces.count();