|
@@ -3,7 +3,6 @@
|
|
|
#include <string>
|
|
|
#include <algorithm>
|
|
|
#include <regex>
|
|
|
-#include "CommEntityUtil.hpp"
|
|
|
#include "SpUtility.h"
|
|
|
#include "iniutil.h"
|
|
|
#if defined(RVC_OS_WIN)
|
|
@@ -90,6 +89,8 @@ ErrorCodeEnum CHealthManagerFSM::Initial()
|
|
|
GetEntityBase()->GetFunction()->SetSysVar("TerminalStage", "X");
|
|
|
WaitDeamonFinishTask* task = new WaitDeamonFinishTask(this);
|
|
|
GetEntityBase()->GetFunction()->PostThreadPoolTask(task);
|
|
|
+ m_netList.Init(0);
|
|
|
+ SP::Module::Net::GetINETMacAddresses(m_netList);
|
|
|
|
|
|
return Error_Succeed;
|
|
|
}
|
|
@@ -829,21 +830,20 @@ void CHealthManagerFSM::ToLogWarnTermAboutInfo()
|
|
|
CSmartPointer<IConfigInfo> spConfigRun;
|
|
|
GetEntityBase()->GetFunction()->OpenConfig(Config_Run, spConfigRun);
|
|
|
|
|
|
- CAutoArray<SP::Module::Net::NetworkAdapterItem> netList;
|
|
|
- SP::Module::Net::GetINETMacAddresses(netList);
|
|
|
+ //CAutoArray<SP::Module::Net::NetworkAdapterItem> netList;
|
|
|
+ if (m_netList.GetCount() == 0)
|
|
|
+ SP::Module::Net::GetINETMacAddresses(m_netList);
|
|
|
CSimpleStringA csMac(""), csIP(""), csDNS("");
|
|
|
- for (int i = 0; i < netList.GetCount(); i++) {
|
|
|
+ for (int i = 0; i < m_netList.GetCount(); i++) {
|
|
|
if (!csMac.IsNullOrEmpty()) {
|
|
|
csMac += ";";
|
|
|
}
|
|
|
- csMac += netList[i].mac.c_str();
|
|
|
- }
|
|
|
- for (int i = 0; i < netList.GetCount(); i++) {
|
|
|
+ csMac += m_netList[i].mac.c_str();
|
|
|
if (!csIP.IsNullOrEmpty()) {
|
|
|
csIP += ";";
|
|
|
}
|
|
|
- csIP += netList[i].ip.c_str();
|
|
|
- }
|
|
|
+ csIP += m_netList[i].ip.c_str();
|
|
|
+ }
|
|
|
for (int i = 0; i < m_dns.GetCount(); i++) {
|
|
|
if (!csDNS.IsNullOrEmpty()) {
|
|
|
csDNS += ";";
|
|
@@ -1042,13 +1042,14 @@ void CHealthManagerFSM::QueryHardwareInfo(SpReqAnsContext<HealthManagerService_Q
|
|
|
CSystemStaticInfo info;
|
|
|
GetEntityBase()->GetFunction()->GetSystemStaticInfo(info);
|
|
|
|
|
|
- CAutoArray<SP::Module::Net::NetworkAdapterItem> netList;
|
|
|
- SP::Module::Net::GetINETMacAddresses(netList);
|
|
|
+ //CAutoArray<SP::Module::Net::NetworkAdapterItem> netList;
|
|
|
+ if (m_netList.GetCount() == 0)
|
|
|
+ SP::Module::Net::GetINETMacAddresses(m_netList);
|
|
|
|
|
|
CAutoArray<CSimpleStringA> ipAddrs, macAddrs;
|
|
|
- for (int i = 0; i < netList.GetCount(); i++) {
|
|
|
- CSimpleStringA tmpip = netList[i].ip.c_str();
|
|
|
- CSimpleStringA tmpmac = netList[i].mac.c_str();
|
|
|
+ for (int i = 0; i < m_netList.GetCount(); i++) {
|
|
|
+ CSimpleStringA tmpip = m_netList[i].ip.c_str();
|
|
|
+ CSimpleStringA tmpmac = m_netList[i].mac.c_str();
|
|
|
ipAddrs.Append(&tmpip, 0, 1);
|
|
|
macAddrs.Append(&tmpmac, 0, 1);
|
|
|
}
|