#ifndef PCAPTHREAD_H #define PCAPTHREAD_H #include #include #include "pcap.h" #include #pragma comment(lib, "wpcap.lib") #pragma comment(lib, "Ws2_32.lib") #define LINE_LEN 16 #define MAX_ADDR_LEN 16 struct Packet { QString time; u_int len; u_int caplen; QString data; }; class CapThread : public QThread { Q_OBJECT public: explicit CapThread(pcap *pcap, QObject *parent = nullptr); void setPacketList(QList *p){p->clear();packet_list=p;} pcap *pcap{0}; QList *packet_list; Packet packet; protected: void run(); signals: void onMsg(); }; #endif // PCAPTHREAD_H