My Project
mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3 
4 #include <QMainWindow>
5 #include <QTableWidget>
6 #include <QPixmap>
7 #include "sniffer.h"
8 #include <QThread>
9 #include <QWaitCondition>
10 #include <QMutex>
11 #include <string>
12 #include <QStringList>
13 #include <QNetworkAccessManager>
14 #include <QNetworkReply>
15 #include <QUrl>
16 #include <QListWidgetItem>
17 #include <QIcon>
18 #include "imagepacket.h"
19 
20 using namespace std ;
21 
22 namespace Ui {
23 class MainWindow;
24 }
25 
26 class MainWindow : public QMainWindow
27 {
28  Q_OBJECT
29 
30 public:
31 
37  explicit MainWindow(QWidget *parent = 0);
38 
44  ~MainWindow();
45 
46 private slots:
47 
53  void on_capture_clicked();
54 
64  void on_packetDisplay_itemClicked(QTableWidgetItem *item);
65 
73  void on_resetButton_clicked();
74 
75 public slots:
76 
89  void handleResults(unsigned long index) ;
90 
100  void slot_netwManagerFinished(QNetworkReply *reply) ;
101 private:
102  Ui::MainWindow *ui;
104  QThread sniff_thread ;
105  QWaitCondition wait_pause ;
106  int pause ;
107  QMutex mutex ;
108  QStringList imageList ;
109  QNetworkAccessManager *netManager ;
110 };
111 
112 #endif // MAINWINDOW_H
QWaitCondition wait_pause
Definition: mainwindow.h:105
Definition: mainwindow.h:22
QMutex mutex
Definition: mainwindow.h:107
QNetworkAccessManager * netManager
Definition: mainwindow.h:109
Sniffer * sniff
Definition: mainwindow.h:103
QThread sniff_thread
Definition: mainwindow.h:104
Definition: mainwindow.h:26
int pause
Definition: mainwindow.h:106
The Sniffer class is the one that use the pcap library to extract the packet information. It discards any packet that is not Ethernet->IP->(TCP|UDP), and pass up to the GUI the packets that are Ethernet->IP->(TCP|UDP).
Definition: sniffer.h:40
QStringList imageList
Definition: mainwindow.h:108