00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef WELLENREITER_H
00015 #define WELLENREITER_H
00016
00017 #include "wellenreiterbase.h"
00018
00019 #ifdef QWS
00020 #include <opie2/odevice.h>
00021 #endif
00022
00023 #include <signal.h>
00024
00025 class QTimerEvent;
00026 class QPixmap;
00027 namespace Opie {namespace Net {class OPacket;}}
00028 namespace Opie {namespace Net {class OWaveLanManagementPacket;}}
00029 namespace Opie {namespace Net {class OWaveLanControlPacket;}}
00030 namespace Opie {namespace Net {class OWaveLanDataPacket;}}
00031 namespace Opie {namespace Net {class OEthernetPacket;}}
00032 namespace Opie {namespace Net {class OARPPacket;}}
00033 namespace Opie {namespace Net {class OMacAddress;}}
00034 namespace Opie {namespace Net {class OIPPacket;}}
00035 namespace Opie {namespace Net {class OPacket;}}
00036 namespace Opie {namespace Net {class OWirelessNetworkInterface;}}
00037 namespace Opie {namespace Net {class OPacketCapturer;}}
00038 class PacketView;
00039 class WellenreiterConfigWindow;
00040 class MLogWindow;
00041 class GPS;
00042
00043 class Wellenreiter : public WellenreiterBase {
00044 Q_OBJECT
00045
00046 public:
00047 Wellenreiter( QWidget* parent = 0 );
00048 ~Wellenreiter();
00049
00050 void setConfigWindow( WellenreiterConfigWindow* cw );
00051 MScanListView* netView() const { return netview; };
00052 MLogWindow* logWindow() const { return logwindow; };
00053 PacketView* hexWindow() const { return hexwindow; };
00054 bool isDaemonRunning() const { return sniffing; };
00055 QString captureFileName() const { return dumpname; };
00056
00057 public:
00058 QString dumpname;
00059 bool sniffing;
00060 static Wellenreiter* instance;
00061 static void signalHandler( int sig );
00062
00063 protected:
00064 virtual void timerEvent( QTimerEvent* );
00065
00066 public slots:
00067 void initialTimer();
00068
00069 void channelHopped(int);
00070 void receivePacket(Opie::Net::OPacket*);
00071 void startClicked();
00072 void stopClicked();
00073
00074 signals:
00075 void startedSniffing();
00076 void stoppedSniffing();
00077
00078 private:
00079 void handleManagementFrame( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* );
00080 void handleManagementFrameBeacon( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* );
00081 void handleManagementFrameProbeRequest( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* );
00082 void handleManagementFrameProbeResponse( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* );
00083 void handleControlFrame( Opie::Net::OPacket* p, Opie::Net::OWaveLanControlPacket* control );
00084 void handleWlanData( Opie::Net::OPacket* p, Opie::Net::OWaveLanDataPacket* data, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to );
00085 void handleEthernetData( Opie::Net::OPacket* p, Opie::Net::OEthernetPacket* data, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to );
00086 void handleARPData( Opie::Net::OPacket* p, Opie::Net::OARPPacket* arp, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to );
00087 void handleIPData( Opie::Net::OPacket* p, Opie::Net::OIPPacket* ip, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to );
00088 void handleNotification( Opie::Net::OPacket* p );
00089 void doAction( const QString& action, const QString& protocol, Opie::Net::OPacket* p );
00090 QObject* childIfToParse( Opie::Net::OPacket* p, const QString& protocol );
00091 bool checkDumpPacket( Opie::Net::OPacket* p );
00092 void registerSignalHandler();
00093
00094 private slots:
00095 void slotTabChanged( QWidget* );
00096
00097 private:
00098 void updateStatistics();
00099
00100 #ifdef QWS
00101 Opie::Core::OSystem _system;
00102 #endif
00103
00104 Opie::Net::OWirelessNetworkInterface* iface;
00105 Opie::Net::OPacketCapturer* pcap;
00106 WellenreiterConfigWindow* configwindow;
00107 GPS* gps;
00108
00109
00110
00111 };
00112
00113
00114
00115 #endif