Home
last modified time | relevance | path

Searched refs:ipAddr (Results 1 – 25 of 101) sorted by relevance

12345

/foundation/communication/wifi/wifi/test/wifi_standard/native/
Dwifi_c_utils_test.cpp44 unsigned int ipAddr[IPV4_ARRAY_LEN] = {0}; in IpStrToArraySuccess() local
46 EXPECT_TRUE(IpStrToArray(str, ipAddr) == WIFI_SUCCESS); in IpStrToArraySuccess()
51 unsigned int ipAddr[IPV4_ARRAY_LEN] = {0}; in IpStrToArrayFail() local
53 EXPECT_TRUE(IpStrToArray(str, ipAddr) == ERROR_WIFI_INVALID_ARGS); in IpStrToArrayFail()
58 unsigned int ipAddr[IPV4_ARRAY_LEN] = {192, 168, 1, 23}; in IpArrayToStrSuccess() local
59 EXPECT_EQ(IpArrayToStr(ipAddr), "192.168.1.23"); in IpArrayToStrSuccess()
/foundation/communication/dsoftbus/tests/core/bus_center/lnn/unittest/
Dnet_buscenter_test.cpp204 char ipAddr[IP_LEN] = {0}; variable
209 EXPECT_TRUE(LnnGetLocalStrInfo(STRING_KEY_WLAN_IP, ipAddr, IP_LEN) == SOFTBUS_OK);
210 EXPECT_TRUE(strncmp(ipAddr, ip, IP_LEN) == 0);
221 char ipAddr[IP_LEN] = {0}; variable
225 EXPECT_TRUE(LnnGetLocalStrInfo(STRING_KEY_WLAN_IP, ipAddr, IP_LEN) == SOFTBUS_OK);
226 EXPECT_TRUE(strncmp(ipAddr, "127.0.0.1", IP_LEN) == 0);
237 char ipAddr[IP_LEN] = {0}; variable
240 EXPECT_TRUE(LnnGetLocalStrInfo(STRING_KEY_WLAN_IP, ipAddr, IP_LEN) == SOFTBUS_OK);
241 EXPECT_TRUE(strncmp(ipAddr, "127.0.0.1", IP_LEN) == 0);
/foundation/communication/netmanager_base/services/netmanagernative/src/netsys/
Dnetlink_socket_diag.cpp150 bool NetLinkSocketDiag::IsMatchNetwork(const inet_diag_msg *msg, const std::string &ipAddr) in IsMatchNetwork() argument
153 if (CommonUtils::GetAddrFamily(ipAddr) != AF_INET) { in IsMatchNetwork()
157 in_addr_t addr = inet_addr(ipAddr.c_str()); in IsMatchNetwork()
164 if (CommonUtils::GetAddrFamily(ipAddr) != AF_INET6) { in IsMatchNetwork()
172 if (src == ipAddr || dst == ipAddr) { in IsMatchNetwork()
179 int32_t NetLinkSocketDiag::ProcessSockDiagDumpResponse(uint8_t proto, const std::string &ipAddr, bo… in ProcessSockDiagDumpResponse() argument
199 SockDiagDumpCallback(proto, msg, ipAddr, excludeLoopback); in ProcessSockDiagDumpResponse()
232 …ocketDiag::SockDiagDumpCallback(uint8_t proto, const inet_diag_msg *msg, const std::string &ipAddr, in SockDiagDumpCallback() argument
245 if (!IsMatchNetwork(msg, ipAddr)) { in SockDiagDumpCallback()
253 void NetLinkSocketDiag::DestroyLiveSockets(const char *ipAddr, bool excludeLoopback) in DestroyLiveSockets() argument
[all …]
/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/net_helper/
Dif_config.h43 …void AddIpAddr(const std::string &ifName, const std::string &ipAddr, const std::string &mask, cons…
50 bool GetIpAddr(const std::string& ifName, std::string& ipAddr);
64 void AddIfRoute(const std::string &ifName, const std::string &ipAddr, const std::string &mask,
68 …const std::string &ifName, const std::string &ipAddr, const std::string &mask, const std::string &…
71 …const std::string &ifName, const std::string &ipAddr, const std::string &mask, const std::string &…
Dipv4_address.cpp104 in_addr ipAddr = GetMaskWithInet(); in GetMaskWithString() local
105 if (inet_ntop(AF_INET, &ipAddr, ipStr, sizeof(ipStr)) == nullptr) { in GetMaskWithString()
124 in_addr ipAddr = GetNetworkAddressWithInet(); in GetNetworkAddressWithString() local
125 if (inet_ntop(AF_INET, &ipAddr, ipStr, sizeof(ipStr)) == nullptr) { in GetNetworkAddressWithString()
141 in_addr ipAddr = GetHostAddressWithInet(); in GetHostAddressWithString() local
142 if (inet_ntop(AF_INET, &ipAddr, ipStr, sizeof(ipStr)) == nullptr) { in GetHostAddressWithString()
Dif_config.cpp159 … const std::string &ifName, const std::string &ipAddr, const std::string &mask, const int &ipType) in AddIpAddr() argument
178 if (inet_aton(ipAddr.c_str(), &(sin->sin_addr)) < 0) { in AddIpAddr()
215 ipRouteCmd.push_back(ipAddr); in AddIpAddr()
256 bool IfConfig::GetIpAddr(const std::string& ifName, std::string& ipAddr) in GetIpAddr() argument
275 ipAddr = inet_ntoa(sin->sin_addr); in GetIpAddr()
347 void IfConfig::AddIfRoute(const std::string &ifName, const std::string &ipAddr, const std::string &… in AddIfRoute() argument
351 AddIpv4Route(ifName, ipAddr, mask, gateWay); in AddIfRoute()
353 AddIpv6Route(ifName, ipAddr, mask, gateWay); in AddIfRoute()
363 …const std::string &ifName, const std::string &ipAddr, const std::string &mask, const std::string &… in AddIpv4Route() argument
367 ipAddr.c_str(), in AddIpv4Route()
[all …]
/foundation/communication/dsoftbus/adapter/common/kernel/liteos_m/
Dlnn_ip_utils_adapter.c31 ip4_addr_t *ipAddr = NULL; in GetNetworkIpByIfName() local
40 netifapi_netif_get_addr(netif, ipAddr, netMask, NULL); in GetNetworkIpByIfName()
42 ipAddr = (ip4_addr_t *)netif_ip4_addr(netif); in GetNetworkIpByIfName()
45 ipStr = ip4addr_ntoa(ipAddr); in GetNetworkIpByIfName()
/foundation/communication/netmanager_base/services/netmanagernative/include/netsys/
Dnetlink_socket_diag.h40 void DestroyLiveSockets(const char *ipAddr, bool excludeLoopback);
50 bool IsMatchNetwork(const inet_diag_msg *msg, const std::string &ipAddr);
51 …int32_t ProcessSockDiagDumpResponse(uint8_t proto, const std::string &ipAddr, bool excludeLoopback…
53 …void SockDiagDumpCallback(uint8_t proto, const inet_diag_msg *msg, const std::string &ipAddr, bool…
/foundation/communication/wifi/wifi/frameworks/native/c_adapter/src/
Dwifi_c_utils.cpp47 WifiErrorCode IpStrToArray(const std::string& str, unsigned int ipAddr[IPV4_ARRAY_LEN]) { in IpStrToArray()
53 ipAddr[i] = std::stoi(vec[i]); in IpStrToArray()
58 std::string IpArrayToStr(const unsigned int ipAddr[IPV4_ARRAY_LEN]) { in IpArrayToStr()
61 str += std::to_string(ipAddr[i]); in IpArrayToStr()
/foundation/communication/wifi/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/
Dif_config_test.cpp47 std::string ipAddr = ""; variable
50 IfConfig::GetInstance().AddIpAddr(ifName, ipAddr, mask, ipType);
62 std::string ipAddr = ""; variable
65 IfConfig::GetInstance().AddIpAddr(ifName, ipAddr, mask, ipType);
Darp_checker_test.cpp32 std::string ipAddr = "10.3.1"; in SetUp() local
33 pArpChecker = std::make_unique<ArpChecker>(ifname, hwAddr, ipAddr); in SetUp()
/foundation/communication/netmanager_ext/services/ethernetmanager/src/
Dethernet_configuration.cpp212 INetAddr ipAddr; in ConvertToConfiguration() local
213 ipAddr.address_ = dhcpResult.ipAddr; in ConvertToConfiguration()
214 ipAddr.family_ = static_cast<uint8_t>(CommonUtils::GetAddrFamily(dhcpResult.ipAddr)); in ConvertToConfiguration()
215 ipAddr.prefixlen_ = (ipAddr.family_ == AF_INET6) in ConvertToConfiguration()
218 config->ipAddrList_.push_back(ipAddr); in ConvertToConfiguration()
232 route.prefixlen_ = ipAddr.prefixlen_; in ConvertToConfiguration()
235 route.prefixlen_ = ipAddr.prefixlen_; in ConvertToConfiguration()
237 route.address_ = (ipAddr.family_ == AF_INET6) ? DEFAULT_IPV6_ADDR : DEFAULT_IPV4_ADDR; in ConvertToConfiguration()
265 for (const auto &ipAddr : devLinkInfo->netAddrList_) { in MakeInterfaceConfiguration() local
266 cfg->ipStatic_.ipAddrList_.push_back(ipAddr); in MakeInterfaceConfiguration()
[all …]
Ddev_interface_state.cpp207 for (const auto &ipAddr : ifCfg_->ipStatic_.ipAddrList_) { in UpdateLinkInfo() local
208 linkInfo_->netAddrList_.push_back(ipAddr); in UpdateLinkInfo()
243 for (const auto &ipAddr : config->ipAddrList_) { in UpdateLinkInfo() local
244 linkInfo_->netAddrList_.push_back(ipAddr); in UpdateLinkInfo()
278 for (const auto &ipAddr : ipAddrList) { in CreateLocalRoute() local
279 auto family = CommonUtils::GetAddrFamily(ipAddr.address_); in CreateLocalRoute()
280 …ng routeAddr = (family == AF_INET6) ? CommonUtils::GetIpv6Prefix(ipAddr.address_, ipAddr.prefixlen… in CreateLocalRoute()
281 : GetIpv4Prefix(ipAddr.address_, netMaskList); in CreateLocalRoute()
286 localRoute.destination_.prefixlen_ = ipAddr.prefixlen_; in CreateLocalRoute()
339 … [&data, &TAB](const auto &ipAddr) { data.append(TAB + TAB + ipAddr.ToString(TAB)); }); in GetDumpInfo() argument
/foundation/communication/dsoftbus/core/bus_center/lnn/lane_hub/lane_manager/include/
Dlnn_lane_link.h94 void LaneAddP2pAddress(const char *networkId, const char *ipAddr, uint16_t port);
96 void LaneAddP2pAddressByIp(const char *ipAddr, uint16_t port);
97 void LaneUpdateP2pAddressByIp(const char *ipAddr, const char *networkId);
/foundation/communication/wifi/wifi/frameworks/native/c_adapter/inc/
Dwifi_c_utils.h62 WifiErrorCode IpStrToArray(const std::string& str, unsigned int ipAddr[IPV4_ARRAY_LEN]);
71 std::string IpArrayToStr(const unsigned int ipAddr[IPV4_ARRAY_LEN]);
/foundation/communication/wifi/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_ap/Mock/
Doperator_overload.cpp28 if (a.ipAddr != b.ipAddr) { in operator ==()
/foundation/communication/netmanager_base/services/netconnmanager/src/
Dnet_monitor.cpp165 std::string ipAddr; in SendHttpProbe() local
166 if (GetIpAddr(defaultDomain, ipAddr, socketType)) { in SendHttpProbe()
181 if (Connect(sockFd, socketType, defaultPort, ipAddr) < 0) { in SendHttpProbe()
201 …NetMonitor::Connect(int32_t sockFd, int socketType, const uint16_t port, const std::string &ipAddr) in Connect() argument
223 return ConnectIpv6(sockFd, port, ipAddr); in Connect()
225 return ConnectIpv4(sockFd, port, ipAddr); in Connect()
229 int32_t NetMonitor::ConnectIpv4(int32_t sockFd, const uint16_t port, const std::string &ipAddr) in ConnectIpv4() argument
232 CommonUtils::ToAnonymousIp(ipAddr).c_str(), sockFd); in ConnectIpv4()
237 serverAddr.sin_addr.s_addr = inet_addr(ipAddr.c_str()); in ConnectIpv4()
242 CommonUtils::ToAnonymousIp(ipAddr).c_str(), errno, strerror(errno)); in ConnectIpv4()
[all …]
/foundation/communication/netmanager_base/services/netconnmanager/include/
Dnet_monitor.h99 int32_t Connect(int32_t sockFd, int socketType, const uint16_t port, const std::string &ipAddr);
110 int32_t ConnectIpv4(int32_t sockFd, const uint16_t port, const std::string &ipAddr);
121 int32_t ConnectIpv6(int32_t sockFd, const uint16_t port, const std::string &ipAddr);
/foundation/communication/dsoftbus/tools/device_info/
Dget_device_info.c54 unsigned char ipAddr[IP_STR_MAX_LEN] = {0}; in PrintNodeProperty() local
56 ipAddr, IP_STR_MAX_LEN) != 0) { in PrintNodeProperty()
59 printf("ipAddr = %s\n", ipAddr); in PrintNodeProperty()
/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_ap/
Dap_stations_manager.cpp126 …if (staInfo.deviceName == OHOS::Wifi::GETTING_INFO && staInfo.ipAddr == OHOS::Wifi::GETTING_INFO) { in StationJoin()
138 if (it == results.end() || it->ipAddr != staInfo.ipAddr) { in StationJoin()
154 IpAnonymize(staInfo.ipAddr).c_str(), in DisConnectStation()
/foundation/communication/dsoftbus/core/bus_center/lnn/lane_hub/lane_manager/src/
Dlnn_lane_link.c116 void LaneAddP2pAddress(const char *networkId, const char *ipAddr, uint16_t port) in LaneAddP2pAddress() argument
133 if (strcpy_s(item->addr, MAX_SOCKET_ADDR_LEN, ipAddr) != EOK) { in LaneAddP2pAddress()
149 if (strcpy_s(p2pAddrNode->addr, MAX_SOCKET_ADDR_LEN, ipAddr) != EOK) { in LaneAddP2pAddress()
161 void LaneAddP2pAddressByIp(const char *ipAddr, uint16_t port) in LaneAddP2pAddressByIp() argument
172 if (strcmp(item->addr, ipAddr) == 0) { in LaneAddP2pAddressByIp()
185 if (strcpy_s(p2pAddrNode->addr, MAX_SOCKET_ADDR_LEN, ipAddr) != EOK) { in LaneAddP2pAddressByIp()
198 void LaneUpdateP2pAddressByIp(const char *ipAddr, const char *networkId) in LaneUpdateP2pAddressByIp() argument
208 if (strcmp(item->addr, ipAddr) == 0) { in LaneUpdateP2pAddressByIp()
218 static bool LaneGetP2PReuseMac(const char *networkId, char *ipAddr, uint32_t maxLen, uint16_t *port) in LaneGetP2PReuseMac() argument
227 if (strcpy_s(ipAddr, maxLen, item->addr) != EOK) { in LaneGetP2PReuseMac()
[all …]
/foundation/communication/dsoftbus/core/connection/p2p/adapter/
Dp2plink_adapter.c264 static bool GetIpAddr(const char *ifName, char *ipAddr, int32_t len) in GetIpAddr() argument
284 if (inet_ntop(sin->sin_family, &sin->sin_addr, ipAddr, len) == NULL) { in GetIpAddr()
294 char ipAddr[P2P_IP_LEN] = {0}; in P2pLinkGetP2pIpAddress() local
311 if (!GetIpAddr(groupInfo->interface, ipAddr, sizeof(ipAddr))) { in P2pLinkGetP2pIpAddress()
317 ret = strcpy_s(ip, len, ipAddr); in P2pLinkGetP2pIpAddress()
571 unsigned int ipAddr[IPV4_ARRAY_LEN] = {0}; in P2pLinkRequestGcIp() local
579 int32_t ret = Hid2dRequestGcIp(p2pBaseMac, ipAddr); in P2pLinkRequestGcIp()
587 ipAddr[IP_INDEX_ZERO], ipAddr[IP_INDEX_ONE], ipAddr[IP_INDEX_TWO], ipAddr[IP_INDEX_TREE]); in P2pLinkRequestGcIp()
/foundation/communication/dhcp/services/dhcp_server/include/
Daddress_utils.h42 uint32_t ParseIp(const uint8_t *ipAddr);
43 const char *ParseStrIp(uint32_t ipAddr);
/foundation/communication/netmanager_base/test/netconnmanager/unittest/net_conn_manager_test/
Dnet_monitor_test.cpp127 std::string ipAddr = "192.168.111.11"; variable
128 int32_t ret = instance_->ConnectIpv4(sockFd, port, ipAddr);
136 std::string ipAddr = "192.168.111.11"; variable
137 int32_t ret = instance_->ConnectIpv6(sockFd, port, ipAddr);
/foundation/communication/dhcp/services/dhcp_server/src/
Daddress_utils.c188 uint32_t ParseIp(const uint8_t *ipAddr) in ParseIp() argument
191 if (memcpy_s(&ip, IP_ADDRESS_LENGTH, ipAddr, IP_ADDRESS_LENGTH) != EOK) { in ParseIp()
197 const char *ParseStrIp(uint32_t ipAddr) in ParseStrIp() argument
201 if (memcpy_s(&inAddr, sizeof(inAddr), &ipAddr, sizeof(ipAddr)) != EOK || in ParseStrIp()

12345