| 1 | #ifndef CNETSTAT_H |
| 2 | #define CNETSTAT_H |
| 3 | |
| 4 | #include <QObject> |
| 5 | #include <QString> |
| 6 | #include <QStringList> |
| 7 | #include <QVector> |
| 8 | #include <QTime> |
| 9 | #include <QThread> |
| 10 | |
| 11 | #include "ProcessList.h" |
| 12 | |
| 13 | #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) |
| 14 | #include "ProcessListLinux.h" |
| 15 | #endif |
| 16 | #if defined(Q_OS_WIN) |
| 17 | #include "ProcessListWindows.h" |
| 18 | #endif |
| 19 | |
| 20 | class cNetStat : public QThread { |
| 21 | Q_OBJECT |
| 22 | public: |
| 23 | cNetStat(); |
| 24 | QVector<sNetStat> getNetStat(); |
| 25 | void run(); |
| 26 | |
| 27 | private: |
| 28 | QString convAddress(QString address, QString ipv); |
| 29 | QVector<sNetStat> getTable(); |
| 30 | void writeLog(QString str); |
| 31 | |
| 32 | |
| 33 | QVector<sNetStat> save_netstat; |
| 34 | |
| 35 | signals: |
| 36 | void endReadStat(QVector<sNetStat>); |
| 37 | }; |
| 38 | |
| 39 | #endif // CNETSTAT_H |