-rw-r--r-- | libopie2/opienet/802_11_user.h | 1 | ||||
-rw-r--r-- | libopie2/opienet/dhcp.h | 2 | ||||
-rw-r--r-- | libopie2/opienet/odebugmapper.cpp | 10 | ||||
-rw-r--r-- | libopie2/opienet/odebugmapper.h | 10 | ||||
-rw-r--r-- | libopie2/opienet/omanufacturerdb.cpp | 7 | ||||
-rw-r--r-- | libopie2/opienet/omanufacturerdb.h | 8 | ||||
-rw-r--r-- | libopie2/opienet/onetutils.cpp | 9 | ||||
-rw-r--r-- | libopie2/opienet/onetutils.h | 15 | ||||
-rw-r--r-- | libopie2/opienet/onetwork.cpp | 9 | ||||
-rw-r--r-- | libopie2/opienet/onetwork.h | 31 | ||||
-rw-r--r-- | libopie2/opienet/opcap.cpp | 8 | ||||
-rw-r--r-- | libopie2/opienet/opcap.h | 52 | ||||
-rw-r--r-- | libopie2/opienet/ostation.cpp | 8 | ||||
-rw-r--r-- | libopie2/opienet/ostation.h | 9 |
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 @@ -454,5 +454,6 @@ struct ctrl_end_ack_t { #define IV_IV(iv) ((iv) & 0xFFFFFF) #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 @@ -41,8 +41,9 @@ #ifndef DHCP_H #define DHCP_H + #define DHCP_UDP_OVERHEAD (14 + /* Ethernet header */ \ 20 + /* IP header */ \ 8) /* UDP header */ #define DHCP_SNAME_LEN 64 @@ -196,6 +197,7 @@ struct dhcp_packet { #define FQDN_DOMAINNAME 7 #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 @@ -6,8 +6,14 @@ #include <opie2/odebug.h> #include "odebugmapper.h" +using namespace Opie::Core; + +namespace Opie { +namespace Net { +namespace Private { + DebugMapper::DebugMapper() { odebug << "DebugMapper::DebugMapper()" << oendl; @@ -211,5 +217,7 @@ const QString& DebugMapper::map( int value ) const return *result; } } - +} +} +} 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 @@ -8,8 +8,12 @@ #include <qstring.h> #include <qintdict.h> +namespace Opie { +namespace Net { +namespace Private { + typedef QIntDict<QString> IntStringMap; class DebugMapper { @@ -19,8 +23,14 @@ 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 @@ -42,8 +42,12 @@ #include <qapplication.h> #include <qfile.h> #include <qtextstream.h> +using namespace Opie::Core; +namespace Opie { +namespace Net { + OManufacturerDB* OManufacturerDB::_instance = 0; OManufacturerDB* OManufacturerDB::instance() { @@ -132,4 +136,7 @@ const QString& OManufacturerDB::lookupExt( const QString& macaddr ) const QMap<QString,QString>::ConstIterator it = manufacturersExt.find( macaddr.upper().left(8) ); 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 @@ -32,8 +32,11 @@ #define OMANUFACTURERDB_H #include <qmap.h> +namespace Opie { +namespace Net { + /** * @brief A Ethernet card vendor database. * * This class encapsulates the lookup of Ethernet vendor given a @@ -62,8 +65,13 @@ class OManufacturerDB private: 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 @@ -36,8 +36,11 @@ #include <net/if.h> #include <assert.h> #include <stdio.h> +namespace Opie { +namespace Net { + /*====================================================================================== * OMacAddress *======================================================================================*/ @@ -184,8 +187,11 @@ 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 *======================================================================================*/ @@ -229,4 +235,7 @@ QString modeToString( int mode ) case IW_MODE_MONITOR: return "monitor"; 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 @@ -40,8 +40,12 @@ #include <sys/types.h> struct ifreq; + +namespace Opie { +namespace Net { + class OWirelessNetworkInterface; /*====================================================================================== * OMacAddress @@ -71,8 +75,10 @@ class OMacAddress private: unsigned char _bytes[6]; friend bool operator==( const OMacAddress &m1, const OMacAddress &m2 ); + class Private; + Private *d; }; bool operator==( const OMacAddress &m1, const OMacAddress &m2 ); @@ -87,8 +93,11 @@ class OHostAddress : public QHostAddress /*public: OHostAddress(); ~OHostAddress(); */ + private: + class Private; + Private *d; }; /*====================================================================================== @@ -114,17 +123,23 @@ class OPrivateIOCTL : public QObject u_int32_t _ioctl; 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 #define IW_PRIV_TYPE_BYTE 0x1000 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 @@ -56,15 +56,21 @@ #include <stdarg.h>
#ifndef NODEBUG
#include <opie2/odebugmapper.h>
+ + +using namespace Opie::Core; +using namespace Opie::Net::Private; DebugMapper* debugmapper = new DebugMapper();
#endif
/*======================================================================================
* ONetwork
*======================================================================================*/
+namespace Opie { +namespace Net { ONetwork* ONetwork::_instance = 0;
ONetwork::ONetwork()
{
@@ -1236,4 +1242,7 @@ void OOrinocoMonitoringInterface::setEnabled( bool b ) 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 @@ -55,8 +55,11 @@ #include <qmap.h> #include <qobject.h> #include <qhostaddress.h> +namespace Opie { +namespace Net { + class ONetworkInterface; class OWirelessNetworkInterface; class OChannelHopper; class OMonitoringInterface; @@ -122,8 +125,10 @@ class ONetwork : public QObject private: static ONetwork* _instance; InterfaceMap _interfaces; + class Private; + Private *d; }; /*====================================================================================== @@ -233,8 +238,11 @@ class ONetworkInterface : public QObject struct ifreq& ifr() const; virtual void init(); bool ioctl( int call ) const; bool ioctl( int call, struct ifreq& ) const; + private: + class Private; + Private *d; }; /*====================================================================================== * OChannelHopper @@ -295,8 +303,10 @@ class OChannelHopper : public QObject int _interval; int _tid; QValueList<int> _channels; QValueList<int>::Iterator _channel; + class Private; + Private *d; }; /*====================================================================================== @@ -454,8 +464,10 @@ class OWirelessNetworkInterface : public ONetworkInterface struct iw_range _range; private: OChannelHopper* _hopper; + class Private; + Private *d; }; /*====================================================================================== @@ -478,8 +490,11 @@ class OMonitoringInterface protected: OWirelessNetworkInterface* _if; bool _prismHeader; + private: + class Private; + Private *d; }; @@ -496,8 +511,11 @@ class OCiscoMonitoringInterface : public OMonitoringInterface virtual void setEnabled( bool ); virtual QString name() const; virtual void setChannel( int ); + private: + class Private; + Private *d; }; @@ -515,8 +533,11 @@ class OWlanNGMonitoringInterface : public OMonitoringInterface public: virtual void setEnabled( bool ); virtual QString name() const; virtual void setChannel( int ); + private: + class Private; + Private *d; }; @@ -533,8 +554,12 @@ class OHostAPMonitoringInterface : public OMonitoringInterface public: virtual void setEnabled( bool ); virtual QString name() const; + + private: + class Private; + Private *d; }; /*====================================================================================== @@ -552,8 +577,14 @@ class OOrinocoMonitoringInterface : public OMonitoringInterface virtual void setChannel( int ); 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 @@ -44,8 +44,13 @@ /* LOCAL */ #include "udp_ports.h" +using namespace Opie::Core; + +namespace Opie { +namespace Net { + /*====================================================================================== * OPacket *======================================================================================*/ @@ -1343,5 +1348,6 @@ 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 @@ -63,10 +63,12 @@ extern "C" // work around a bpf/pcap conflict in recent headers 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 *======================================================================================*/ @@ -140,8 +142,11 @@ class OPacket : public QObject private: 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 ); @@ -162,8 +167,11 @@ class OEthernetPacket : public QObject int type() const; private: const struct ether_header* _ether; + private: + class Private; + Private *d; }; /*====================================================================================== * OPrismHeaderPacket - DLT_PRISM_HEADER frame @@ -180,8 +188,10 @@ class OPrismHeaderPacket : public QObject unsigned int signalStrength() const; private: const struct prism_hdr* _header; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanPacket - DLT_IEEE802_11 frame @@ -209,8 +219,10 @@ class OWaveLanPacket : public QObject bool usesWep() const; private: const struct ieee_802_11_header* _wlanhdr; + class Private; + Private *d; }; /*====================================================================================== @@ -238,8 +250,10 @@ 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; }; /*====================================================================================== @@ -257,8 +271,10 @@ class OWaveLanManagementSSID : public QObject QString ID( bool decloak = false ) const; private: const struct ssid_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementRates @@ -273,8 +289,10 @@ class OWaveLanManagementRates : public QObject virtual ~OWaveLanManagementRates(); private: const struct rates_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementCF @@ -289,8 +307,10 @@ class OWaveLanManagementCF : public QObject virtual ~OWaveLanManagementCF(); private: const struct cf_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementFH @@ -305,8 +325,10 @@ class OWaveLanManagementFH : public QObject virtual ~OWaveLanManagementFH(); private: const struct fh_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementDS @@ -323,8 +345,10 @@ class OWaveLanManagementDS : public QObject int channel() const; private: const struct ds_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementTim @@ -339,8 +363,10 @@ class OWaveLanManagementTim : public QObject virtual ~OWaveLanManagementTim(); private: const struct tim_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementIBSS @@ -355,8 +381,10 @@ class OWaveLanManagementIBSS : public QObject virtual ~OWaveLanManagementIBSS(); private: const struct ibss_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanManagementChallenge @@ -371,8 +399,10 @@ class OWaveLanManagementChallenge : public QObject virtual ~OWaveLanManagementChallenge(); private: const struct challenge_t* _data; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanDataPacket - type: data (T_DATA) @@ -387,8 +417,10 @@ class OWaveLanDataPacket : public QObject virtual ~OWaveLanDataPacket(); private: const struct ieee_802_11_data_header* _header; + class Private; + Private *d; }; /*====================================================================================== * OWaveLanControlPacket - type: control (T_CTRL) @@ -405,8 +437,10 @@ class OWaveLanControlPacket : public QObject QString controlType() const; private: const struct ieee_802_11_control_header* _header; + class Private; + Private *d; }; /*====================================================================================== * OLLCPacket - IEEE 802.2 Link Level Control @@ -421,8 +455,10 @@ class OLLCPacket : public QObject virtual ~OLLCPacket(); private: const struct ieee_802_11_802_2_header* _header; + class Private; + Private *d; }; /*====================================================================================== * OIPPacket @@ -448,8 +484,10 @@ class OIPPacket : public QObject int checksum() const; private: const struct iphdr* _iphdr; + class Private; + Private *d; }; /*====================================================================================== * OARPPacket @@ -472,8 +510,10 @@ class OARPPacket : public QObject QString type() const; private: const struct myarphdr* _arphdr; + class Private; + Private *d; }; /*====================================================================================== * OUDPPacket @@ -493,8 +533,10 @@ class OUDPPacket : public QObject int checksum() const; private: const struct udphdr* _udphdr; + class Private; + Private *d; }; /*====================================================================================== * ODHCPPacket @@ -521,8 +563,10 @@ class ODHCPPacket : public QObject private: const struct dhcp_packet* _dhcphdr; unsigned char _type; + class Private; + Private *d; }; /*====================================================================================== * OTCPPacket @@ -544,8 +588,10 @@ class OTCPPacket : public QObject int checksum() const; private: const struct tcphdr* _tcphdr; + class Private; + Private *d; }; /*====================================================================================== @@ -664,8 +710,12 @@ class OPacketCapturer : public QObject pcap_dumper_t* _pcd; // pcap dumper handle 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 @@ -30,8 +30,13 @@ #include <opie2/ostation.h> #include <opie2/odebug.h> + +using namespace Opie::Core; + +namespace Opie { +namespace Net { /*====================================================================================== * OStation *======================================================================================*/ @@ -61,4 +66,7 @@ void OStation::dump() qDebug( "mac: %s", (const char*) macAddress.toString() ); 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 @@ -39,10 +39,14 @@ #include <qobject.h> #include <sys/types.h> +namespace Opie { +namespace Net { + class OStation; + typedef QList<OStation> OStationList; /*====================================================================================== * OStation @@ -65,9 +69,14 @@ class OStation QString ssid; OMacAddress apAddress; int channel; bool encrypted; + private: + class Private; + Private *d; }; +} +} #endif // OSTATION_H |