summaryrefslogtreecommitdiff
path: root/libopie2/opienet
authorzecke <zecke>2004-03-13 19:51:45 (UTC)
committer zecke <zecke>2004-03-13 19:51:45 (UTC)
commit6d08277737e22b7a1527124623f3571969073ddf (patch) (side-by-side diff)
tree4129e674e21df767b31299e873dd44e33a308e1b /libopie2/opienet
parent8e28911f7199f4450ac5eef09482069f9b9caea2 (diff)
downloadopie-6d08277737e22b7a1527124623f3571969073ddf.zip
opie-6d08277737e22b7a1527124623f3571969073ddf.tar.gz
opie-6d08277737e22b7a1527124623f3571969073ddf.tar.bz2
Move XML class to internal PIM
Add namespaces!!! Opie::Core and Opie::Core::Private Opie::Net and Opie::Net::Private Opie::Ui and Opie::Ui::Private Opie::MM and Opie::MM::Private Opie::DB and Opie::DB::Private PIM classes are not yet converted because we will do other work on it as well
Diffstat (limited to 'libopie2/opienet') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opienet/802_11_user.h1
-rw-r--r--libopie2/opienet/dhcp.h2
-rw-r--r--libopie2/opienet/odebugmapper.cpp10
-rw-r--r--libopie2/opienet/odebugmapper.h10
-rw-r--r--libopie2/opienet/omanufacturerdb.cpp7
-rw-r--r--libopie2/opienet/omanufacturerdb.h8
-rw-r--r--libopie2/opienet/onetutils.cpp9
-rw-r--r--libopie2/opienet/onetutils.h15
-rw-r--r--libopie2/opienet/onetwork.cpp9
-rw-r--r--libopie2/opienet/onetwork.h31
-rw-r--r--libopie2/opienet/opcap.cpp8
-rw-r--r--libopie2/opienet/opcap.h52
-rw-r--r--libopie2/opienet/ostation.cpp8
-rw-r--r--libopie2/opienet/ostation.h9
14 files changed, 176 insertions, 3 deletions
diff --git a/libopie2/opienet/802_11_user.h b/libopie2/opienet/802_11_user.h
index 7ae27c5..1a9a7a0 100644
--- a/libopie2/opienet/802_11_user.h
+++ b/libopie2/opienet/802_11_user.h
@@ -455,4 +455,5 @@ struct ctrl_end_ack_t {
#define IV_PAD(iv) (((iv) >> 24) & 0x3F)
#define IV_KEYID(iv) (((iv) >> 30) & 0x03)
+
#endif
diff --git a/libopie2/opienet/dhcp.h b/libopie2/opienet/dhcp.h
index 368e375..6ba4c53 100644
--- a/libopie2/opienet/dhcp.h
+++ b/libopie2/opienet/dhcp.h
@@ -42,6 +42,7 @@
#ifndef DHCP_H
#define DHCP_H
+
#define DHCP_UDP_OVERHEAD (14 + /* Ethernet header */ \
20 + /* IP header */ \
8) /* UDP header */
@@ -197,5 +198,6 @@ struct dhcp_packet {
#define FQDN_FQDN 8
#define FQDN_SUBOPTION_COUNT 8
+
#endif
diff --git a/libopie2/opienet/odebugmapper.cpp b/libopie2/opienet/odebugmapper.cpp
index 7e4ab2b..f679afb 100644
--- a/libopie2/opienet/odebugmapper.cpp
+++ b/libopie2/opienet/odebugmapper.cpp
@@ -7,6 +7,12 @@
#include "odebugmapper.h"
+using namespace Opie::Core;
+
+namespace Opie {
+namespace Net {
+namespace Private {
+
DebugMapper::DebugMapper()
{
odebug << "DebugMapper::DebugMapper()" << oendl;
@@ -212,4 +218,6 @@ const QString& DebugMapper::map( int value ) const
}
}
-
+}
+}
+}
diff --git a/libopie2/opienet/odebugmapper.h b/libopie2/opienet/odebugmapper.h
index 66b331d..f47db47 100644
--- a/libopie2/opienet/odebugmapper.h
+++ b/libopie2/opienet/odebugmapper.h
@@ -9,6 +9,10 @@
#include <qstring.h>
#include <qintdict.h>
+namespace Opie {
+namespace Net {
+namespace Private {
+
typedef QIntDict<QString> IntStringMap;
class DebugMapper
@@ -20,7 +24,13 @@ class DebugMapper
const QString& map( int value ) const;
private:
IntStringMap _map;
+ class Private;
+ Private *d;
};
+}
+}
+}
+
#endif
diff --git a/libopie2/opienet/omanufacturerdb.cpp b/libopie2/opienet/omanufacturerdb.cpp
index b93b752..209ec94 100644
--- a/libopie2/opienet/omanufacturerdb.cpp
+++ b/libopie2/opienet/omanufacturerdb.cpp
@@ -43,6 +43,10 @@
#include <qfile.h>
#include <qtextstream.h>
+using namespace Opie::Core;
+namespace Opie {
+namespace Net {
+
OManufacturerDB* OManufacturerDB::_instance = 0;
OManufacturerDB* OManufacturerDB::instance()
@@ -133,3 +137,6 @@ const QString& OManufacturerDB::lookupExt( const QString& macaddr ) const
return it == manufacturersExt.end() ? lookup( macaddr ) : *it;
}
+}
+}
+
diff --git a/libopie2/opienet/omanufacturerdb.h b/libopie2/opienet/omanufacturerdb.h
index c2712e5..5c1940e 100644
--- a/libopie2/opienet/omanufacturerdb.h
+++ b/libopie2/opienet/omanufacturerdb.h
@@ -33,6 +33,9 @@
#include <qmap.h>
+namespace Opie {
+namespace Net {
+
/**
* @brief A Ethernet card vendor database.
*
@@ -63,7 +66,12 @@ class OManufacturerDB
QMap<QString, QString> manufacturers;
QMap<QString, QString> manufacturersExt;
static OManufacturerDB* _instance;
+ class Private;
+ Private *d;
};
+}
+}
+
#endif
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
@@ -37,6 +37,9 @@
#include <assert.h>
#include <stdio.h>
+namespace Opie {
+namespace Net {
+
/*======================================================================================
* OMacAddress
*======================================================================================*/
@@ -185,6 +188,9 @@ void OPrivateIOCTL::setParameter( int num, u_int32_t value )
arglist[num] = value;
}
+
+
+namespace Private {
/*======================================================================================
* assorted functions
*======================================================================================*/
@@ -230,3 +236,6 @@ QString modeToString( int mode )
default: assert( 0 );
}
}
+}
+}
+}
diff --git a/libopie2/opienet/onetutils.h b/libopie2/opienet/onetutils.h
index bddfab9..ca6815d 100644
--- a/libopie2/opienet/onetutils.h
+++ b/libopie2/opienet/onetutils.h
@@ -41,6 +41,10 @@
#include <sys/types.h>
struct ifreq;
+
+namespace Opie {
+namespace Net {
+
class OWirelessNetworkInterface;
/*======================================================================================
@@ -72,6 +76,8 @@ class OMacAddress
unsigned char _bytes[6];
friend bool operator==( const OMacAddress &m1, const OMacAddress &m2 );
+ class Private;
+ Private *d;
};
@@ -88,6 +94,9 @@ class OHostAddress : public QHostAddress
OHostAddress();
~OHostAddress();
*/
+ private:
+ class Private;
+ Private *d;
};
@@ -115,15 +124,21 @@ class OPrivateIOCTL : public QObject
u_int16_t _getargs;
u_int16_t _setargs;
+ class Private;
+ Private *d;
};
/*======================================================================================
* Miscellaneous
*======================================================================================*/
+namespace Private {
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
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index e5b091f..ab3e77f 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -57,6 +57,10 @@
#ifndef NODEBUG
#include <opie2/odebugmapper.h>
+
+
+using namespace Opie::Core;
+using namespace Opie::Net::Private;
DebugMapper* debugmapper = new DebugMapper();
#endif
@@ -64,6 +68,8 @@ DebugMapper* debugmapper = new DebugMapper();
* ONetwork
*======================================================================================*/
+namespace Opie {
+namespace Net {
ONetwork* ONetwork::_instance = 0;
ONetwork::ONetwork()
@@ -1237,3 +1243,6 @@ QString OOrinocoMonitoringInterface::name() const
{
return "orinoco";
}
+
+}
+}
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h
index 93b129f..a953296 100644
--- a/libopie2/opienet/onetwork.h
+++ b/libopie2/opienet/onetwork.h
@@ -56,6 +56,9 @@
#include <qobject.h>
#include <qhostaddress.h>
+namespace Opie {
+namespace Net {
+
class ONetworkInterface;
class OWirelessNetworkInterface;
class OChannelHopper;
@@ -123,6 +126,8 @@ class ONetwork : public QObject
private:
static ONetwork* _instance;
InterfaceMap _interfaces;
+ class Private;
+ Private *d;
};
@@ -234,6 +239,9 @@ class ONetworkInterface : public QObject
virtual void init();
bool ioctl( int call ) const;
bool ioctl( int call, struct ifreq& ) const;
+ private:
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -296,6 +304,8 @@ class OChannelHopper : public QObject
int _tid;
QValueList<int> _channels;
QValueList<int>::Iterator _channel;
+ class Private;
+ Private *d;
};
@@ -455,6 +465,8 @@ class OWirelessNetworkInterface : public ONetworkInterface
private:
OChannelHopper* _hopper;
+ class Private;
+ Private *d;
};
@@ -479,6 +491,9 @@ class OMonitoringInterface
protected:
OWirelessNetworkInterface* _if;
bool _prismHeader;
+ private:
+ class Private;
+ Private *d;
};
@@ -497,6 +512,9 @@ class OCiscoMonitoringInterface : public OMonitoringInterface
virtual void setEnabled( bool );
virtual QString name() const;
virtual void setChannel( int );
+ private:
+ class Private;
+ Private *d;
};
@@ -516,6 +534,9 @@ class OWlanNGMonitoringInterface : public OMonitoringInterface
virtual void setEnabled( bool );
virtual QString name() const;
virtual void setChannel( int );
+ private:
+ class Private;
+ Private *d;
};
@@ -534,6 +555,10 @@ class OHostAPMonitoringInterface : public OMonitoringInterface
public:
virtual void setEnabled( bool );
virtual QString name() const;
+
+ private:
+ class Private;
+ Private *d;
};
@@ -553,7 +578,13 @@ class OOrinocoMonitoringInterface : public OMonitoringInterface
virtual void setEnabled( bool );
virtual QString name() const;
+ private:
+ class Private;
+ Private *d;
};
+}
+}
+
#endif // ONETWORK_H
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp
index fdd519c..4081d4f 100644
--- a/libopie2/opienet/opcap.cpp
+++ b/libopie2/opienet/opcap.cpp
@@ -45,6 +45,11 @@
/* LOCAL */
#include "udp_ports.h"
+using namespace Opie::Core;
+
+namespace Opie {
+namespace Net {
+
/*======================================================================================
* OPacket
*======================================================================================*/
@@ -1344,4 +1349,5 @@ QString OPacketCapturer::version() const
return QString().sprintf( "%d.%d", pcap_major_version( _pch ), pcap_minor_version( _pch ) );
}
-
+}
+}
diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h
index b873b49..dc609a3 100644
--- a/libopie2/opienet/opcap.h
+++ b/libopie2/opienet/opcap.h
@@ -64,8 +64,10 @@ typedef struct timeval timevalstruct;
typedef struct pcap_pkthdr packetheaderstruct;
/* FORWARDS */
-class OPacketCapturer;
class QSocketNotifier;
+namespace Opie {
+namespace Net {
+class OPacketCapturer;
/*======================================================================================
* OPacket - A frame on the wire
@@ -141,6 +143,9 @@ class OPacket : public QObject
const packetheaderstruct _hdr; // pcap packet header
const unsigned char* _data; // pcap packet data
const unsigned char* _end; // end of pcap packet data
+ private:
+ class Private;
+ Private *d;
};
QTextStream& operator<<( QTextStream& s, const OPacket& p );
@@ -163,6 +168,9 @@ class OEthernetPacket : public QObject
private:
const struct ether_header* _ether;
+ private:
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -181,6 +189,8 @@ class OPrismHeaderPacket : public QObject
private:
const struct prism_hdr* _header;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -210,6 +220,8 @@ class OWaveLanPacket : public QObject
private:
const struct ieee_802_11_header* _wlanhdr;
+ class Private;
+ Private *d;
};
@@ -239,6 +251,8 @@ class OWaveLanManagementPacket : public QObject
private:
const struct ieee_802_11_mgmt_header* _header;
const struct ieee_802_11_mgmt_body* _body;
+ class Private;
+ Private *d;
};
@@ -258,6 +272,8 @@ class OWaveLanManagementSSID : public QObject
private:
const struct ssid_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -274,6 +290,8 @@ class OWaveLanManagementRates : public QObject
private:
const struct rates_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -290,6 +308,8 @@ class OWaveLanManagementCF : public QObject
private:
const struct cf_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -306,6 +326,8 @@ class OWaveLanManagementFH : public QObject
private:
const struct fh_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -324,6 +346,8 @@ class OWaveLanManagementDS : public QObject
private:
const struct ds_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -340,6 +364,8 @@ class OWaveLanManagementTim : public QObject
private:
const struct tim_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -356,6 +382,8 @@ class OWaveLanManagementIBSS : public QObject
private:
const struct ibss_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -372,6 +400,8 @@ class OWaveLanManagementChallenge : public QObject
private:
const struct challenge_t* _data;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -388,6 +418,8 @@ class OWaveLanDataPacket : public QObject
private:
const struct ieee_802_11_data_header* _header;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -406,6 +438,8 @@ class OWaveLanControlPacket : public QObject
private:
const struct ieee_802_11_control_header* _header;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -422,6 +456,8 @@ class OLLCPacket : public QObject
private:
const struct ieee_802_11_802_2_header* _header;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -449,6 +485,8 @@ class OIPPacket : public QObject
private:
const struct iphdr* _iphdr;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -473,6 +511,8 @@ class OARPPacket : public QObject
private:
const struct myarphdr* _arphdr;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -494,6 +534,8 @@ class OUDPPacket : public QObject
private:
const struct udphdr* _udphdr;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -522,6 +564,8 @@ class ODHCPPacket : public QObject
private:
const struct dhcp_packet* _dhcphdr;
unsigned char _type;
+ class Private;
+ Private *d;
};
/*======================================================================================
@@ -545,6 +589,8 @@ class OTCPPacket : public QObject
private:
const struct tcphdr* _tcphdr;
+ class Private;
+ Private *d;
};
@@ -665,7 +711,11 @@ class OPacketCapturer : public QObject
QSocketNotifier* _sn; // socket notifier for main loop
mutable char _errbuf[PCAP_ERRBUF_SIZE]; // holds error strings from libpcap
QMap<QString, int> _stats; // statistics;
+ class Private; // Private Forward declaration
+ Private *d; // if we need to add data
};
+}
+}
#endif // OPCAP_H
diff --git a/libopie2/opienet/ostation.cpp b/libopie2/opienet/ostation.cpp
index 8c989d8..140b924 100644
--- a/libopie2/opienet/ostation.cpp
+++ b/libopie2/opienet/ostation.cpp
@@ -31,6 +31,11 @@
#include <opie2/ostation.h>
#include <opie2/odebug.h>
+
+using namespace Opie::Core;
+
+namespace Opie {
+namespace Net {
/*======================================================================================
* OStation
*======================================================================================*/
@@ -62,3 +67,6 @@ void OStation::dump()
qDebug( "ap: %s", (const char*) apAddress.toString() );
qDebug( "ip: %s", (const char*) ipAddress.toString() );
}
+
+}
+} \ No newline at end of file
diff --git a/libopie2/opienet/ostation.h b/libopie2/opienet/ostation.h
index 1e7366d..68f1114 100644
--- a/libopie2/opienet/ostation.h
+++ b/libopie2/opienet/ostation.h
@@ -40,8 +40,12 @@
#include <sys/types.h>
+namespace Opie {
+namespace Net {
+
class OStation;
+
typedef QList<OStation> OStationList;
/*======================================================================================
@@ -66,8 +70,13 @@ class OStation
OMacAddress apAddress;
int channel;
bool encrypted;
+ private:
+ class Private;
+ Private *d;
};
+}
+}
#endif // OSTATION_H