qt/ledset/mainwin.h
2022-12-16 16:16:12 +08:00

43 lines
784 B
C++

#ifndef MAINWIN_H
#define MAINWIN_H
#include "basewin.h"
#include "table.h"
#define HAVE_REMOTE
#include <winsock2.h>
#include "pcap.h"
#include <QThread>
class MainPcapThread : public QThread {
Q_OBJECT
public:
explicit MainPcapThread(pcap *pcap);
~MainPcapThread() {
pcap_close(pcap);
}
pcap *pcap;
std::atomic<char> status{0};
protected:
void run();
signals:
void onMsg(const u_char *data,int len);
void onError(char *);
};
class MainWin : public BaseWin {
Q_OBJECT
public:
MainWin();
QWidget *win{0};
QByteArray net_name;
pcap_t *pcapRe{0};
pcap_t *pcapSend{0};
MainPcapThread *thd{0};
Table *table = nullptr;
protected slots:
void ProNetData(const u_char *data,int len);
};
#endif // MAINWIN_H