Refactory network module.
This commit is contained in:
@@ -12,21 +12,20 @@ class NetworkManager : public QObject
|
||||
public:
|
||||
static host getLocalHost();
|
||||
static bool setLocalHost(const host& h);
|
||||
//static NetworkManager* Instance();
|
||||
static NetworkManager* getInstance();
|
||||
//static void qIfConfig(const localhost& lhost);
|
||||
static QString interfaceName();
|
||||
static bool isDHCP();
|
||||
static IpAddr getDefaultIpAddr();
|
||||
bool isDHCP();
|
||||
IpAddr getDefaultIpAddr();
|
||||
static QList<QStringList> getIpAddrList();
|
||||
static QString getDefaultGateway();
|
||||
static QList<QStringList> getIpRouteList();
|
||||
|
||||
//static void setInterfaceName(const QString& name);
|
||||
static bool checkPassWord(const QString& pwd, QString& err_info);
|
||||
static bool restart(QString& err_info);
|
||||
static bool setJsonDHCP(bool enable);
|
||||
|
||||
static bool setDefaultIpAddr(const IpAddr& addr, QString& err_info);
|
||||
bool setDHCP();
|
||||
bool setIpAddr(const IpAddr& addr, const QString& aGateWay, QString& err_info);
|
||||
void initNetworkInfo();
|
||||
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);
|
||||
@@ -34,23 +33,11 @@ public:
|
||||
|
||||
static bool validate(const QString& addr);
|
||||
|
||||
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;
|
||||
|
||||
|
||||
private:
|
||||
explicit NetworkManager(QObject* parent = nullptr);
|
||||
bool mIsDHCP;
|
||||
QString mIpAddress;
|
||||
QString mSubNetMask;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user