Lines Matching refs:iface

60 int32_t EthernetManagement::DevInterfaceStateCallback::OnInterfaceAdded(const std::string &iface)
63 if (std::regex_search(iface, re)) {
64 ethernetManagement_.DevInterfaceAdd(iface);
65 if (NetsysController::GetInstance().SetInterfaceUp(iface) != ERR_NONE) {
66 NETMGR_EXT_LOG_E("Iface[%{public}s] added set up fail!", iface.c_str());
72 int32_t EthernetManagement::DevInterfaceStateCallback::OnInterfaceRemoved(const std::string &iface)
75 if (std::regex_search(iface, re)) {
76 ethernetManagement_.DevInterfaceRemove(iface);
77 if (NetsysController::GetInstance().SetInterfaceDown(iface) != ERR_NONE) {
78 NETMGR_EXT_LOG_E("Iface[%{public}s] added set down fail!", iface.c_str());
98 NETMGR_EXT_LOG_I("OnInterfaceLinkStateChanged iface[%{public}s] up[%{public}d], cost=%{public}lld",
115 const std::string &iface)
191 NETMGR_EXT_LOG_E("EthernetManagement iface list is empty");
194 for (const auto &iface : ifaceLists) {
195 if (std::regex_search(iface, re)) {
197 auto spMacAddr = GetMacAddr(iface);
199 NETMGR_EXT_LOG_E("The iface[%{public}s] device does not find MAC address", iface.c_str());
202 macAddressInfo.iface_ = iface;
214 std::string EthernetManagement::GetMacAddr(const std::string &iface)
216 NETMGR_EXT_LOG_D("GetMacAddr when iface is [%{public}s]", iface.c_str());
221 strncpy_s(ifr.ifr_name, IFNAMSIZ, iface.c_str(), iface.length());
248 int32_t EthernetManagement::UpdateDevInterfaceCfg(const std::string &iface, sptr<InterfaceConfiguration> cfg)
255 auto fit = devs_.find(iface);
257 NETMGR_EXT_LOG_E("The iface[%{public}s] device or device information does not exist", iface.c_str());
261 NETMGR_EXT_LOG_E("The iface[%{public}s] device is unlink", iface.c_str());
265 NETMGR_EXT_LOG_E("The iface[%{public}s] device can not exchange between WAN and LAN", iface.c_str());
268 if (!ethConfiguration_->WriteUserConfiguration(iface, cfg)) {
274 StartDhcpClient(iface, fit->second);
276 StopDhcpClient(iface, fit->second);
277 netLinkConfigs_[iface] = nullptr;
289 devCfgs_[iface] = cfg;
297 auto fit = devs_.find(dhcpResult.iface);
299 NETMGR_EXT_LOG_E("The iface[%{public}s] device or device information does not exist", dhcpResult.iface.c_str());
303 NETMGR_EXT_LOG_E("The iface[%{public}s] The device is not turned on", dhcpResult.iface.c_str());
309 NETMGR_EXT_LOG_E("The iface[%{public}s] set mode is STATIC now", dhcpResult.iface.c_str());
313 auto &config = netLinkConfigs_[dhcpResult.iface];
317 NETMGR_EXT_LOG_E("Iface:%{public}s's link info config is nullptr", dhcpResult.iface.c_str());
336 int32_t EthernetManagement::GetDevInterfaceCfg(const std::string &iface, sptr<InterfaceConfiguration> &ifaceConfig)
339 auto fit = devs_.find(iface);
341 NETMGR_EXT_LOG_E("The iface[%{public}s] device does not exist", iface.c_str());
356 int32_t EthernetManagement::IsIfaceActive(const std::string &iface, int32_t &activeStatus)
359 auto fit = devs_.find(iface);
361 NETMGR_EXT_LOG_E("The iface[%{public}s] device does not exist", iface.c_str());
445 bool EthernetManagement::IsIfaceLinkUp(const std::string &iface)
448 config.ifName = iface;
456 UpdateInterfaceState(iface, true);