-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlistenthread.h
More file actions
36 lines (31 loc) · 1.06 KB
/
listenthread.h
File metadata and controls
36 lines (31 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef LISTENTHREAD_H
#define LISTENTHREAD_H
#include <QMainWindow>
#include <QThread>
#include <QStandardItemModel>
#include "mainwindow.h"
#include "pcap.h"
#define HAVE_REMOTE
class listenThread : public QThread
{
Q_OBJECT
public:
listenThread(MainWindow *mainW,Ui::MainWindow *ui,pcap_t *adhandle);
//~listenThread();
static void packet_handler(const struct pcap_pkthdr *header, const unsigned char *pkt_data);
static int countIPPacket[4];
static QStandardItemModel *packetTableModel;
void run();
private:
//static QList<QString> packetList;
MainWindow *mainW;
Ui::MainWindow *ui;
pcap_t *adhandle;
static void packetWrite(u_char *rest_packet,int tempCount, int restPacketLen);
static int count;
static void analyzeIP(const u_char *rest_pkt_data,int tempCount);
static void analyzeARP(const u_char *rest_pkt_data,int tempCount);
static void analyzeRARP(const u_char *rest_pkt_data,int tempCount);
static void unknownEthernetPacket(int tempCount);
};
#endif // LISTENTHREAD_H