#ifndef PCAPRETHREAD_H #define PCAPRETHREAD_H #include "waitingdlg.h" #include "pcap.h" #include typedef std::function FuncIntByte; #define LineLen 16 struct PcapResp { FuncIntByte callback; int id; qint64 timeout; bool notCancelled{true}; }; class PcapReThread : public QThread { Q_OBJECT public: explicit PcapReThread(pcap *pcap); ~PcapReThread(); int sendMsgNet(const byte *msg, int size, int id, qint64 timeout, FuncIntByte callback, WaitingDlg *waitingDlg = 0); QList resps; std::mutex mtx; pcap *pcap; std::atomic status{0}; char fmt{0}; signals: void onCallback(FuncIntByte callback, int code, const QByteArray data); void onMsg(const QString &); void onError(char *); protected: void run(); }; #endif // PCAPRETHREAD_H