-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathmypingthread.h
More file actions
37 lines (32 loc) · 788 Bytes
/
Copy pathmypingthread.h
File metadata and controls
37 lines (32 loc) · 788 Bytes
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
37
// ---------------------------------------------
// 过滤抓包(ICMP 指定IP包)单线程
// ---------------------------------------------
#ifndef MYPINGTHREAD_H
#define MYPINGTHREAD_H
#include <QThread>
#include "tcpipcommon.h"
#include "tcpipprotocol.h"
#include "pcap.h"
class MyPingThread : public QThread
{
Q_OBJECT
public:
MyPingThread();
MyPingThread(HostInfo *hostInfo,const char*dev,QString filter);
void quitThread();
private:
bool init();
void filterStart();
void run();
private:
pcap_t * handle;
HostInfo *hostInfo;
QString filter;
bool quitFg;
YEthernetPacket * ethernetPacket;
YArpPacket *arppacket;
YIPHeaderPacket *eippacket;
signals:
void pingUpdateDataSig(QString data);
};
#endif // MYPINGTHREAD_H