utils.h 409 B

1234567891011121314151617181920
  1. #ifndef __UTILS_H__
  2. #define __UTILS_H__
  3. #include <QObject>
  4. class Utils : public QObject
  5. {
  6. Q_OBJECT
  7. public:
  8. explicit Utils(QObject *parent = nullptr);
  9. static QString timestamp();
  10. static qint64 currentNanoTimestamp();
  11. static bool ipv4(const char *ifname, char **ip_str, char **mask_str);
  12. static QString broadcast(const char *ip_str, const char *mask_str);
  13. };
  14. #endif // UTILS_H