/ohos5.0/foundation/communication/dhcp/services/dhcp_server/src/ |
H A D | address_utils.cpp | 42 return (ip & netmask); in NetworkAddress() 47 uint32_t network = NetworkAddress(ip, netmask); in FirstIpAddress() 57 uint32_t hostTotal = HostTotal(netmask); in NextIpAddress() 60 return FirstIpAddress(currIp, netmask); in NextIpAddress() 80 uint32_t network = NetworkAddress(ip, netmask); in LastIpAddress() 125 int NetworkBits(uint32_t netmask) in NetworkBits() argument 128 uint32_t net = htonl(netmask); in NetworkBits() 139 uint32_t HostBits(uint32_t netmask) in HostBits() argument 142 uint32_t net = htonl(netmask); in HostBits() 153 uint32_t HostTotal(uint32_t netmask) in HostTotal() argument [all …]
|
H A D | dhcp_address_pool.cpp | 134 if (!pool->netmask || IsEmptyHWAddr(macAddr)) { in CheckRangeAvailability() 140 if (IpInRange(distIp, beginIp, endIp, pool->netmask)) { in CheckRangeAvailability() 167 uint32_t NextIpOffset(uint32_t netmask) in NextIpOffset() argument 170 if (g_distributeMode && netmask) { in NextIpOffset() 171 uint32_t total = HostTotal(netmask); in NextIpOffset() 185 if (!pool->netmask || IsEmptyHWAddr(macAddr)) { in AddressDistribute() 191 uint32_t total = HostTotal(pool->netmask); in AddressDistribute() 201 offset = NextIpOffset(pool->netmask); in AddressDistribute() 203 distIp = NextIpAddress(distIp, pool->netmask, offset); in AddressDistribute() 495 uint32_t netmask = pool->netmask; in LoadBindingRecoders() local [all …]
|
H A D | dhcp_dhcpd.cpp | 65 config->netmask = argNetmask; in InitNetworkAbout() 71 if (!config->netmask) { in InitNetworkAbout() 72 config->netmask = ParseIpAddr(DEFAUTL_NET_MASK); in InitNetworkAbout() 133 config->pool.beginAddress = FirstIpAddress(config->serverId, config->netmask); in InitAddressRange() 134 config->pool.endAddress = LastIpAddress(config->serverId, config->netmask); in InitAddressRange()
|
/ohos5.0/foundation/communication/dhcp/services/dhcp_server/include/ |
H A D | address_utils.h | 29 uint32_t NetworkAddress(uint32_t ip, uint32_t netmask); 30 uint32_t FirstIpAddress(uint32_t ip, uint32_t netmask); 31 uint32_t NextIpAddress(uint32_t currIp, uint32_t netmask, uint32_t offset); 33 uint32_t LastIpAddress(uint32_t ip, uint32_t netmask); 34 int IpInNetwork(uint32_t ip, uint32_t network, uint32_t netmask); 35 int IpInRange(uint32_t ip, uint32_t beginIp, uint32_t endIp, uint32_t netmask); 36 uint32_t BroadCastAddress(uint32_t ip, uint32_t netmask); 39 int NetworkBits(uint32_t netmask); 40 uint32_t HostBits(uint32_t netmask); 41 uint32_t HostTotal(uint32_t netmask);
|
/ohos5.0/foundation/communication/dhcp/test/fuzztest/addressutils_fuzzer/ |
H A D | addressutils_fuzzer.cpp | 33 uint32_t netmask = static_cast<uint32_t>(data[index++]); in NetworkAddressTest() local 34 NetworkAddress(ip, netmask); in NetworkAddressTest() 42 FirstIpAddress(ip, netmask); in FirstIpAddressTest() 51 NextIpAddress(currIp, netmask, offset); in NextIpAddressTest() 66 LastIpAddress(ip, netmask); in LastIpAddressTest() 75 IpInNetwork(ip, network, netmask); in IpInNetworkTest() 85 IpInRange(ip, beginIp, endIp, netmask); in IpInRangeTest() 93 BroadCastAddress(ip, netmask); in BroadCastAddressTest() 118 NetworkBits(netmask); in NetworkBitsTest() 125 HostBits(netmask); in HostBitsTest() [all …]
|
/ohos5.0/docs/zh-cn/device-dev/kernel/ |
H A D | kernel-small-debug-shell-net-ifconfig.md | 38 | netmask | 设置子网掩码,后面要掩码参数,比如255.255.255.0。 | N/A | 57 - ifconfig eth0 192.168.100.31 netmask 255.255.255.0 gateway 192.168.100.1 hw ether 00:49:cb:6c:a1:… 71 …OHOS:/$ ifconfig eth0 192.168.100.31 netmask 255.255.255.0 gateway 192.168.100.1 hw ether 00:49:cb… 73 lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1 76 eth0 ip:192.168.100.31 netmask:255.255.255.0 gateway:192.168.100.1 87 | netmask | 网络掩码。 | 134 lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1 137 eth0 ip:192.168.1.10 netmask:255.255.255.0 gateway:192.168.1.1 148 lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1 151 eth0 ip:192.168.1.10 netmask:255.255.255.0 gateway:192.168.1.1
|
H A D | kernel-small-debug-shell-net-dhclient.md | 47 lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1 50 eth0 ip:192.168.1.10 netmask:255.255.255.0 gateway:192.168.1.1 63 lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1 66 eth0 ip:0.0.0.0 netmask:0.0.0.0 gateway:0.0.0.0
|
/ohos5.0/foundation/communication/dsoftbus/adapter/common/kernel/posix/ |
H A D | lnn_ip_utils_adapter.c | 26 static int32_t GetNetworkIfIp(int32_t fd, struct ifreq *req, char *ip, char *netmask, uint32_t len) in GetNetworkIfIp() argument 46 if (netmask != NULL) { in GetNetworkIfIp() 52 if (inet_ntop(sockAddr->sin_family, &sockAddr->sin_addr, netmask, len) == NULL) { in GetNetworkIfIp() 60 int32_t GetNetworkIpByIfName(const char *ifName, char *ip, char *netmask, uint32_t len) in GetNetworkIpByIfName() argument 77 if (GetNetworkIfIp(fd, &ifr, ip, netmask, len) != SOFTBUS_OK) { in GetNetworkIpByIfName()
|
/ohos5.0/docs/en/device-dev/kernel/ |
H A D | kernel-small-debug-shell-net-ifconfig.md | 42 | netmask | Specifies the subnet mask, for example, **255.255.255.0**.| N/A | 61 - ifconfig eth0 192.168.100.31 netmask 255.255.255.0 gateway 192.168.100.1 hw ether 00:49:cb:6c:a1:… 75 …OHOS:/$ ifconfig eth0 192.168.100.31 netmask 255.255.255.0 gateway 192.168.100.1 hw ether 00:49:cb… 77 lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1 80 eth0 ip:192.168.100.31 netmask:255.255.255.0 gateway:192.168.100.1 91 | netmask | Subnet mask.| 138 lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1 141 eth0 ip:192.168.1.10 netmask:255.255.255.0 gateway:192.168.1.1 152 lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1 155 eth0 ip:192.168.1.10 netmask:255.255.255.0 gateway:192.168.1.1
|
H A D | kernel-small-debug-shell-net-dhclient.md | 47 lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1 50 eth0 ip:192.168.1.10 netmask:255.255.255.0 gateway:192.168.1.1 63 lo ip:127.0.0.1 netmask:255.0.0.0 gateway:127.0.0.1 66 eth0 ip:0.0.0.0 netmask:0.0.0.0 gateway:0.0.0.0
|
/ohos5.0/foundation/communication/dsoftbus/tests/core/bus_center/lnn/net_buscenter/ |
H A D | lnn_ip_network_impl_mock.cpp | 46 const char *ifName, char *ip, char *netmask, uint32_t len) in ActionOfGetNetworkIpByIfName() argument 48 if (ifName == nullptr || netmask == nullptr || len == 0) { in ActionOfGetNetworkIpByIfName() 165 int32_t GetNetworkIpByIfName(const char *ifName, char *ip, char *netmask, uint32_t len) in GetNetworkIpByIfName() argument 167 return GetLnnIpNetworkImplInterface()->GetNetworkIpByIfName(ifName, ip, netmask, len); in GetNetworkIpByIfName()
|
H A D | lnn_ip_network_impl_mock.h | 58 …virtual int32_t GetNetworkIpByIfName(const char *ifName, char *ip, char *netmask, uint32_t len) = … 87 …static int32_t ActionOfGetNetworkIpByIfName(const char *ifName, char *ip, char *netmask, uint32_t …
|
/ohos5.0/base/telephony/cellular_data/services/src/utils/ |
H A D | cellular_data_utils.cpp | 110 int32_t CellularDataUtils::GetPrefixLen(const std::string &netmask, const std::string& flag) in GetPrefixLen() argument 112 std::vector<std::string> mask = Split(netmask, flag); in GetPrefixLen() 116 int32_t CellularDataUtils::GetPrefixLen(const std::vector<std::string> &netmask, const size_t start) in GetPrefixLen() argument 119 for (size_t i = start; i < netmask.size(); ++i) { in GetPrefixLen() 120 if (!IsValidDecValue(netmask[i].c_str())) { in GetPrefixLen() 123 int32_t maskValue = (std::stoi(netmask[i].c_str()) & 0x00FF); in GetPrefixLen()
|
/ohos5.0/foundation/communication/dsoftbus/adapter/common/kernel/liteos_m/ |
H A D | lnn_ip_utils_adapter.c | 21 int32_t GetNetworkIpByIfName(const char *ifName, char *ip, char *netmask, uint32_t len) in GetNetworkIpByIfName() argument 50 if (netmask != NULL) { in GetNetworkIpByIfName() 52 if (strncpy_s(netmask, len, netMaskStr, strlen(netMaskStr)) != EOK) { in GetNetworkIpByIfName()
|
/ohos5.0/foundation/communication/dsoftbus/tests/adapter/unittest/ |
H A D | dsoftbus_other_test.cpp | 65 char netmask[] = "abcdefd"; variable 68 int32_t ret = GetNetworkIpByIfName(ifName, ip, netmask, len); 81 char netmask[] = "abcdefd"; variable 84 int32_t ret = GetNetworkIpByIfName(NULL, ip, netmask, len); 87 ret = GetNetworkIpByIfName(ifName, NULL, netmask, len);
|
/ohos5.0/foundation/communication/dhcp/services/dhcp_server/etc/ |
H A D | dhcpd.conf.sample | 19 #netmask=255.255.255.0 43 netmask=255.255.255.0 56 #netmask=255.255.255.0
|
/ohos5.0/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/ |
H A D | wifi_net_agent.cpp | 286 …static_cast<unsigned int>(IpTools::GetMaskLength(IpTools::ConvertIpv4Address(wifiIpInfo.netmask))); 291 netAddr->netMask_ = IpTools::ConvertIpv4Address(wifiIpInfo.netmask); 298 netIpv6Addr->netMask_ = wifiIpV6Info.netmask; 381 if ((wifiIpInfo.ipAddress & wifiIpInfo.netmask) != (wifiIpInfo.gateway & wifiIpInfo.netmask)) { 397 …static_cast<unsigned int>(IpTools::GetMaskLength(IpTools::ConvertIpv4Address(wifiIpInfo.netmask))); 399 …std::string strLocalRoute = IpTools::ConvertIpv4Address(wifiIpInfo.ipAddress & wifiIpInfo.netmask); 408 if (!wifiIpV6Info.netmask.empty()) { 409 unsigned int ipv6PrefixLength = IpTools::GetIPV6MaskLength(wifiIpV6Info.netmask);
|
/ohos5.0/base/telephony/cellular_data/services/include/utils/ |
H A D | cellular_data_utils.h | 35 static int32_t GetPrefixLen(const std::string &netmask, const std::string& flag); 36 static int32_t GetPrefixLen(const std::vector<std::string> &netmask, const size_t start);
|
/ohos5.0/foundation/communication/wifi/wifi/interfaces/kits/c/ |
H A D | wifi_device_config.h | 177 unsigned int netmask; member 285 char netmask[DEVICE_IPV6_MAX_LEN]; member
|
/ohos5.0/drivers/hdf_core/framework/model/network/ethernet/src/ |
H A D | hdf_eth_core.c | 56 IpV4Addr netmask; in SetEthNetworkAddr() local 60 netmask.addr = 0x00ffffffUL; /* 255, 255, 255, 0 */ in SetEthNetworkAddr() 63 if (NetIfSetAddr(netDev, &ip, &netmask, &gw) != HDF_SUCCESS) { in SetEthNetworkAddr()
|
/ohos5.0/foundation/communication/dhcp/test/unittest/services/dhcp_server/unittest/ |
H A D | dhcp_s_server_test.cpp | 75 uint32_t netmask = ParseIpAddr("255.255.255.0"); in InitServerConfig() local 78 if (serverId == 0 || netmask == 0 || beginIp == 0 || endIp == 0) { in InitServerConfig() 92 config->netmask = netmask; in InitServerConfig()
|
H A D | dhcp_function_test.cpp | 130 std::string ifname, ip, netmask; variable 131 EXPECT_EQ(DHCP_OPT_ERROR, DhcpFunction::GetLocalIp(ifname, ip, netmask)); 143 EXPECT_EQ(DHCP_OPT_FAILED, DhcpFunction::GetLocalIp(ifname, ip, netmask)); 144 EXPECT_EQ(DHCP_OPT_FAILED, DhcpFunction::GetLocalIp(ifname, ip, netmask));
|
/ohos5.0/drivers/hdf_core/framework/test/unittest/model/network/wifi/unittest/netdevice/ |
H A D | net_device_test.c | 113 IpV4Addr netmask = { 0x00ffffffUL }; // 255, 255, 255, 0 in WiFiNetDviceTestSetAddr() local 115 return NetIfSetAddr(g_netDevice, &ip, &netmask, &gw); in WiFiNetDviceTestSetAddr()
|
/ohos5.0/drivers/peripheral/usb/test/moduletest/common/scripts/ |
H A D | usb_set_net_ip.sh | 17 sudo ifconfig enp0s6u2 10.0.0.10 netmask 255.255.255.0
|
/ohos5.0/foundation/communication/dsoftbus/adapter/common/include/ |
H A D | lnn_ip_utils_adapter.h | 35 int32_t GetNetworkIpByIfName(const char *ifName, char *ip, char *netmask, uint32_t len);
|