基本完成网络设置模块,还有一些细节需要完善。
This commit is contained in:
52
src/device/networkmanager.h
Normal file
52
src/device/networkmanager.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef NETWORKMANAGER_H
|
||||
#define NETWORKMANAGER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
#include "json/jsonobject.h"
|
||||
|
||||
class NetworkManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
//static NetworkManager* Instance();
|
||||
//static void qIfConfig(const localhost& lhost);
|
||||
static QString interfaceName();
|
||||
static bool isDHCP();
|
||||
static IpAddr getDefaultIpAddr();
|
||||
static QList<QStringList> getIpAddrList();
|
||||
static QString getDefaultGateway();
|
||||
static QList<QStringList> getIpRouteList();
|
||||
|
||||
//static void setInterfaceName(const QString& name);
|
||||
static bool restart(QString& err_info);
|
||||
static bool setJsonDHCP(bool enable);
|
||||
|
||||
static bool setDefaultIpAddr(const IpAddr& addr, QString& err_info);
|
||||
static bool setIpAddrList(const QList<QStringList>& list, QString& err_info);
|
||||
static bool setDefaultGateway(const QString& gw, QString& err_info);
|
||||
static bool setIpRouteList(const QList<QStringList>& list, QString& err_info);
|
||||
static QString NewExp(QString ip, QString mask);
|
||||
|
||||
|
||||
static bool testSetMode(QString& err_info);
|
||||
static void testGetMode();
|
||||
//private:
|
||||
//explicit NetworkManager(QObject* parent = nullptr);
|
||||
//static NetworkManager* instance;
|
||||
|
||||
|
||||
//QString InterfaceName;
|
||||
//bool isDHCP;
|
||||
//IpAddress default_IpAddr;
|
||||
//QList<IpAddress> addresses;
|
||||
|
||||
//IpRoute default_IpRoute;
|
||||
//QList<IpRoute> routes;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // NETWORKMANAGER_H
|
||||
Reference in New Issue
Block a user