Home
last modified time | relevance | path

Searched refs:sin_addr (Results 1 – 25 of 54) sorted by relevance

123

/foundation/communication/dsoftbus/components/nstackx/nstackx_util/core/
Dnstackx_socket.c202 if (sockAddr->sin_addr.s_addr != 0) { in CreateTcpServer()
203 localAddr.sin_addr.s_addr = sockAddr->sin_addr.s_addr; in CreateTcpServer()
205 localAddr.sin_addr.s_addr = INADDR_ANY; in CreateTcpServer()
213 if (sockAddr->sin_addr.s_addr != 0 && in CreateTcpServer()
264 if (sockAddr->sin_addr.s_addr != 0) { in CreateUdpServer()
265 localAddr.sin_addr.s_addr = sockAddr->sin_addr.s_addr; in CreateUdpServer()
267 localAddr.sin_addr.s_addr = INADDR_ANY; in CreateUdpServer()
274 if (sockAddr->sin_addr.s_addr != 0 && in CreateUdpServer()
Dnstackx_util.c187 uint32_t ip4 = ((const struct sockaddr_in *)addr)->sin_addr.s_addr; in IpAddrAnonymousFormat()
/foundation/communication/dsoftbus/components/nstackx/nstackx_util/platform/liteos/
Dsys_dev.c119 if (sourceIp == ((struct sockaddr_in *)&(buf[i].ifr_addr))->sin_addr.s_addr) { in GetConnectionTypeByDev()
146 if (sourceIP == ((struct sockaddr_in *)&(buf[i].ifr_addr))->sin_addr.s_addr) { in FindDevByInterfaceIP()
226 … if (localAddr->sin_addr.s_addr == ((struct sockaddr_in *)&(buf[i].ifr_addr))->sin_addr.s_addr) { in BindToDevice()
279 if (inet_ntop(AF_INET, &(((struct sockaddr_in *)&(buf[i].ifr_addr))->sin_addr), ipString, in GetIfBroadcastIp()
338 localIp = ((struct sockaddr_in *)(&buf[i].ifr_addr))->sin_addr.s_addr; in GetTargetInterface()
345 netMask = ((struct sockaddr_in *)&(buf[i].ifr_netmask))->sin_addr.s_addr; in GetTargetInterface()
347 if ((dstAddr->sin_addr.s_addr & netMask) == (localIp & netMask)) { in GetTargetInterface()
/foundation/communication/dsoftbus/components/nstackx/nstackx_util/platform/unix/
Dsys_dev.c119 if (sourceIp == ((struct sockaddr_in *)&(buf[i].ifr_addr))->sin_addr.s_addr) { in GetConnectionTypeByDev()
146 if (sourceIP == ((struct sockaddr_in *)&(buf[i].ifr_addr))->sin_addr.s_addr) { in FindDevByInterfaceIP()
231 … if (localAddr->sin_addr.s_addr == ((struct sockaddr_in *)&(buf[i].ifr_addr))->sin_addr.s_addr) { in BindToDevice()
286 if (inet_ntop(AF_INET, &(((struct sockaddr_in *)&(buf[i].ifr_addr))->sin_addr), ipString, in GetIfBroadcastIp()
345 localIp = ((struct sockaddr_in *)(&buf[i].ifr_addr))->sin_addr.s_addr; in GetTargetInterface()
352 netMask = ((struct sockaddr_in *)&(buf[i].ifr_netmask))->sin_addr.s_addr; in GetTargetInterface()
354 if ((dstAddr->sin_addr.s_addr & netMask) == (localIp & netMask)) { in GetTargetInterface()
/foundation/communication/dsoftbus/adapter/common/kernel/posix/
Dlnn_ip_utils_adapter.c42 if (inet_ntop(sockAddr->sin_family, &sockAddr->sin_addr, ip, len) == NULL) { in GetNetworkIfIp()
54 if (inet_ntop(sockAddr->sin_family, &sockAddr->sin_addr, netmask, len) == NULL) { in GetNetworkIfIp()
/foundation/communication/dsoftbus/components/nstackx/fillp/src/public/include/
Dutils.h54 return (port ^ (remoteAddr)->sin_addr.s_addr); in UtilsIpv4AddrPortKey()
99 #define UTILS_IPV4_ADDR_MATCH(a, b) ((a)->sin_addr.s_addr == (b)->sin_addr.s_addr && \
/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/net_helper/
Dif_config.cpp140 if (inet_aton("0.0.0.0", &(sin->sin_addr)) < 0) { in FlushIpAddr()
178 if (inet_aton(ipAddr.c_str(), &(sin->sin_addr)) < 0) { in AddIpAddr()
196 if (inet_aton(mask.c_str(), &(sin->sin_addr)) < 0) { in AddIpAddr()
275 ipAddr = inet_ntoa(sin->sin_addr); in GetIpAddr()
379 if (inet_aton(gateWay.c_str(), &(addr->sin_addr)) < 0) { in AddIpv4Route()
385 addr->sin_addr.s_addr = INADDR_ANY; in AddIpv4Route()
388 addr->sin_addr.s_addr = INADDR_ANY; in AddIpv4Route()
Dnetwork_interface.cpp314 if (inet_aton(IpAddr.c_str(), &(sin->sin_addr)) < 0) { in IpAddressChange()
323 if (inet_aton(Mask.c_str(), &(sin->sin_addr)) < 0) { in IpAddressChange()
/foundation/communication/netmanager_base/services/netmanagernative/src/netsys/dnsresolv/
Ddns_proxy_listen.cpp84 addrParse.sin_addr.s_addr = inet_addr(servers[serversNum].c_str()); in DnsParseBySocket()
85 if (addrParse.sin_addr.s_addr == INADDR_NONE) { in DnsParseBySocket()
140 proxyAddr.sin_addr.s_addr = htonl(INADDR_ANY); in StartListen()
/foundation/communication/dsoftbus/sdk/transmission/trans_channel/udp/file/src/
Dfile_adapter.c107 localAddr.sin_addr.s_addr = SoftBusNtoHl(SoftBusInetAddr(myIp)); in StartNStackXDFileServer()
131 localAddr.sin_addr.s_addr = SoftBusNtoHl(SoftBusInetAddr(peerIp)); in StartNStackXDFileClient()
/foundation/communication/dsoftbus/core/connection/wifi_direct/utils/
Dwifi_direct_network_utils.c157 if (!inet_ntop(sockAddrIn->sin_family, &sockAddrIn->sin_addr, ipString, ipStringSize)) { in GetInterfaceIpString()
250 info[count].address = ntohl(addr->sin_addr.s_addr); in GetLocalIpv4InfoArray()
251 inet_ntop(AF_INET, &addr->sin_addr.s_addr, addrString, sizeof(addrString)); in GetLocalIpv4InfoArray()
254 info[count].prefixLength = IP_MASK_MAX - (ffs((int32_t)ntohl(addr->sin_addr.s_addr)) - 1); in GetLocalIpv4InfoArray()
/foundation/communication/dsoftbus/components/nstackx/nstackx_ctrl/core/mini_discover/
Dcoap_app.c74 if (remoteAddr->sin_addr.s_addr == localAddr.s_addr) { in IsLoopBackPacket()
135 localAddr.sin_addr.s_addr = inet_addr(ipString); in CoapCreateUdpClientEx()
185 sockAddr.sin_addr.s_addr = inet_addr(coapRequest->remoteIp); in CoapSendMsg()
351 localAddr.sin_addr.s_addr = inet_addr(ipAddr); in CoapCreateUdpServer()
/foundation/communication/ipc/ipc/test/rpc/socket_trans/src/
Drpc_socket_trans.c79 int rc = inet_pton(AF_INET, localIP, &addr->sin_addr); in BindLocalIP()
258 inet_pton(AF_INET, peerDeviceId, &addr.sin_addr); in Connect()
326 char *localDeviceId = inet_ntoa(((struct sockaddr_in*)ifa->ifa_addr)->sin_addr); in GetSocketLocalDeviceID()
Drpc_mini_socket_trans.c81 int rc = inet_pton(AF_INET, localIP, &addr->sin_addr); in BindLocalIP()
296 inet_pton(AF_INET, peerDeviceId, &addr.sin_addr); in Connect()
/foundation/communication/netmanager_ext/services/mdnsmanager/src/protocol/
Dmdns_socket_listener.cpp112 …mreq.imr_interface = ifa ? reinterpret_cast<sockaddr_in *>(ifa->ifa_addr)->sin_addr : in_addr{INAD… in InitSocketV4()
123 sockAddr.sin_addr.s_addr = INADDR_ANY; in InitSocketV4()
289 reinterpret_cast<sockaddr_in *>(&saddr_[sock])->sin_addr = saddr->sin_addr; in OpenSocketV4()
456 sockaddr_in saddr{.sin_family = AF_INET, .sin_port = htons(MDNS_PORT), .sin_addr = addr}; in Multicast()
/foundation/communication/dhcp/test/services/dhcp_server/unittest/
Dsystem_func_mock.cpp67 struct in_addr sin_addr; member
167 sAddr->sin_addr.s_addr = HostToNetwork(srcIp); in recvfrom()
/foundation/communication/netstack/frameworks/js/napi/socket/options/src/
Dnet_address.cpp44 addr = &(ipv4->sin_addr); in SetAddress()
/foundation/communication/netmanager_base/services/netmanagernative/src/manager/
Dvpn_manager.cpp133 sin->sin_addr = ipv4Addr; in SetVpnAddress()
146 sin->sin_addr.s_addr = htonl(mask); in SetVpnAddress()
Dinterface_manager.cpp294 addr.s_addr = ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr; in GetIfaceConfig()
298 …g.prefixLength = Ipv4NetmaskToPrefixLength(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr); in GetIfaceConfig()
382 sin->sin_addr = ipv4Addr; in SetIpAddress()
/foundation/communication/bluetooth_service/services/bluetooth/service/src/pan/
Dpan_network.cpp181 sin->sin_addr = ipv4Addr; in SetIpAddress()
186 sin->sin_addr = mask4Addr; in SetIpAddress()
196 ipv4Addr.s_addr = (reinterpret_cast<struct sockaddr_in *>(&ifr.ifr_addr))->sin_addr.s_addr; in SetIpAddress()
/foundation/communication/dsoftbus/components/nstackx/fillp/src/public/src/
Dcheck_gso_support.c119 sa.sin_addr.s_addr = inet_addr("127.0.0.1"); in CheckGSOSupport()
/foundation/communication/netmanager_base/test/netmanagernative/unittest/netsys_manager_test/
Ddns_proxy_listen_test.cpp79 proxyAddr.sin_addr.s_addr = htonl(INADDR_ANY);
/foundation/communication/dsoftbus/tests/core/bus_center/lnn/unittest/
Dnet_buscenter_test.cpp138 if (inet_pton(AF_INET, ip.c_str(), &(addr.sin_addr)) <= 0) { in SetIpaddr()
/foundation/communication/netmanager_base/services/netsyscontroller/src/
Dmock_netsys_native_client.cpp481 if (inet_aton(gateWay.c_str(), &(_sin.sin_addr)) < 0) { in AddRoute()
488 if (inet_aton(ip.c_str(), &((struct sockaddr_in *)&rt.rt_dst)->sin_addr) < 0) { in AddRoute()
493 …if (inet_aton(mask.c_str(), &(reinterpret_cast<struct sockaddr_in *>(&rt.rt_genmask))->sin_addr) <… in AddRoute()
/foundation/communication/dhcp/services/dhcp_client/src/
Ddhcp_function.c208 *ifaddr4 = pSockIn->sin_addr.s_addr; in GetLocalInterface()
294 sin.sin_addr.s_addr = netAddr; in SetIpOrMask()

123